diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-09-26 06:55:26 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-01-24 11:25:54 +0100 |
commit | 24b33ee104ecd5a4e1e71412f8966199d6a0bf02 (patch) | |
tree | 05d5e761abe8c637a4e93e5d1700c3e863757d52 /fs/overlayfs/copy_up.c | |
parent | ovl: cleanup temp index entries (diff) | |
download | linux-24b33ee104ecd5a4e1e71412f8966199d6a0bf02.tar.xz linux-24b33ee104ecd5a4e1e71412f8966199d6a0bf02.zip |
ovl: create ovl_need_index() helper
The helper determines which lower file needs to be indexed
on copy up and before nlink changes.
For index=on, the helper evaluates to true for lower hardlinks.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/copy_up.c')
-rw-r--r-- | fs/overlayfs/copy_up.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c index 503c92404095..103e62dcb745 100644 --- a/fs/overlayfs/copy_up.c +++ b/fs/overlayfs/copy_up.c @@ -536,11 +536,7 @@ static int ovl_do_copy_up(struct ovl_copy_up_ctx *c) { int err; struct ovl_fs *ofs = c->dentry->d_sb->s_fs_info; - bool indexed = false; - - if (ovl_indexdir(c->dentry->d_sb) && !S_ISDIR(c->stat.mode) && - c->stat.nlink > 1) - indexed = true; + bool indexed = ovl_need_index(c->dentry); if (S_ISDIR(c->stat.mode) || c->stat.nlink == 1 || indexed) c->origin = true; |