diff options
| author | Linus Torvalds <[email protected]> | 2024-09-23 16:35:36 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2024-09-23 16:35:36 +0000 |
| commit | f8ffbc365f703d74ecca8ca787318d05bbee2bf7 (patch) | |
| tree | cdb3e023473e02a186b39fe541eb719ed2ffcb7f /fs/kernel_read_file.c | |
| parent | mm: fix build on 32-bit targets without MAX_PHYSMEM_BITS (diff) | |
| parent | add struct fd constructors, get rid of __to_fd() (diff) | |
| download | kernel-f8ffbc365f703d74ecca8ca787318d05bbee2bf7.tar.gz kernel-f8ffbc365f703d74ecca8ca787318d05bbee2bf7.zip | |
Merge tag 'pull-stable-struct_fd' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull 'struct fd' updates from Al Viro:
"Just the 'struct fd' layout change, with conversion to accessor
helpers"
* tag 'pull-stable-struct_fd' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
add struct fd constructors, get rid of __to_fd()
struct fd: representation change
introduce fd_file(), convert all accessors to it.
Diffstat (limited to 'fs/kernel_read_file.c')
| -rw-r--r-- | fs/kernel_read_file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/kernel_read_file.c b/fs/kernel_read_file.c index c429c42a6867..9ff37ae650ea 100644 --- a/fs/kernel_read_file.c +++ b/fs/kernel_read_file.c @@ -178,10 +178,10 @@ ssize_t kernel_read_file_from_fd(int fd, loff_t offset, void **buf, struct fd f = fdget(fd); ssize_t ret = -EBADF; - if (!f.file || !(f.file->f_mode & FMODE_READ)) + if (!fd_file(f) || !(fd_file(f)->f_mode & FMODE_READ)) goto out; - ret = kernel_read_file(f.file, offset, buf, buf_size, file_size, id); + ret = kernel_read_file(fd_file(f), offset, buf, buf_size, file_size, id); out: fdput(f); return ret; |
