diff options
author | Oleg Nesterov <oleg@redhat.com> | 2014-01-13 10:49:06 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-01-25 03:14:38 -0500 |
commit | e6ff9a9fa4e05c1c03dec63cdc6a87d6dea02755 (patch) | |
tree | 2c2227443f90e38581b8bc5f30cd3949301f7d0d /fs/file.c | |
parent | ad46183445043b562856c60b74db664668fb364b (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.c | 14 |
1 files changed, 3 insertions, 11 deletions
@@ -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; |