diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-01-18 23:31:19 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-02-17 22:14:37 -0500 |
commit | dbca51ddb053567a5248cff0d863301417555b2f (patch) | |
tree | 64d3d97d48b9223326c189d9eb4fc1367a2307a0 | |
parent | f5af19d10d151c5a2afae3306578f485c244db25 (diff) |
switch ll_lookup_finish_locks() and ll_revalidate_it_finish() to inode
Note that ll_prep_inode() in the latter does *not* modify ->d_inode;
it expects non-negative dentry, and in such cases ll_prep_inode() doesn't
modify *inode - it only uses the value.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | drivers/staging/lustre/lustre/llite/dcache.c | 12 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/llite/file.c | 8 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/llite/llite_internal.h | 4 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/llite/namei.c | 12 |
4 files changed, 18 insertions, 18 deletions
diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c index 88614b71cf6d..ddf1fa9f67f8 100644 --- a/drivers/staging/lustre/lustre/llite/dcache.c +++ b/drivers/staging/lustre/lustre/llite/dcache.c | |||
@@ -270,7 +270,7 @@ void ll_invalidate_aliases(struct inode *inode) | |||
270 | 270 | ||
271 | int ll_revalidate_it_finish(struct ptlrpc_request *request, | 271 | int ll_revalidate_it_finish(struct ptlrpc_request *request, |
272 | struct lookup_intent *it, | 272 | struct lookup_intent *it, |
273 | struct dentry *de) | 273 | struct inode *inode) |
274 | { | 274 | { |
275 | int rc = 0; | 275 | int rc = 0; |
276 | 276 | ||
@@ -280,19 +280,17 @@ int ll_revalidate_it_finish(struct ptlrpc_request *request, | |||
280 | if (it_disposition(it, DISP_LOOKUP_NEG)) | 280 | if (it_disposition(it, DISP_LOOKUP_NEG)) |
281 | return -ENOENT; | 281 | return -ENOENT; |
282 | 282 | ||
283 | rc = ll_prep_inode(&de->d_inode, request, NULL, it); | 283 | rc = ll_prep_inode(&inode, request, NULL, it); |
284 | 284 | ||
285 | return rc; | 285 | return rc; |
286 | } | 286 | } |
287 | 287 | ||
288 | void ll_lookup_finish_locks(struct lookup_intent *it, struct dentry *dentry) | 288 | void ll_lookup_finish_locks(struct lookup_intent *it, struct inode *inode) |
289 | { | 289 | { |
290 | LASSERT(it != NULL); | 290 | LASSERT(it != NULL); |
291 | LASSERT(dentry != NULL); | ||
292 | 291 | ||
293 | if (it->d.lustre.it_lock_mode && dentry->d_inode != NULL) { | 292 | if (it->d.lustre.it_lock_mode && inode != NULL) { |
294 | struct inode *inode = dentry->d_inode; | 293 | struct ll_sb_info *sbi = ll_i2sbi(inode); |
295 | struct ll_sb_info *sbi = ll_i2sbi(dentry->d_inode); | ||
296 | 294 | ||
297 | CDEBUG(D_DLMTRACE, "setting l_data to inode %p (%lu/%u)\n", | 295 | CDEBUG(D_DLMTRACE, "setting l_data to inode %p (%lu/%u)\n", |
298 | inode, inode->i_ino, inode->i_generation); | 296 | inode, inode->i_ino, inode->i_generation); |
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 7c7ef7ec908e..5ebee6ca0a10 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c | |||
@@ -2912,8 +2912,8 @@ static int __ll_inode_revalidate(struct dentry *dentry, __u64 ibits) | |||
2912 | oit.it_op = IT_LOOKUP; | 2912 | oit.it_op = IT_LOOKUP; |
2913 | 2913 | ||
2914 | /* Call getattr by fid, so do not provide name at all. */ | 2914 | /* Call getattr by fid, so do not provide name at all. */ |
2915 | op_data = ll_prep_md_op_data(NULL, dentry->d_inode, | 2915 | op_data = ll_prep_md_op_data(NULL, inode, |
2916 | dentry->d_inode, NULL, 0, 0, | 2916 | inode, NULL, 0, 0, |
2917 | LUSTRE_OPC_ANY, NULL); | 2917 | LUSTRE_OPC_ANY, NULL); |
2918 | if (IS_ERR(op_data)) | 2918 | if (IS_ERR(op_data)) |
2919 | return PTR_ERR(op_data); | 2919 | return PTR_ERR(op_data); |
@@ -2931,7 +2931,7 @@ static int __ll_inode_revalidate(struct dentry *dentry, __u64 ibits) | |||
2931 | goto out; | 2931 | goto out; |
2932 | } | 2932 | } |
2933 | 2933 | ||
2934 | rc = ll_revalidate_it_finish(req, &oit, dentry); | 2934 | rc = ll_revalidate_it_finish(req, &oit, inode); |
2935 | if (rc != 0) { | 2935 | if (rc != 0) { |
2936 | ll_intent_release(&oit); | 2936 | ll_intent_release(&oit); |
2937 | goto out; | 2937 | goto out; |
@@ -2944,7 +2944,7 @@ static int __ll_inode_revalidate(struct dentry *dentry, __u64 ibits) | |||
2944 | if (!dentry->d_inode->i_nlink) | 2944 | if (!dentry->d_inode->i_nlink) |
2945 | d_lustre_invalidate(dentry, 0); | 2945 | d_lustre_invalidate(dentry, 0); |
2946 | 2946 | ||
2947 | ll_lookup_finish_locks(&oit, dentry); | 2947 | ll_lookup_finish_locks(&oit, inode); |
2948 | } else if (!ll_have_md_lock(dentry->d_inode, &ibits, LCK_MINMODE)) { | 2948 | } else if (!ll_have_md_lock(dentry->d_inode, &ibits, LCK_MINMODE)) { |
2949 | struct ll_sb_info *sbi = ll_i2sbi(dentry->d_inode); | 2949 | struct ll_sb_info *sbi = ll_i2sbi(dentry->d_inode); |
2950 | u64 valid = OBD_MD_FLGETATTR; | 2950 | u64 valid = OBD_MD_FLGETATTR; |
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index d032c2b086cc..2af1d7286250 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h | |||
@@ -786,9 +786,9 @@ extern const struct dentry_operations ll_d_ops; | |||
786 | void ll_intent_drop_lock(struct lookup_intent *); | 786 | void ll_intent_drop_lock(struct lookup_intent *); |
787 | void ll_intent_release(struct lookup_intent *); | 787 | void ll_intent_release(struct lookup_intent *); |
788 | void ll_invalidate_aliases(struct inode *); | 788 | void ll_invalidate_aliases(struct inode *); |
789 | void ll_lookup_finish_locks(struct lookup_intent *it, struct dentry *dentry); | 789 | void ll_lookup_finish_locks(struct lookup_intent *it, struct inode *inode); |
790 | int ll_revalidate_it_finish(struct ptlrpc_request *request, | 790 | int ll_revalidate_it_finish(struct ptlrpc_request *request, |
791 | struct lookup_intent *it, struct dentry *de); | 791 | struct lookup_intent *it, struct inode *inode); |
792 | 792 | ||
793 | /* llite/llite_lib.c */ | 793 | /* llite/llite_lib.c */ |
794 | extern struct super_operations lustre_super_operations; | 794 | extern struct super_operations lustre_super_operations; |
diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 4f361b77c749..890ac190f5fa 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c | |||
@@ -481,6 +481,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry, | |||
481 | struct lookup_intent lookup_it = { .it_op = IT_LOOKUP }; | 481 | struct lookup_intent lookup_it = { .it_op = IT_LOOKUP }; |
482 | struct dentry *save = dentry, *retval; | 482 | struct dentry *save = dentry, *retval; |
483 | struct ptlrpc_request *req = NULL; | 483 | struct ptlrpc_request *req = NULL; |
484 | struct inode *inode; | ||
484 | struct md_op_data *op_data; | 485 | struct md_op_data *op_data; |
485 | __u32 opc; | 486 | __u32 opc; |
486 | int rc; | 487 | int rc; |
@@ -539,12 +540,13 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry, | |||
539 | goto out; | 540 | goto out; |
540 | } | 541 | } |
541 | 542 | ||
542 | if ((it->it_op & IT_OPEN) && dentry->d_inode && | 543 | inode = dentry->d_inode; |
543 | !S_ISREG(dentry->d_inode->i_mode) && | 544 | if ((it->it_op & IT_OPEN) && inode && |
544 | !S_ISDIR(dentry->d_inode->i_mode)) { | 545 | !S_ISREG(inode->i_mode) && |
545 | ll_release_openhandle(dentry->d_inode, it); | 546 | !S_ISDIR(inode->i_mode)) { |
547 | ll_release_openhandle(inode, it); | ||
546 | } | 548 | } |
547 | ll_lookup_finish_locks(it, dentry); | 549 | ll_lookup_finish_locks(it, inode); |
548 | 550 | ||
549 | if (dentry == save) | 551 | if (dentry == save) |
550 | retval = NULL; | 552 | retval = NULL; |