diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-11-08 20:23:36 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-01-24 12:19:25 +0300 |
commit | d583ed7d138825fd9469d5419e23230ad39173e8 (patch) | |
tree | 2da4bca9cba146bedead26fff6355b987a44b858 /fs/overlayfs/namei.c | |
parent | 972d0093c2f7b1bd57e47a1780a552dde528fd16 (diff) | |
download | linux-d583ed7d138825fd9469d5419e23230ad39173e8.tar.xz |
ovl: store layer index in ovl_layer
Store the fs root layer index inside ovl_layer struct, so we can
get the root fs layer index from merge dir lower layer instead of
find it with ovl_find_layer() helper.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/namei.c')
-rw-r--r-- | fs/overlayfs/namei.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index 69f4f19659fc..a38db76cbccd 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -572,18 +572,6 @@ int ovl_path_next(int idx, struct dentry *dentry, struct path *path) return (idx < oe->numlower) ? idx + 1 : -1; } -static int ovl_find_layer(struct ovl_fs *ofs, struct ovl_path *path) -{ - int i; - - for (i = 0; i < ofs->numlower; i++) { - if (ofs->lower_layers[i].mnt == path->layer->mnt) - break; - } - - return i; -} - /* Fix missing 'origin' xattr */ static int ovl_fix_origin(struct dentry *dentry, struct dentry *lower, struct dentry *upper) @@ -733,11 +721,8 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry, if (d.redirect && d.redirect[0] == '/' && poe != roe) { poe = roe; - /* Find the current layer on the root dentry */ - i = ovl_find_layer(ofs, &lower); - if (WARN_ON(i == ofs->numlower)) - break; + i = lower.layer->idx - 1; } } |