Lines Matching refs:imap
37 xfs_bmbt_irec_t *imap)
44 (unsigned long long)imap->br_startblock,
45 (unsigned long long)imap->br_startoff,
46 (unsigned long long)imap->br_blockcount,
47 imap->br_state);
94 struct xfs_bmbt_irec *imap,
102 if (unlikely(!xfs_valid_startblock(ip, imap->br_startblock)))
103 return xfs_alert_fsblock_zero(ip, imap);
105 if (imap->br_startblock == HOLESTARTBLOCK) {
108 } else if (imap->br_startblock == DELAYSTARTBLOCK ||
109 isnullstartblock(imap->br_startblock)) {
113 iomap->addr = BBTOB(xfs_fsb_to_db(ip, imap->br_startblock));
117 if (imap->br_state == XFS_EXT_UNWRITTEN)
123 iomap->offset = XFS_FSB_TO_B(mp, imap->br_startoff);
124 iomap->length = XFS_FSB_TO_B(mp, imap->br_blockcount);
241 struct xfs_bmbt_irec *imap,
285 if (imap->br_state == XFS_EXT_UNWRITTEN) {
304 * From this point onwards we overwrite the imap pointer that the
309 imap, &nimaps);
328 if (unlikely(!xfs_valid_startblock(ip, imap->br_startblock)))
329 error = xfs_alert_fsblock_zero(ip, imap);
559 xfs_bmbt_irec_t imap;
616 XFS_BMAPI_CONVERT, resblks, &imap,
642 if (unlikely(!xfs_valid_startblock(ip, imap.br_startblock)))
643 return xfs_alert_fsblock_zero(ip, &imap);
645 if ((numblks_fsb = imap.br_blockcount) == 0) {
650 ASSERT(imap.br_blockcount);
669 struct xfs_bmbt_irec *imap,
676 imap->br_startblock == HOLESTARTBLOCK ||
677 imap->br_startblock == DELAYSTARTBLOCK)
680 if ((flags & IOMAP_DAX) && imap->br_state == XFS_EXT_UNWRITTEN)
689 struct xfs_bmbt_irec *imap,
698 imap->br_startblock == HOLESTARTBLOCK ||
699 imap->br_state == XFS_EXT_UNWRITTEN)
757 * Check that the imap we are going to return to the caller spans the entire
762 struct xfs_bmbt_irec *imap,
766 if (imap->br_startoff > offset_fsb)
768 if (imap->br_startoff + imap->br_blockcount < end_fsb)
784 struct xfs_bmbt_irec imap, cmap;
810 error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap,
815 if (imap_needs_cow(ip, flags, &imap, nimaps)) {
821 error = xfs_reflink_allocate_cow(ip, &imap, &cmap, &shared,
828 end_fsb = imap.br_startoff + imap.br_blockcount;
832 if (imap_needs_alloc(inode, flags, &imap, nimaps))
843 if (!imap_spans_range(&imap, offset_fsb, end_fsb))
855 if (imap.br_state != XFS_EXT_NORM &&
862 trace_xfs_iomap_found(ip, offset, length, XFS_DATA_FORK, &imap);
863 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags, iomap_flags, seq);
884 else if (nimaps && imap.br_startblock == HOLESTARTBLOCK)
885 end_fsb = min(end_fsb, imap.br_startoff + imap.br_blockcount);
889 flags, &imap, &seq);
893 trace_xfs_iomap_alloc(ip, offset, length, XFS_DATA_FORK, &imap);
894 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags,
900 if (imap.br_startblock != HOLESTARTBLOCK) {
902 error = xfs_bmbt_to_iomap(ip, srcmap, &imap, flags, 0, seq);
960 struct xfs_bmbt_irec imap, cmap;
1005 eof = !xfs_iext_lookup_extent(ip, &ip->i_df, offset_fsb, &icur, &imap);
1007 imap.br_startoff = end_fsb; /* fake hole until the end */
1011 imap.br_startoff > offset_fsb) {
1012 xfs_hole_to_iomap(ip, iomap, offset_fsb, imap.br_startoff);
1037 if (imap.br_startoff <= offset_fsb) {
1044 ((flags & IOMAP_ZERO) && imap.br_state != XFS_EXT_NORM)) {
1046 &imap);
1050 xfs_trim_extent(&imap, offset_fsb, end_fsb - offset_fsb);
1053 error = xfs_bmap_trim_cow(ip, &imap, &shared);
1060 &imap);
1069 end_fsb = imap.br_startoff + imap.br_blockcount;
1123 allocfork == XFS_DATA_FORK ? &imap : &cmap,
1153 trace_xfs_iomap_alloc(ip, offset, count, allocfork, &imap);
1154 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags, IOMAP_F_NEW, seq);
1159 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags, 0, seq);
1163 if (imap.br_startoff <= offset_fsb) {
1164 error = xfs_bmbt_to_iomap(ip, srcmap, &imap, flags, 0, seq);
1173 xfs_trim_extent(&cmap, offset_fsb, imap.br_startoff - offset_fsb);
1240 struct xfs_bmbt_irec imap;
1256 error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap,
1259 error = xfs_reflink_trim_around_shared(ip, &imap, &shared);
1265 trace_xfs_iomap_found(ip, offset, length, XFS_DATA_FORK, &imap);
1266 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags,
1289 struct xfs_bmbt_irec imap, cmap;
1302 if (xfs_iext_lookup_extent(ip, &ip->i_df, offset_fsb, &icur, &imap)) {
1306 if (imap.br_startoff <= offset_fsb)
1308 data_fsb = imap.br_startoff;
1343 imap.br_blockcount = cow_fsb - offset_fsb;
1345 imap.br_blockcount = data_fsb - offset_fsb;
1346 imap.br_startoff = offset_fsb;
1347 imap.br_startblock = HOLESTARTBLOCK;
1348 imap.br_state = XFS_EXT_NORM;
1351 xfs_trim_extent(&imap, offset_fsb, end_fsb);
1352 error = xfs_bmbt_to_iomap(ip, iomap, &imap, flags, 0, seq);
1375 struct xfs_bmbt_irec imap;
1392 error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap,
1402 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags, IOMAP_F_XATTR, seq);