Commit 60751d49 authored by NeilBrown's avatar NeilBrown Committed by Greg Kroah-Hartman

staging: lustre: ldlm: remove 'flags' arg from ldlm_flock_destroy()

The only value ever passed in LDLM_FL_WAIT_NOREPROC, so assume that
instead of passing it.
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f95e8c71
...@@ -88,24 +88,23 @@ ldlm_flocks_overlap(struct ldlm_lock *lock, struct ldlm_lock *new) ...@@ -88,24 +88,23 @@ ldlm_flocks_overlap(struct ldlm_lock *lock, struct ldlm_lock *new)
} }
static inline void static inline void
ldlm_flock_destroy(struct ldlm_lock *lock, enum ldlm_mode mode, __u64 flags) ldlm_flock_destroy(struct ldlm_lock *lock, enum ldlm_mode mode)
{ {
LDLM_DEBUG(lock, "%s(mode: %d, flags: 0x%llx)", LDLM_DEBUG(lock, "%s(mode: %d)",
__func__, mode, flags); __func__, mode);
/* Safe to not lock here, since it should be empty anyway */ /* Safe to not lock here, since it should be empty anyway */
LASSERT(hlist_unhashed(&lock->l_exp_flock_hash)); LASSERT(hlist_unhashed(&lock->l_exp_flock_hash));
list_del_init(&lock->l_res_link); list_del_init(&lock->l_res_link);
if (flags == LDLM_FL_WAIT_NOREPROC) {
/* client side - set a flag to prevent sending a CANCEL */
lock->l_flags |= LDLM_FL_LOCAL_ONLY | LDLM_FL_CBPENDING;
/* when reaching here, it is under lock_res_and_lock(). Thus, /* client side - set a flag to prevent sending a CANCEL */
* need call the nolock version of ldlm_lock_decref_internal lock->l_flags |= LDLM_FL_LOCAL_ONLY | LDLM_FL_CBPENDING;
*/
ldlm_lock_decref_internal_nolock(lock, mode); /* when reaching here, it is under lock_res_and_lock(). Thus,
} * need call the nolock version of ldlm_lock_decref_internal
*/
ldlm_lock_decref_internal_nolock(lock, mode);
ldlm_lock_destroy_nolock(lock); ldlm_lock_destroy_nolock(lock);
} }
...@@ -208,8 +207,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req) ...@@ -208,8 +207,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req)
} }
if (added) { if (added) {
ldlm_flock_destroy(lock, mode, ldlm_flock_destroy(lock, mode);
LDLM_FL_WAIT_NOREPROC);
} else { } else {
new = lock; new = lock;
added = 1; added = 1;
...@@ -233,8 +231,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req) ...@@ -233,8 +231,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req)
new->l_policy_data.l_flock.end + 1; new->l_policy_data.l_flock.end + 1;
break; break;
} }
ldlm_flock_destroy(lock, lock->l_req_mode, ldlm_flock_destroy(lock, lock->l_req_mode);
LDLM_FL_WAIT_NOREPROC);
continue; continue;
} }
if (new->l_policy_data.l_flock.end >= if (new->l_policy_data.l_flock.end >=
...@@ -265,8 +262,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req) ...@@ -265,8 +262,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req)
NULL, 0, LVB_T_NONE); NULL, 0, LVB_T_NONE);
lock_res_and_lock(req); lock_res_and_lock(req);
if (IS_ERR(new2)) { if (IS_ERR(new2)) {
ldlm_flock_destroy(req, lock->l_granted_mode, ldlm_flock_destroy(req, lock->l_granted_mode);
LDLM_FL_WAIT_NOREPROC);
return LDLM_ITER_STOP; return LDLM_ITER_STOP;
} }
goto reprocess; goto reprocess;
...@@ -323,7 +319,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req) ...@@ -323,7 +319,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req)
* could be freed before the completion AST can be sent. * could be freed before the completion AST can be sent.
*/ */
if (added) if (added)
ldlm_flock_destroy(req, mode, LDLM_FL_WAIT_NOREPROC); ldlm_flock_destroy(req, mode);
ldlm_resource_dump(D_INFO, res); ldlm_resource_dump(D_INFO, res);
return LDLM_ITER_CONTINUE; return LDLM_ITER_CONTINUE;
...@@ -479,7 +475,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data) ...@@ -479,7 +475,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
"client-side enqueue deadlock received"); "client-side enqueue deadlock received");
rc = -EDEADLK; rc = -EDEADLK;
} }
ldlm_flock_destroy(lock, mode, LDLM_FL_WAIT_NOREPROC); ldlm_flock_destroy(lock, mode);
unlock_res_and_lock(lock); unlock_res_and_lock(lock);
/* Need to wake up the waiter if we were evicted */ /* Need to wake up the waiter if we were evicted */
...@@ -500,7 +496,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data) ...@@ -500,7 +496,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
* in the lock changes we can decref the appropriate refcount. * in the lock changes we can decref the appropriate refcount.
*/ */
LASSERT(ldlm_is_test_lock(lock)); LASSERT(ldlm_is_test_lock(lock));
ldlm_flock_destroy(lock, getlk->fl_type, LDLM_FL_WAIT_NOREPROC); ldlm_flock_destroy(lock, getlk->fl_type);
switch (lock->l_granted_mode) { switch (lock->l_granted_mode) {
case LCK_PR: case LCK_PR:
getlk->fl_type = F_RDLCK; getlk->fl_type = F_RDLCK;
......
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