Commit e4599d4b authored by Amir Goldstein's avatar Amir Goldstein

ovl: negate the ofs->share_whiteout boolean

The default common case is that whiteout sharing is enabled.
Change to storing the negated no_shared_whiteout state, so we will not
need to initialize it.

This is the first step towards removing all config and feature
initializations out of ovl_fill_super().
Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
parent f723edb8
...@@ -83,7 +83,7 @@ static struct dentry *ovl_whiteout(struct ovl_fs *ofs) ...@@ -83,7 +83,7 @@ static struct dentry *ovl_whiteout(struct ovl_fs *ofs)
ofs->whiteout = whiteout; ofs->whiteout = whiteout;
} }
if (ofs->share_whiteout) { if (!ofs->no_shared_whiteout) {
whiteout = ovl_lookup_temp(ofs, workdir); whiteout = ovl_lookup_temp(ofs, workdir);
if (IS_ERR(whiteout)) if (IS_ERR(whiteout))
goto out; goto out;
...@@ -95,7 +95,7 @@ static struct dentry *ovl_whiteout(struct ovl_fs *ofs) ...@@ -95,7 +95,7 @@ static struct dentry *ovl_whiteout(struct ovl_fs *ofs)
if (err != -EMLINK) { if (err != -EMLINK) {
pr_warn("Failed to link whiteout - disabling whiteout inode sharing(nlink=%u, err=%i)\n", pr_warn("Failed to link whiteout - disabling whiteout inode sharing(nlink=%u, err=%i)\n",
ofs->whiteout->d_inode->i_nlink, err); ofs->whiteout->d_inode->i_nlink, err);
ofs->share_whiteout = false; ofs->no_shared_whiteout = true;
} }
dput(whiteout); dput(whiteout);
} }
......
...@@ -86,7 +86,6 @@ struct ovl_fs { ...@@ -86,7 +86,6 @@ struct ovl_fs {
/* Did we take the inuse lock? */ /* Did we take the inuse lock? */
bool upperdir_locked; bool upperdir_locked;
bool workdir_locked; bool workdir_locked;
bool share_whiteout;
/* Traps in ovl inode cache */ /* Traps in ovl inode cache */
struct inode *workbasedir_trap; struct inode *workbasedir_trap;
struct inode *workdir_trap; struct inode *workdir_trap;
...@@ -95,8 +94,9 @@ struct ovl_fs { ...@@ -95,8 +94,9 @@ struct ovl_fs {
int xino_mode; int xino_mode;
/* For allocation of non-persistent inode numbers */ /* For allocation of non-persistent inode numbers */
atomic_long_t last_ino; atomic_long_t last_ino;
/* Whiteout dentry cache */ /* Shared whiteout cache */
struct dentry *whiteout; struct dentry *whiteout;
bool no_shared_whiteout;
/* r/o snapshot of upperdir sb's only taken on volatile mounts */ /* r/o snapshot of upperdir sb's only taken on volatile mounts */
errseq_t errseq; errseq_t errseq;
}; };
......
...@@ -1954,9 +1954,6 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent) ...@@ -1954,9 +1954,6 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
if (!cred) if (!cred)
goto out_err; goto out_err;
/* Is there a reason anyone would want not to share whiteouts? */
ofs->share_whiteout = true;
ofs->config.index = ovl_index_def; ofs->config.index = ovl_index_def;
ofs->config.uuid = true; ofs->config.uuid = true;
ofs->config.nfs_export = ovl_nfs_export_def; ofs->config.nfs_export = ovl_nfs_export_def;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment