diff options
author | Amir Goldstein <amir73il@gmail.com> | 2023-06-15 13:22:26 +0200 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2023-06-19 18:11:58 +0200 |
commit | cbb0b9d4bbcfa96e7872808a63be03202536f1bc (patch) | |
tree | 065d10cee8d5fbdb6452671d4bfe980b4cc3f9e7 /fs/cachefiles | |
parent | fs: rename {vfs,kernel}_tmpfile_open() (diff) | |
download | linux-cbb0b9d4bbcfa96e7872808a63be03202536f1bc.tar.xz linux-cbb0b9d4bbcfa96e7872808a63be03202536f1bc.zip |
fs: use a helper for opening kernel internal files
cachefiles uses kernel_open_tmpfile() to open kernel internal tmpfile
without accounting for nr_files.
cachefiles uses open_with_fake_path() for the same reason without the
need for a fake path.
Fork open_with_fake_path() to kernel_file_open() which only does the
noaccount part and use it in cachefiles.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Message-Id: <20230615112229.2143178-3-amir73il@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/cachefiles')
-rw-r--r-- | fs/cachefiles/namei.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c index 6c7d4e97c219..499cf73f097b 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c @@ -560,8 +560,8 @@ static bool cachefiles_open_file(struct cachefiles_object *object, */ path.mnt = cache->mnt; path.dentry = dentry; - file = open_with_fake_path(&path, O_RDWR | O_LARGEFILE | O_DIRECT, - d_backing_inode(dentry), cache->cache_cred); + file = kernel_file_open(&path, O_RDWR | O_LARGEFILE | O_DIRECT, + d_backing_inode(dentry), cache->cache_cred); if (IS_ERR(file)) { trace_cachefiles_vfs_error(object, d_backing_inode(dentry), PTR_ERR(file), |