diff options
author | Jeff Layton <jlayton@primarydata.com> | 2014-09-01 19:04:48 -0400 |
---|---|---|
committer | Jeff Layton <jlayton@primarydata.com> | 2014-10-07 14:06:13 -0400 |
commit | 7ca76311fe6c397e9f332e5e6c79e3310d5ee98a (patch) | |
tree | 869c239a097a91bde4b62c23151381190374196d | |
parent | 4d01b7f5e7576858b71cbaa72b541e17a229cb91 (diff) |
locks: set fl_owner for leases to filp instead of current->files
Like flock locks, leases are owned by the file description. Now that the
i_have_this_lease check in __break_lease is gone, we don't actually use
the fl_owner for leases for anything. So, it's now safe to set this more
appropriately to the same value as the fl_file.
While we're at it, fix up the comments over the fl_owner_t definition
since they're rather out of date.
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
-rw-r--r-- | fs/locks.c | 2 | ||||
-rw-r--r-- | include/linux/fs.h | 8 |
2 files changed, 2 insertions, 8 deletions
diff --git a/fs/locks.c b/fs/locks.c index aed4a957d232..314135ad820b 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -465,7 +465,7 @@ static int lease_init(struct file *filp, long type, struct file_lock *fl) | |||
465 | if (assign_type(fl, type) != 0) | 465 | if (assign_type(fl, type) != 0) |
466 | return -EINVAL; | 466 | return -EINVAL; |
467 | 467 | ||
468 | fl->fl_owner = current->files; | 468 | fl->fl_owner = filp; |
469 | fl->fl_pid = current->tgid; | 469 | fl->fl_pid = current->tgid; |
470 | 470 | ||
471 | fl->fl_file = filp; | 471 | fl->fl_file = filp; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index ed4e1897099c..bb9484ae1eef 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -851,13 +851,7 @@ static inline struct file *get_file(struct file *f) | |||
851 | */ | 851 | */ |
852 | #define FILE_LOCK_DEFERRED 1 | 852 | #define FILE_LOCK_DEFERRED 1 |
853 | 853 | ||
854 | /* | 854 | /* legacy typedef, should eventually be removed */ |
855 | * The POSIX file lock owner is determined by | ||
856 | * the "struct files_struct" in the thread group | ||
857 | * (or NULL for no owner - BSD locks). | ||
858 | * | ||
859 | * Lockd stuffs a "host" pointer into this. | ||
860 | */ | ||
861 | typedef void *fl_owner_t; | 855 | typedef void *fl_owner_t; |
862 | 856 | ||
863 | struct file_lock_operations { | 857 | struct file_lock_operations { |