Lines Matching refs:imap

39 	xfs_bmbt_irec_t	*imap)
46 (unsigned long long)imap->br_startblock,
47 (unsigned long long)imap->br_startoff,
48 (unsigned long long)imap->br_blockcount,
49 imap->br_state);
97 struct xfs_bmbt_irec *imap,
105 if (unlikely(!xfs_valid_startblock(ip, imap->br_startblock))) {
107 return xfs_alert_fsblock_zero(ip, imap);
110 if (imap->br_startblock == HOLESTARTBLOCK) {
113 } else if (imap->br_startblock == DELAYSTARTBLOCK ||
114 isnullstartblock(imap->br_startblock)) {
118 iomap->addr = BBTOB(xfs_fsb_to_db(ip, imap->br_startblock));
122 if (imap->br_state == XFS_EXT_UNWRITTEN)
128 iomap->offset = XFS_FSB_TO_B(mp, imap->br_startoff);
129 iomap->length = XFS_FSB_TO_B(mp, imap->br_blockcount);
246 struct xfs_bmbt_irec *imap,
290 if (imap->br_state == XFS_EXT_UNWRITTEN) {
307 * From this point onwards we overwrite the imap pointer that the
312 imap, &nimaps);
323 if (unlikely(!xfs_valid_startblock(ip, imap->br_startblock))) {
325 error = xfs_alert_fsblock_zero(ip, imap);
574 xfs_bmbt_irec_t imap;
628 XFS_BMAPI_CONVERT, resblks, &imap,
654 if (unlikely(!xfs_valid_startblock(ip, imap.br_startblock))) {
656 return xfs_alert_fsblock_zero(ip, &imap);
659 if ((numblks_fsb = imap.br_blockcount) == 0) {
664 ASSERT(imap.br_blockcount);
683 struct xfs_bmbt_irec *imap,
690 imap->br_startblock == HOLESTARTBLOCK ||
691 imap->br_startblock == DELAYSTARTBLOCK)
694 if ((flags & IOMAP_DAX) && imap->br_state == XFS_EXT_UNWRITTEN)
703 struct xfs_bmbt_irec *imap,
712 imap->br_startblock == HOLESTARTBLOCK ||
713 imap->br_state == XFS_EXT_UNWRITTEN)
771 * Check that the imap we are going to return to the caller spans the entire
776 struct xfs_bmbt_irec *imap,
780 if (imap->br_startoff > offset_fsb)
782 if (imap->br_startoff + imap->br_blockcount < end_fsb)
798 struct xfs_bmbt_irec imap, cmap;
824 error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap,
829 if (imap_needs_cow(ip, flags, &imap, nimaps)) {
835 error = xfs_reflink_allocate_cow(ip, &imap, &cmap, &shared,
842 end_fsb = imap.br_startoff + imap.br_blockcount;
846 if (imap_needs_alloc(inode, flags, &imap, nimaps))
857 if (!imap_spans_range(&imap, offset_fsb, end_fsb))
869 if (imap.br_state != XFS_EXT_NORM &&
876 trace_xfs_iomap_found(ip, offset, length, XFS_DATA_FORK, &imap);
877 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags, iomap_flags, seq);
898 else if (nimaps && imap.br_startblock == HOLESTARTBLOCK)
899 end_fsb = min(end_fsb, imap.br_startoff + imap.br_blockcount);
903 flags, &imap, &seq);
907 trace_xfs_iomap_alloc(ip, offset, length, XFS_DATA_FORK, &imap);
908 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags,
914 if (imap.br_startblock != HOLESTARTBLOCK) {
916 error = xfs_bmbt_to_iomap(ip, srcmap, &imap, flags, 0, seq);
974 struct xfs_bmbt_irec imap, cmap;
1018 eof = !xfs_iext_lookup_extent(ip, &ip->i_df, offset_fsb, &icur, &imap);
1020 imap.br_startoff = end_fsb; /* fake hole until the end */
1024 imap.br_startoff > offset_fsb) {
1025 xfs_hole_to_iomap(ip, iomap, offset_fsb, imap.br_startoff);
1034 if ((flags & IOMAP_ZERO) && imap.br_startoff <= offset_fsb &&
1035 isnullstartblock(imap.br_startblock)) {
1042 xfs_trim_extent(&imap, offset_fsb,
1068 if (imap.br_startoff <= offset_fsb) {
1075 ((flags & IOMAP_ZERO) && imap.br_state != XFS_EXT_NORM)) {
1077 &imap);
1081 xfs_trim_extent(&imap, offset_fsb, end_fsb - offset_fsb);
1084 error = xfs_bmap_trim_cow(ip, &imap, &shared);
1091 &imap);
1100 end_fsb = imap.br_startoff + imap.br_blockcount;
1154 allocfork == XFS_DATA_FORK ? &imap : &cmap,
1184 trace_xfs_iomap_alloc(ip, offset, count, allocfork, &imap);
1185 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags, IOMAP_F_NEW, seq);
1190 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags, 0, seq);
1200 trace_xfs_iomap_alloc(ip, offset, count, XFS_DATA_FORK, &imap);
1205 if (imap.br_startoff <= offset_fsb) {
1206 error = xfs_bmbt_to_iomap(ip, srcmap, &imap, flags, 0, seq);
1215 xfs_trim_extent(&cmap, offset_fsb, imap.br_startoff - offset_fsb);
1282 struct xfs_bmbt_irec imap;
1298 error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap,
1301 error = xfs_reflink_trim_around_shared(ip, &imap, &shared);
1307 trace_xfs_iomap_found(ip, offset, length, XFS_DATA_FORK, &imap);
1308 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags,
1331 struct xfs_bmbt_irec imap, cmap;
1344 if (xfs_iext_lookup_extent(ip, &ip->i_df, offset_fsb, &icur, &imap)) {
1348 if (imap.br_startoff <= offset_fsb)
1350 data_fsb = imap.br_startoff;
1385 imap.br_blockcount = cow_fsb - offset_fsb;
1387 imap.br_blockcount = data_fsb - offset_fsb;
1388 imap.br_startoff = offset_fsb;
1389 imap.br_startblock = HOLESTARTBLOCK;
1390 imap.br_state = XFS_EXT_NORM;
1393 xfs_trim_extent(&imap, offset_fsb, end_fsb - offset_fsb);
1394 error = xfs_bmbt_to_iomap(ip, iomap, &imap, flags, 0, seq);
1417 struct xfs_bmbt_irec imap;
1434 error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap,
1444 return xfs_bmbt_to_iomap(ip, iomap, &imap, flags, IOMAP_F_XATTR, seq);