* Documentation/filesystems/unionfs/concepts.txt
*/
-/* forward definitions */
-static struct dentry *create_parents_named(struct inode *dir,
- struct dentry *dentry,
- const char *name, int bindex);
-
#ifdef CONFIG_UNION_FS_XATTR
/* copyup all extended attrs for a given dentry */
static int copyup_xattrs(struct dentry *old_hidden_dentry,
goto out;
/* Create the directory structure above this dentry. */
- new_hidden_dentry =
- create_parents_named(dir, dentry, name, new_bindex);
+ new_hidden_dentry = create_parents(dir, dentry, name, new_bindex);
if (IS_ERR(new_hidden_dentry)) {
err = PTR_ERR(new_hidden_dentry);
goto out;
return err;
}
-/*
- * This function replicates the directory structure up-to given dentry in the
- * bindex branch. Can create directory structure recursively to the right
- * also.
- */
-struct dentry *create_parents(struct inode *dir, struct dentry *dentry,
- int bindex)
-{
- return create_parents_named(dir, dentry, dentry->d_name.name, bindex);
-}
-
/* purge a dentry's lower-branch states (dput/mntput, etc.) */
static void __cleanup_dentry(struct dentry *dentry, int bindex,
int old_bstart, int old_bend)
* This function replicates the directory structure up-to given dentry
* in the bindex branch.
*/
-static struct dentry *create_parents_named(struct inode *dir,
- struct dentry *dentry,
- const char *name, int bindex)
+struct dentry *create_parents(struct inode *dir, struct dentry *dentry,
+ const char *name, int bindex)
{
int err;
struct dentry *child_dentry;
* because lookup passed as a negative unionfs dentry
* pointing to a lone negative underlying dentry.
*/
- hidden_dentry = create_parents(parent, dentry, bindex);
+ hidden_dentry = create_parents(parent, dentry,
+ dentry->d_name.name,
+ bindex);
if (!hidden_dentry || IS_ERR(hidden_dentry)) {
if (IS_ERR(hidden_dentry))
err = PTR_ERR(hidden_dentry);
}
if (dbstart(old_dentry) != dbstart(new_dentry)) {
- hidden_new_dentry =
- create_parents(dir, new_dentry, dbstart(old_dentry));
+ hidden_new_dentry = create_parents(dir, new_dentry,
+ new_dentry->d_name.name,
+ dbstart(old_dentry));
err = PTR_ERR(hidden_new_dentry);
if (IS_COPYUP_ERR(err))
goto docopyup;
if (!err) {
hidden_new_dentry =
create_parents(dir, new_dentry,
+ new_dentry->d_name.name,
bindex);
hidden_old_dentry =
unionfs_lower_dentry(old_dentry);
* unionfs dentry pointing to a lone negative
* underlying dentry
*/
- hidden_dentry = create_parents(dir, dentry, bindex);
+ hidden_dentry = create_parents(dir, dentry,
+ dentry->d_name.name,
+ bindex);
if (!hidden_dentry || IS_ERR(hidden_dentry)) {
if (IS_ERR(hidden_dentry))
err = PTR_ERR(hidden_dentry);
hidden_dentry = unionfs_lower_dentry_idx(dentry, bindex);
if (!hidden_dentry) {
- hidden_dentry = create_parents(parent, dentry, bindex);
+ hidden_dentry = create_parents(parent, dentry,
+ dentry->d_name.name,
+ bindex);
if (!hidden_dentry || IS_ERR(hidden_dentry)) {
printk(KERN_DEBUG "unionfs: hidden dentry "
" NULL for bindex = %d\n", bindex);
hidden_dentry = unionfs_lower_dentry_idx(dentry, bindex);
if (!hidden_dentry) {
- hidden_dentry = create_parents(dir, dentry, bindex);
+ hidden_dentry = create_parents(dir, dentry,
+ dentry->d_name.name,
+ bindex);
if (IS_ERR(hidden_dentry)) {
printk(KERN_DEBUG "unionfs: failed to create "
"parents on %d, err = %ld\n",
if (!hidden_new_dentry) {
hidden_new_dentry =
create_parents(new_dentry->d_parent->d_inode,
- new_dentry, bindex);
+ new_dentry, new_dentry->d_name.name,
+ bindex);
if (IS_ERR(hidden_new_dentry)) {
printk(KERN_DEBUG "unionfs: error creating directory "
"tree for rename, bindex = %d, err = %ld\n",
* this dentry.
*/
hidden_dentry = create_parents(dentry->d_inode,
- dentry, bindex);
+ dentry,
+ dentry->d_name.name,
+ bindex);
if (!hidden_dentry || IS_ERR(hidden_dentry)) {
printk(KERN_DEBUG "unionfs: create_parents "
"failed for bindex = %d\n", bindex);
/* replicates the directory structure up to given dentry in given branch */
extern struct dentry *create_parents(struct inode *dir, struct dentry *dentry,
- int bindex);
+ const char *name, int bindex);
extern int make_dir_opaque(struct dentry *dir, int bindex);
/* partial lookup */