aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJeff Layton2014-08-22 10:55:47 -0400
committerJeff Layton2014-10-07 14:06:12 -0400
commit1c7dd2ff430fa14b45c9def54468e3a25ab8342b (patch)
treea80695c6ca57be5da96c63b67d1264507bfe509e /include
parente6f5c78930e409f3a6b37f5484313a416359ac7f (diff)
locks: define a lm_setup handler for leases
...and move the fasync setup into it for fcntl lease calls. At the same time, change the semantics of how the file_lock double-pointer is handled. Up until now, on a successful lease return you got a pointer to the lock on the list. This is bad, since that pointer can no longer be relied on as valid once the inode->i_lock has been released. Change the code to instead just zero out the pointer if the lease we passed in ended up being used. Then the callers can just check to see if it's NULL after the call and free it if it isn't. The priv argument has the same semantics. The lm_setup function can zero the pointer out to signal to the caller that it should not be freed after the function returns. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f1870eb67b02..9a6d56154dd5 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -874,6 +874,7 @@ struct lock_manager_operations {
int (*lm_grant)(struct file_lock *, int);
void (*lm_break)(struct file_lock *);
int (*lm_change)(struct file_lock **, int);
+ void (*lm_setup)(struct file_lock *, void **);
};
struct lock_manager {