diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-12-18 11:43:51 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-12 20:02:46 -0500 |
commit | 1c929cfe6d8f2087a337a868fbf6c38d56bb4889 (patch) | |
tree | 7af4da88d893a45bff4fa3df9163a150a8a837b7 /fs/cifs | |
parent | 8b244ff2fa58f81f84aa03c82c2c23307a778ce7 (diff) |
switch cifs
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsfs.c | 6 | ||||
-rw-r--r-- | fs/cifs/dir.c | 25 | ||||
-rw-r--r-- | fs/cifs/inode.c | 8 | ||||
-rw-r--r-- | fs/cifs/link.c | 4 | ||||
-rw-r--r-- | fs/cifs/readdir.c | 5 |
5 files changed, 7 insertions, 41 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 5e7075d5f139..d9f652a522a6 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -174,6 +174,12 @@ cifs_read_super(struct super_block *sb, void *data, | |||
174 | goto out_no_root; | 174 | goto out_no_root; |
175 | } | 175 | } |
176 | 176 | ||
177 | /* do that *after* d_alloc_root() - we want NULL ->d_op for root here */ | ||
178 | if (cifs_sb_master_tcon(cifs_sb)->nocase) | ||
179 | sb->s_d_op = &cifs_ci_dentry_ops; | ||
180 | else | ||
181 | sb->s_d_op = &cifs_dentry_ops; | ||
182 | |||
177 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 183 | #ifdef CONFIG_CIFS_EXPERIMENTAL |
178 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { | 184 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { |
179 | cFYI(1, "export ops supported"); | 185 | cFYI(1, "export ops supported"); |
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 2e773825835e..1e95dd635632 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -130,17 +130,6 @@ cifs_bp_rename_retry: | |||
130 | return full_path; | 130 | return full_path; |
131 | } | 131 | } |
132 | 132 | ||
133 | static void setup_cifs_dentry(struct cifsTconInfo *tcon, | ||
134 | struct dentry *direntry, | ||
135 | struct inode *newinode) | ||
136 | { | ||
137 | if (tcon->nocase) | ||
138 | d_set_d_op(direntry, &cifs_ci_dentry_ops); | ||
139 | else | ||
140 | d_set_d_op(direntry, &cifs_dentry_ops); | ||
141 | d_instantiate(direntry, newinode); | ||
142 | } | ||
143 | |||
144 | /* Inode operations in similar order to how they appear in Linux file fs.h */ | 133 | /* Inode operations in similar order to how they appear in Linux file fs.h */ |
145 | 134 | ||
146 | int | 135 | int |
@@ -327,7 +316,7 @@ cifs_create_get_file_info: | |||
327 | 316 | ||
328 | cifs_create_set_dentry: | 317 | cifs_create_set_dentry: |
329 | if (rc == 0) | 318 | if (rc == 0) |
330 | setup_cifs_dentry(tcon, direntry, newinode); | 319 | d_instantiate(direntry, newinode); |
331 | else | 320 | else |
332 | cFYI(1, "Create worked, get_inode_info failed rc = %d", rc); | 321 | cFYI(1, "Create worked, get_inode_info failed rc = %d", rc); |
333 | 322 | ||
@@ -418,10 +407,6 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, | |||
418 | 407 | ||
419 | rc = cifs_get_inode_info_unix(&newinode, full_path, | 408 | rc = cifs_get_inode_info_unix(&newinode, full_path, |
420 | inode->i_sb, xid); | 409 | inode->i_sb, xid); |
421 | if (pTcon->nocase) | ||
422 | d_set_d_op(direntry, &cifs_ci_dentry_ops); | ||
423 | else | ||
424 | d_set_d_op(direntry, &cifs_dentry_ops); | ||
425 | 410 | ||
426 | if (rc == 0) | 411 | if (rc == 0) |
427 | d_instantiate(direntry, newinode); | 412 | d_instantiate(direntry, newinode); |
@@ -601,10 +586,6 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, | |||
601 | parent_dir_inode->i_sb, xid, NULL); | 586 | parent_dir_inode->i_sb, xid, NULL); |
602 | 587 | ||
603 | if ((rc == 0) && (newInode != NULL)) { | 588 | if ((rc == 0) && (newInode != NULL)) { |
604 | if (pTcon->nocase) | ||
605 | d_set_d_op(direntry, &cifs_ci_dentry_ops); | ||
606 | else | ||
607 | d_set_d_op(direntry, &cifs_dentry_ops); | ||
608 | d_add(direntry, newInode); | 589 | d_add(direntry, newInode); |
609 | if (posix_open) { | 590 | if (posix_open) { |
610 | filp = lookup_instantiate_filp(nd, direntry, | 591 | filp = lookup_instantiate_filp(nd, direntry, |
@@ -631,10 +612,6 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, | |||
631 | } else if (rc == -ENOENT) { | 612 | } else if (rc == -ENOENT) { |
632 | rc = 0; | 613 | rc = 0; |
633 | direntry->d_time = jiffies; | 614 | direntry->d_time = jiffies; |
634 | if (pTcon->nocase) | ||
635 | d_set_d_op(direntry, &cifs_ci_dentry_ops); | ||
636 | else | ||
637 | d_set_d_op(direntry, &cifs_dentry_ops); | ||
638 | d_add(direntry, NULL); | 615 | d_add(direntry, NULL); |
639 | /* if it was once a directory (but how can we tell?) we could do | 616 | /* if it was once a directory (but how can we tell?) we could do |
640 | shrink_dcache_parent(direntry); */ | 617 | shrink_dcache_parent(direntry); */ |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 0c7e36910e31..b06b60620240 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -1324,10 +1324,6 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) | |||
1324 | /*BB check (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID ) to see if need | 1324 | /*BB check (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID ) to see if need |
1325 | to set uid/gid */ | 1325 | to set uid/gid */ |
1326 | inc_nlink(inode); | 1326 | inc_nlink(inode); |
1327 | if (pTcon->nocase) | ||
1328 | d_set_d_op(direntry, &cifs_ci_dentry_ops); | ||
1329 | else | ||
1330 | d_set_d_op(direntry, &cifs_dentry_ops); | ||
1331 | 1327 | ||
1332 | cifs_unix_basic_to_fattr(&fattr, pInfo, cifs_sb); | 1328 | cifs_unix_basic_to_fattr(&fattr, pInfo, cifs_sb); |
1333 | cifs_fill_uniqueid(inode->i_sb, &fattr); | 1329 | cifs_fill_uniqueid(inode->i_sb, &fattr); |
@@ -1368,10 +1364,6 @@ mkdir_get_info: | |||
1368 | rc = cifs_get_inode_info(&newinode, full_path, NULL, | 1364 | rc = cifs_get_inode_info(&newinode, full_path, NULL, |
1369 | inode->i_sb, xid, NULL); | 1365 | inode->i_sb, xid, NULL); |
1370 | 1366 | ||
1371 | if (pTcon->nocase) | ||
1372 | d_set_d_op(direntry, &cifs_ci_dentry_ops); | ||
1373 | else | ||
1374 | d_set_d_op(direntry, &cifs_dentry_ops); | ||
1375 | d_instantiate(direntry, newinode); | 1367 | d_instantiate(direntry, newinode); |
1376 | /* setting nlink not necessary except in cases where we | 1368 | /* setting nlink not necessary except in cases where we |
1377 | * failed to get it from the server or was set bogus */ | 1369 | * failed to get it from the server or was set bogus */ |
diff --git a/fs/cifs/link.c b/fs/cifs/link.c index fe2f6a93c49e..306769de2fb5 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c | |||
@@ -524,10 +524,6 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname) | |||
524 | cFYI(1, "Create symlink ok, getinodeinfo fail rc = %d", | 524 | cFYI(1, "Create symlink ok, getinodeinfo fail rc = %d", |
525 | rc); | 525 | rc); |
526 | } else { | 526 | } else { |
527 | if (pTcon->nocase) | ||
528 | d_set_d_op(direntry, &cifs_ci_dentry_ops); | ||
529 | else | ||
530 | d_set_d_op(direntry, &cifs_dentry_ops); | ||
531 | d_instantiate(direntry, newinode); | 527 | d_instantiate(direntry, newinode); |
532 | } | 528 | } |
533 | } | 529 | } |
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 76b1b37c9e6b..7f25cc3d2256 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
@@ -102,11 +102,6 @@ cifs_readdir_lookup(struct dentry *parent, struct qstr *name, | |||
102 | return NULL; | 102 | return NULL; |
103 | } | 103 | } |
104 | 104 | ||
105 | if (cifs_sb_master_tcon(CIFS_SB(sb))->nocase) | ||
106 | d_set_d_op(dentry, &cifs_ci_dentry_ops); | ||
107 | else | ||
108 | d_set_d_op(dentry, &cifs_dentry_ops); | ||
109 | |||
110 | alias = d_materialise_unique(dentry, inode); | 105 | alias = d_materialise_unique(dentry, inode); |
111 | if (alias != NULL) { | 106 | if (alias != NULL) { |
112 | dput(dentry); | 107 | dput(dentry); |