diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-09 10:05:18 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-03 15:21:11 -0500 |
commit | c139f3cef36291902d7a29a334acd25a1251cd9d (patch) | |
tree | df4fdeac1020100d37e439444d67f760c488040c | |
parent | 48eddfd5ca591d2bd97594afd58cffa6b5a48ef4 (diff) |
ll_setxattr(): get rid of struct file on stack
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | drivers/staging/lustre/lustre/llite/file.c | 15 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/llite/llite_internal.h | 2 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/llite/xattr.c | 5 |
3 files changed, 11 insertions, 11 deletions
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 382b53a8ce62..3f00a40cf387 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c | |||
@@ -1351,7 +1351,7 @@ static int ll_lov_recreate_fid(struct inode *inode, unsigned long arg) | |||
1351 | return ll_lov_recreate(inode, &oi, ost_idx); | 1351 | return ll_lov_recreate(inode, &oi, ost_idx); |
1352 | } | 1352 | } |
1353 | 1353 | ||
1354 | int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file, | 1354 | int ll_lov_setstripe_ea_info(struct inode *inode, struct dentry *dentry, |
1355 | int flags, struct lov_user_md *lum, int lum_size) | 1355 | int flags, struct lov_user_md *lum, int lum_size) |
1356 | { | 1356 | { |
1357 | struct lov_stripe_md *lsm = NULL; | 1357 | struct lov_stripe_md *lsm = NULL; |
@@ -1368,21 +1368,20 @@ int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file, | |||
1368 | } | 1368 | } |
1369 | 1369 | ||
1370 | ll_inode_size_lock(inode); | 1370 | ll_inode_size_lock(inode); |
1371 | rc = ll_intent_file_open(file->f_path.dentry, lum, lum_size, &oit); | 1371 | rc = ll_intent_file_open(dentry, lum, lum_size, &oit); |
1372 | if (rc) | 1372 | if (rc) |
1373 | goto out_unlock; | 1373 | goto out_unlock; |
1374 | rc = oit.d.lustre.it_status; | 1374 | rc = oit.d.lustre.it_status; |
1375 | if (rc < 0) | 1375 | if (rc < 0) |
1376 | goto out_req_free; | 1376 | goto out_req_free; |
1377 | 1377 | ||
1378 | ll_release_openhandle(file->f_dentry, &oit); | 1378 | ll_release_openhandle(dentry, &oit); |
1379 | 1379 | ||
1380 | out_unlock: | 1380 | out_unlock: |
1381 | ll_inode_size_unlock(inode); | 1381 | ll_inode_size_unlock(inode); |
1382 | ll_intent_release(&oit); | 1382 | ll_intent_release(&oit); |
1383 | ccc_inode_lsm_put(inode, lsm); | 1383 | ccc_inode_lsm_put(inode, lsm); |
1384 | out: | 1384 | out: |
1385 | cl_lov_delay_create_clear(&file->f_flags); | ||
1386 | return rc; | 1385 | return rc; |
1387 | out_req_free: | 1386 | out_req_free: |
1388 | ptlrpc_req_finished((struct ptlrpc_request *) oit.d.lustre.it_data); | 1387 | 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, | |||
1496 | return -EFAULT; | 1495 | return -EFAULT; |
1497 | } | 1496 | } |
1498 | 1497 | ||
1499 | rc = ll_lov_setstripe_ea_info(inode, file, flags, lump, lum_size); | 1498 | rc = ll_lov_setstripe_ea_info(inode, file->f_path.dentry, flags, lump, |
1499 | lum_size); | ||
1500 | cl_lov_delay_create_clear(&file->f_flags); | ||
1500 | 1501 | ||
1501 | OBD_FREE_LARGE(lump, lum_size); | 1502 | OBD_FREE_LARGE(lump, lum_size); |
1502 | return rc; | 1503 | return rc; |
@@ -1523,7 +1524,9 @@ static int ll_lov_setstripe(struct inode *inode, struct file *file, | |||
1523 | return -EFAULT; | 1524 | return -EFAULT; |
1524 | } | 1525 | } |
1525 | 1526 | ||
1526 | rc = ll_lov_setstripe_ea_info(inode, file, flags, lumv1, lum_size); | 1527 | rc = ll_lov_setstripe_ea_info(inode, file->f_path.dentry, flags, lumv1, |
1528 | lum_size); | ||
1529 | cl_lov_delay_create_clear(&file->f_flags); | ||
1527 | if (rc == 0) { | 1530 | if (rc == 0) { |
1528 | struct lov_stripe_md *lsm; | 1531 | struct lov_stripe_md *lsm; |
1529 | __u32 gen; | 1532 | __u32 gen; |
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index 36aa0fd147f2..4b80a6f0c2f7 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h | |||
@@ -763,7 +763,7 @@ struct posix_acl *ll_get_acl(struct inode *inode, int type); | |||
763 | 763 | ||
764 | int ll_inode_permission(struct inode *inode, int mask); | 764 | int ll_inode_permission(struct inode *inode, int mask); |
765 | 765 | ||
766 | int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file, | 766 | int ll_lov_setstripe_ea_info(struct inode *inode, struct dentry *dentry, |
767 | int flags, struct lov_user_md *lum, | 767 | int flags, struct lov_user_md *lum, |
768 | int lum_size); | 768 | int lum_size); |
769 | int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename, | 769 | int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename, |
diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index 252a6194ed9b..5ad5e7b310c4 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c | |||
@@ -241,14 +241,11 @@ int ll_setxattr(struct dentry *dentry, const char *name, | |||
241 | lump->lmm_stripe_offset = -1; | 241 | lump->lmm_stripe_offset = -1; |
242 | 242 | ||
243 | if (lump != NULL && S_ISREG(inode->i_mode)) { | 243 | if (lump != NULL && S_ISREG(inode->i_mode)) { |
244 | struct file f; | ||
245 | int flags = FMODE_WRITE; | 244 | int flags = FMODE_WRITE; |
246 | int lum_size = (lump->lmm_magic == LOV_USER_MAGIC_V1) ? | 245 | int lum_size = (lump->lmm_magic == LOV_USER_MAGIC_V1) ? |
247 | sizeof(*lump) : sizeof(struct lov_user_md_v3); | 246 | sizeof(*lump) : sizeof(struct lov_user_md_v3); |
248 | 247 | ||
249 | memset(&f, 0, sizeof(f)); /* f.f_flags is used below */ | 248 | rc = ll_lov_setstripe_ea_info(inode, dentry, flags, lump, |
250 | f.f_dentry = dentry; | ||
251 | rc = ll_lov_setstripe_ea_info(inode, &f, flags, lump, | ||
252 | lum_size); | 249 | lum_size); |
253 | /* b10667: rc always be 0 here for now */ | 250 | /* b10667: rc always be 0 here for now */ |
254 | rc = 0; | 251 | rc = 0; |