diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2025-01-18 01:44:34 +0000 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-02-21 10:25:31 +0100 |
| commit | f9835fa147e6adebd342e88a517c158f6ad20b9a (patch) | |
| tree | 25905eeba3e2329b91aff2c515e30b23beb0c1c0 /fs/cachefiles | |
| parent | Merge patch series "CONFIG_DEBUG_VFS at last" (diff) | |
| download | linux-f9835fa147e6adebd342e88a517c158f6ad20b9a.tar.gz linux-f9835fa147e6adebd342e88a517c158f6ad20b9a.zip | |
make use of anon_inode_getfile_fmode()
["fallen through the cracks" misc stuff]
A bunch of anon_inode_getfile() callers follow it with adjusting
->f_mode; we have a helper doing that now, so let's make use
of it.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Link: https://lore.kernel.org/r/20250118014434.GT1977892@ZenIV
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/cachefiles')
| -rw-r--r-- | fs/cachefiles/ondemand.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/cachefiles/ondemand.c b/fs/cachefiles/ondemand.c index fe3de9ad57bf..d9bc67176128 100644 --- a/fs/cachefiles/ondemand.c +++ b/fs/cachefiles/ondemand.c @@ -317,8 +317,9 @@ static int cachefiles_ondemand_get_fd(struct cachefiles_req *req, goto err_free_id; } - anon_file->file = anon_inode_getfile("[cachefiles]", - &cachefiles_ondemand_fd_fops, object, O_WRONLY); + anon_file->file = anon_inode_getfile_fmode("[cachefiles]", + &cachefiles_ondemand_fd_fops, object, + O_WRONLY, FMODE_PWRITE | FMODE_LSEEK); if (IS_ERR(anon_file->file)) { ret = PTR_ERR(anon_file->file); goto err_put_fd; @@ -333,8 +334,6 @@ static int cachefiles_ondemand_get_fd(struct cachefiles_req *req, goto err_put_file; } - anon_file->file->f_mode |= FMODE_PWRITE | FMODE_LSEEK; - load = (void *)req->msg.data; load->fd = anon_file->fd; object->ondemand->ondemand_id = object_id; |
