From patchwork Wed Aug 20 10:07:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 4748741 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 293599F375 for ; Wed, 20 Aug 2014 10:07:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19495200FE for ; Wed, 20 Aug 2014 10:07:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2DADA200F4 for ; Wed, 20 Aug 2014 10:07:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751220AbaHTKHn (ORCPT ); Wed, 20 Aug 2014 06:07:43 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:47294 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750876AbaHTKHm (ORCPT ); Wed, 20 Aug 2014 06:07:42 -0400 Received: by mail-pd0-f169.google.com with SMTP id y10so11426390pdj.0 for ; Wed, 20 Aug 2014 03:07:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=HJDQ+9wp0TwadrAlM2wiTwv/1ZXF7JiXQ7IVrjT3AcA=; b=zL/MzKQwqMmQKfwygSwk5mzfNpZzApZXYpycSFPUA9UGPJ/dqeKJSQscdD63mkN9hR UvXbxjDEwQe+qYEiIrT/xXZXlGr0YRIlsbI7hv8RqHNJ/HUP6vAMZQOpQHPjomeEgHOe e9O3NxOwE4SDOMYJsMoDAPGs4Vm8AamJT6QIvZML20gpHocOVexhfO5rAN9x4u1Uqxfr r4UDjxtukmL6oyJT7td/pB2lvukEhKgQv7c13a1AsgykmiZK5hGgZvvRYVB34e9IjNGM Kyvn8zRMgmfeKTbU93ZX7bfkVCYUIoMMbT7gJ80KguN119hEtrxmjXGHN9E97k203dLw /O9g== X-Received: by 10.68.220.71 with SMTP id pu7mr25128380pbc.22.1408529258791; Wed, 20 Aug 2014 03:07:38 -0700 (PDT) Received: from [192.168.0.100] ([118.117.110.46]) by mx.google.com with ESMTPSA id s16sm10838739pdj.21.2014.08.20.03.07.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Aug 2014 03:07:37 -0700 (PDT) Message-ID: <53F47357.7050608@gmail.com> Date: Wed, 20 Aug 2014 18:07:19 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Jeff Layton , "J. Bruce Fields" , kinglongmee@gmail.com CC: Linux NFS Mailing List , Joe Perches Subject: [PATCH] lockd: Remove unused b_fl member from struct nlm_block Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix left code by Joe Perches's patch, "locks: Remove unused conf argument from lm_grant" Signed-off-by: Kinglong Mee --- 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 */