linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lockd: Remove unused b_fl member from struct nlm_block
@ 2014-08-20 10:07 Kinglong Mee
  2014-08-20 10:58 ` Jeff Layton
  2014-08-20 11:16 ` Jeff Layton
  0 siblings, 2 replies; 7+ messages in thread
From: Kinglong Mee @ 2014-08-20 10:07 UTC (permalink / raw)
  To: Jeff Layton, J. Bruce Fields, kinglongmee
  Cc: Linux NFS Mailing List, Joe Perches

Fix left code by Joe Perches's patch,
"locks: Remove unused conf argument from lm_grant"

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/lockd/svclock.c          | 26 +++++---------------------
 include/linux/lockd/lockd.h |  1 -
 2 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 2a61701..796e63b 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -245,7 +245,6 @@ nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_host *host,
 	block->b_daemon = rqstp->rq_server;
 	block->b_host   = host;
 	block->b_file   = file;
-	block->b_fl = NULL;
 	file->f_count++;
 
 	/* Add to file's list of blocks */
@@ -295,7 +294,6 @@ static void nlmsvc_free_block(struct kref *kref)
 	nlmsvc_freegrantargs(block->b_call);
 	nlmsvc_release_call(block->b_call);
 	nlm_release_file(block->b_file);
-	kfree(block->b_fl);
 	kfree(block);
 }
 
@@ -523,20 +521,13 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
 	block = nlmsvc_lookup_block(file, lock);
 
 	if (block == NULL) {
-		struct file_lock *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
-
-		if (conf == NULL)
-			return nlm_granted;
 		block = nlmsvc_create_block(rqstp, host, file, lock, cookie);
-		if (block == NULL) {
-			kfree(conf);
+		if (block == NULL)
 			return nlm_granted;
-		}
-		block->b_fl = conf;
 	}
 	if (block->b_flags & B_QUEUED) {
-		dprintk("lockd: nlmsvc_testlock deferred block %p flags %d fl %p\n",
-			block, block->b_flags, block->b_fl);
+		dprintk("lockd: nlmsvc_testlock deferred block %p flags %d\n",
+			block, block->b_flags);
 		if (block->b_flags & B_TIMED_OUT) {
 			nlmsvc_unlink_block(block);
 			ret = nlm_lck_denied;
@@ -544,14 +535,8 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
 		}
 		if (block->b_flags & B_GOT_CALLBACK) {
 			nlmsvc_unlink_block(block);
-			if (block->b_fl != NULL
-					&& block->b_fl->fl_type != F_UNLCK) {
-				lock->fl = *block->b_fl;
-				goto conf_lock;
-			} else {
-				ret = nlm_granted;
-				goto out;
-			}
+			ret = nlm_granted;
+			goto out;
 		}
 		ret = nlm_drop_reply;
 		goto out;
@@ -575,7 +560,6 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file,
 		goto out;
 	}
 
-conf_lock:
 	dprintk("lockd: conflicting lock(ty=%d, %Ld-%Ld)\n",
 		lock->fl.fl_type, (long long)lock->fl.fl_start,
 		(long long)lock->fl.fl_end);
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 219d796..ff82a32 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -178,7 +178,6 @@ struct nlm_block {
 	unsigned char		b_granted;	/* VFS granted lock */
 	struct nlm_file *	b_file;		/* file in question */
 	struct cache_req *	b_cache_req;	/* deferred request handling */
-	struct file_lock *	b_fl;		/* set for GETLK */
 	struct cache_deferred_req * b_deferred_req;
 	unsigned int		b_flags;	/* block flags */
 #define B_QUEUED		1	/* lock queued */
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-08-21 14:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-20 10:07 [PATCH] lockd: Remove unused b_fl member from struct nlm_block Kinglong Mee
2014-08-20 10:58 ` Jeff Layton
2014-08-20 12:10   ` Kinglong Mee
2014-08-20 13:04     ` Jeff Layton
2014-08-21 13:16       ` Kinglong Mee
2014-08-21 14:02         ` Jeff Layton
2014-08-20 11:16 ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).