提交 163467d3 编写于 作者: Z Zhi Yong Wu 提交者: Ben Myers

xfs: factor prid related codes into xfs_get_initial_prid()

It will be reused by the O_TMPFILE creation function.
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NZhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Signed-off-by: NBen Myers <bpm@sgi.com>
上级 f9b395a8
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#include "xfs_bmap_util.h" #include "xfs_bmap_util.h"
#include "xfs_error.h" #include "xfs_error.h"
#include "xfs_quota.h" #include "xfs_quota.h"
#include "xfs_dinode.h"
#include "xfs_filestream.h" #include "xfs_filestream.h"
#include "xfs_cksum.h" #include "xfs_cksum.h"
#include "xfs_trace.h" #include "xfs_trace.h"
...@@ -1169,10 +1168,7 @@ xfs_create( ...@@ -1169,10 +1168,7 @@ xfs_create(
if (XFS_FORCED_SHUTDOWN(mp)) if (XFS_FORCED_SHUTDOWN(mp))
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) prid = xfs_get_initial_prid(dp);
prid = xfs_get_projid(dp);
else
prid = XFS_PROJID_DEFAULT;
/* /*
* Make sure that we have allocated dquot(s) on disk. * Make sure that we have allocated dquot(s) on disk.
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "xfs_inode_buf.h" #include "xfs_inode_buf.h"
#include "xfs_inode_fork.h" #include "xfs_inode_fork.h"
#include "xfs_dinode.h"
/* /*
* Kernel only inode definitions * Kernel only inode definitions
...@@ -192,6 +193,15 @@ xfs_set_projid(struct xfs_inode *ip, ...@@ -192,6 +193,15 @@ xfs_set_projid(struct xfs_inode *ip,
ip->i_d.di_projid_lo = (__uint16_t) (projid & 0xffff); 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. * In-core inode flags.
*/ */
......
...@@ -208,10 +208,7 @@ xfs_symlink( ...@@ -208,10 +208,7 @@ xfs_symlink(
return XFS_ERROR(ENAMETOOLONG); return XFS_ERROR(ENAMETOOLONG);
udqp = gdqp = NULL; udqp = gdqp = NULL;
if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) prid = xfs_get_initial_prid(dp);
prid = xfs_get_projid(dp);
else
prid = XFS_PROJID_DEFAULT;
/* /*
* Make sure that we have allocated dquot(s) on disk. * Make sure that we have allocated dquot(s) on disk.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册