summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/util.c
diff options
context:
space:
mode:
authorAmir Goldstein2017-03-22 13:42:21 +0100
committerMiklos Szeredi2017-05-05 11:38:57 +0200
commit7bcd74b98d7bac3e5149894caaf72de6989af7f0 (patch)
tree0b7b0bb5dd7848ad6572b50d64ad81059e2b5fae /fs/overlayfs/util.c
parentovl: do not set overlay.opaque on non-dir create (diff)
downloadkernel-qcow2-linux-7bcd74b98d7bac3e5149894caaf72de6989af7f0.tar.gz
kernel-qcow2-linux-7bcd74b98d7bac3e5149894caaf72de6989af7f0.tar.xz
kernel-qcow2-linux-7bcd74b98d7bac3e5149894caaf72de6989af7f0.zip
ovl: check if all layers are on the same fs
Some features can only work when all layers are on the same fs. Test this condition during mount time, so features can check them later. Add helper ovl_same_sb() to return the common super block in case all layers are on the same fs. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/util.c')
-rw-r--r--fs/overlayfs/util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index 35b8959db5ee..2bd4c264ccbe 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -41,6 +41,13 @@ const struct cred *ovl_override_creds(struct super_block *sb)
return override_creds(ofs->creator_cred);
}
+struct super_block *ovl_same_sb(struct super_block *sb)
+{
+ struct ovl_fs *ofs = sb->s_fs_info;
+
+ return ofs->same_sb;
+}
+
struct ovl_entry *ovl_alloc_entry(unsigned int numlower)
{
size_t size = offsetof(struct ovl_entry, lowerstack[numlower]);