diff options
author | Amir Goldstein <amir73il@gmail.com> | 2023-11-19 19:55:00 +0100 |
---|---|---|
committer | Amir Goldstein <amir73il@gmail.com> | 2023-11-20 08:49:09 +0100 |
commit | 02d70090e0e020eff440dbe51e93fe2fc94d9835 (patch) | |
tree | add479ba3fd8b3c9010654e24d8ae929660b2516 /fs/overlayfs/readdir.c | |
parent | Linux 6.7-rc2 (diff) | |
download | linux-02d70090e0e020eff440dbe51e93fe2fc94d9835.tar.xz linux-02d70090e0e020eff440dbe51e93fe2fc94d9835.zip |
ovl: remove redundant ofs->indexdir member
When the index feature is disabled, ofs->indexdir is NULL.
When the index feature is enabled, ofs->indexdir has the same value as
ofs->workdir and takes an extra reference.
This makes the code harder to understand when it is not always clear
that ofs->indexdir in one function is the same dentry as ofs->workdir
in another function.
Remove this redundancy, by referencing ofs->workdir directly in index
helpers and by using the ovl_indexdir() accessor in generic code.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Diffstat (limited to 'fs/overlayfs/readdir.c')
-rw-r--r-- | fs/overlayfs/readdir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c index a490fc47c3e7..e71156baa7bc 100644 --- a/fs/overlayfs/readdir.c +++ b/fs/overlayfs/readdir.c @@ -1169,7 +1169,7 @@ int ovl_workdir_cleanup(struct ovl_fs *ofs, struct inode *dir, int ovl_indexdir_cleanup(struct ovl_fs *ofs) { int err; - struct dentry *indexdir = ofs->indexdir; + struct dentry *indexdir = ofs->workdir; struct dentry *index = NULL; struct inode *dir = indexdir->d_inode; struct path path = { .mnt = ovl_upper_mnt(ofs), .dentry = indexdir }; |