aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/file_table.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2019-03-19 13:12:18 +0000
committerMark Brown <broonie@kernel.org>2019-03-19 13:12:18 +0000
commitc9e48084c88cf901ad0d99a889f2628a5622d90b (patch)
treee95ef2305fa14e0c6e218a6aba8de8df4a0b5798 /fs/file_table.c
parentregulator: axp20x: Use rdev_get_id at appropriate places (diff)
parentLinux 5.1-rc1 (diff)
downloadwireguard-linux-c9e48084c88cf901ad0d99a889f2628a5622d90b.tar.xz
wireguard-linux-c9e48084c88cf901ad0d99a889f2628a5622d90b.zip
Merge tag 'v5.1-rc1' into regulator-5.2
Linux 5.1-rc1
Diffstat (limited to 'fs/file_table.c')
-rw-r--r--fs/file_table.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/file_table.c b/fs/file_table.c
index 5679e7fcb6b0..155d7514a094 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -326,9 +326,9 @@ void flush_delayed_fput(void)
static DECLARE_DELAYED_WORK(delayed_fput_work, delayed_fput);
-void fput(struct file *file)
+void fput_many(struct file *file, unsigned int refs)
{
- if (atomic_long_dec_and_test(&file->f_count)) {
+ if (atomic_long_sub_and_test(refs, &file->f_count)) {
struct task_struct *task = current;
if (likely(!in_interrupt() && !(task->flags & PF_KTHREAD))) {
@@ -347,6 +347,11 @@ void fput(struct file *file)
}
}
+void fput(struct file *file)
+{
+ fput_many(file, 1);
+}
+
/*
* synchronous analog of fput(); for kernel threads that might be needed
* in some umount() (and thus can't use flush_delayed_fput() without