Lines Matching refs:whichfork

57 	int		whichfork)	/* data or attr fork */  in xfs_bmap_compute_maxlevels()  argument
81 if (whichfork == XFS_DATA_FORK) { in xfs_bmap_compute_maxlevels()
98 mp->m_bm_maxlevels[whichfork] = level; in xfs_bmap_compute_maxlevels()
125 static inline bool xfs_bmap_needs_btree(struct xfs_inode *ip, int whichfork) in xfs_bmap_needs_btree() argument
127 return whichfork != XFS_COW_FORK && in xfs_bmap_needs_btree()
128 XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS && in xfs_bmap_needs_btree()
129 XFS_IFORK_NEXTENTS(ip, whichfork) > in xfs_bmap_needs_btree()
130 XFS_IFORK_MAXEXT(ip, whichfork); in xfs_bmap_needs_btree()
136 static inline bool xfs_bmap_wants_extents(struct xfs_inode *ip, int whichfork) in xfs_bmap_wants_extents() argument
138 return whichfork != XFS_COW_FORK && in xfs_bmap_wants_extents()
139 XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE && in xfs_bmap_wants_extents()
140 XFS_IFORK_NEXTENTS(ip, whichfork) <= in xfs_bmap_wants_extents()
141 XFS_IFORK_MAXEXT(ip, whichfork); in xfs_bmap_wants_extents()
219 int whichfork) in xfs_bmap_forkoff_reset() argument
221 if (whichfork == XFS_ATTR_FORK && in xfs_bmap_forkoff_reset()
322 int whichfork) /* data or attr fork */ in xfs_bmap_check_leaf_extents() argument
338 if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE) { in xfs_bmap_check_leaf_extents()
348 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_check_leaf_extents()
522 #define xfs_bmap_check_leaf_extents(cur, ip, whichfork) do { } while (0) argument
591 int whichfork) /* data or attr fork */ in xfs_bmap_btree_to_extents() argument
605 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_btree_to_extents()
606 ASSERT(whichfork != XFS_COW_FORK); in xfs_bmap_btree_to_extents()
608 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE); in xfs_bmap_btree_to_extents()
627 xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork); in xfs_bmap_btree_to_extents()
634 xfs_iroot_realloc(ip, -1, whichfork); in xfs_bmap_btree_to_extents()
637 XFS_IFORK_FMT_SET(ip, whichfork, XFS_DINODE_FMT_EXTENTS); in xfs_bmap_btree_to_extents()
638 *logflagsp = XFS_ILOG_CORE | xfs_ilog_fext(whichfork); in xfs_bmap_btree_to_extents()
653 int whichfork) /* data or attr fork */ in xfs_bmap_extents_to_btree() argument
671 ASSERT(whichfork != XFS_COW_FORK); in xfs_bmap_extents_to_btree()
672 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_extents_to_btree()
673 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS); in xfs_bmap_extents_to_btree()
679 xfs_iroot_realloc(ip, 1, whichfork); in xfs_bmap_extents_to_btree()
692 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmap_extents_to_btree()
697 XFS_IFORK_FMT_SET(ip, whichfork, XFS_DINODE_FMT_BTREE); in xfs_bmap_extents_to_btree()
701 xfs_rmap_ino_bmbt_owner(&args.oinfo, ip->i_ino, whichfork); in xfs_bmap_extents_to_btree()
755 ASSERT(cnt == XFS_IFORK_NEXTENTS(ip, whichfork)); in xfs_bmap_extents_to_btree()
776 *logflagsp = XFS_ILOG_CORE | xfs_ilog_fbroot(whichfork); in xfs_bmap_extents_to_btree()
782 xfs_iroot_realloc(ip, -1, whichfork); in xfs_bmap_extents_to_btree()
783 XFS_IFORK_FMT_SET(ip, whichfork, XFS_DINODE_FMT_EXTENTS); in xfs_bmap_extents_to_btree()
799 int whichfork) in xfs_bmap_local_to_extents_empty() argument
801 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_local_to_extents_empty()
803 ASSERT(whichfork != XFS_COW_FORK); in xfs_bmap_local_to_extents_empty()
804 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL); in xfs_bmap_local_to_extents_empty()
806 ASSERT(XFS_IFORK_NEXTENTS(ip, whichfork) == 0); in xfs_bmap_local_to_extents_empty()
808 xfs_bmap_forkoff_reset(ip, whichfork); in xfs_bmap_local_to_extents_empty()
813 XFS_IFORK_FMT_SET(ip, whichfork, XFS_DINODE_FMT_EXTENTS); in xfs_bmap_local_to_extents_empty()
823 int whichfork, in xfs_bmap_local_to_extents() argument
841 ASSERT(!(S_ISREG(VFS_I(ip)->i_mode) && whichfork == XFS_DATA_FORK)); in xfs_bmap_local_to_extents()
842 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_local_to_extents()
843 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL); in xfs_bmap_local_to_extents()
846 xfs_bmap_local_to_extents_empty(ip, whichfork); in xfs_bmap_local_to_extents()
857 xfs_rmap_ino_owner(&args.oinfo, ip->i_ino, whichfork, 0); in xfs_bmap_local_to_extents()
892 xfs_idata_realloc(ip, -ifp->if_bytes, whichfork); in xfs_bmap_local_to_extents()
893 xfs_bmap_local_to_extents_empty(ip, whichfork); in xfs_bmap_local_to_extents()
906 XFS_IFORK_NEXT_SET(ip, whichfork, 1); in xfs_bmap_local_to_extents()
910 flags |= xfs_ilog_fext(whichfork); in xfs_bmap_local_to_extents()
1007 dargs.whichfork = XFS_DATA_FORK; in xfs_bmap_add_attrfork_local()
1165 int whichfork) in xfs_iread_extents() argument
1168 int state = xfs_bmap_fork_to_state(whichfork); in xfs_iread_extents()
1169 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_iread_extents()
1170 xfs_extnum_t nextents = XFS_IFORK_NEXTENTS(ip, whichfork); in xfs_iread_extents()
1183 if (unlikely(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE)) { in xfs_iread_extents()
1258 fa = xfs_bmap_validate_extent(ip, whichfork, &new); in xfs_iread_extents()
1284 if (i != XFS_IFORK_NEXTENTS(ip, whichfork)) { in xfs_iread_extents()
1312 int whichfork) /* data or attr fork */ in xfs_bmap_first_unused() argument
1314 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_first_unused()
1321 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE || in xfs_bmap_first_unused()
1322 XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS || in xfs_bmap_first_unused()
1323 XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL); in xfs_bmap_first_unused()
1325 if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL) { in xfs_bmap_first_unused()
1331 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_first_unused()
1363 int whichfork) /* data or attr fork */ in xfs_bmap_last_before() argument
1365 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_last_before()
1370 switch (XFS_IFORK_FORMAT(ip, whichfork)) { in xfs_bmap_last_before()
1382 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_last_before()
1396 int whichfork, in xfs_bmap_last_extent() argument
1400 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_last_extent()
1405 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_last_extent()
1430 int whichfork) in xfs_bmap_isaeof() argument
1437 error = xfs_bmap_last_extent(NULL, bma->ip, whichfork, &rec, in xfs_bmap_isaeof()
1466 int whichfork) in xfs_bmap_last_offset() argument
1474 if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL) in xfs_bmap_last_offset()
1477 if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE && in xfs_bmap_last_offset()
1478 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) in xfs_bmap_last_offset()
1481 error = xfs_bmap_last_extent(NULL, ip, whichfork, &rec, &is_empty); in xfs_bmap_last_offset()
1497 int whichfork) /* data or attr fork */ in xfs_bmap_one_block() argument
1505 if (whichfork == XFS_DATA_FORK) in xfs_bmap_one_block()
1508 if (XFS_IFORK_NEXTENTS(ip, whichfork) != 1) in xfs_bmap_one_block()
1510 if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) in xfs_bmap_one_block()
1512 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_one_block()
1517 if (rval && whichfork == XFS_DATA_FORK) in xfs_bmap_one_block()
1532 int whichfork) in xfs_bmap_add_extent_delay_real() argument
1542 int state = xfs_bmap_fork_to_state(whichfork); in xfs_bmap_add_extent_delay_real()
1552 ifp = XFS_IFORK_PTR(bma->ip, whichfork); in xfs_bmap_add_extent_delay_real()
1553 ASSERT(whichfork != XFS_ATTR_FORK); in xfs_bmap_add_extent_delay_real()
1554 nextents = (whichfork == XFS_COW_FORK ? &bma->ip->i_cnextents : in xfs_bmap_add_extent_delay_real()
1808 if (xfs_bmap_needs_btree(bma->ip, whichfork)) { in xfs_bmap_add_extent_delay_real()
1810 &bma->cur, 1, &tmp_rval, whichfork); in xfs_bmap_add_extent_delay_real()
1885 if (xfs_bmap_needs_btree(bma->ip, whichfork)) { in xfs_bmap_add_extent_delay_real()
1887 &bma->cur, 1, &tmp_rval, whichfork); in xfs_bmap_add_extent_delay_real()
1965 if (xfs_bmap_needs_btree(bma->ip, whichfork)) { in xfs_bmap_add_extent_delay_real()
1967 &bma->cur, 1, &tmp_rval, whichfork); in xfs_bmap_add_extent_delay_real()
1992 error = xfs_rmap_map_extent(bma->tp, bma->ip, whichfork, new); in xfs_bmap_add_extent_delay_real()
1998 if (xfs_bmap_needs_btree(bma->ip, whichfork)) { in xfs_bmap_add_extent_delay_real()
2004 whichfork); in xfs_bmap_add_extent_delay_real()
2022 xfs_bmap_check_leaf_extents(bma->cur, bma->ip, whichfork); in xfs_bmap_add_extent_delay_real()
2024 if (whichfork != XFS_COW_FORK) in xfs_bmap_add_extent_delay_real()
2039 int whichfork, in xfs_bmap_add_extent_unwritten_real() argument
2053 int state = xfs_bmap_fork_to_state(whichfork); in xfs_bmap_add_extent_unwritten_real()
2060 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_add_extent_unwritten_real()
2147 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_add_extent_unwritten_real()
2148 XFS_IFORK_NEXTENTS(ip, whichfork) - 2); in xfs_bmap_add_extent_unwritten_real()
2185 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_add_extent_unwritten_real()
2186 XFS_IFORK_NEXTENTS(ip, whichfork) - 1); in xfs_bmap_add_extent_unwritten_real()
2220 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_add_extent_unwritten_real()
2221 XFS_IFORK_NEXTENTS(ip, whichfork) - 1); in xfs_bmap_add_extent_unwritten_real()
2313 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_add_extent_unwritten_real()
2314 XFS_IFORK_NEXTENTS(ip, whichfork) + 1); in xfs_bmap_add_extent_unwritten_real()
2381 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_add_extent_unwritten_real()
2382 XFS_IFORK_NEXTENTS(ip, whichfork) + 1); in xfs_bmap_add_extent_unwritten_real()
2425 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_add_extent_unwritten_real()
2426 XFS_IFORK_NEXTENTS(ip, whichfork) + 2); in xfs_bmap_add_extent_unwritten_real()
2474 error = xfs_rmap_convert_extent(mp, tp, ip, whichfork, new); in xfs_bmap_add_extent_unwritten_real()
2479 if (xfs_bmap_needs_btree(ip, whichfork)) { in xfs_bmap_add_extent_unwritten_real()
2484 &tmp_logflags, whichfork); in xfs_bmap_add_extent_unwritten_real()
2496 xfs_bmap_check_leaf_extents(*curp, ip, whichfork); in xfs_bmap_add_extent_unwritten_real()
2511 int whichfork, in xfs_bmap_add_extent_hole_delay() argument
2520 int state = xfs_bmap_fork_to_state(whichfork); in xfs_bmap_add_extent_hole_delay()
2523 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_add_extent_hole_delay()
2651 int whichfork, in xfs_bmap_add_extent_hole_real() argument
2658 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_add_extent_hole_real()
2666 int state = xfs_bmap_fork_to_state(whichfork); in xfs_bmap_add_extent_hole_real()
2731 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_add_extent_hole_real()
2732 XFS_IFORK_NEXTENTS(ip, whichfork) - 1); in xfs_bmap_add_extent_hole_real()
2734 rval = XFS_ILOG_CORE | xfs_ilog_fext(whichfork); in xfs_bmap_add_extent_hole_real()
2768 rval = xfs_ilog_fext(whichfork); in xfs_bmap_add_extent_hole_real()
2795 rval = xfs_ilog_fext(whichfork); in xfs_bmap_add_extent_hole_real()
2815 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_add_extent_hole_real()
2816 XFS_IFORK_NEXTENTS(ip, whichfork) + 1); in xfs_bmap_add_extent_hole_real()
2818 rval = XFS_ILOG_CORE | xfs_ilog_fext(whichfork); in xfs_bmap_add_extent_hole_real()
2835 error = xfs_rmap_map_extent(tp, ip, whichfork, new); in xfs_bmap_add_extent_hole_real()
2841 if (xfs_bmap_needs_btree(ip, whichfork)) { in xfs_bmap_add_extent_hole_real()
2846 &tmp_logflags, whichfork); in xfs_bmap_add_extent_hole_real()
2857 xfs_bmap_check_leaf_extents(cur, ip, whichfork); in xfs_bmap_add_extent_hole_real()
3823 int whichfork = xfs_bmapi_whichfork(flags); in xfs_bmapi_read() local
3831 (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmapi_read()
3832 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), in xfs_bmapi_read()
3843 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmapi_read()
3846 if (whichfork == XFS_COW_FORK) { in xfs_bmapi_read()
3863 __func__, ip->i_ino, whichfork); in xfs_bmapi_read()
3869 error = xfs_iread_extents(NULL, ip, whichfork); in xfs_bmapi_read()
3929 int whichfork, in xfs_bmapi_reserve_delalloc() argument
3938 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmapi_reserve_delalloc()
3955 if (whichfork == XFS_COW_FORK) { in xfs_bmapi_reserve_delalloc()
4000 xfs_bmap_add_extent_hole_delay(ip, whichfork, icur, got); in xfs_bmapi_reserve_delalloc()
4007 if (whichfork == XFS_DATA_FORK && prealloc) in xfs_bmapi_reserve_delalloc()
4009 if (whichfork == XFS_COW_FORK && (prealloc || aoff < off || alen > len)) in xfs_bmapi_reserve_delalloc()
4028 int whichfork = xfs_bmapi_whichfork(bma->flags); in xfs_bmapi_allocate() local
4029 struct xfs_ifork *ifp = XFS_IFORK_PTR(bma->ip, whichfork); in xfs_bmapi_allocate()
4058 if (whichfork == XFS_DATA_FORK) { in xfs_bmapi_allocate()
4075 !(bma->flags & XFS_BMAPI_METADATA) && whichfork == XFS_DATA_FORK) { in xfs_bmapi_allocate()
4076 error = xfs_bmap_isaeof(bma, whichfork); in xfs_bmapi_allocate()
4088 bma->cur = xfs_bmbt_init_cursor(mp, bma->tp, bma->ip, whichfork); in xfs_bmapi_allocate()
4119 error = xfs_bmap_add_extent_delay_real(bma, whichfork); in xfs_bmapi_allocate()
4122 whichfork, &bma->icur, &bma->cur, &bma->got, in xfs_bmapi_allocate()
4151 int whichfork = xfs_bmapi_whichfork(flags); in xfs_bmapi_convert_unwritten() local
4152 struct xfs_ifork *ifp = XFS_IFORK_PTR(bma->ip, whichfork); in xfs_bmapi_convert_unwritten()
4173 bma->ip, whichfork); in xfs_bmapi_convert_unwritten()
4189 error = xfs_bmap_add_extent_unwritten_real(bma->tp, bma->ip, whichfork, in xfs_bmapi_convert_unwritten()
4202 if (whichfork != XFS_COW_FORK) in xfs_bmapi_convert_unwritten()
4248 int whichfork; /* data or attr fork */ in xfs_bmapi_write() local
4263 whichfork = xfs_bmapi_whichfork(flags); in xfs_bmapi_write()
4271 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_LOCAL); in xfs_bmapi_write()
4288 (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmapi_write()
4289 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), in xfs_bmapi_write()
4298 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmapi_write()
4303 if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE) in xfs_bmapi_write()
4312 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmapi_write()
4403 if (whichfork == XFS_COW_FORK) { in xfs_bmapi_write()
4443 if (xfs_bmap_wants_extents(ip, whichfork)) { in xfs_bmapi_write()
4448 &tmp_logflags, whichfork); in xfs_bmapi_write()
4454 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE || in xfs_bmapi_write()
4455 XFS_IFORK_NEXTENTS(ip, whichfork) > in xfs_bmapi_write()
4456 XFS_IFORK_MAXEXT(ip, whichfork)); in xfs_bmapi_write()
4463 if ((bma.logflags & xfs_ilog_fext(whichfork)) && in xfs_bmapi_write()
4464 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) in xfs_bmapi_write()
4465 bma.logflags &= ~xfs_ilog_fext(whichfork); in xfs_bmapi_write()
4466 else if ((bma.logflags & xfs_ilog_fbroot(whichfork)) && in xfs_bmapi_write()
4467 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE) in xfs_bmapi_write()
4468 bma.logflags &= ~xfs_ilog_fbroot(whichfork); in xfs_bmapi_write()
4500 int whichfork = xfs_bmapi_whichfork(flags); in xfs_bmapi_remap() local
4503 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmapi_remap()
4513 (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmapi_remap()
4514 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), in xfs_bmapi_remap()
4524 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmapi_remap()
4539 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmapi_remap()
4551 error = xfs_bmap_add_extent_hole_real(tp, ip, whichfork, &icur, in xfs_bmapi_remap()
4556 if (xfs_bmap_wants_extents(ip, whichfork)) { in xfs_bmapi_remap()
4560 &tmp_logflags, whichfork); in xfs_bmapi_remap()
4665 int whichfork, in xfs_bmap_del_extent_delay() argument
4671 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_del_extent_delay()
4676 int state = xfs_bmap_fork_to_state(whichfork); in xfs_bmap_del_extent_delay()
4682 isrt = (whichfork == XFS_DATA_FORK) && XFS_IS_REALTIME_INODE(ip); in xfs_bmap_del_extent_delay()
4872 int whichfork, /* data or attr fork */ in xfs_bmap_del_extent_real() argument
4889 int state = xfs_bmap_fork_to_state(whichfork); in xfs_bmap_del_extent_real()
4895 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_del_extent_real()
4915 XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS && in xfs_bmap_del_extent_real()
4916 XFS_IFORK_NEXTENTS(ip, whichfork) >= in xfs_bmap_del_extent_real()
4917 XFS_IFORK_MAXEXT(ip, whichfork) && in xfs_bmap_del_extent_real()
4922 if (whichfork == XFS_DATA_FORK && XFS_IS_REALTIME_INODE(ip)) { in xfs_bmap_del_extent_real()
4971 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_del_extent_real()
4972 XFS_IFORK_NEXTENTS(ip, whichfork) - 1); in xfs_bmap_del_extent_real()
4975 flags |= xfs_ilog_fext(whichfork); in xfs_bmap_del_extent_real()
4991 flags |= xfs_ilog_fext(whichfork); in xfs_bmap_del_extent_real()
5005 flags |= xfs_ilog_fext(whichfork); in xfs_bmap_del_extent_real()
5070 flags |= xfs_ilog_fext(whichfork); in xfs_bmap_del_extent_real()
5071 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_del_extent_real()
5072 XFS_IFORK_NEXTENTS(ip, whichfork) + 1); in xfs_bmap_del_extent_real()
5079 error = xfs_rmap_unmap_extent(tp, ip, whichfork, del); in xfs_bmap_del_extent_real()
5087 if (xfs_is_reflink_inode(ip) && whichfork == XFS_DATA_FORK) { in xfs_bmap_del_extent_real()
5142 int whichfork; /* data or attribute fork */ in __xfs_bunmapi() local
5153 whichfork = xfs_bmapi_whichfork(flags); in __xfs_bunmapi()
5154 ASSERT(whichfork != XFS_COW_FORK); in __xfs_bunmapi()
5155 ifp = XFS_IFORK_PTR(ip, whichfork); in __xfs_bunmapi()
5157 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in __xfs_bunmapi()
5158 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE)) { in __xfs_bunmapi()
5176 if (tp && xfs_is_reflink_inode(ip) && whichfork == XFS_DATA_FORK) in __xfs_bunmapi()
5182 (error = xfs_iread_extents(tp, ip, whichfork))) in __xfs_bunmapi()
5189 isrt = (whichfork == XFS_DATA_FORK) && XFS_IS_REALTIME_INODE(ip); in __xfs_bunmapi()
5200 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE); in __xfs_bunmapi()
5201 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in __xfs_bunmapi()
5316 whichfork, &icur, &cur, &del, in __xfs_bunmapi()
5373 ip, whichfork, &icur, &cur, in __xfs_bunmapi()
5382 ip, whichfork, &icur, &cur, in __xfs_bunmapi()
5392 error = xfs_bmap_del_extent_delay(ip, whichfork, &icur, in __xfs_bunmapi()
5396 &del, &tmp_logflags, whichfork, in __xfs_bunmapi()
5428 if (xfs_bmap_needs_btree(ip, whichfork)) { in __xfs_bunmapi()
5431 &tmp_logflags, whichfork); in __xfs_bunmapi()
5439 else if (xfs_bmap_wants_extents(ip, whichfork)) { in __xfs_bunmapi()
5442 whichfork); in __xfs_bunmapi()
5456 if ((logflags & xfs_ilog_fext(whichfork)) && in __xfs_bunmapi()
5457 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) in __xfs_bunmapi()
5458 logflags &= ~xfs_ilog_fext(whichfork); in __xfs_bunmapi()
5459 else if ((logflags & xfs_ilog_fbroot(whichfork)) && in __xfs_bunmapi()
5460 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE) in __xfs_bunmapi()
5461 logflags &= ~xfs_ilog_fbroot(whichfork); in __xfs_bunmapi()
5534 int whichfork, in xfs_bmse_merge() argument
5560 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmse_merge()
5561 XFS_IFORK_NEXTENTS(ip, whichfork) - 1); in xfs_bmse_merge()
5591 xfs_iext_prev(XFS_IFORK_PTR(ip, whichfork), icur); in xfs_bmse_merge()
5592 xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), icur, in xfs_bmse_merge()
5596 error = xfs_rmap_unmap_extent(tp, ip, whichfork, got); in xfs_bmse_merge()
5601 return xfs_rmap_map_extent(tp, ip, whichfork, &new); in xfs_bmse_merge()
5608 int whichfork, in xfs_bmap_shift_update_extent() argument
5636 xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), icur, in xfs_bmap_shift_update_extent()
5640 error = xfs_rmap_unmap_extent(tp, ip, whichfork, &prev); in xfs_bmap_shift_update_extent()
5643 return xfs_rmap_map_extent(tp, ip, whichfork, got); in xfs_bmap_shift_update_extent()
5654 int whichfork = XFS_DATA_FORK; in xfs_bmap_collapse_extents() local
5656 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_collapse_extents()
5665 (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmap_collapse_extents()
5666 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), in xfs_bmap_collapse_extents()
5678 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_collapse_extents()
5684 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmap_collapse_extents()
5703 error = xfs_bmse_merge(tp, ip, whichfork, in xfs_bmap_collapse_extents()
5717 error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got, in xfs_bmap_collapse_extents()
5772 int whichfork = XFS_DATA_FORK; in xfs_bmap_insert_extents() local
5774 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_insert_extents()
5783 (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmap_insert_extents()
5784 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), in xfs_bmap_insert_extents()
5796 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_insert_extents()
5802 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmap_insert_extents()
5844 error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got, in xfs_bmap_insert_extents()
5876 int whichfork = XFS_DATA_FORK; in xfs_bmap_split_extent_at() local
5889 (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmap_split_extent_at()
5890 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), in xfs_bmap_split_extent_at()
5900 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_split_extent_at()
5903 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_split_extent_at()
5922 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmap_split_extent_at()
5931 xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), &icur, in xfs_bmap_split_extent_at()
5945 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_split_extent_at()
5946 XFS_IFORK_NEXTENTS(ip, whichfork) + 1); in xfs_bmap_split_extent_at()
5962 if (xfs_bmap_needs_btree(ip, whichfork)) { in xfs_bmap_split_extent_at()
5967 &tmp_logflags, whichfork); in xfs_bmap_split_extent_at()
6025 int whichfork, in __xfs_bmap_add() argument
6034 ip->i_ino, whichfork, in __xfs_bmap_add()
6043 bi->bi_whichfork = whichfork; in __xfs_bmap_add()
6085 int whichfork, in xfs_bmap_finish_one() argument
6098 ip->i_ino, whichfork, startoff, *blockcount, state); in xfs_bmap_finish_one()
6100 if (WARN_ON_ONCE(whichfork != XFS_DATA_FORK)) in xfs_bmap_finish_one()
6129 int whichfork, in xfs_bmap_validate_extent() argument
6138 if (isrt && whichfork == XFS_DATA_FORK) { in xfs_bmap_validate_extent()
6153 if (whichfork != XFS_DATA_FORK) in xfs_bmap_validate_extent()