aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jeff.layton@primarydata.com>2015-04-03 09:04:04 -0400
committerJeff Layton <jeff.layton@primarydata.com>2015-04-03 09:04:04 -0400
commitcae80b305e1c3944746dd93e33e9b2ccd5a490c1 (patch)
tree1ede43da59f29e2a9af7cfb13070310a4d073194
parent5c1c669a1b2435e071d566b6db1a8e6b26542ba1 (diff)
locks: change lm_get_owner and lm_put_owner prototypes
The current prototypes for these operations are somewhat awkward as they deal with fl_owners but take struct file_lock arguments. In the future, we'll want to be able to take references without necessarily dealing with a struct file_lock. Change them to take fl_owner_t arguments instead and have the callers deal with assigning the values to the file_lock structs. Signed-off-by: Jeff Layton <jlayton@primarydata.com>
-rw-r--r--fs/locks.c8
-rw-r--r--fs/nfsd/nfs4state.c18
-rw-r--r--include/linux/fs.h4
3 files changed, 17 insertions, 13 deletions
diff --git a/fs/locks.c b/fs/locks.c
index 54a79883a7f9..3ebaafb4c587 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -276,8 +276,10 @@ void locks_release_private(struct file_lock *fl)
276 } 276 }
277 277
278 if (fl->fl_lmops) { 278 if (fl->fl_lmops) {
279 if (fl->fl_lmops->lm_put_owner) 279 if (fl->fl_lmops->lm_put_owner) {
280 fl->fl_lmops->lm_put_owner(fl); 280 fl->fl_lmops->lm_put_owner(fl->fl_owner);
281 fl->fl_owner = NULL;
282 }
281 fl->fl_lmops = NULL; 283 fl->fl_lmops = NULL;
282 } 284 }
283} 285}
@@ -333,7 +335,7 @@ void locks_copy_conflock(struct file_lock *new, struct file_lock *fl)
333 335
334 if (fl->fl_lmops) { 336 if (fl->fl_lmops) {
335 if (fl->fl_lmops->lm_get_owner) 337 if (fl->fl_lmops->lm_get_owner)
336 fl->fl_lmops->lm_get_owner(new, fl); 338 fl->fl_lmops->lm_get_owner(fl->fl_owner);
337 } 339 }
338} 340}
339EXPORT_SYMBOL(locks_copy_conflock); 341EXPORT_SYMBOL(locks_copy_conflock);
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 8ba1d888f1e6..326a545ea7b2 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4932,20 +4932,22 @@ nfs4_transform_lock_offset(struct file_lock *lock)
4932 lock->fl_end = OFFSET_MAX; 4932 lock->fl_end = OFFSET_MAX;
4933} 4933}
4934 4934
4935static void nfsd4_fl_get_owner(struct file_lock *dst, struct file_lock *src) 4935static fl_owner_t
4936nfsd4_fl_get_owner(fl_owner_t owner)
4936{ 4937{
4937 struct nfs4_lockowner *lo = (struct nfs4_lockowner *)src->fl_owner; 4938 struct nfs4_lockowner *lo = (struct nfs4_lockowner *)owner;
4938 dst->fl_owner = (fl_owner_t)lockowner(nfs4_get_stateowner(&lo->lo_owner)); 4939
4940 nfs4_get_stateowner(&lo->lo_owner);
4941 return owner;
4939} 4942}
4940 4943
4941static void nfsd4_fl_put_owner(struct file_lock *fl) 4944static void
4945nfsd4_fl_put_owner(fl_owner_t owner)
4942{ 4946{
4943 struct nfs4_lockowner *lo = (struct nfs4_lockowner *)fl->fl_owner; 4947 struct nfs4_lockowner *lo = (struct nfs4_lockowner *)owner;
4944 4948
4945 if (lo) { 4949 if (lo)
4946 nfs4_put_stateowner(&lo->lo_owner); 4950 nfs4_put_stateowner(&lo->lo_owner);
4947 fl->fl_owner = NULL;
4948 }
4949} 4951}
4950 4952
4951static const struct lock_manager_operations nfsd_posix_mng_ops = { 4953static const struct lock_manager_operations nfsd_posix_mng_ops = {
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f4131e8ead74..e4111a29697e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -893,8 +893,8 @@ struct file_lock_operations {
893struct lock_manager_operations { 893struct lock_manager_operations {
894 int (*lm_compare_owner)(struct file_lock *, struct file_lock *); 894 int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
895 unsigned long (*lm_owner_key)(struct file_lock *); 895 unsigned long (*lm_owner_key)(struct file_lock *);
896 void (*lm_get_owner)(struct file_lock *, struct file_lock *); 896 fl_owner_t (*lm_get_owner)(fl_owner_t);
897 void (*lm_put_owner)(struct file_lock *); 897 void (*lm_put_owner)(fl_owner_t);
898 void (*lm_notify)(struct file_lock *); /* unblock callback */ 898 void (*lm_notify)(struct file_lock *); /* unblock callback */
899 int (*lm_grant)(struct file_lock *, int); 899 int (*lm_grant)(struct file_lock *, int);
900 bool (*lm_break)(struct file_lock *); 900 bool (*lm_break)(struct file_lock *);