summaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2020-11-21 00:14:25 +0100
committerEric W. Biederman <ebiederm@xmission.com>2020-12-10 19:39:59 +0100
commit120ce2b0cd52abe73e8b16c23461eb14df5a87d8 (patch)
tree8df6b2fe4cf87d23b757ec605c133a47a3742fc2 /fs/proc
parentfile: Rename __fcheck_files to files_lookup_fd_raw (diff)
downloadlinux-120ce2b0cd52abe73e8b16c23461eb14df5a87d8.tar.xz
linux-120ce2b0cd52abe73e8b16c23461eb14df5a87d8.zip
file: Factor files_lookup_fd_locked out of fcheck_files
To make it easy to tell where files->file_lock protection is being used when looking up a file create files_lookup_fd_locked. Only allow this function to be called with the file_lock held. Update the callers of fcheck and fcheck_files that are called with the files->file_lock held to call files_lookup_fd_locked instead. Hopefully this makes it easier to quickly understand what is going on. The need for better names became apparent in the last round of discussion of this set of changes[1]. [1] https://lkml.kernel.org/r/CAHk-=wj8BQbgJFLa+J0e=iT-1qpmCRTbPAJ8gd6MJQ=kbRPqyQ@mail.gmail.com Link: https://lkml.kernel.org/r/20201120231441.29911-8-ebiederm@xmission.com Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/fd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/fd.c b/fs/proc/fd.c
index d58960f6ee52..2cca9bca3b3a 100644
--- a/fs/proc/fd.c
+++ b/fs/proc/fd.c
@@ -35,7 +35,7 @@ static int seq_show(struct seq_file *m, void *v)
unsigned int fd = proc_fd(m->private);
spin_lock(&files->file_lock);
- file = fcheck_files(files, fd);
+ file = files_lookup_fd_locked(files, fd);
if (file) {
struct fdtable *fdt = files_fdtable(files);