diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2018-05-16 17:51:25 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-05-31 11:06:11 +0200 |
commit | 95a1c8153ad8bc99e7c4b90257f20b4f0474a9a0 (patch) | |
tree | da1fadaf2b5e9c96cab3225e596641595f0600ad /fs/overlayfs/copy_up.c | |
parent | 471ec5dcf4e712ea81bf431a57c98d4b67416d30 (diff) |
ovl: return dentry from ovl_create_real()
Al Viro suggested to simplify callers of ovl_create_real() by
returning the created dentry (or ERR_PTR) from ovl_create_real().
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/copy_up.c')
-rw-r--r-- | fs/overlayfs/copy_up.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c index 5f4c78b1bbeb..d3e9c1eeb7a4 100644 --- a/fs/overlayfs/copy_up.c +++ b/fs/overlayfs/copy_up.c @@ -502,19 +502,12 @@ static int ovl_get_tmpfile(struct ovl_copy_up_ctx *c, struct dentry **tempp) if (c->tmpfile) { temp = ovl_do_tmpfile(c->workdir, c->stat.mode); - if (IS_ERR(temp)) - goto temp_err; } else { - temp = ovl_lookup_temp(c->workdir); - if (IS_ERR(temp)) - goto temp_err; - - err = ovl_create_real(d_inode(c->workdir), temp, &cattr); - if (err) { - dput(temp); - goto out; - } + temp = ovl_create_real(d_inode(c->workdir), + ovl_lookup_temp(c->workdir), &cattr); } + if (IS_ERR(temp)) + goto temp_err; err = 0; *tempp = temp; out: |