mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dilger, Andreas" <andreas.dilger@intel.com>
To: NeilBrown <neilb@suse.com>
Cc: "Drokin, Oleg" <oleg.drokin@intel.com>,
	James Simmons <jsimmons@infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"lustre-devel@lists.lustre.org" <lustre-devel@lists.lustre.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 6/9] staging: lustre: ldlm: remove 'flags' arg from ldlm_flock_destroy()
Date: Fri, 27 Oct 2017 09:23:59 +0000	[thread overview]
Message-ID: <D702959F-FD04-4996-8C43-98263EC36D9D@intel.com> (raw)
In-Reply-To: <150872002976.3340.17760141414233585370.stgit@noble>

On Oct 22, 2017, at 18:53, NeilBrown <neilb@suse.com> wrote:
> 
> The only value ever passed in LDLM_FL_WAIT_NOREPROC, so assume that
> instead of passing it.
> 
> Signed-off-by: NeilBrown <neilb@suse.com>

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>

> ---
> drivers/staging/lustre/lustre/ldlm/ldlm_flock.c |   36 ++++++++++-------------
> 1 file changed, 16 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> index d5a5742a1171..1bf56892fcf5 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
> @@ -88,24 +88,23 @@ ldlm_flocks_overlap(struct ldlm_lock *lock, struct ldlm_lock *new)
> }
> 
> 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)",
> -		   __func__, mode, flags);
> +	LDLM_DEBUG(lock, "%s(mode: %d)",
> +		   __func__, mode);
> 
> 	/* Safe to not lock here, since it should be empty anyway */
> 	LASSERT(hlist_unhashed(&lock->l_exp_flock_hash));
> 
> 	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,
> -		 * need call the nolock version of ldlm_lock_decref_internal
> -		 */
> -		ldlm_lock_decref_internal_nolock(lock, mode);
> -	}
> +	/* 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,
> +	 * need call the nolock version of ldlm_lock_decref_internal
> +	 */
> +	ldlm_lock_decref_internal_nolock(lock, mode);
> 
> 	ldlm_lock_destroy_nolock(lock);
> }
> @@ -208,8 +207,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req)
> 			}
> 
> 			if (added) {
> -				ldlm_flock_destroy(lock, mode,
> -						   LDLM_FL_WAIT_NOREPROC);
> +				ldlm_flock_destroy(lock, mode);
> 			} else {
> 				new = lock;
> 				added = 1;
> @@ -233,8 +231,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req)
> 					new->l_policy_data.l_flock.end + 1;
> 				break;
> 			}
> -			ldlm_flock_destroy(lock, lock->l_req_mode,
> -					   LDLM_FL_WAIT_NOREPROC);
> +			ldlm_flock_destroy(lock, lock->l_req_mode);
> 			continue;
> 		}
> 		if (new->l_policy_data.l_flock.end >=
> @@ -265,8 +262,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req)
> 						NULL, 0, LVB_T_NONE);
> 			lock_res_and_lock(req);
> 			if (IS_ERR(new2)) {
> -				ldlm_flock_destroy(req, lock->l_granted_mode,
> -						   LDLM_FL_WAIT_NOREPROC);
> +				ldlm_flock_destroy(req, lock->l_granted_mode);
> 				return LDLM_ITER_STOP;
> 			}
> 			goto reprocess;
> @@ -323,7 +319,7 @@ static int ldlm_process_flock_lock(struct ldlm_lock *req)
> 	 * could be freed before the completion AST can be sent.
> 	 */
> 	if (added)
> -		ldlm_flock_destroy(req, mode, LDLM_FL_WAIT_NOREPROC);
> +		ldlm_flock_destroy(req, mode);
> 
> 	ldlm_resource_dump(D_INFO, res);
> 	return LDLM_ITER_CONTINUE;
> @@ -477,7 +473,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
> 			LDLM_DEBUG(lock, "client-side enqueue deadlock received");
> 			rc = -EDEADLK;
> 		}
> -		ldlm_flock_destroy(lock, mode, LDLM_FL_WAIT_NOREPROC);
> +		ldlm_flock_destroy(lock, mode);
> 		unlock_res_and_lock(lock);
> 
> 		/* Need to wake up the waiter if we were evicted */
> @@ -498,7 +494,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
> 		 * in the lock changes we can decref the appropriate refcount.
> 		 */
> 		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) {
> 		case LCK_PR:
> 			getlk->fl_type = F_RDLCK;
> 
> 

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

  reply	other threads:[~2017-10-27  9:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23  0:53 [PATCH 0/9] Assorted cleanups for staging/.../lustre/ldlm/ldlm_flock.c NeilBrown
2017-10-23  0:53 ` [PATCH 2/9] staging: lustre: ldlm: remove unused 'work_list' arg from ldlm_process_flock_lock() NeilBrown
2017-10-27  9:09   ` Dilger, Andreas
2017-10-23  0:53 ` [PATCH 4/9] staging: lustre: ldlm: remove 'flags' " NeilBrown
2017-10-27  9:19   ` Dilger, Andreas
2017-10-23  0:53 ` [PATCH 1/9] staging: lustre: ldlm: remove 'first_enq' " NeilBrown
2017-10-27  9:08   ` Dilger, Andreas
2017-10-23  0:53 ` [PATCH 9/9] staging: lustre: ldlm: remove unused field 'fwd_generation' NeilBrown
2017-10-27  9:39   ` [lustre-devel] " Dilger, Andreas
2017-10-27 11:10     ` NeilBrown
2017-10-23  0:53 ` [PATCH 5/9] staging: lustre: ldlm: remove unused 'overlaps' variable NeilBrown
2017-10-27  9:20   ` Dilger, Andreas
2017-10-23  0:53 ` [PATCH 3/9] staging: lustre: ldlm: remove unneeded 'err' arg to ldlm_process_flock_lock() NeilBrown
2017-10-27  9:11   ` Dilger, Andreas
2017-10-23  0:53 ` [PATCH 7/9] staging: lustre: ldlm: tidy list walking in ldlm_flock() NeilBrown
2017-10-27  9:32   ` Dilger, Andreas
2017-10-23  0:53 ` [PATCH 8/9] staging: lustre: ldlm: remove unnecessary 'ownlocks' variable NeilBrown
2017-10-27  9:33   ` Dilger, Andreas
2017-10-23  0:53 ` [PATCH 6/9] staging: lustre: ldlm: remove 'flags' arg from ldlm_flock_destroy() NeilBrown
2017-10-27  9:23   ` Dilger, Andreas [this message]
2017-10-24 22:20 ` [PATCH 0/9] Assorted cleanups for staging/.../lustre/ldlm/ldlm_flock.c James Simmons
2017-10-25 21:55   ` NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D702959F-FD04-4996-8C43-98263EC36D9D@intel.com \
    --to=andreas.dilger@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=neilb@suse.com \
    --cc=oleg.drokin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®