Lines Matching refs:whichfork
53 int whichfork) /* data or attr fork */ in xfs_bmap_compute_maxlevels() argument
76 whichfork); in xfs_bmap_compute_maxlevels()
77 if (whichfork == XFS_DATA_FORK) in xfs_bmap_compute_maxlevels()
92 mp->m_bm_maxlevels[whichfork] = level; in xfs_bmap_compute_maxlevels()
93 ASSERT(mp->m_bm_maxlevels[whichfork] <= xfs_bmbt_maxlevels_ondisk()); in xfs_bmap_compute_maxlevels()
129 static inline bool xfs_bmap_needs_btree(struct xfs_inode *ip, int whichfork) in xfs_bmap_needs_btree() argument
131 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_needs_btree()
133 return whichfork != XFS_COW_FORK && in xfs_bmap_needs_btree()
135 ifp->if_nextents > XFS_IFORK_MAXEXT(ip, whichfork); in xfs_bmap_needs_btree()
141 static inline bool xfs_bmap_wants_extents(struct xfs_inode *ip, int whichfork) in xfs_bmap_wants_extents() argument
143 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_wants_extents()
145 return whichfork != XFS_COW_FORK && in xfs_bmap_wants_extents()
147 ifp->if_nextents <= XFS_IFORK_MAXEXT(ip, whichfork); in xfs_bmap_wants_extents()
216 int whichfork) in xfs_bmap_forkoff_reset() argument
218 if (whichfork == XFS_ATTR_FORK && in xfs_bmap_forkoff_reset()
319 int whichfork) /* data or attr fork */ in xfs_bmap_check_leaf_extents() argument
322 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_check_leaf_extents()
518 #define xfs_bmap_check_leaf_extents(cur, ip, whichfork) do { } while (0) argument
539 int whichfork) /* data or attr fork */ in xfs_bmap_btree_to_extents() argument
541 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_btree_to_extents()
552 if (!xfs_bmap_wants_extents(ip, whichfork)) in xfs_bmap_btree_to_extents()
556 ASSERT(whichfork != XFS_COW_FORK); in xfs_bmap_btree_to_extents()
575 xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork); in xfs_bmap_btree_to_extents()
582 xfs_iroot_realloc(ip, -1, whichfork); in xfs_bmap_btree_to_extents()
585 *logflagsp |= XFS_ILOG_CORE | xfs_ilog_fext(whichfork); in xfs_bmap_btree_to_extents()
600 int whichfork) /* data or attr fork */ in xfs_bmap_extents_to_btree() argument
618 ASSERT(whichfork != XFS_COW_FORK); in xfs_bmap_extents_to_btree()
619 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_extents_to_btree()
626 xfs_iroot_realloc(ip, 1, whichfork); in xfs_bmap_extents_to_btree()
638 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmap_extents_to_btree()
647 xfs_rmap_ino_bmbt_owner(&args.oinfo, ip->i_ino, whichfork); in xfs_bmap_extents_to_btree()
711 *logflagsp = XFS_ILOG_CORE | xfs_ilog_fbroot(whichfork); in xfs_bmap_extents_to_btree()
717 xfs_iroot_realloc(ip, -1, whichfork); in xfs_bmap_extents_to_btree()
735 int whichfork) in xfs_bmap_local_to_extents_empty() argument
737 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_local_to_extents_empty()
739 ASSERT(whichfork != XFS_COW_FORK); in xfs_bmap_local_to_extents_empty()
744 xfs_bmap_forkoff_reset(ip, whichfork); in xfs_bmap_local_to_extents_empty()
758 int whichfork, in xfs_bmap_local_to_extents() argument
776 ASSERT(!(S_ISREG(VFS_I(ip)->i_mode) && whichfork == XFS_DATA_FORK)); in xfs_bmap_local_to_extents()
777 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_local_to_extents()
781 xfs_bmap_local_to_extents_empty(tp, ip, whichfork); in xfs_bmap_local_to_extents()
793 xfs_rmap_ino_owner(&args.oinfo, ip->i_ino, whichfork, 0); in xfs_bmap_local_to_extents()
826 xfs_idata_realloc(ip, -ifp->if_bytes, whichfork); in xfs_bmap_local_to_extents()
827 xfs_bmap_local_to_extents_empty(tp, ip, whichfork); in xfs_bmap_local_to_extents()
843 flags |= xfs_ilog_fext(whichfork); in xfs_bmap_local_to_extents()
946 dargs.whichfork = XFS_DATA_FORK; in xfs_bmap_add_attrfork_local()
1101 int whichfork = cur->bc_ino.whichfork; in xfs_iread_bmbt_block() local
1102 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iread_bmbt_block()
1123 fa = xfs_bmap_validate_extent(ip, whichfork, &new); in xfs_iread_bmbt_block()
1131 xfs_bmap_fork_to_state(whichfork)); in xfs_iread_bmbt_block()
1133 xfs_bmap_fork_to_state(whichfork), _THIS_IP_); in xfs_iread_bmbt_block()
1147 int whichfork) in xfs_iread_extents() argument
1150 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iread_extents()
1162 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_iread_extents()
1192 int whichfork) /* data or attr fork */ in xfs_bmap_first_unused() argument
1194 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_first_unused()
1208 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_first_unused()
1239 int whichfork) /* data or attr fork */ in xfs_bmap_last_before() argument
1241 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_last_before()
1258 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_last_before()
1271 int whichfork, in xfs_bmap_last_extent() argument
1275 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_last_extent()
1279 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_last_extent()
1303 int whichfork) in xfs_bmap_isaeof() argument
1310 error = xfs_bmap_last_extent(NULL, bma->ip, whichfork, &rec, in xfs_bmap_isaeof()
1339 int whichfork) in xfs_bmap_last_offset() argument
1341 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_last_offset()
1354 error = xfs_bmap_last_extent(NULL, ip, whichfork, &rec, &is_empty); in xfs_bmap_last_offset()
1372 int whichfork) in xfs_bmap_add_extent_delay_real() argument
1375 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork); in xfs_bmap_add_extent_delay_real()
1383 uint32_t state = xfs_bmap_fork_to_state(whichfork); in xfs_bmap_add_extent_delay_real()
1390 ASSERT(whichfork != XFS_ATTR_FORK); in xfs_bmap_add_extent_delay_real()
1673 if (xfs_bmap_needs_btree(bma->ip, whichfork)) { in xfs_bmap_add_extent_delay_real()
1675 &bma->cur, 1, &tmp_rval, whichfork); in xfs_bmap_add_extent_delay_real()
1760 if (xfs_bmap_needs_btree(bma->ip, whichfork)) { in xfs_bmap_add_extent_delay_real()
1762 &bma->cur, 1, &tmp_rval, whichfork); in xfs_bmap_add_extent_delay_real()
1846 if (xfs_bmap_needs_btree(bma->ip, whichfork)) { in xfs_bmap_add_extent_delay_real()
1848 &bma->cur, 1, &tmp_rval, whichfork); in xfs_bmap_add_extent_delay_real()
1873 xfs_rmap_map_extent(bma->tp, bma->ip, whichfork, new); in xfs_bmap_add_extent_delay_real()
1876 if (xfs_bmap_needs_btree(bma->ip, whichfork)) { in xfs_bmap_add_extent_delay_real()
1882 whichfork); in xfs_bmap_add_extent_delay_real()
1903 xfs_bmap_check_leaf_extents(bma->cur, bma->ip, whichfork); in xfs_bmap_add_extent_delay_real()
1905 if (whichfork != XFS_COW_FORK) in xfs_bmap_add_extent_delay_real()
1920 int whichfork, in xfs_bmap_add_extent_unwritten_real() argument
1934 uint32_t state = xfs_bmap_fork_to_state(whichfork); in xfs_bmap_add_extent_unwritten_real()
1941 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_add_extent_unwritten_real()
2419 xfs_rmap_convert_extent(mp, tp, ip, whichfork, new); in xfs_bmap_add_extent_unwritten_real()
2422 if (xfs_bmap_needs_btree(ip, whichfork)) { in xfs_bmap_add_extent_unwritten_real()
2427 &tmp_logflags, whichfork); in xfs_bmap_add_extent_unwritten_real()
2439 xfs_bmap_check_leaf_extents(*curp, ip, whichfork); in xfs_bmap_add_extent_unwritten_real()
2454 int whichfork, in xfs_bmap_add_extent_hole_delay() argument
2463 uint32_t state = xfs_bmap_fork_to_state(whichfork); in xfs_bmap_add_extent_hole_delay()
2466 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_add_extent_hole_delay()
2595 int whichfork, in xfs_bmap_add_extent_hole_real() argument
2602 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_add_extent_hole_real()
2610 uint32_t state = xfs_bmap_fork_to_state(whichfork); in xfs_bmap_add_extent_hole_real()
2677 rval = XFS_ILOG_CORE | xfs_ilog_fext(whichfork); in xfs_bmap_add_extent_hole_real()
2720 rval = xfs_ilog_fext(whichfork); in xfs_bmap_add_extent_hole_real()
2750 rval = xfs_ilog_fext(whichfork); in xfs_bmap_add_extent_hole_real()
2776 rval = XFS_ILOG_CORE | xfs_ilog_fext(whichfork); in xfs_bmap_add_extent_hole_real()
2799 xfs_rmap_map_extent(tp, ip, whichfork, new); in xfs_bmap_add_extent_hole_real()
2802 if (xfs_bmap_needs_btree(ip, whichfork)) { in xfs_bmap_add_extent_hole_real()
2807 &tmp_logflags, whichfork); in xfs_bmap_add_extent_hole_real()
2818 xfs_bmap_check_leaf_extents(cur, ip, whichfork); in xfs_bmap_add_extent_hole_real()
3834 int whichfork = xfs_bmapi_whichfork(flags); in xfs_bmapi_read() local
3835 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_read()
3860 error = xfs_iread_extents(NULL, ip, whichfork); in xfs_bmapi_read()
3919 int whichfork, in xfs_bmapi_reserve_delalloc() argument
3928 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_reserve_delalloc()
3945 if (whichfork == XFS_COW_FORK) { in xfs_bmapi_reserve_delalloc()
3990 xfs_bmap_add_extent_hole_delay(ip, whichfork, icur, got); in xfs_bmapi_reserve_delalloc()
3997 if (whichfork == XFS_DATA_FORK && prealloc) in xfs_bmapi_reserve_delalloc()
3999 if (whichfork == XFS_COW_FORK && (prealloc || aoff < off || alen > len)) in xfs_bmapi_reserve_delalloc()
4017 int whichfork = xfs_bmapi_whichfork(bma->flags); in xfs_bmap_alloc_userdata() local
4027 if (whichfork == XFS_DATA_FORK || whichfork == XFS_COW_FORK) { in xfs_bmap_alloc_userdata()
4033 error = xfs_bmap_isaeof(bma, whichfork); in xfs_bmap_alloc_userdata()
4054 int whichfork = xfs_bmapi_whichfork(bma->flags); in xfs_bmapi_allocate() local
4055 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork); in xfs_bmapi_allocate()
4101 bma->cur = xfs_bmbt_init_cursor(mp, bma->tp, bma->ip, whichfork); in xfs_bmapi_allocate()
4121 error = xfs_bmap_add_extent_delay_real(bma, whichfork); in xfs_bmapi_allocate()
4124 whichfork, &bma->icur, &bma->cur, &bma->got, in xfs_bmapi_allocate()
4153 int whichfork = xfs_bmapi_whichfork(flags); in xfs_bmapi_convert_unwritten() local
4154 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork); in xfs_bmapi_convert_unwritten()
4175 bma->ip, whichfork); in xfs_bmapi_convert_unwritten()
4191 error = xfs_bmap_add_extent_unwritten_real(bma->tp, bma->ip, whichfork, in xfs_bmapi_convert_unwritten()
4204 if (whichfork != XFS_COW_FORK) in xfs_bmapi_convert_unwritten()
4249 int whichfork, in xfs_bmapi_finish() argument
4252 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork); in xfs_bmapi_finish()
4254 if ((bma->logflags & xfs_ilog_fext(whichfork)) && in xfs_bmapi_finish()
4256 bma->logflags &= ~xfs_ilog_fext(whichfork); in xfs_bmapi_finish()
4257 else if ((bma->logflags & xfs_ilog_fbroot(whichfork)) && in xfs_bmapi_finish()
4259 bma->logflags &= ~xfs_ilog_fbroot(whichfork); in xfs_bmapi_finish()
4290 int whichfork = xfs_bmapi_whichfork(flags); in xfs_bmapi_write() local
4291 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_write()
4342 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmapi_write()
4350 bma.minleft = xfs_bmapi_minleft(tp, ip, whichfork); in xfs_bmapi_write()
4408 if (whichfork == XFS_COW_FORK) in xfs_bmapi_write()
4443 whichfork); in xfs_bmapi_write()
4448 ifp->if_nextents > XFS_IFORK_MAXEXT(ip, whichfork)); in xfs_bmapi_write()
4449 xfs_bmapi_finish(&bma, whichfork, 0); in xfs_bmapi_write()
4454 xfs_bmapi_finish(&bma, whichfork, error); in xfs_bmapi_write()
4467 int whichfork, in xfs_bmapi_convert_delalloc() argument
4472 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_convert_delalloc()
4480 if (whichfork == XFS_COW_FORK) in xfs_bmapi_convert_delalloc()
4495 error = xfs_iext_count_may_overflow(ip, whichfork, in xfs_bmapi_convert_delalloc()
4510 WARN_ON_ONCE(whichfork != XFS_COW_FORK); in xfs_bmapi_convert_delalloc()
4532 bma.minleft = xfs_bmapi_minleft(tp, ip, whichfork); in xfs_bmapi_convert_delalloc()
4548 if (whichfork == XFS_COW_FORK) in xfs_bmapi_convert_delalloc()
4573 if (whichfork == XFS_COW_FORK) in xfs_bmapi_convert_delalloc()
4577 whichfork); in xfs_bmapi_convert_delalloc()
4581 xfs_bmapi_finish(&bma, whichfork, 0); in xfs_bmapi_convert_delalloc()
4587 xfs_bmapi_finish(&bma, whichfork, error); in xfs_bmapi_convert_delalloc()
4608 int whichfork = xfs_bmapi_whichfork(flags); in xfs_bmapi_remap() local
4611 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_remap()
4628 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmapi_remap()
4642 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmapi_remap()
4654 error = xfs_bmap_add_extent_hole_real(tp, ip, whichfork, &icur, in xfs_bmapi_remap()
4659 error = xfs_bmap_btree_to_extents(tp, ip, cur, &logflags, whichfork); in xfs_bmapi_remap()
4762 int whichfork, in xfs_bmap_del_extent_delay() argument
4768 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_del_extent_delay()
4773 uint32_t state = xfs_bmap_fork_to_state(whichfork); in xfs_bmap_del_extent_delay()
4779 isrt = (whichfork == XFS_DATA_FORK) && XFS_IS_REALTIME_INODE(ip); in xfs_bmap_del_extent_delay()
4970 int whichfork, /* data or attr fork */ in xfs_bmap_del_extent_real() argument
4987 uint32_t state = xfs_bmap_fork_to_state(whichfork); in xfs_bmap_del_extent_real()
4993 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_del_extent_real()
5014 ifp->if_nextents >= XFS_IFORK_MAXEXT(ip, whichfork) && in xfs_bmap_del_extent_real()
5019 if (whichfork == XFS_DATA_FORK && XFS_IS_REALTIME_INODE(ip)) { in xfs_bmap_del_extent_real()
5075 flags |= xfs_ilog_fext(whichfork); in xfs_bmap_del_extent_real()
5094 flags |= xfs_ilog_fext(whichfork); in xfs_bmap_del_extent_real()
5108 flags |= xfs_ilog_fext(whichfork); in xfs_bmap_del_extent_real()
5180 flags |= xfs_ilog_fext(whichfork); in xfs_bmap_del_extent_real()
5189 xfs_rmap_unmap_extent(tp, ip, whichfork, del); in xfs_bmap_del_extent_real()
5195 if (xfs_is_reflink_inode(ip) && whichfork == XFS_DATA_FORK) { in xfs_bmap_del_extent_real()
5248 int whichfork; /* data or attribute fork */ in __xfs_bunmapi() local
5257 whichfork = xfs_bmapi_whichfork(flags); in __xfs_bunmapi()
5258 ASSERT(whichfork != XFS_COW_FORK); in __xfs_bunmapi()
5259 ifp = xfs_ifork_ptr(ip, whichfork); in __xfs_bunmapi()
5269 error = xfs_iread_extents(tp, ip, whichfork); in __xfs_bunmapi()
5278 isrt = (whichfork == XFS_DATA_FORK) && XFS_IS_REALTIME_INODE(ip); in __xfs_bunmapi()
5290 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in __xfs_bunmapi()
5386 whichfork, &icur, &cur, &del, in __xfs_bunmapi()
5445 ip, whichfork, &icur, &cur, in __xfs_bunmapi()
5454 ip, whichfork, &icur, &cur, in __xfs_bunmapi()
5464 error = xfs_bmap_del_extent_delay(ip, whichfork, &icur, in __xfs_bunmapi()
5468 &del, &tmp_logflags, whichfork, in __xfs_bunmapi()
5499 if (xfs_bmap_needs_btree(ip, whichfork)) { in __xfs_bunmapi()
5502 &tmp_logflags, whichfork); in __xfs_bunmapi()
5506 whichfork); in __xfs_bunmapi()
5514 if ((logflags & xfs_ilog_fext(whichfork)) && in __xfs_bunmapi()
5516 logflags &= ~xfs_ilog_fext(whichfork); in __xfs_bunmapi()
5517 else if ((logflags & xfs_ilog_fbroot(whichfork)) && in __xfs_bunmapi()
5519 logflags &= ~xfs_ilog_fbroot(whichfork); in __xfs_bunmapi()
5592 int whichfork, in xfs_bmse_merge() argument
5600 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmse_merge()
5651 error = xfs_bmap_btree_to_extents(tp, ip, cur, logflags, whichfork); in xfs_bmse_merge()
5658 xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), icur, in xfs_bmse_merge()
5662 xfs_rmap_unmap_extent(tp, ip, whichfork, got); in xfs_bmse_merge()
5665 xfs_rmap_map_extent(tp, ip, whichfork, &new); in xfs_bmse_merge()
5673 int whichfork, in xfs_bmap_shift_update_extent() argument
5702 xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), icur, in xfs_bmap_shift_update_extent()
5706 xfs_rmap_unmap_extent(tp, ip, whichfork, &prev); in xfs_bmap_shift_update_extent()
5707 xfs_rmap_map_extent(tp, ip, whichfork, got); in xfs_bmap_shift_update_extent()
5719 int whichfork = XFS_DATA_FORK; in xfs_bmap_collapse_extents() local
5721 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_collapse_extents()
5739 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_collapse_extents()
5744 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmap_collapse_extents()
5765 error = xfs_bmse_merge(tp, ip, whichfork, in xfs_bmap_collapse_extents()
5779 error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got, in xfs_bmap_collapse_extents()
5834 int whichfork = XFS_DATA_FORK; in xfs_bmap_insert_extents() local
5836 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_insert_extents()
5854 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_insert_extents()
5859 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmap_insert_extents()
5903 error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got, in xfs_bmap_insert_extents()
5935 int whichfork = XFS_DATA_FORK; in xfs_bmap_split_extent() local
5936 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_split_extent()
5956 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_split_extent()
5974 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmap_split_extent()
5986 xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), &icur, in xfs_bmap_split_extent()
6022 if (xfs_bmap_needs_btree(ip, whichfork)) { in xfs_bmap_split_extent()
6027 &tmp_logflags, whichfork); in xfs_bmap_split_extent()
6057 int whichfork, in __xfs_bmap_add() argument
6066 ip->i_ino, whichfork, in __xfs_bmap_add()
6075 bi->bi_whichfork = whichfork; in __xfs_bmap_add()
6159 int whichfork, in xfs_bmap_validate_extent() argument
6167 if (XFS_IS_REALTIME_INODE(ip) && whichfork == XFS_DATA_FORK) { in xfs_bmap_validate_extent()
6176 if (irec->br_state != XFS_EXT_NORM && whichfork != XFS_DATA_FORK) in xfs_bmap_validate_extent()