[PATCH] locks: remove unused lm_release_private

J. Bruce Fields
2012-08-01T11:56:21Z

From: "J. Bruce Fields" <bfields@redhat.com>

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 <bfields@redhat.com>
---
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);
};
--
1.7.9.5