switch cifs
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 18 Dec 2010 16:43:51 +0000 (11:43 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 13 Jan 2011 01:02:46 +0000 (20:02 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/cifs/cifsfs.c
fs/cifs/dir.c
fs/cifs/inode.c
fs/cifs/link.c
fs/cifs/readdir.c

index 5e7075d5f13970876879fdfe276e9f69e60b0a77..d9f652a522a6994097d7ec4008abacb0cfc0b65a 100644 (file)
@@ -174,6 +174,12 @@ cifs_read_super(struct super_block *sb, void *data,
                goto out_no_root;
        }
 
+       /* do that *after* d_alloc_root() - we want NULL ->d_op for root here */
+       if (cifs_sb_master_tcon(cifs_sb)->nocase)
+               sb->s_d_op = &cifs_ci_dentry_ops;
+       else
+               sb->s_d_op = &cifs_dentry_ops;
+
 #ifdef CONFIG_CIFS_EXPERIMENTAL
        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
                cFYI(1, "export ops supported");
index 2e773825835e837a4fd77ff038928c29dce191aa..1e95dd6356324bfbc908c86335f6a501c61b6aa6 100644 (file)
@@ -130,17 +130,6 @@ cifs_bp_rename_retry:
        return full_path;
 }
 
-static void setup_cifs_dentry(struct cifsTconInfo *tcon,
-                             struct dentry *direntry,
-                             struct inode *newinode)
-{
-       if (tcon->nocase)
-               d_set_d_op(direntry, &cifs_ci_dentry_ops);
-       else
-               d_set_d_op(direntry, &cifs_dentry_ops);
-       d_instantiate(direntry, newinode);
-}
-
 /* Inode operations in similar order to how they appear in Linux file fs.h */
 
 int
@@ -327,7 +316,7 @@ cifs_create_get_file_info:
 
 cifs_create_set_dentry:
        if (rc == 0)
-               setup_cifs_dentry(tcon, direntry, newinode);
+               d_instantiate(direntry, newinode);
        else
                cFYI(1, "Create worked, get_inode_info failed rc = %d", rc);
 
@@ -418,10 +407,6 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
 
                rc = cifs_get_inode_info_unix(&newinode, full_path,
                                                inode->i_sb, xid);
-               if (pTcon->nocase)
-                       d_set_d_op(direntry, &cifs_ci_dentry_ops);
-               else
-                       d_set_d_op(direntry, &cifs_dentry_ops);
 
                if (rc == 0)
                        d_instantiate(direntry, newinode);
@@ -601,10 +586,6 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
                                parent_dir_inode->i_sb, xid, NULL);
 
        if ((rc == 0) && (newInode != NULL)) {
-               if (pTcon->nocase)
-                       d_set_d_op(direntry, &cifs_ci_dentry_ops);
-               else
-                       d_set_d_op(direntry, &cifs_dentry_ops);
                d_add(direntry, newInode);
                if (posix_open) {
                        filp = lookup_instantiate_filp(nd, direntry,
@@ -631,10 +612,6 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
        } else if (rc == -ENOENT) {
                rc = 0;
                direntry->d_time = jiffies;
-               if (pTcon->nocase)
-                       d_set_d_op(direntry, &cifs_ci_dentry_ops);
-               else
-                       d_set_d_op(direntry, &cifs_dentry_ops);
                d_add(direntry, NULL);
        /*      if it was once a directory (but how can we tell?) we could do
                shrink_dcache_parent(direntry); */
index 0c7e36910e3106846bfde09610045230a1b2e745..b06b60620240e72b99e3a97a3cf4b588f8afa06f 100644 (file)
@@ -1324,10 +1324,6 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
 /*BB check (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID ) to see if need
        to set uid/gid */
                        inc_nlink(inode);
-                       if (pTcon->nocase)
-                               d_set_d_op(direntry, &cifs_ci_dentry_ops);
-                       else
-                               d_set_d_op(direntry, &cifs_dentry_ops);
 
                        cifs_unix_basic_to_fattr(&fattr, pInfo, cifs_sb);
                        cifs_fill_uniqueid(inode->i_sb, &fattr);
@@ -1368,10 +1364,6 @@ mkdir_get_info:
                        rc = cifs_get_inode_info(&newinode, full_path, NULL,
                                                 inode->i_sb, xid, NULL);
 
-               if (pTcon->nocase)
-                       d_set_d_op(direntry, &cifs_ci_dentry_ops);
-               else
-                       d_set_d_op(direntry, &cifs_dentry_ops);
                d_instantiate(direntry, newinode);
                 /* setting nlink not necessary except in cases where we
                  * failed to get it from the server or was set bogus */
index fe2f6a93c49e3cf596fb14f3482f2a55e540fef7..306769de2fb5369e221df1975dba3b904b6b1d5c 100644 (file)
@@ -524,10 +524,6 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
                        cFYI(1, "Create symlink ok, getinodeinfo fail rc = %d",
                              rc);
                } else {
-                       if (pTcon->nocase)
-                               d_set_d_op(direntry, &cifs_ci_dentry_ops);
-                       else
-                               d_set_d_op(direntry, &cifs_dentry_ops);
                        d_instantiate(direntry, newinode);
                }
        }
index 76b1b37c9e6b7e916258cb19a862875843d20e66..7f25cc3d22569509cd59ac27f6b9e3acc2ddaf5f 100644 (file)
@@ -102,11 +102,6 @@ cifs_readdir_lookup(struct dentry *parent, struct qstr *name,
                return NULL;
        }
 
-       if (cifs_sb_master_tcon(CIFS_SB(sb))->nocase)
-               d_set_d_op(dentry, &cifs_ci_dentry_ops);
-       else
-               d_set_d_op(dentry, &cifs_dentry_ops);
-
        alias = d_materialise_unique(dentry, inode);
        if (alias != NULL) {
                dput(dentry);