xfs: factor prid related codes into xfs_get_initial_prid()
It will be reused by the O_TMPFILE creation function. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: Ben Myers <bpm@sgi.com>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "xfs_inode_buf.h"
|
||||
#include "xfs_inode_fork.h"
|
||||
#include "xfs_dinode.h"
|
||||
|
||||
/*
|
||||
* Kernel only inode definitions
|
||||
@@ -192,6 +193,15 @@ xfs_set_projid(struct xfs_inode *ip,
|
||||
ip->i_d.di_projid_lo = (__uint16_t) (projid & 0xffff);
|
||||
}
|
||||
|
||||
static inline prid_t
|
||||
xfs_get_initial_prid(struct xfs_inode *dp)
|
||||
{
|
||||
if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT)
|
||||
return xfs_get_projid(dp);
|
||||
|
||||
return XFS_PROJID_DEFAULT;
|
||||
}
|
||||
|
||||
/*
|
||||
* In-core inode flags.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user