From patchwork Wed Aug 1 11:56:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 1264061 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 2A82C3FC81 for ; Wed, 1 Aug 2012 11:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753981Ab2HAL4V (ORCPT ); Wed, 1 Aug 2012 07:56:21 -0400 Received: from fieldses.org ([174.143.236.118]:52809 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751910Ab2HAL4U (ORCPT ); Wed, 1 Aug 2012 07:56:20 -0400 Received: from bfields by fieldses.org with local (Exim 4.72) (envelope-from ) id 1SwXXE-00015I-Nh; Wed, 01 Aug 2012 07:56:16 -0400 Date: Wed, 1 Aug 2012 07:56:16 -0400 From: "J. Bruce Fields" To: Linus Torvalds Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, matthew@wil.cx Subject: [PATCH] locks: remove unused lm_release_private Message-ID: <20120801115616.GA3958@fieldses.org> References: <20120731142948.GC27834@fieldses.org> <20120731143600.GD27834@fieldses.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: "J. Bruce Fields" 3b6e2723f32de42028617f2c99b244ccd72cd959 "locks: prevent side-effects of locks_release_private before file_lock is initialized" removed the last user of lm_release_private without removing the field itself. Signed-off-by: J. Bruce Fields --- Documentation/filesystems/Locking | 2 -- fs/locks.c | 6 +----- include/linux/fs.h | 1 - 3 files changed, 1 insertion(+), 8 deletions(-) On Tue, Jul 31, 2012 at 02:54:05PM -0700, Linus Torvalds wrote: > Maybe I missed some odd user that somehow avoids the grep, but I don't > think so. So there is nothing that ever sets it, why the hell does the > thing still remain at all? Embarassingly: I had work in progress that could make use of lm_release_private soon, so I didn't bother removing it. But "soon" was optimistic, and anyway why leave the code in a confusing state, so: agreed it should have gone, apologies. --b. diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 8e2da1e..f11d51f 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking @@ -343,7 +343,6 @@ prototypes: int (*lm_compare_owner)(struct file_lock *, struct file_lock *); void (*lm_notify)(struct file_lock *); /* unblock callback */ int (*lm_grant)(struct file_lock *, struct file_lock *, int); - void (*lm_release_private)(struct file_lock *); void (*lm_break)(struct file_lock *); /* break_lease callback */ int (*lm_change)(struct file_lock **, int); @@ -352,7 +351,6 @@ locking rules: lm_compare_owner: yes no lm_notify: yes no lm_grant: no no -lm_release_private: maybe no lm_break: yes no lm_change yes no diff --git a/fs/locks.c b/fs/locks.c index 541075a..5cf874c 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -200,11 +200,7 @@ void locks_release_private(struct file_lock *fl) fl->fl_ops->fl_release_private(fl); fl->fl_ops = NULL; } - if (fl->fl_lmops) { - if (fl->fl_lmops->lm_release_private) - fl->fl_lmops->lm_release_private(fl); - fl->fl_lmops = NULL; - } + fl->fl_lmops = NULL; } EXPORT_SYMBOL_GPL(locks_release_private); diff --git a/include/linux/fs.h b/include/linux/fs.h index a1e7727..9a6ac61 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1154,7 +1154,6 @@ struct lock_manager_operations { int (*lm_compare_owner)(struct file_lock *, struct file_lock *); void (*lm_notify)(struct file_lock *); /* unblock callback */ int (*lm_grant)(struct file_lock *, struct file_lock *, int); - void (*lm_release_private)(struct file_lock *); void (*lm_break)(struct file_lock *); int (*lm_change)(struct file_lock **, int); };