fs: use a helper for opening kernel internal files
authorAmir Goldstein <amir73il@gmail.com>
Thu, 15 Jun 2023 11:22:26 +0000 (14:22 +0300)
committerChristian Brauner <brauner@kernel.org>
Mon, 19 Jun 2023 16:11:58 +0000 (18:11 +0200)
commitcbb0b9d4bbcfa96e7872808a63be03202536f1bc
tree065d10cee8d5fbdb6452671d4bfe980b4cc3f9e7
parentd56e0ddb8fc35a7aa13ab8f21c499a34f45dda05
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>
fs/cachefiles/namei.c
fs/open.c
include/linux/fs.h