Lines Matching refs:whichfork
53 int whichfork) /* data or attr fork */
76 whichfork);
77 if (whichfork == XFS_DATA_FORK)
92 mp->m_bm_maxlevels[whichfork] = level;
93 ASSERT(mp->m_bm_maxlevels[whichfork] <= xfs_bmbt_maxlevels_ondisk());
129 static inline bool xfs_bmap_needs_btree(struct xfs_inode *ip, int whichfork)
131 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
133 return whichfork != XFS_COW_FORK &&
135 ifp->if_nextents > XFS_IFORK_MAXEXT(ip, whichfork);
141 static inline bool xfs_bmap_wants_extents(struct xfs_inode *ip, int whichfork)
143 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
145 return whichfork != XFS_COW_FORK &&
147 ifp->if_nextents <= XFS_IFORK_MAXEXT(ip, whichfork);
216 int whichfork)
218 if (whichfork == XFS_ATTR_FORK &&
319 int whichfork) /* data or attr fork */
322 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
518 #define xfs_bmap_check_leaf_extents(cur, ip, whichfork) do { } while (0)
539 int whichfork) /* data or attr fork */
541 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
552 if (!xfs_bmap_wants_extents(ip, whichfork))
556 ASSERT(whichfork != XFS_COW_FORK);
576 xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork);
587 xfs_iroot_realloc(ip, -1, whichfork);
590 *logflagsp |= XFS_ILOG_CORE | xfs_ilog_fext(whichfork);
605 int whichfork) /* data or attr fork */
623 ASSERT(whichfork != XFS_COW_FORK);
624 ifp = xfs_ifork_ptr(ip, whichfork);
631 xfs_iroot_realloc(ip, 1, whichfork);
643 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
652 xfs_rmap_ino_bmbt_owner(&args.oinfo, ip->i_ino, whichfork);
716 *logflagsp = XFS_ILOG_CORE | xfs_ilog_fbroot(whichfork);
722 xfs_iroot_realloc(ip, -1, whichfork);
740 int whichfork)
742 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
744 ASSERT(whichfork != XFS_COW_FORK);
749 xfs_bmap_forkoff_reset(ip, whichfork);
763 int whichfork,
781 ASSERT(!(S_ISREG(VFS_I(ip)->i_mode) && whichfork == XFS_DATA_FORK));
782 ifp = xfs_ifork_ptr(ip, whichfork);
786 xfs_bmap_local_to_extents_empty(tp, ip, whichfork);
798 xfs_rmap_ino_owner(&args.oinfo, ip->i_ino, whichfork, 0);
831 xfs_idata_realloc(ip, -ifp->if_bytes, whichfork);
832 xfs_bmap_local_to_extents_empty(tp, ip, whichfork);
848 flags |= xfs_ilog_fext(whichfork);
951 dargs.whichfork = XFS_DATA_FORK;
1094 int whichfork,
1101 switch (whichfork) {
1134 int whichfork = cur->bc_ino.whichfork;
1135 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
1156 fa = xfs_bmap_validate_extent(ip, whichfork, &new);
1161 return xfs_bmap_complain_bad_rec(ip, whichfork, fa,
1165 xfs_bmap_fork_to_state(whichfork));
1167 xfs_bmap_fork_to_state(whichfork), _THIS_IP_);
1181 int whichfork)
1184 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
1196 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
1232 int whichfork) /* data or attr fork */
1234 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
1248 error = xfs_iread_extents(tp, ip, whichfork);
1279 int whichfork) /* data or attr fork */
1281 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
1298 error = xfs_iread_extents(tp, ip, whichfork);
1311 int whichfork,
1315 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
1319 error = xfs_iread_extents(tp, ip, whichfork);
1343 int whichfork)
1350 error = xfs_bmap_last_extent(NULL, bma->ip, whichfork, &rec,
1379 int whichfork)
1381 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
1394 error = xfs_bmap_last_extent(NULL, ip, whichfork, &rec, &is_empty);
1412 int whichfork)
1415 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork);
1423 uint32_t state = xfs_bmap_fork_to_state(whichfork);
1430 ASSERT(whichfork != XFS_ATTR_FORK);
1713 if (xfs_bmap_needs_btree(bma->ip, whichfork)) {
1715 &bma->cur, 1, &tmp_rval, whichfork);
1800 if (xfs_bmap_needs_btree(bma->ip, whichfork)) {
1802 &bma->cur, 1, &tmp_rval, whichfork);
1886 if (xfs_bmap_needs_btree(bma->ip, whichfork)) {
1888 &bma->cur, 1, &tmp_rval, whichfork);
1913 xfs_rmap_map_extent(bma->tp, bma->ip, whichfork, new);
1916 if (xfs_bmap_needs_btree(bma->ip, whichfork)) {
1922 whichfork);
1943 xfs_bmap_check_leaf_extents(bma->cur, bma->ip, whichfork);
1945 if (whichfork != XFS_COW_FORK)
1960 int whichfork,
1974 uint32_t state = xfs_bmap_fork_to_state(whichfork);
1981 ifp = xfs_ifork_ptr(ip, whichfork);
2459 xfs_rmap_convert_extent(mp, tp, ip, whichfork, new);
2462 if (xfs_bmap_needs_btree(ip, whichfork)) {
2467 &tmp_logflags, whichfork);
2479 xfs_bmap_check_leaf_extents(*curp, ip, whichfork);
2494 int whichfork,
2503 uint32_t state = xfs_bmap_fork_to_state(whichfork);
2506 ifp = xfs_ifork_ptr(ip, whichfork);
2635 int whichfork,
2642 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
2650 uint32_t state = xfs_bmap_fork_to_state(whichfork);
2717 rval = XFS_ILOG_CORE | xfs_ilog_fext(whichfork);
2760 rval = xfs_ilog_fext(whichfork);
2790 rval = xfs_ilog_fext(whichfork);
2816 rval = XFS_ILOG_CORE | xfs_ilog_fext(whichfork);
2839 xfs_rmap_map_extent(tp, ip, whichfork, new);
2842 if (xfs_bmap_needs_btree(ip, whichfork)) {
2847 &tmp_logflags, whichfork);
2858 xfs_bmap_check_leaf_extents(cur, ip, whichfork);
3874 int whichfork = xfs_bmapi_whichfork(flags);
3875 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
3900 error = xfs_iread_extents(NULL, ip, whichfork);
3959 int whichfork,
3968 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
3985 if (whichfork == XFS_COW_FORK) {
4030 xfs_bmap_add_extent_hole_delay(ip, whichfork, icur, got);
4037 if (whichfork == XFS_DATA_FORK && prealloc)
4039 if (whichfork == XFS_COW_FORK && (prealloc || aoff < off || alen > len))
4057 int whichfork = xfs_bmapi_whichfork(bma->flags);
4067 if (whichfork == XFS_DATA_FORK || whichfork == XFS_COW_FORK) {
4073 error = xfs_bmap_isaeof(bma, whichfork);
4094 int whichfork = xfs_bmapi_whichfork(bma->flags);
4095 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork);
4141 bma->cur = xfs_bmbt_init_cursor(mp, bma->tp, bma->ip, whichfork);
4161 error = xfs_bmap_add_extent_delay_real(bma, whichfork);
4164 whichfork, &bma->icur, &bma->cur, &bma->got,
4193 int whichfork = xfs_bmapi_whichfork(flags);
4194 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork);
4215 bma->ip, whichfork);
4231 error = xfs_bmap_add_extent_unwritten_real(bma->tp, bma->ip, whichfork,
4244 if (whichfork != XFS_COW_FORK)
4289 int whichfork,
4292 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork);
4294 if ((bma->logflags & xfs_ilog_fext(whichfork)) &&
4296 bma->logflags &= ~xfs_ilog_fext(whichfork);
4297 else if ((bma->logflags & xfs_ilog_fbroot(whichfork)) &&
4299 bma->logflags &= ~xfs_ilog_fbroot(whichfork);
4330 int whichfork = xfs_bmapi_whichfork(flags);
4331 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
4382 error = xfs_iread_extents(tp, ip, whichfork);
4390 bma.minleft = xfs_bmapi_minleft(tp, ip, whichfork);
4448 if (whichfork == XFS_COW_FORK)
4483 whichfork);
4488 ifp->if_nextents > XFS_IFORK_MAXEXT(ip, whichfork));
4489 xfs_bmapi_finish(&bma, whichfork, 0);
4494 xfs_bmapi_finish(&bma, whichfork, error);
4507 int whichfork,
4512 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
4520 if (whichfork == XFS_COW_FORK)
4535 error = xfs_iext_count_may_overflow(ip, whichfork,
4550 WARN_ON_ONCE(whichfork != XFS_COW_FORK);
4572 bma.minleft = xfs_bmapi_minleft(tp, ip, whichfork);
4588 if (whichfork == XFS_COW_FORK)
4613 if (whichfork == XFS_COW_FORK)
4617 whichfork);
4621 xfs_bmapi_finish(&bma, whichfork, 0);
4627 xfs_bmapi_finish(&bma, whichfork, error);
4648 int whichfork = xfs_bmapi_whichfork(flags);
4651 ifp = xfs_ifork_ptr(ip, whichfork);
4668 error = xfs_iread_extents(tp, ip, whichfork);
4682 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
4694 error = xfs_bmap_add_extent_hole_real(tp, ip, whichfork, &icur,
4699 error = xfs_bmap_btree_to_extents(tp, ip, cur, &logflags, whichfork);
4802 int whichfork,
4808 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
4813 uint32_t state = xfs_bmap_fork_to_state(whichfork);
4819 isrt = (whichfork == XFS_DATA_FORK) && XFS_IS_REALTIME_INODE(ip);
5010 int whichfork, /* data or attr fork */
5027 uint32_t state = xfs_bmap_fork_to_state(whichfork);
5033 ifp = xfs_ifork_ptr(ip, whichfork);
5054 ifp->if_nextents >= XFS_IFORK_MAXEXT(ip, whichfork) &&
5059 if (whichfork == XFS_DATA_FORK && XFS_IS_REALTIME_INODE(ip)) {
5102 flags |= xfs_ilog_fext(whichfork);
5121 flags |= xfs_ilog_fext(whichfork);
5135 flags |= xfs_ilog_fext(whichfork);
5207 flags |= xfs_ilog_fext(whichfork);
5216 xfs_rmap_unmap_extent(tp, ip, whichfork, del);
5222 if (xfs_is_reflink_inode(ip) && whichfork == XFS_DATA_FORK) {
5278 int whichfork; /* data or attribute fork */
5287 whichfork = xfs_bmapi_whichfork(flags);
5288 ASSERT(whichfork != XFS_COW_FORK);
5289 ifp = xfs_ifork_ptr(ip, whichfork);
5299 error = xfs_iread_extents(tp, ip, whichfork);
5308 isrt = (whichfork == XFS_DATA_FORK) && XFS_IS_REALTIME_INODE(ip);
5320 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
5416 whichfork, &icur, &cur, &del,
5475 ip, whichfork, &icur, &cur,
5484 ip, whichfork, &icur, &cur,
5494 error = xfs_bmap_del_extent_delay(ip, whichfork, &icur,
5498 &del, &tmp_logflags, whichfork,
5529 if (xfs_bmap_needs_btree(ip, whichfork)) {
5532 &tmp_logflags, whichfork);
5536 whichfork);
5544 if ((logflags & xfs_ilog_fext(whichfork)) &&
5546 logflags &= ~xfs_ilog_fext(whichfork);
5547 else if ((logflags & xfs_ilog_fbroot(whichfork)) &&
5549 logflags &= ~xfs_ilog_fbroot(whichfork);
5622 int whichfork,
5630 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
5681 error = xfs_bmap_btree_to_extents(tp, ip, cur, logflags, whichfork);
5688 xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), icur,
5692 xfs_rmap_unmap_extent(tp, ip, whichfork, got);
5695 xfs_rmap_map_extent(tp, ip, whichfork, &new);
5703 int whichfork,
5732 xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), icur,
5736 xfs_rmap_unmap_extent(tp, ip, whichfork, &prev);
5737 xfs_rmap_map_extent(tp, ip, whichfork, got);
5749 int whichfork = XFS_DATA_FORK;
5751 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
5769 error = xfs_iread_extents(tp, ip, whichfork);
5774 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
5795 error = xfs_bmse_merge(tp, ip, whichfork,
5809 error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got,
5864 int whichfork = XFS_DATA_FORK;
5866 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
5884 error = xfs_iread_extents(tp, ip, whichfork);
5889 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
5933 error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got,
5965 int whichfork = XFS_DATA_FORK;
5966 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);
5986 error = xfs_iread_extents(tp, ip, whichfork);
6004 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
6016 xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), &icur,
6052 if (xfs_bmap_needs_btree(ip, whichfork)) {
6057 &tmp_logflags, whichfork);
6087 int whichfork,
6096 ip->i_ino, whichfork,
6105 bi->bi_whichfork = whichfork;
6190 int whichfork,
6198 if (XFS_IS_REALTIME_INODE(ip) && whichfork == XFS_DATA_FORK) {
6207 if (irec->br_state != XFS_EXT_NORM && whichfork != XFS_DATA_FORK)