From: Al Viro Date: Mon, 27 Aug 2012 00:30:57 +0000 (-0400) Subject: switch readahead(2) to fget_light() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=132ea2479f77dd598f11a77bdfebbd23d244ce6f;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git switch readahead(2) to fget_light() Signed-off-by: Al Viro --- diff --git a/mm/readahead.c b/mm/readahead.c index ea8f8fa21649..1011111e2bf4 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -580,9 +580,10 @@ SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count) { ssize_t ret; struct file *file; + int fput_needed; ret = -EBADF; - file = fget(fd); + file = fget_light(fd, &fput_needed); if (file) { if (file->f_mode & FMODE_READ) { struct address_space *mapping = file->f_mapping; @@ -591,7 +592,7 @@ SYSCALL_DEFINE(readahead)(int fd, loff_t offset, size_t count) unsigned long len = end - start + 1; ret = do_readahead(mapping, file, start, len); } - fput(file); + fput_light(file, fput_needed); } return ret; }