aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-10-11 18:09:12 +1000
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-16 14:15:32 +1000
commit3e5daf05a0c7cce36dc2db41933b14b36d2048dc (patch)
tree6116ce7e400b152594e867b9e4d67bdfe67a414c /fs/xfs/xfs_vnodeops.c
parent[XFS] avoid xfs_getattr in XFS_IOC_FSGETXATTR ioctl (diff)
downloadlinux-dev-3e5daf05a0c7cce36dc2db41933b14b36d2048dc.tar.xz
linux-dev-3e5daf05a0c7cce36dc2db41933b14b36d2048dc.zip
[XFS] simplify xfs_create/mknod/symlink prototype
Simplify the prototype for xfs_create/xfs_mkdir/xfs_symlink by not passing down a bhv_vattr_t that just hogs stack space. Instead pass down the mode in a mode_t and in case of xfs_create the rdev as a scalar type as well. SGI-PV: 968563 SGI-Modid: xfs-linux-melb:xfs-kern:29794a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 83cc1cb4089a..5e3c57ca9981 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1824,7 +1824,8 @@ int
xfs_create(
xfs_inode_t *dp,
bhv_vname_t *dentry,
- bhv_vattr_t *vap,
+ mode_t mode,
+ xfs_dev_t rdev,
bhv_vnode_t **vpp,
cred_t *credp)
{
@@ -1834,7 +1835,6 @@ xfs_create(
xfs_inode_t *ip;
bhv_vnode_t *vp = NULL;
xfs_trans_t *tp;
- xfs_dev_t rdev;
int error;
xfs_bmap_free_t free_list;
xfs_fsblock_t first_block;
@@ -1845,20 +1845,18 @@ xfs_create(
xfs_prid_t prid;
struct xfs_dquot *udqp, *gdqp;
uint resblks;
- int dm_di_mode;
int namelen;
ASSERT(!*vpp);
vn_trace_entry(dp, __FUNCTION__, (inst_t *)__return_address);
- dm_di_mode = vap->va_mode;
namelen = VNAMELEN(dentry);
if (DM_EVENT_ENABLED(dp, DM_EVENT_CREATE)) {
error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE,
dir_vp, DM_RIGHT_NULL, NULL,
DM_RIGHT_NULL, name, NULL,
- dm_di_mode, 0, 0);
+ mode, 0, 0);
if (error)
return error;
@@ -1873,8 +1871,6 @@ xfs_create(
udqp = gdqp = NULL;
if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT)
prid = dp->i_d.di_projid;
- else if (vap->va_mask & XFS_AT_PROJID)
- prid = (xfs_prid_t)vap->va_projid;
else
prid = (xfs_prid_t)dfltprid;
@@ -1926,8 +1922,7 @@ xfs_create(
if (resblks == 0 && (error = xfs_dir_canenter(tp, dp, name, namelen)))
goto error_return;
- rdev = (vap->va_mask & XFS_AT_RDEV) ? vap->va_rdev : 0;
- error = xfs_dir_ialloc(&tp, dp, vap->va_mode, 1,
+ error = xfs_dir_ialloc(&tp, dp, mode, 1,
rdev, credp, prid, resblks > 0,
&ip, &committed);
if (error) {
@@ -2018,7 +2013,7 @@ std_return:
dir_vp, DM_RIGHT_NULL,
*vpp ? vp:NULL,
DM_RIGHT_NULL, name, NULL,
- dm_di_mode, error, 0);
+ mode, error, 0);
}
return error;
@@ -2709,7 +2704,7 @@ int
xfs_mkdir(
xfs_inode_t *dp,
bhv_vname_t *dentry,
- bhv_vattr_t *vap,
+ mode_t mode,
bhv_vnode_t **vpp,
cred_t *credp)
{
@@ -2731,19 +2726,17 @@ xfs_mkdir(
xfs_prid_t prid;
struct xfs_dquot *udqp, *gdqp;
uint resblks;
- int dm_di_mode;
if (XFS_FORCED_SHUTDOWN(mp))
return XFS_ERROR(EIO);
tp = NULL;
- dm_di_mode = vap->va_mode;
if (DM_EVENT_ENABLED(dp, DM_EVENT_CREATE)) {
error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE,
dir_vp, DM_RIGHT_NULL, NULL,
DM_RIGHT_NULL, dir_name, NULL,
- dm_di_mode, 0, 0);
+ mode, 0, 0);
if (error)
return error;
dm_event_sent = 1;
@@ -2757,8 +2750,6 @@ xfs_mkdir(
udqp = gdqp = NULL;
if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT)
prid = dp->i_d.di_projid;
- else if (vap->va_mask & XFS_AT_PROJID)
- prid = (xfs_prid_t)vap->va_projid;
else
prid = (xfs_prid_t)dfltprid;
@@ -2811,7 +2802,7 @@ xfs_mkdir(
/*
* create the directory inode.
*/
- error = xfs_dir_ialloc(&tp, dp, vap->va_mode, 2,
+ error = xfs_dir_ialloc(&tp, dp, mode, 2,
0, credp, prid, resblks > 0,
&cdp, NULL);
if (error) {
@@ -2905,7 +2896,7 @@ std_return:
created ? XFS_ITOV(cdp):NULL,
DM_RIGHT_NULL,
dir_name, NULL,
- dm_di_mode, error, 0);
+ mode, error, 0);
}
return error;
@@ -3162,8 +3153,8 @@ int
xfs_symlink(
xfs_inode_t *dp,
bhv_vname_t *dentry,
- bhv_vattr_t *vap,
char *target_path,
+ mode_t mode,
bhv_vnode_t **vpp,
cred_t *credp)
{
@@ -3251,8 +3242,6 @@ xfs_symlink(
udqp = gdqp = NULL;
if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT)
prid = dp->i_d.di_projid;
- else if (vap->va_mask & XFS_AT_PROJID)
- prid = (xfs_prid_t)vap->va_projid;
else
prid = (xfs_prid_t)dfltprid;
@@ -3321,7 +3310,7 @@ xfs_symlink(
/*
* Allocate an inode for the symlink.
*/
- error = xfs_dir_ialloc(&tp, dp, S_IFLNK | (vap->va_mode&~S_IFMT),
+ error = xfs_dir_ialloc(&tp, dp, S_IFLNK | (mode & ~S_IFMT),
1, 0, credp, prid, resblks > 0, &ip, NULL);
if (error) {
if (error == ENOSPC)