From fcea5b35f36233c04003ab8b3eb081b5e20e1aa4 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 2 Jul 2024 11:22:33 -0700 Subject: xfs: hoist project id get/set functions to libxfs Move the project id get and set functions into libxfs. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/libxfs/xfs_inode_util.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'fs/xfs/libxfs/xfs_inode_util.c') diff --git a/fs/xfs/libxfs/xfs_inode_util.c b/fs/xfs/libxfs/xfs_inode_util.c index ed5e1a9b4b8c..3b5397a3f34f 100644 --- a/fs/xfs/libxfs/xfs_inode_util.c +++ b/fs/xfs/libxfs/xfs_inode_util.c @@ -122,3 +122,13 @@ xfs_ip2xflags( flags |= FS_XFLAG_HASATTR; return flags; } + +prid_t +xfs_get_initial_prid(struct xfs_inode *dp) +{ + if (dp->i_diflags & XFS_DIFLAG_PROJINHERIT) + return dp->i_projid; + + /* Assign to the root project by default. */ + return 0; +} -- cgit v1.2.3-70-g09d2