summaryrefslogtreecommitdiff
path: root/fs/aufs/cpup.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/aufs/cpup.c')
-rw-r--r--fs/aufs/cpup.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/fs/aufs/cpup.c b/fs/aufs/cpup.c
index dbf96fd60..52f87de63 100644
--- a/fs/aufs/cpup.c
+++ b/fs/aufs/cpup.c
@@ -1087,23 +1087,27 @@ static int au_do_cpup_wh(struct au_cp_generic *cpg, struct dentry *wh_dentry,
int err;
unsigned int flags_orig;
aufs_bindex_t bsrc_orig;
- struct dentry *h_d_dst, *h_d_start;
struct au_dinfo *dinfo;
- struct au_hdentry *hdp;
+ struct {
+ struct au_hdentry *hd;
+ struct dentry *h_dentry;
+ } hdst, hsrc;
dinfo = au_di(cpg->dentry);
AuRwMustWriteLock(&dinfo->di_rwsem);
bsrc_orig = cpg->bsrc;
cpg->bsrc = dinfo->di_btop;
- hdp = dinfo->di_hdentry;
- h_d_dst = hdp[0 + cpg->bdst].hd_dentry;
+ hdst.hd = au_hdentry(dinfo, cpg->bdst);
+ hdst.h_dentry = hdst.hd->hd_dentry;
+ hdst.hd->hd_dentry = wh_dentry;
dinfo->di_btop = cpg->bdst;
- hdp[0 + cpg->bdst].hd_dentry = wh_dentry;
- h_d_start = NULL;
+
+ hsrc.h_dentry = NULL;
if (file) {
- h_d_start = hdp[0 + cpg->bsrc].hd_dentry;
- hdp[0 + cpg->bsrc].hd_dentry = au_hf_top(file)->f_path.dentry;
+ hsrc.hd = au_hdentry(dinfo, cpg->bsrc);
+ hsrc.h_dentry = hsrc.hd->hd_dentry;
+ hsrc.hd->hd_dentry = au_hf_top(file)->f_path.dentry;
}
flags_orig = cpg->flags;
cpg->flags = !AuCpup_DTIME;
@@ -1112,9 +1116,9 @@ static int au_do_cpup_wh(struct au_cp_generic *cpg, struct dentry *wh_dentry,
if (file) {
if (!err)
err = au_reopen_nondir(file);
- hdp[0 + cpg->bsrc].hd_dentry = h_d_start;
+ hsrc.hd->hd_dentry = hsrc.h_dentry;
}
- hdp[0 + cpg->bdst].hd_dentry = h_d_dst;
+ hdst.hd->hd_dentry = hdst.h_dentry;
dinfo->di_btop = cpg->bsrc;
cpg->bsrc = bsrc_orig;