bool ovl_need_index(struct dentry *dentry);
int ovl_nlink_start(struct dentry *dentry);
void ovl_nlink_end(struct dentry *dentry);
-int ovl_lock_rename_workdir(struct dentry *workdir, struct dentry *work,
- struct dentry *upperdir, struct dentry *upper);
int ovl_check_metacopy_xattr(struct ovl_fs *ofs, const struct path *path,
struct ovl_metacopy *data);
int ovl_set_metacopy_xattr(struct ovl_fs *ofs, struct dentry *d,
ovl_inode_unlock(inode);
}
-int ovl_lock_rename_workdir(struct dentry *workdir, struct dentry *work,
- struct dentry *upperdir, struct dentry *upper)
-{
- struct dentry *trap;
-
- /* Workdir should not be subdir of upperdir and vice versa */
- trap = lock_rename(workdir, upperdir);
- if (IS_ERR(trap))
- goto err;
- if (trap)
- goto err_unlock;
- if (work && (work->d_parent != workdir || d_unhashed(work)))
- goto err_unlock;
- if (upper && (upper->d_parent != upperdir || d_unhashed(upper)))
- goto err_unlock;
-
- return 0;
-
-err_unlock:
- unlock_rename(workdir, upperdir);
-err:
- pr_err("failed to lock workdir+upperdir\n");
- return -EIO;
-}
-
/*
* err < 0, 0 if no metacopy xattr, metacopy data size if xattr found.
* an empty xattr returns OVL_METACOPY_MIN_SIZE to distinguish from no xattr value.