diff options
author | Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> | 2013-12-17 19:22:39 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2014-01-06 14:46:25 -0500 |
commit | 163467d3753e77e1d77da75727975cc3803a1dbc (patch) | |
tree | ae457354c02370c445d2b44628ec579bad1fb424 /fs | |
parent | f9b395a8ef8f34d19cae2cde361e19c96e097fad (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_inode.c | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.h | 10 | ||||
-rw-r--r-- | fs/xfs/xfs_symlink.c | 5 |
3 files changed, 12 insertions, 9 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 001aa893ed59..c79b875f0354 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include "xfs_bmap_util.h" | 42 | #include "xfs_bmap_util.h" |
43 | #include "xfs_error.h" | 43 | #include "xfs_error.h" |
44 | #include "xfs_quota.h" | 44 | #include "xfs_quota.h" |
45 | #include "xfs_dinode.h" | ||
46 | #include "xfs_filestream.h" | 45 | #include "xfs_filestream.h" |
47 | #include "xfs_cksum.h" | 46 | #include "xfs_cksum.h" |
48 | #include "xfs_trace.h" | 47 | #include "xfs_trace.h" |
@@ -1169,10 +1168,7 @@ xfs_create( | |||
1169 | if (XFS_FORCED_SHUTDOWN(mp)) | 1168 | if (XFS_FORCED_SHUTDOWN(mp)) |
1170 | return XFS_ERROR(EIO); | 1169 | return XFS_ERROR(EIO); |
1171 | 1170 | ||
1172 | if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) | 1171 | prid = xfs_get_initial_prid(dp); |
1173 | prid = xfs_get_projid(dp); | ||
1174 | else | ||
1175 | prid = XFS_PROJID_DEFAULT; | ||
1176 | 1172 | ||
1177 | /* | 1173 | /* |
1178 | * Make sure that we have allocated dquot(s) on disk. | 1174 | * Make sure that we have allocated dquot(s) on disk. |
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 @@ | |||
20 | 20 | ||
21 | #include "xfs_inode_buf.h" | 21 | #include "xfs_inode_buf.h" |
22 | #include "xfs_inode_fork.h" | 22 | #include "xfs_inode_fork.h" |
23 | #include "xfs_dinode.h" | ||
23 | 24 | ||
24 | /* | 25 | /* |
25 | * Kernel only inode definitions | 26 | * Kernel only inode definitions |
@@ -192,6 +193,15 @@ xfs_set_projid(struct xfs_inode *ip, | |||
192 | ip->i_d.di_projid_lo = (__uint16_t) (projid & 0xffff); | 193 | ip->i_d.di_projid_lo = (__uint16_t) (projid & 0xffff); |
193 | } | 194 | } |
194 | 195 | ||
196 | static inline prid_t | ||
197 | xfs_get_initial_prid(struct xfs_inode *dp) | ||
198 | { | ||
199 | if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) | ||
200 | return xfs_get_projid(dp); | ||
201 | |||
202 | return XFS_PROJID_DEFAULT; | ||
203 | } | ||
204 | |||
195 | /* | 205 | /* |
196 | * In-core inode flags. | 206 | * In-core inode flags. |
197 | */ | 207 | */ |
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c index 14e58f2c96bd..13140c7244f5 100644 --- a/fs/xfs/xfs_symlink.c +++ b/fs/xfs/xfs_symlink.c | |||
@@ -208,10 +208,7 @@ xfs_symlink( | |||
208 | return XFS_ERROR(ENAMETOOLONG); | 208 | return XFS_ERROR(ENAMETOOLONG); |
209 | 209 | ||
210 | udqp = gdqp = NULL; | 210 | udqp = gdqp = NULL; |
211 | if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) | 211 | prid = xfs_get_initial_prid(dp); |
212 | prid = xfs_get_projid(dp); | ||
213 | else | ||
214 | prid = XFS_PROJID_DEFAULT; | ||
215 | 212 | ||
216 | /* | 213 | /* |
217 | * Make sure that we have allocated dquot(s) on disk. | 214 | * Make sure that we have allocated dquot(s) on disk. |