aboutsummaryrefslogtreecommitdiffstats
path: root/fs/file.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2014-01-13 10:49:06 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2014-01-25 03:14:38 -0500
commite6ff9a9fa4e05c1c03dec63cdc6a87d6dea02755 (patch)
tree2c2227443f90e38581b8bc5f30cd3949301f7d0d /fs/file.c
parentad46183445043b562856c60b74db664668fb364b (diff)
fs: __fget_light() can use __fget() in slow path
The slow path in __fget_light() can use __fget() to avoid the code duplication. Saves 232 bytes. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/file.c')
-rw-r--r--fs/file.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/fs/file.c b/fs/file.c
index 50c1208f6450..771578b33fb6 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -694,17 +694,9 @@ struct file *__fget_light(unsigned int fd, fmode_t mask, int *fput_needed)
694 if (file && (file->f_mode & mask)) 694 if (file && (file->f_mode & mask))
695 file = NULL; 695 file = NULL;
696 } else { 696 } else {
697 rcu_read_lock(); 697 file = __fget(fd, mask);
698 file = fcheck_files(files, fd); 698 if (file)
699 if (file) { 699 *fput_needed = 1;
700 if (!(file->f_mode & mask) &&
701 atomic_long_inc_not_zero(&file->f_count))
702 *fput_needed = 1;
703 else
704 /* Didn't get the reference, someone's freed */
705 file = NULL;
706 }
707 rcu_read_unlock();
708 } 700 }
709 701
710 return file; 702 return file;