summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_inode_fork.h
diff options
context:
space:
mode:
authorChandan Babu R <chandan.babu@oracle.com>2020-08-27 15:09:10 +0530
committerChandan Babu R <chandan.babu@oracle.com>2022-04-11 04:11:17 +0000
commit9feb8f19665c8ba051c6a81aa7897149e7748e1e (patch)
tree501f071896209b1c464e49d69a1f42f940b6f16b /fs/xfs/libxfs/xfs_inode_fork.h
parent95f0b95e2b686ceaa3f465e9fa079f22e0fe7665 (diff)
xfs: Introduce xfs_iext_max_nextents() helper
xfs_iext_max_nextents() returns the maximum number of extents possible for one of data, cow or attribute fork. This helper will be extended further in a future commit when maximum extent counts associated with data/attribute forks are increased. Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_inode_fork.h')
-rw-r--r--fs/xfs/libxfs/xfs_inode_fork.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_fork.h b/fs/xfs/libxfs/xfs_inode_fork.h
index 3d64a3acb0ed..2605f7ff8fc1 100644
--- a/fs/xfs/libxfs/xfs_inode_fork.h
+++ b/fs/xfs/libxfs/xfs_inode_fork.h
@@ -133,6 +133,14 @@ static inline int8_t xfs_ifork_format(struct xfs_ifork *ifp)
return ifp->if_format;
}
+static inline xfs_extnum_t xfs_iext_max_nextents(int whichfork)
+{
+ if (whichfork == XFS_DATA_FORK || whichfork == XFS_COW_FORK)
+ return MAXEXTNUM;
+
+ return MAXAEXTNUM;
+}
+
struct xfs_ifork *xfs_ifork_alloc(enum xfs_dinode_fmt format,
xfs_extnum_t nextents);
struct xfs_ifork *xfs_iext_state_to_fork(struct xfs_inode *ip, int state);