diff options
author | Jeff Layton <jlayton@primarydata.com> | 2015-01-16 15:05:57 -0500 |
---|---|---|
committer | Jeff Layton <jeff.layton@primarydata.com> | 2015-01-16 16:08:50 -0500 |
commit | 7448cc37b1a6b620d948aaee3bb30960c06d5d5d (patch) | |
tree | ad3db19117c9f7c6ac28e3be759ade949359c55a | |
parent | 6109c85037e53443f29fd39c0de69f578a1cf285 (diff) |
locks: clean up the lm_change prototype
Now that we use standard list_heads for tracking leases, we can have
lm_change take a pointer to the lease to be modified instead of a
double pointer.
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Acked-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | fs/locks.c | 13 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 3 | ||||
-rw-r--r-- | include/linux/fs.h | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/fs/locks.c b/fs/locks.c index a268d959ccd6..864f2460a0ad 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -1309,9 +1309,8 @@ static void lease_clear_pending(struct file_lock *fl, int arg) | |||
1309 | } | 1309 | } |
1310 | 1310 | ||
1311 | /* We already had a lease on this file; just change its type */ | 1311 | /* We already had a lease on this file; just change its type */ |
1312 | int lease_modify(struct file_lock **before, int arg, struct list_head *dispose) | 1312 | int lease_modify(struct file_lock *fl, int arg, struct list_head *dispose) |
1313 | { | 1313 | { |
1314 | struct file_lock *fl = *before; | ||
1315 | int error = assign_type(fl, arg); | 1314 | int error = assign_type(fl, arg); |
1316 | 1315 | ||
1317 | if (error) | 1316 | if (error) |
@@ -1352,9 +1351,9 @@ static void time_out_leases(struct inode *inode, struct list_head *dispose) | |||
1352 | list_for_each_entry_safe(fl, tmp, &ctx->flc_lease, fl_list) { | 1351 | list_for_each_entry_safe(fl, tmp, &ctx->flc_lease, fl_list) { |
1353 | trace_time_out_leases(inode, fl); | 1352 | trace_time_out_leases(inode, fl); |
1354 | if (past_time(fl->fl_downgrade_time)) | 1353 | if (past_time(fl->fl_downgrade_time)) |
1355 | lease_modify(&fl, F_RDLCK, dispose); | 1354 | lease_modify(fl, F_RDLCK, dispose); |
1356 | if (past_time(fl->fl_break_time)) | 1355 | if (past_time(fl->fl_break_time)) |
1357 | lease_modify(&fl, F_UNLCK, dispose); | 1356 | lease_modify(fl, F_UNLCK, dispose); |
1358 | } | 1357 | } |
1359 | } | 1358 | } |
1360 | 1359 | ||
@@ -1669,7 +1668,7 @@ generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **pr | |||
1669 | } | 1668 | } |
1670 | 1669 | ||
1671 | if (my_fl != NULL) { | 1670 | if (my_fl != NULL) { |
1672 | error = lease->fl_lmops->lm_change(&my_fl, arg, &dispose); | 1671 | error = lease->fl_lmops->lm_change(my_fl, arg, &dispose); |
1673 | if (error) | 1672 | if (error) |
1674 | goto out; | 1673 | goto out; |
1675 | goto out_setup; | 1674 | goto out_setup; |
@@ -1732,7 +1731,7 @@ static int generic_delete_lease(struct file *filp) | |||
1732 | } | 1731 | } |
1733 | trace_generic_delete_lease(inode, fl); | 1732 | trace_generic_delete_lease(inode, fl); |
1734 | if (victim) | 1733 | if (victim) |
1735 | error = fl->fl_lmops->lm_change(&victim, F_UNLCK, &dispose); | 1734 | error = fl->fl_lmops->lm_change(victim, F_UNLCK, &dispose); |
1736 | spin_unlock(&ctx->flc_lock); | 1735 | spin_unlock(&ctx->flc_lock); |
1737 | locks_dispose_list(&dispose); | 1736 | locks_dispose_list(&dispose); |
1738 | return error; | 1737 | return error; |
@@ -2426,7 +2425,7 @@ locks_remove_lease(struct file *filp) | |||
2426 | 2425 | ||
2427 | spin_lock(&ctx->flc_lock); | 2426 | spin_lock(&ctx->flc_lock); |
2428 | list_for_each_entry_safe(fl, tmp, &ctx->flc_lease, fl_list) | 2427 | list_for_each_entry_safe(fl, tmp, &ctx->flc_lease, fl_list) |
2429 | lease_modify(&fl, F_UNLCK, &dispose); | 2428 | lease_modify(fl, F_UNLCK, &dispose); |
2430 | spin_unlock(&ctx->flc_lock); | 2429 | spin_unlock(&ctx->flc_lock); |
2431 | locks_dispose_list(&dispose); | 2430 | locks_dispose_list(&dispose); |
2432 | } | 2431 | } |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 80242f5bd621..532a60cca2fb 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -3477,7 +3477,8 @@ nfsd_break_deleg_cb(struct file_lock *fl) | |||
3477 | } | 3477 | } |
3478 | 3478 | ||
3479 | static int | 3479 | static int |
3480 | nfsd_change_deleg_cb(struct file_lock **onlist, int arg, struct list_head *dispose) | 3480 | nfsd_change_deleg_cb(struct file_lock *onlist, int arg, |
3481 | struct list_head *dispose) | ||
3481 | { | 3482 | { |
3482 | if (arg & F_UNLCK) | 3483 | if (arg & F_UNLCK) |
3483 | return lease_modify(onlist, arg, dispose); | 3484 | return lease_modify(onlist, arg, dispose); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 32eafa9b5c9f..94e706a0a408 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -900,7 +900,7 @@ struct lock_manager_operations { | |||
900 | void (*lm_notify)(struct file_lock *); /* unblock callback */ | 900 | void (*lm_notify)(struct file_lock *); /* unblock callback */ |
901 | int (*lm_grant)(struct file_lock *, int); | 901 | int (*lm_grant)(struct file_lock *, int); |
902 | bool (*lm_break)(struct file_lock *); | 902 | bool (*lm_break)(struct file_lock *); |
903 | int (*lm_change)(struct file_lock **, int, struct list_head *); | 903 | int (*lm_change)(struct file_lock *, int, struct list_head *); |
904 | void (*lm_setup)(struct file_lock *, void **); | 904 | void (*lm_setup)(struct file_lock *, void **); |
905 | }; | 905 | }; |
906 | 906 | ||
@@ -1021,7 +1021,7 @@ extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int t | |||
1021 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 1021 | extern void lease_get_mtime(struct inode *, struct timespec *time); |
1022 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); | 1022 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); |
1023 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **); | 1023 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **); |
1024 | extern int lease_modify(struct file_lock **, int, struct list_head *); | 1024 | extern int lease_modify(struct file_lock *, int, struct list_head *); |
1025 | #else /* !CONFIG_FILE_LOCKING */ | 1025 | #else /* !CONFIG_FILE_LOCKING */ |
1026 | static inline int fcntl_getlk(struct file *file, unsigned int cmd, | 1026 | static inline int fcntl_getlk(struct file *file, unsigned int cmd, |
1027 | struct flock __user *user) | 1027 | struct flock __user *user) |
@@ -1153,7 +1153,7 @@ static inline int vfs_setlease(struct file *filp, long arg, | |||
1153 | return -EINVAL; | 1153 | return -EINVAL; |
1154 | } | 1154 | } |
1155 | 1155 | ||
1156 | static inline int lease_modify(struct file_lock **before, int arg, | 1156 | static inline int lease_modify(struct file_lock *fl, int arg, |
1157 | struct list_head *dispose) | 1157 | struct list_head *dispose) |
1158 | { | 1158 | { |
1159 | return -EINVAL; | 1159 | return -EINVAL; |