summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_inode_util.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-07-02 11:22:33 -0700
committerDarrick J. Wong <djwong@kernel.org>2024-07-02 11:36:56 -0700
commitfcea5b35f36233c04003ab8b3eb081b5e20e1aa4 (patch)
tree7e1201539401ddd579db627525641c687abbb5fa /fs/xfs/libxfs/xfs_inode_util.c
parentb7c477be396948ce88ea591b91070fa68ac12437 (diff)
downloadlinux-fcea5b35f36233c04003ab8b3eb081b5e20e1aa4.tar.gz
linux-fcea5b35f36233c04003ab8b3eb081b5e20e1aa4.tar.bz2
linux-fcea5b35f36233c04003ab8b3eb081b5e20e1aa4.zip
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 <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/libxfs/xfs_inode_util.c')
-rw-r--r--fs/xfs/libxfs/xfs_inode_util.c10
1 files changed, 10 insertions, 0 deletions
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;
+}