[XFS] cleanup vnode use in xfs_iops.c
SGI-PV: 976035 SGI-Modid: xfs-linux-melb:xfs-kern:30552a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>wifi-calibration
parent
dcf49cc5cf
commit
af048193fc
|
@ -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
|
||||||
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(
|
||||||
*/
|
*/
|
||||||
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(
|
||||||
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(
|
||||||
* 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
|
||||||
|
|
Loading…
Reference in New Issue