diff options
author | Amir Goldstein <amir73il@gmail.com> | 2023-04-27 11:48:46 +0200 |
---|---|---|
committer | Amir Goldstein <amir73il@gmail.com> | 2023-06-19 13:01:13 +0200 |
commit | 37ebf056d6cfc6638c821386bc33a9602bbc0d28 (patch) | |
tree | 6afbbc69d724e289a11e7985c3d991986810ccb5 /fs/overlayfs/ovl_entry.h | |
parent | ovl: remove unneeded goto instructions (diff) | |
download | linux-37ebf056d6cfc6638c821386bc33a9602bbc0d28.tar.xz linux-37ebf056d6cfc6638c821386bc33a9602bbc0d28.zip |
ovl: introduce data-only lower layers
Introduce the format lowerdir=lower1:lower2::lowerdata1::lowerdata2
where the lower layers on the right of the :: separators are not merged
into the overlayfs merge dirs.
Data-only lower layers are only allowed at the bottom of the stack.
The files in those layers are only meant to be accessible via absolute
redirect from metacopy files in lower layers. Following changes will
implement lookup in the data layers.
This feature was requested for composefs ostree use case, where the
lower data layer should only be accessiable via absolute redirects
from metacopy inodes.
The lower data layers are not required to a have a unique uuid or any
uuid at all, because they are never used to compose the overlayfs inode
st_ino/st_dev.
Reviewed-by: Alexander Larsson <alexl@redhat.com>
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.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/overlayfs/ovl_entry.h b/fs/overlayfs/ovl_entry.h index 548c93e030fc..93ff299da0dd 100644 --- a/fs/overlayfs/ovl_entry.h +++ b/fs/overlayfs/ovl_entry.h @@ -57,6 +57,8 @@ struct ovl_fs { unsigned int numlayer; /* Number of unique fs among layers including upper fs */ unsigned int numfs; + /* Number of data-only lower layers */ + unsigned int numdatalayer; const struct ovl_layer *layers; struct ovl_sb *fs; /* workbasedir is the path at workdir= mount option */ @@ -90,6 +92,13 @@ struct ovl_fs { errseq_t errseq; }; + +/* Number of lower layers, not including data-only layers */ +static inline unsigned int ovl_numlowerlayer(struct ovl_fs *ofs) +{ + return ofs->numlayer - ofs->numdatalayer - 1; +} + static inline struct vfsmount *ovl_upper_mnt(struct ovl_fs *ofs) { return ofs->layers[0].mnt; |