diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-03-04 14:54:22 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-03-10 11:44:42 -0400 |
commit | bd2a31d522344b3ac2fb680bd2366e77a9bd8209 (patch) | |
tree | d08be6aea75b2f41bebf516bfc33187d0673bfce /fs/read_write.c | |
parent | 00e188ef6a7e7bf2883bcffc30d89e98a0bb76b3 (diff) |
get rid of fget_light()
instead of returning the flags by reference, we can just have the
low-level primitive return those in lower bits of unsigned long,
with struct file * derived from the rest.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r-- | fs/read_write.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/fs/read_write.c b/fs/read_write.c index 932bb3414a96..54e19b9392dc 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
@@ -264,23 +264,9 @@ loff_t vfs_llseek(struct file *file, loff_t offset, int whence) | |||
264 | } | 264 | } |
265 | EXPORT_SYMBOL(vfs_llseek); | 265 | EXPORT_SYMBOL(vfs_llseek); |
266 | 266 | ||
267 | /* | ||
268 | * We only lock f_pos if we have threads or if the file might be | ||
269 | * shared with another process. In both cases we'll have an elevated | ||
270 | * file count (done either by fdget() or by fork()). | ||
271 | */ | ||
272 | static inline struct fd fdget_pos(int fd) | 267 | static inline struct fd fdget_pos(int fd) |
273 | { | 268 | { |
274 | struct fd f = fdget(fd); | 269 | return __to_fd(__fdget_pos(fd)); |
275 | struct file *file = f.file; | ||
276 | |||
277 | if (file && (file->f_mode & FMODE_ATOMIC_POS)) { | ||
278 | if (file_count(file) > 1) { | ||
279 | f.flags |= FDPUT_POS_UNLOCK; | ||
280 | mutex_lock(&file->f_pos_lock); | ||
281 | } | ||
282 | } | ||
283 | return f; | ||
284 | } | 270 | } |
285 | 271 | ||
286 | static inline void fdput_pos(struct fd f) | 272 | static inline void fdput_pos(struct fd f) |