Skip to content

Commit

Permalink
switch fallocate(2) to fget_light()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Sep 27, 2012
1 parent bf2965d commit 6b48c5b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,12 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
SYSCALL_DEFINE(fallocate)(int fd, int mode, loff_t offset, loff_t len)
{
struct file *file;
int error = -EBADF;
int error = -EBADF, fput_needed;

file = fget(fd);
file = fget_light(fd, &fput_needed);
if (file) {
error = do_fallocate(file, mode, offset, len);
fput(file);
fput_light(file, fput_needed);
}

return error;
Expand Down

0 comments on commit 6b48c5b

Please sign in to comment.