fs: use backing_file container for internal files with "fake" f_path
authorAmir Goldstein <amir73il@gmail.com>
Thu, 15 Jun 2023 11:22:28 +0000 (14:22 +0300)
committerChristian Brauner <brauner@kernel.org>
Mon, 19 Jun 2023 16:16:38 +0000 (18:16 +0200)
commit62d53c4a1dfe347bd87ede46ffad38c9a3870338
tree50bf37201de8a425c8e4cc23b1be69bde2e4b6eb
parent8a05a8c31d06c5d0d67b273a4a00f87269adde82
fs: use backing_file container for internal files with "fake" f_path

Overlayfs uses open_with_fake_path() to allocate internal kernel files,
with a "fake" path - whose f_path is not on the same fs as f_inode.

Allocate a container struct backing_file for those internal files, that
is used to hold the "fake" ovl path along with the real path.

backing_file_real_path() can be used to access the stored real path.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Message-Id: <20230615112229.2143178-5-amir73il@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/file_table.c
fs/internal.h
fs/open.c
fs/overlayfs/file.c
include/linux/fs.h