Unionfs: use d_set_d_op
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 6 Sep 2011 05:01:42 +0000 (01:01 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 11 Nov 2014 02:52:19 +0000 (21:52 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/lookup.c
fs/unionfs/main.c

index fa00189d48898696d4dd1ec5c32c346e937636a7..35bccc818971d2d8d4644905e9f43df1701d9c7b 100644 (file)
@@ -311,7 +311,8 @@ struct dentry *unionfs_lookup_full(struct dentry *dentry,
        verify_locked(parent);
 
        /* must initialize dentry operations */
-       dentry->d_op = &unionfs_dops;
+       if (lookupmode == INTERPOSE_LOOKUP)
+               d_set_d_op(dentry, &unionfs_dops);
 
        /* We never partial lookup the root directory. */
        if (IS_ROOT(dentry))
index fa52f61178963de137cedafb9026ae8a212c8a36..f4bcd89498612644651d46f9966657dcee14dfda 100644 (file)
@@ -145,7 +145,7 @@ skip:
                         * properly.  Finally we must return this new
                         * dentry.
                         */
-                       spliced->d_op = &unionfs_dops;
+                       d_set_d_op(spliced, &unionfs_dops);
                        spliced->d_fsdata = dentry->d_fsdata;
                        dentry->d_fsdata = NULL;
                        dentry = spliced;
@@ -543,7 +543,7 @@ static struct dentry *unionfs_d_alloc_root(struct super_block *sb)
 
                ret = d_alloc(NULL, &name);
                if (likely(ret)) {
-                       ret->d_op = &unionfs_dops;
+                       d_set_d_op(ret, &unionfs_dops);
                        ret->d_sb = sb;
                        ret->d_parent = ret;
                }