Skip to content

Commit

Permalink
switch cifs
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Jan 13, 2011
1 parent 8b244ff commit 1c929cf
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 41 deletions.
6 changes: 6 additions & 0 deletions fs/cifs/cifsfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
25 changes: 1 addition & 24 deletions fs/cifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,6 @@ build_path_from_dentry(struct dentry *direntry)
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
Expand Down Expand Up @@ -327,7 +316,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,

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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand All @@ -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); */
Expand Down
8 changes: 0 additions & 8 deletions fs/cifs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -1368,10 +1364,6 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
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 */
Expand Down
4 changes: 0 additions & 4 deletions fs/cifs/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
5 changes: 0 additions & 5 deletions fs/cifs/readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1c929cf

Please sign in to comment.