fs/9p: Use the correct dentry operations
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Mon, 30 Aug 2010 16:04:35 +0000 (16:04 +0000)
committerEric Van Hensbergen <ericvh@gmail.com>
Mon, 13 Sep 2010 13:13:03 +0000 (08:13 -0500)
We should use the cached dentry operation only if caching mode is enabled

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
fs/9p/vfs_inode.c

index 84159cf9c5212a559d18bc3fd54ae20090245d0f..a6990bbf6056e090239251ae9ffae2aa6d0b667b 100644 (file)
@@ -730,7 +730,10 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int mode,
                P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", err);
                goto error;
        }
-       dentry->d_op = &v9fs_cached_dentry_operations;
+       if (v9ses->cache)
+               dentry->d_op = &v9fs_cached_dentry_operations;
+       else
+               dentry->d_op = &v9fs_dentry_operations;
        d_instantiate(dentry, inode);
        err = v9fs_fid_add(dentry, fid);
        if (err < 0)