Commit af048193 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Lachlan McIlroy

[XFS] cleanup vnode use in xfs_iops.c

SGI-PV: 976035
SGI-Modid: xfs-linux-melb:xfs-kern:30552a
Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
parent dcf49cc5
...@@ -62,12 +62,11 @@ void ...@@ -62,12 +62,11 @@ void
xfs_synchronize_atime( xfs_synchronize_atime(
xfs_inode_t *ip) xfs_inode_t *ip)
{ {
bhv_vnode_t *vp; struct inode *inode = ip->i_vnode;
vp = XFS_ITOV_NULL(ip); if (inode) {
if (vp) { ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec;
ip->i_d.di_atime.t_sec = (__int32_t)vp->i_atime.tv_sec; ip->i_d.di_atime.t_nsec = (__int32_t)inode->i_atime.tv_nsec;
ip->i_d.di_atime.t_nsec = (__int32_t)vp->i_atime.tv_nsec;
} }
} }
...@@ -80,11 +79,10 @@ void ...@@ -80,11 +79,10 @@ void
xfs_mark_inode_dirty_sync( xfs_mark_inode_dirty_sync(
xfs_inode_t *ip) xfs_inode_t *ip)
{ {
bhv_vnode_t *vp; struct inode *inode = ip->i_vnode;
vp = XFS_ITOV_NULL(ip); if (inode)
if (vp) mark_inode_dirty_sync(inode);
mark_inode_dirty_sync(vn_to_inode(vp));
} }
/* /*
...@@ -215,26 +213,26 @@ xfs_validate_fields( ...@@ -215,26 +213,26 @@ xfs_validate_fields(
*/ */
STATIC int STATIC int
xfs_init_security( xfs_init_security(
bhv_vnode_t *vp, struct inode *inode,
struct inode *dir) struct inode *dir)
{ {
struct inode *ip = vn_to_inode(vp); struct xfs_inode *ip = XFS_I(inode);
size_t length; size_t length;
void *value; void *value;
char *name; char *name;
int error; int error;
error = security_inode_init_security(ip, dir, &name, &value, &length); error = security_inode_init_security(inode, dir, &name,
&value, &length);
if (error) { if (error) {
if (error == -EOPNOTSUPP) if (error == -EOPNOTSUPP)
return 0; return 0;
return -error; return -error;
} }
error = xfs_attr_set(XFS_I(ip), name, value, error = xfs_attr_set(ip, name, value, length, ATTR_SECURE);
length, ATTR_SECURE);
if (!error) if (!error)
xfs_iflags_set(XFS_I(ip), XFS_IMODIFIED); xfs_iflags_set(ip, XFS_IMODIFIED);
kfree(name); kfree(name);
kfree(value); kfree(value);
...@@ -244,7 +242,7 @@ xfs_init_security( ...@@ -244,7 +242,7 @@ xfs_init_security(
STATIC void STATIC void
xfs_cleanup_inode( xfs_cleanup_inode(
struct inode *dir, struct inode *dir,
bhv_vnode_t *vp, struct inode *inode,
struct dentry *dentry, struct dentry *dentry,
int mode) int mode)
{ {
...@@ -255,14 +253,14 @@ xfs_cleanup_inode( ...@@ -255,14 +253,14 @@ xfs_cleanup_inode(
* xfs_init_security we must back out. * xfs_init_security we must back out.
* ENOSPC can hit here, among other things. * ENOSPC can hit here, among other things.
*/ */
teardown.d_inode = vn_to_inode(vp); teardown.d_inode = inode;
teardown.d_name = dentry->d_name; teardown.d_name = dentry->d_name;
if (S_ISDIR(mode)) if (S_ISDIR(mode))
xfs_rmdir(XFS_I(dir), &teardown); xfs_rmdir(XFS_I(dir), &teardown);
else else
xfs_remove(XFS_I(dir), &teardown); xfs_remove(XFS_I(dir), &teardown);
VN_RELE(vp); iput(inode);
} }
STATIC int STATIC int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment