summaryrefslogtreecommitdiff
path: root/fs/overlayfs/dir.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2016-12-16 13:02:55 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2016-12-16 13:02:55 +0300
commitc412ce498396097cb96b3e24e062752312a962c9 (patch)
tree607029b78cb046e211919cfc6f7cc796a0ad44c9 /fs/overlayfs/dir.c
parent99f5d08e3640c8319f353e6c883da150c48067f6 (diff)
downloadlinux-c412ce498396097cb96b3e24e062752312a962c9.tar.xz
ovl: add ovl_dentry_is_whiteout()
And use it instead of ovl_dentry_is_opaque() where appropriate. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/dir.c')
-rw-r--r--fs/overlayfs/dir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
index fdc7b14ab571..b559221b2d34 100644
--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -504,7 +504,7 @@ static int ovl_create_or_link(struct dentry *dentry, struct inode *inode,
put_cred(override_creds(override_cred));
put_cred(override_cred);
- if (!ovl_dentry_is_opaque(dentry))
+ if (!ovl_dentry_is_whiteout(dentry))
err = ovl_create_upper(dentry, inode, stat, link,
hardlink);
else
@@ -842,14 +842,14 @@ static int ovl_rename(struct inode *olddir, struct dentry *old,
if (overwrite) {
if (old_opaque) {
- if (new->d_inode || !new_opaque) {
+ if (!ovl_dentry_is_whiteout(new)) {
/* Whiteout source */
flags |= RENAME_WHITEOUT;
} else {
/* Switch whiteouts */
flags |= RENAME_EXCHANGE;
}
- } else if (is_dir && !new->d_inode && new_opaque) {
+ } else if (is_dir && ovl_dentry_is_whiteout(new)) {
flags |= RENAME_EXCHANGE;
cleanup_whiteout = true;
}