aboutsummaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/util.c
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2019-11-16 18:14:41 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2020-01-24 09:46:45 +0100
commit0f831ec85eda1ae27490baba106aba632c1d8e94 (patch)
treef97b25b2abf25f78fb98a3763dee228667fd8665 /fs/overlayfs/util.c
parentovl: generalize the lower_layers[] array (diff)
downloadlinux-dev-0f831ec85eda1ae27490baba106aba632c1d8e94.tar.xz
linux-dev-0f831ec85eda1ae27490baba106aba632c1d8e94.zip
ovl: simplify ovl_same_sb() helper
No code uses the sb returned from this helper, so make it retrun a boolean and rename it to ovl_same_fs(). The xino mode is irrelevant when all layers are on same fs, so instead of describing samefs with mode OVL_XINO_OFF, use a new xino_mode state, which is 0 in the case of samefs, -1 in the case of xino=off and > 0 with xino enabled. Create a new helper ovl_same_dev(), to use instead of the common check for (ovl_same_fs() || xinobits). 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.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index cb4a5eaf0ba5..df503a8c6bcf 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -40,18 +40,6 @@ 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;
-
- if (!ofs->numlowerfs)
- return ofs->upper_mnt->mnt_sb;
- else if (ofs->numlowerfs == 1 && !ofs->upper_mnt)
- return ofs->lower_fs[0].sb;
- else
- return NULL;
-}
-
/*
* Check if underlying fs supports file handles and try to determine encoding
* type, in order to deduce maximum inode number used by fs.