diff options
| author | Zhi Yong Wu <[email protected]> | 2013-12-18 00:22:39 +0000 |
|---|---|---|
| committer | Ben Myers <[email protected]> | 2014-01-06 19:46:25 +0000 |
| commit | 163467d3753e77e1d77da75727975cc3803a1dbc (patch) | |
| tree | ae457354c02370c445d2b44628ec579bad1fb424 /fs/xfs/xfs_inode.h | |
| parent | xfs: align initial file allocations correctly (diff) | |
| download | kernel-163467d3753e77e1d77da75727975cc3803a1dbc.tar.gz kernel-163467d3753e77e1d77da75727975cc3803a1dbc.zip | |
xfs: factor prid related codes into xfs_get_initial_prid()
It will be reused by the O_TMPFILE creation function.
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Zhi Yong Wu <[email protected]>
Signed-off-by: Ben Myers <[email protected]>
Diffstat (limited to 'fs/xfs/xfs_inode.h')
| -rw-r--r-- | fs/xfs/xfs_inode.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 9e6efccbae04..6c58349494e7 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -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. */ |
