diff options
author | Jeff Layton <jlayton@primarydata.com> | 2014-09-01 07:12:07 -0400 |
---|---|---|
committer | Jeff Layton <jlayton@primarydata.com> | 2014-10-07 14:06:13 -0400 |
commit | c45198eda2794bb72601c9f96266d8b95db66dd5 (patch) | |
tree | 59c973d0d5356e113efd22ece677267cbc07e0af /include/linux/fs.h | |
parent | f82b4b6780afabce9d9a91c84fae17ec3d63b9d7 (diff) |
locks: move freeing of leases outside of i_lock
There was only one place where we still could free a file_lock while
holding the i_lock -- lease_modify. Add a new list_head argument to the
lm_change operation, pass in a private list when calling it, and fix
those callers to dispose of the list once the lock has been dropped.
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 9a6d56154dd5..f419f718e447 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -873,7 +873,7 @@ struct lock_manager_operations { | |||
873 | void (*lm_notify)(struct file_lock *); /* unblock callback */ | 873 | void (*lm_notify)(struct file_lock *); /* unblock callback */ |
874 | int (*lm_grant)(struct file_lock *, int); | 874 | int (*lm_grant)(struct file_lock *, int); |
875 | void (*lm_break)(struct file_lock *); | 875 | void (*lm_break)(struct file_lock *); |
876 | int (*lm_change)(struct file_lock **, int); | 876 | int (*lm_change)(struct file_lock **, int, struct list_head *); |
877 | void (*lm_setup)(struct file_lock *, void **); | 877 | void (*lm_setup)(struct file_lock *, void **); |
878 | }; | 878 | }; |
879 | 879 | ||
@@ -985,7 +985,7 @@ extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int t | |||
985 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 985 | extern void lease_get_mtime(struct inode *, struct timespec *time); |
986 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); | 986 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); |
987 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **); | 987 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **); |
988 | extern int lease_modify(struct file_lock **, int); | 988 | extern int lease_modify(struct file_lock **, int, struct list_head *); |
989 | #else /* !CONFIG_FILE_LOCKING */ | 989 | #else /* !CONFIG_FILE_LOCKING */ |
990 | static inline int fcntl_getlk(struct file *file, unsigned int cmd, | 990 | static inline int fcntl_getlk(struct file *file, unsigned int cmd, |
991 | struct flock __user *user) | 991 | struct flock __user *user) |
@@ -1112,7 +1112,8 @@ static inline int vfs_setlease(struct file *filp, long arg, | |||
1112 | return -EINVAL; | 1112 | return -EINVAL; |
1113 | } | 1113 | } |
1114 | 1114 | ||
1115 | static inline int lease_modify(struct file_lock **before, int arg) | 1115 | static inline int lease_modify(struct file_lock **before, int arg, |
1116 | struct list_head *dispose) | ||
1116 | { | 1117 | { |
1117 | return -EINVAL; | 1118 | return -EINVAL; |
1118 | } | 1119 | } |