if (IS_ERR(temp))
goto temp_err;
- err = ovl_do_mkdir(dir, temp, S_IFDIR, true);
+ err = ovl_do_mkdir(dir, temp, S_IFDIR);
if (err)
goto out;
c->dentry->d_name.len);
err = PTR_ERR(upper);
if (!IS_ERR(upper)) {
- err = ovl_do_link(ovl_dentry_upper(c->dentry), udir, upper,
- true);
+ err = ovl_do_link(ovl_dentry_upper(c->dentry), udir, upper);
dput(upper);
if (!err) {
return PTR_ERR(upper);
if (c->tmpfile)
- err = ovl_do_link(temp, udir, upper, true);
+ err = ovl_do_link(temp, udir, upper);
else
err = ovl_do_rename(d_inode(c->workdir), temp, udir, upper, 0);
goto temp_err;
err = ovl_create_real(d_inode(c->workdir), temp, &cattr,
- NULL, true);
+ NULL);
if (err) {
dput(temp);
goto out;
}
int ovl_create_real(struct inode *dir, struct dentry *newdentry,
- struct cattr *attr, struct dentry *hardlink, bool debug)
+ struct cattr *attr, struct dentry *hardlink)
{
int err;
return -ESTALE;
if (hardlink) {
- err = ovl_do_link(hardlink, dir, newdentry, debug);
+ err = ovl_do_link(hardlink, dir, newdentry);
} else {
switch (attr->mode & S_IFMT) {
case S_IFREG:
- err = ovl_do_create(dir, newdentry, attr->mode, debug);
+ err = ovl_do_create(dir, newdentry, attr->mode);
break;
case S_IFDIR:
- err = ovl_do_mkdir(dir, newdentry, attr->mode, debug);
+ err = ovl_do_mkdir(dir, newdentry, attr->mode);
break;
case S_IFCHR:
case S_IFBLK:
case S_IFIFO:
case S_IFSOCK:
- err = ovl_do_mknod(dir, newdentry,
- attr->mode, attr->rdev, debug);
+ err = ovl_do_mknod(dir, newdentry, attr->mode,
+ attr->rdev);
break;
case S_IFLNK:
- err = ovl_do_symlink(dir, newdentry, attr->link, debug);
+ err = ovl_do_symlink(dir, newdentry, attr->link);
break;
default:
err = PTR_ERR(newdentry);
if (IS_ERR(newdentry))
goto out_unlock;
- err = ovl_create_real(udir, newdentry, attr, hardlink, false);
+ err = ovl_create_real(udir, newdentry, attr, hardlink);
if (err)
goto out_dput;
goto out_unlock;
err = ovl_create_real(wdir, opaquedir,
- &(struct cattr){.mode = stat.mode}, NULL, true);
+ &(struct cattr){.mode = stat.mode}, NULL);
if (err)
goto out_dput;
if (IS_ERR(upper))
goto out_dput;
- err = ovl_create_real(wdir, newdentry, cattr, hardlink, true);
+ err = ovl_create_real(wdir, newdentry, cattr, hardlink);
if (err)
goto out_dput2;
static inline int ovl_do_rmdir(struct inode *dir, struct dentry *dentry)
{
int err = vfs_rmdir(dir, dentry);
+
pr_debug("rmdir(%pd2) = %i\n", dentry, err);
return err;
}
static inline int ovl_do_unlink(struct inode *dir, struct dentry *dentry)
{
int err = vfs_unlink(dir, dentry, NULL);
+
pr_debug("unlink(%pd2) = %i\n", dentry, err);
return err;
}
static inline int ovl_do_link(struct dentry *old_dentry, struct inode *dir,
- struct dentry *new_dentry, bool debug)
+ struct dentry *new_dentry)
{
int err = vfs_link(old_dentry, dir, new_dentry, NULL);
- if (debug) {
- pr_debug("link(%pd2, %pd2) = %i\n",
- old_dentry, new_dentry, err);
- }
+
+ pr_debug("link(%pd2, %pd2) = %i\n", old_dentry, new_dentry, err);
return err;
}
static inline int ovl_do_create(struct inode *dir, struct dentry *dentry,
- umode_t mode, bool debug)
+ umode_t mode)
{
int err = vfs_create(dir, dentry, mode, true);
- if (debug)
- pr_debug("create(%pd2, 0%o) = %i\n", dentry, mode, err);
+
+ pr_debug("create(%pd2, 0%o) = %i\n", dentry, mode, err);
return err;
}
static inline int ovl_do_mkdir(struct inode *dir, struct dentry *dentry,
- umode_t mode, bool debug)
+ umode_t mode)
{
int err = vfs_mkdir(dir, dentry, mode);
- if (debug)
- pr_debug("mkdir(%pd2, 0%o) = %i\n", dentry, mode, err);
+ pr_debug("mkdir(%pd2, 0%o) = %i\n", dentry, mode, err);
return err;
}
static inline int ovl_do_mknod(struct inode *dir, struct dentry *dentry,
- umode_t mode, dev_t dev, bool debug)
+ umode_t mode, dev_t dev)
{
int err = vfs_mknod(dir, dentry, mode, dev);
- if (debug) {
- pr_debug("mknod(%pd2, 0%o, 0%o) = %i\n",
- dentry, mode, dev, err);
- }
+
+ pr_debug("mknod(%pd2, 0%o, 0%o) = %i\n", dentry, mode, dev, err);
return err;
}
static inline int ovl_do_symlink(struct inode *dir, struct dentry *dentry,
- const char *oldname, bool debug)
+ const char *oldname)
{
int err = vfs_symlink(dir, dentry, oldname);
- if (debug)
- pr_debug("symlink(\"%s\", %pd2) = %i\n", oldname, dentry, err);
+
+ pr_debug("symlink(\"%s\", %pd2) = %i\n", oldname, dentry, err);
return err;
}
{
int err;
- pr_debug("rename(%pd2, %pd2, 0x%x)\n",
- olddentry, newdentry, flags);
-
+ pr_debug("rename(%pd2, %pd2, 0x%x)\n", olddentry, newdentry, flags);
err = vfs_rename(olddir, olddentry, newdir, newdentry, NULL, flags);
-
if (err) {
pr_debug("...rename(%pd2, %pd2, ...) = %i\n",
olddentry, newdentry, err);
};
int ovl_create_real(struct inode *dir, struct dentry *newdentry,
struct cattr *attr,
- struct dentry *hardlink, bool debug);
+ struct dentry *hardlink);
int ovl_cleanup(struct inode *dir, struct dentry *dentry);
/* copy_up.c */