Lines Matching refs:imap
37 xfs_bmbt_irec_t *imap) in xfs_alert_fsblock_zero() argument
44 (unsigned long long)imap->br_startblock, in xfs_alert_fsblock_zero()
45 (unsigned long long)imap->br_startoff, in xfs_alert_fsblock_zero()
46 (unsigned long long)imap->br_blockcount, in xfs_alert_fsblock_zero()
47 imap->br_state); in xfs_alert_fsblock_zero()
94 struct xfs_bmbt_irec *imap, in xfs_bmbt_to_iomap() argument
102 if (unlikely(!xfs_valid_startblock(ip, imap->br_startblock))) in xfs_bmbt_to_iomap()
103 return xfs_alert_fsblock_zero(ip, imap); in xfs_bmbt_to_iomap()
105 if (imap->br_startblock == HOLESTARTBLOCK) { in xfs_bmbt_to_iomap()
108 } else if (imap->br_startblock == DELAYSTARTBLOCK || in xfs_bmbt_to_iomap()
109 isnullstartblock(imap->br_startblock)) { in xfs_bmbt_to_iomap()
113 iomap->addr = BBTOB(xfs_fsb_to_db(ip, imap->br_startblock)); in xfs_bmbt_to_iomap()
117 if (imap->br_state == XFS_EXT_UNWRITTEN) in xfs_bmbt_to_iomap()
123 iomap->offset = XFS_FSB_TO_B(mp, imap->br_startoff); in xfs_bmbt_to_iomap()
124 iomap->length = XFS_FSB_TO_B(mp, imap->br_blockcount); in xfs_bmbt_to_iomap()
241 struct xfs_bmbt_irec *imap, in xfs_iomap_write_direct() argument
285 if (imap->br_state == XFS_EXT_UNWRITTEN) { in xfs_iomap_write_direct()
309 imap, &nimaps); in xfs_iomap_write_direct()
320 if (unlikely(!xfs_valid_startblock(ip, imap->br_startblock))) in xfs_iomap_write_direct()
321 error = xfs_alert_fsblock_zero(ip, imap); in xfs_iomap_write_direct()
551 xfs_bmbt_irec_t imap; in xfs_iomap_write_unwritten() local
608 XFS_BMAPI_CONVERT, resblks, &imap, in xfs_iomap_write_unwritten()
634 if (unlikely(!xfs_valid_startblock(ip, imap.br_startblock))) in xfs_iomap_write_unwritten()
635 return xfs_alert_fsblock_zero(ip, &imap); in xfs_iomap_write_unwritten()
637 if ((numblks_fsb = imap.br_blockcount) == 0) { in xfs_iomap_write_unwritten()
642 ASSERT(imap.br_blockcount); in xfs_iomap_write_unwritten()
661 struct xfs_bmbt_irec *imap, in imap_needs_alloc() argument
668 imap->br_startblock == HOLESTARTBLOCK || in imap_needs_alloc()
669 imap->br_startblock == DELAYSTARTBLOCK) in imap_needs_alloc()
672 if ((flags & IOMAP_DAX) && imap->br_state == XFS_EXT_UNWRITTEN) in imap_needs_alloc()
681 struct xfs_bmbt_irec *imap, in imap_needs_cow() argument
690 imap->br_startblock == HOLESTARTBLOCK || in imap_needs_cow()
691 imap->br_state == XFS_EXT_UNWRITTEN) in imap_needs_cow()
754 struct xfs_bmbt_irec *imap, in imap_spans_range() argument
758 if (imap->br_startoff > offset_fsb) in imap_spans_range()
760 if (imap->br_startoff + imap->br_blockcount < end_fsb) in imap_spans_range()
776 struct xfs_bmbt_irec imap, cmap; in xfs_direct_write_iomap_begin() local
802 error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap, in xfs_direct_write_iomap_begin()
807 if (imap_needs_cow(ip, flags, &imap, nimaps)) { in xfs_direct_write_iomap_begin()
813 error = xfs_reflink_allocate_cow(ip, &imap, &cmap, &shared, in xfs_direct_write_iomap_begin()
820 end_fsb = imap.br_startoff + imap.br_blockcount; in xfs_direct_write_iomap_begin()
824 if (imap_needs_alloc(inode, flags, &imap, nimaps)) in xfs_direct_write_iomap_begin()
835 if (!imap_spans_range(&imap, offset_fsb, end_fsb)) in xfs_direct_write_iomap_begin()
847 if (imap.br_state != XFS_EXT_NORM && in xfs_direct_write_iomap_begin()
854 trace_xfs_iomap_found(ip, offset, length, XFS_DATA_FORK, &imap); in xfs_direct_write_iomap_begin()
855 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags, iomap_flags, seq); in xfs_direct_write_iomap_begin()
876 else if (nimaps && imap.br_startblock == HOLESTARTBLOCK) in xfs_direct_write_iomap_begin()
877 end_fsb = min(end_fsb, imap.br_startoff + imap.br_blockcount); in xfs_direct_write_iomap_begin()
881 flags, &imap, &seq); in xfs_direct_write_iomap_begin()
885 trace_xfs_iomap_alloc(ip, offset, length, XFS_DATA_FORK, &imap); in xfs_direct_write_iomap_begin()
886 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags, in xfs_direct_write_iomap_begin()
892 if (imap.br_startblock != HOLESTARTBLOCK) { in xfs_direct_write_iomap_begin()
894 error = xfs_bmbt_to_iomap(ip, srcmap, &imap, flags, 0, seq); in xfs_direct_write_iomap_begin()
952 struct xfs_bmbt_irec imap, cmap; in xfs_buffered_write_iomap_begin() local
997 eof = !xfs_iext_lookup_extent(ip, &ip->i_df, offset_fsb, &icur, &imap); in xfs_buffered_write_iomap_begin()
999 imap.br_startoff = end_fsb; /* fake hole until the end */ in xfs_buffered_write_iomap_begin()
1003 imap.br_startoff > offset_fsb) { in xfs_buffered_write_iomap_begin()
1004 xfs_hole_to_iomap(ip, iomap, offset_fsb, imap.br_startoff); in xfs_buffered_write_iomap_begin()
1013 if ((flags & IOMAP_ZERO) && imap.br_startoff <= offset_fsb && in xfs_buffered_write_iomap_begin()
1014 isnullstartblock(imap.br_startblock)) { in xfs_buffered_write_iomap_begin()
1021 xfs_trim_extent(&imap, offset_fsb, in xfs_buffered_write_iomap_begin()
1047 if (imap.br_startoff <= offset_fsb) { in xfs_buffered_write_iomap_begin()
1054 ((flags & IOMAP_ZERO) && imap.br_state != XFS_EXT_NORM)) { in xfs_buffered_write_iomap_begin()
1056 &imap); in xfs_buffered_write_iomap_begin()
1060 xfs_trim_extent(&imap, offset_fsb, end_fsb - offset_fsb); in xfs_buffered_write_iomap_begin()
1063 error = xfs_bmap_trim_cow(ip, &imap, &shared); in xfs_buffered_write_iomap_begin()
1070 &imap); in xfs_buffered_write_iomap_begin()
1079 end_fsb = imap.br_startoff + imap.br_blockcount; in xfs_buffered_write_iomap_begin()
1142 end_fsb - offset_fsb, prealloc_blocks, &imap, &icur, in xfs_buffered_write_iomap_begin()
1153 trace_xfs_iomap_alloc(ip, offset, count, allocfork, &imap); in xfs_buffered_write_iomap_begin()
1154 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags, IOMAP_F_NEW, seq); in xfs_buffered_write_iomap_begin()
1159 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags, 0, seq); in xfs_buffered_write_iomap_begin()
1169 trace_xfs_iomap_alloc(ip, offset, count, XFS_DATA_FORK, &imap); in xfs_buffered_write_iomap_begin()
1174 if (imap.br_startoff <= offset_fsb) { in xfs_buffered_write_iomap_begin()
1175 error = xfs_bmbt_to_iomap(ip, srcmap, &imap, flags, 0, seq); in xfs_buffered_write_iomap_begin()
1184 xfs_trim_extent(&cmap, offset_fsb, imap.br_startoff - offset_fsb); in xfs_buffered_write_iomap_begin()
1251 struct xfs_bmbt_irec imap; in xfs_read_iomap_begin() local
1267 error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap, in xfs_read_iomap_begin()
1270 error = xfs_reflink_trim_around_shared(ip, &imap, &shared); in xfs_read_iomap_begin()
1276 trace_xfs_iomap_found(ip, offset, length, XFS_DATA_FORK, &imap); in xfs_read_iomap_begin()
1277 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags, in xfs_read_iomap_begin()
1300 struct xfs_bmbt_irec imap, cmap; in xfs_seek_iomap_begin() local
1313 if (xfs_iext_lookup_extent(ip, &ip->i_df, offset_fsb, &icur, &imap)) { in xfs_seek_iomap_begin()
1317 if (imap.br_startoff <= offset_fsb) in xfs_seek_iomap_begin()
1319 data_fsb = imap.br_startoff; in xfs_seek_iomap_begin()
1354 imap.br_blockcount = cow_fsb - offset_fsb; in xfs_seek_iomap_begin()
1356 imap.br_blockcount = data_fsb - offset_fsb; in xfs_seek_iomap_begin()
1357 imap.br_startoff = offset_fsb; in xfs_seek_iomap_begin()
1358 imap.br_startblock = HOLESTARTBLOCK; in xfs_seek_iomap_begin()
1359 imap.br_state = XFS_EXT_NORM; in xfs_seek_iomap_begin()
1362 xfs_trim_extent(&imap, offset_fsb, end_fsb - offset_fsb); in xfs_seek_iomap_begin()
1363 error = xfs_bmbt_to_iomap(ip, iomap, &imap, flags, 0, seq); in xfs_seek_iomap_begin()
1386 struct xfs_bmbt_irec imap; in xfs_xattr_iomap_begin() local
1403 error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap, in xfs_xattr_iomap_begin()
1413 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags, IOMAP_F_XATTR, seq); in xfs_xattr_iomap_begin()