Lines Matching refs:imap
38 xfs_bmbt_irec_t *imap)
45 (unsigned long long)imap->br_startblock,
46 (unsigned long long)imap->br_startoff,
47 (unsigned long long)imap->br_blockcount,
48 imap->br_state);
56 struct xfs_bmbt_irec *imap,
62 if (unlikely(!xfs_valid_startblock(ip, imap->br_startblock)))
63 return xfs_alert_fsblock_zero(ip, imap);
65 if (imap->br_startblock == HOLESTARTBLOCK) {
68 } else if (imap->br_startblock == DELAYSTARTBLOCK ||
69 isnullstartblock(imap->br_startblock)) {
73 iomap->addr = BBTOB(xfs_fsb_to_db(ip, imap->br_startblock));
74 if (imap->br_state == XFS_EXT_UNWRITTEN)
79 iomap->offset = XFS_FSB_TO_B(mp, imap->br_startoff);
80 iomap->length = XFS_FSB_TO_B(mp, imap->br_blockcount);
191 struct xfs_bmbt_irec *imap)
237 if (imap->br_state == XFS_EXT_UNWRITTEN) {
256 * From this point onwards we overwrite the imap pointer that the
261 imap, &nimaps);
280 if (unlikely(!xfs_valid_startblock(ip, imap->br_startblock)))
281 error = xfs_alert_fsblock_zero(ip, imap);
512 xfs_bmbt_irec_t imap;
569 XFS_BMAPI_CONVERT, resblks, &imap,
595 if (unlikely(!xfs_valid_startblock(ip, imap.br_startblock)))
596 return xfs_alert_fsblock_zero(ip, &imap);
598 if ((numblks_fsb = imap.br_blockcount) == 0) {
603 ASSERT(imap.br_blockcount);
622 struct xfs_bmbt_irec *imap,
629 imap->br_startblock == HOLESTARTBLOCK ||
630 imap->br_startblock == DELAYSTARTBLOCK)
633 if (IS_DAX(inode) && imap->br_state == XFS_EXT_UNWRITTEN)
642 struct xfs_bmbt_irec *imap,
651 imap->br_startblock == HOLESTARTBLOCK ||
652 imap->br_state == XFS_EXT_UNWRITTEN)
710 * Check that the imap we are going to return to the caller spans the entire
715 struct xfs_bmbt_irec *imap,
719 if (imap->br_startoff > offset_fsb)
721 if (imap->br_startoff + imap->br_blockcount < end_fsb)
737 struct xfs_bmbt_irec imap, cmap;
762 error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap,
767 if (imap_needs_cow(ip, flags, &imap, nimaps)) {
773 error = xfs_reflink_allocate_cow(ip, &imap, &cmap, &shared,
779 end_fsb = imap.br_startoff + imap.br_blockcount;
783 if (imap_needs_alloc(inode, flags, &imap, nimaps))
793 !imap_spans_range(&imap, offset_fsb, end_fsb)) {
799 trace_xfs_iomap_found(ip, offset, length, XFS_DATA_FORK, &imap);
800 return xfs_bmbt_to_iomap(ip, iomap, &imap, iomap_flags);
821 else if (nimaps && imap.br_startblock == HOLESTARTBLOCK)
822 end_fsb = min(end_fsb, imap.br_startoff + imap.br_blockcount);
826 &imap);
830 trace_xfs_iomap_alloc(ip, offset, length, XFS_DATA_FORK, &imap);
831 return xfs_bmbt_to_iomap(ip, iomap, &imap, iomap_flags | IOMAP_F_NEW);
837 if (imap.br_startblock != HOLESTARTBLOCK) {
838 error = xfs_bmbt_to_iomap(ip, srcmap, &imap, 0);
866 struct xfs_bmbt_irec imap, cmap;
905 eof = !xfs_iext_lookup_extent(ip, &ip->i_df, offset_fsb, &icur, &imap);
907 imap.br_startoff = end_fsb; /* fake hole until the end */
910 if ((flags & IOMAP_ZERO) && imap.br_startoff > offset_fsb) {
911 xfs_hole_to_iomap(ip, iomap, offset_fsb, imap.br_startoff);
936 if (imap.br_startoff <= offset_fsb) {
943 ((flags & IOMAP_ZERO) && imap.br_state != XFS_EXT_NORM)) {
945 &imap);
949 xfs_trim_extent(&imap, offset_fsb, end_fsb - offset_fsb);
952 error = xfs_bmap_trim_cow(ip, &imap, &shared);
959 &imap);
968 end_fsb = imap.br_startoff + imap.br_blockcount;
1023 allocfork == XFS_DATA_FORK ? &imap : &cmap,
1052 trace_xfs_iomap_alloc(ip, offset, count, allocfork, &imap);
1053 return xfs_bmbt_to_iomap(ip, iomap, &imap, IOMAP_F_NEW);
1057 return xfs_bmbt_to_iomap(ip, iomap, &imap, 0);
1061 if (imap.br_startoff <= offset_fsb) {
1062 error = xfs_bmbt_to_iomap(ip, srcmap, &imap, 0);
1068 xfs_trim_extent(&cmap, offset_fsb, imap.br_startoff - offset_fsb);
1154 struct xfs_bmbt_irec imap;
1169 error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap,
1172 error = xfs_reflink_trim_around_shared(ip, &imap, &shared);
1177 trace_xfs_iomap_found(ip, offset, length, XFS_DATA_FORK, &imap);
1178 return xfs_bmbt_to_iomap(ip, iomap, &imap, shared ? IOMAP_F_SHARED : 0);
1200 struct xfs_bmbt_irec imap, cmap;
1214 if (xfs_iext_lookup_extent(ip, &ip->i_df, offset_fsb, &icur, &imap)) {
1218 if (imap.br_startoff <= offset_fsb)
1220 data_fsb = imap.br_startoff;
1253 imap.br_blockcount = cow_fsb - offset_fsb;
1255 imap.br_blockcount = data_fsb - offset_fsb;
1256 imap.br_startoff = offset_fsb;
1257 imap.br_startblock = HOLESTARTBLOCK;
1258 imap.br_state = XFS_EXT_NORM;
1260 xfs_trim_extent(&imap, offset_fsb, end_fsb);
1261 error = xfs_bmbt_to_iomap(ip, iomap, &imap, 0);
1284 struct xfs_bmbt_irec imap;
1300 error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap,
1308 return xfs_bmbt_to_iomap(ip, iomap, &imap, 0);