ll_setxattr(): get rid of struct file on stack
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
48eddfd5ca
commit
c139f3cef3
@ -1351,7 +1351,7 @@ static int ll_lov_recreate_fid(struct inode *inode, unsigned long arg)
|
||||
return ll_lov_recreate(inode, &oi, ost_idx);
|
||||
}
|
||||
|
||||
int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file,
|
||||
int ll_lov_setstripe_ea_info(struct inode *inode, struct dentry *dentry,
|
||||
int flags, struct lov_user_md *lum, int lum_size)
|
||||
{
|
||||
struct lov_stripe_md *lsm = NULL;
|
||||
@ -1368,21 +1368,20 @@ int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file,
|
||||
}
|
||||
|
||||
ll_inode_size_lock(inode);
|
||||
rc = ll_intent_file_open(file->f_path.dentry, lum, lum_size, &oit);
|
||||
rc = ll_intent_file_open(dentry, lum, lum_size, &oit);
|
||||
if (rc)
|
||||
goto out_unlock;
|
||||
rc = oit.d.lustre.it_status;
|
||||
if (rc < 0)
|
||||
goto out_req_free;
|
||||
|
||||
ll_release_openhandle(file->f_dentry, &oit);
|
||||
ll_release_openhandle(dentry, &oit);
|
||||
|
||||
out_unlock:
|
||||
ll_inode_size_unlock(inode);
|
||||
ll_intent_release(&oit);
|
||||
ccc_inode_lsm_put(inode, lsm);
|
||||
out:
|
||||
cl_lov_delay_create_clear(&file->f_flags);
|
||||
return rc;
|
||||
out_req_free:
|
||||
ptlrpc_req_finished((struct ptlrpc_request *) oit.d.lustre.it_data);
|
||||
@ -1496,7 +1495,9 @@ static int ll_lov_setea(struct inode *inode, struct file *file,
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
rc = ll_lov_setstripe_ea_info(inode, file, flags, lump, lum_size);
|
||||
rc = ll_lov_setstripe_ea_info(inode, file->f_path.dentry, flags, lump,
|
||||
lum_size);
|
||||
cl_lov_delay_create_clear(&file->f_flags);
|
||||
|
||||
OBD_FREE_LARGE(lump, lum_size);
|
||||
return rc;
|
||||
@ -1523,7 +1524,9 @@ static int ll_lov_setstripe(struct inode *inode, struct file *file,
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
rc = ll_lov_setstripe_ea_info(inode, file, flags, lumv1, lum_size);
|
||||
rc = ll_lov_setstripe_ea_info(inode, file->f_path.dentry, flags, lumv1,
|
||||
lum_size);
|
||||
cl_lov_delay_create_clear(&file->f_flags);
|
||||
if (rc == 0) {
|
||||
struct lov_stripe_md *lsm;
|
||||
__u32 gen;
|
||||
|
@ -763,7 +763,7 @@ struct posix_acl *ll_get_acl(struct inode *inode, int type);
|
||||
|
||||
int ll_inode_permission(struct inode *inode, int mask);
|
||||
|
||||
int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file,
|
||||
int ll_lov_setstripe_ea_info(struct inode *inode, struct dentry *dentry,
|
||||
int flags, struct lov_user_md *lum,
|
||||
int lum_size);
|
||||
int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename,
|
||||
|
@ -241,14 +241,11 @@ int ll_setxattr(struct dentry *dentry, const char *name,
|
||||
lump->lmm_stripe_offset = -1;
|
||||
|
||||
if (lump != NULL && S_ISREG(inode->i_mode)) {
|
||||
struct file f;
|
||||
int flags = FMODE_WRITE;
|
||||
int lum_size = (lump->lmm_magic == LOV_USER_MAGIC_V1) ?
|
||||
sizeof(*lump) : sizeof(struct lov_user_md_v3);
|
||||
|
||||
memset(&f, 0, sizeof(f)); /* f.f_flags is used below */
|
||||
f.f_dentry = dentry;
|
||||
rc = ll_lov_setstripe_ea_info(inode, &f, flags, lump,
|
||||
rc = ll_lov_setstripe_ea_info(inode, dentry, flags, lump,
|
||||
lum_size);
|
||||
/* b10667: rc always be 0 here for now */
|
||||
rc = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user