diff options
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r-- | fs/cifs/dir.c | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index db2a58c00f7b..dd5f22918c33 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 |
@@ -293,10 +282,8 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
293 | args.uid = NO_CHANGE_64; | 282 | args.uid = NO_CHANGE_64; |
294 | args.gid = NO_CHANGE_64; | 283 | args.gid = NO_CHANGE_64; |
295 | } | 284 | } |
296 | CIFSSMBUnixSetPathInfo(xid, tcon, full_path, &args, | 285 | CIFSSMBUnixSetFileInfo(xid, tcon, &args, fileHandle, |
297 | cifs_sb->local_nls, | 286 | current->tgid); |
298 | cifs_sb->mnt_cifs_flags & | ||
299 | CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
300 | } else { | 287 | } else { |
301 | /* BB implement mode setting via Windows security | 288 | /* BB implement mode setting via Windows security |
302 | descriptors e.g. */ | 289 | descriptors e.g. */ |
@@ -329,7 +316,7 @@ cifs_create_get_file_info: | |||
329 | 316 | ||
330 | cifs_create_set_dentry: | 317 | cifs_create_set_dentry: |
331 | if (rc == 0) | 318 | if (rc == 0) |
332 | setup_cifs_dentry(tcon, direntry, newinode); | 319 | d_instantiate(direntry, newinode); |
333 | else | 320 | else |
334 | cFYI(1, "Create worked, get_inode_info failed rc = %d", rc); | 321 | cFYI(1, "Create worked, get_inode_info failed rc = %d", rc); |
335 | 322 | ||
@@ -420,10 +407,6 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, | |||
420 | 407 | ||
421 | rc = cifs_get_inode_info_unix(&newinode, full_path, | 408 | rc = cifs_get_inode_info_unix(&newinode, full_path, |
422 | inode->i_sb, xid); | 409 | inode->i_sb, xid); |
423 | if (pTcon->nocase) | ||
424 | d_set_d_op(direntry, &cifs_ci_dentry_ops); | ||
425 | else | ||
426 | d_set_d_op(direntry, &cifs_dentry_ops); | ||
427 | 410 | ||
428 | if (rc == 0) | 411 | if (rc == 0) |
429 | d_instantiate(direntry, newinode); | 412 | d_instantiate(direntry, newinode); |
@@ -603,10 +586,6 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, | |||
603 | parent_dir_inode->i_sb, xid, NULL); | 586 | parent_dir_inode->i_sb, xid, NULL); |
604 | 587 | ||
605 | if ((rc == 0) && (newInode != NULL)) { | 588 | if ((rc == 0) && (newInode != NULL)) { |
606 | if (pTcon->nocase) | ||
607 | d_set_d_op(direntry, &cifs_ci_dentry_ops); | ||
608 | else | ||
609 | d_set_d_op(direntry, &cifs_dentry_ops); | ||
610 | d_add(direntry, newInode); | 589 | d_add(direntry, newInode); |
611 | if (posix_open) { | 590 | if (posix_open) { |
612 | filp = lookup_instantiate_filp(nd, direntry, | 591 | filp = lookup_instantiate_filp(nd, direntry, |
@@ -633,10 +612,6 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, | |||
633 | } else if (rc == -ENOENT) { | 612 | } else if (rc == -ENOENT) { |
634 | rc = 0; | 613 | rc = 0; |
635 | direntry->d_time = jiffies; | 614 | direntry->d_time = jiffies; |
636 | if (pTcon->nocase) | ||
637 | d_set_d_op(direntry, &cifs_ci_dentry_ops); | ||
638 | else | ||
639 | d_set_d_op(direntry, &cifs_dentry_ops); | ||
640 | d_add(direntry, NULL); | 615 | d_add(direntry, NULL); |
641 | /* 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 |
642 | shrink_dcache_parent(direntry); */ | 617 | shrink_dcache_parent(direntry); */ |
@@ -700,6 +675,7 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd) | |||
700 | 675 | ||
701 | const struct dentry_operations cifs_dentry_ops = { | 676 | const struct dentry_operations cifs_dentry_ops = { |
702 | .d_revalidate = cifs_d_revalidate, | 677 | .d_revalidate = cifs_d_revalidate, |
678 | .d_automount = cifs_dfs_d_automount, | ||
703 | /* d_delete: cifs_d_delete, */ /* not needed except for debugging */ | 679 | /* d_delete: cifs_d_delete, */ /* not needed except for debugging */ |
704 | }; | 680 | }; |
705 | 681 | ||
@@ -736,4 +712,5 @@ const struct dentry_operations cifs_ci_dentry_ops = { | |||
736 | .d_revalidate = cifs_d_revalidate, | 712 | .d_revalidate = cifs_d_revalidate, |
737 | .d_hash = cifs_ci_hash, | 713 | .d_hash = cifs_ci_hash, |
738 | .d_compare = cifs_ci_compare, | 714 | .d_compare = cifs_ci_compare, |
715 | .d_automount = cifs_dfs_d_automount, | ||
739 | }; | 716 | }; |