summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/ovl_entry.h
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2023-04-27 11:21:46 +0200
committerAmir Goldstein <amir73il@gmail.com>2023-06-19 13:01:14 +0200
commit2b21da920866ad20b5e3119f3b8d2267774b7b0a (patch)
tree93b2c8fd6d67615cabfef1de618ec9bc73343c22 /fs/overlayfs/ovl_entry.h
parentovl: implement lookup in data-only layers (diff)
downloadlinux-2b21da920866ad20b5e3119f3b8d2267774b7b0a.tar.xz
linux-2b21da920866ad20b5e3119f3b8d2267774b7b0a.zip
ovl: prepare to store lowerdata redirect for lazy lowerdata lookup
Prepare to allow ovl_lookup() to leave the last entry in a non-dir lowerstack empty to signify lazy lowerdata lookup. In this case, ovl_lookup() stores the redirect path from metacopy to lowerdata in ovl_inode, which is going to be used later to perform the lazy lowerdata lookup. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/ovl_entry.h')
-rw-r--r--fs/overlayfs/ovl_entry.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/overlayfs/ovl_entry.h b/fs/overlayfs/ovl_entry.h
index 93ff299da0dd..513c2c499e41 100644
--- a/fs/overlayfs/ovl_entry.h
+++ b/fs/overlayfs/ovl_entry.h
@@ -141,6 +141,7 @@ static inline struct ovl_path *ovl_lowerdata(struct ovl_entry *oe)
return lowerstack ? &lowerstack[oe->__numlower - 1] : NULL;
}
+/* May return NULL if lazy lookup of lowerdata is needed */
static inline struct dentry *ovl_lowerdata_dentry(struct ovl_entry *oe)
{
struct ovl_path *lowerdata = ovl_lowerdata(oe);
@@ -157,7 +158,7 @@ static inline unsigned long *OVL_E_FLAGS(struct dentry *dentry)
struct ovl_inode {
union {
struct ovl_dir_cache *cache; /* directory */
- /* place holder for non-dir */ /* regular file */
+ const char *lowerdata_redirect; /* regular file */
};
const char *redirect;
u64 version;