aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2011-01-09 18:18:16 -0500
committerSteve French <sfrench@us.ibm.com>2011-01-09 18:18:16 -0500
commitacc6f11272ce4f77c40b1a6292eb198fd6aaf8c3 (patch)
tree2da3a61b6726707a89f1cf93446aabd2fb00e1f0 /fs/cifs/dir.c
parent7e12eddb73d4f288b0339ee13832a34d6bc4fd90 (diff)
parent0c21e3aaf6ae85bee804a325aa29c325209180fd (diff)
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: fs/cifs/dir.c
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r--fs/cifs/dir.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 521d841b1fd1..ce8014345258 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -135,9 +135,9 @@ static void setup_cifs_dentry(struct cifsTconInfo *tcon,
135 struct inode *newinode) 135 struct inode *newinode)
136{ 136{
137 if (tcon->nocase) 137 if (tcon->nocase)
138 direntry->d_op = &cifs_ci_dentry_ops; 138 d_set_d_op(direntry, &cifs_ci_dentry_ops);
139 else 139 else
140 direntry->d_op = &cifs_dentry_ops; 140 d_set_d_op(direntry, &cifs_dentry_ops);
141 d_instantiate(direntry, newinode); 141 d_instantiate(direntry, newinode);
142} 142}
143 143
@@ -421,9 +421,9 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
421 rc = cifs_get_inode_info_unix(&newinode, full_path, 421 rc = cifs_get_inode_info_unix(&newinode, full_path,
422 inode->i_sb, xid); 422 inode->i_sb, xid);
423 if (pTcon->nocase) 423 if (pTcon->nocase)
424 direntry->d_op = &cifs_ci_dentry_ops; 424 d_set_d_op(direntry, &cifs_ci_dentry_ops);
425 else 425 else
426 direntry->d_op = &cifs_dentry_ops; 426 d_set_d_op(direntry, &cifs_dentry_ops);
427 427
428 if (rc == 0) 428 if (rc == 0)
429 d_instantiate(direntry, newinode); 429 d_instantiate(direntry, newinode);
@@ -604,9 +604,9 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
604 604
605 if ((rc == 0) && (newInode != NULL)) { 605 if ((rc == 0) && (newInode != NULL)) {
606 if (pTcon->nocase) 606 if (pTcon->nocase)
607 direntry->d_op = &cifs_ci_dentry_ops; 607 d_set_d_op(direntry, &cifs_ci_dentry_ops);
608 else 608 else
609 direntry->d_op = &cifs_dentry_ops; 609 d_set_d_op(direntry, &cifs_dentry_ops);
610 d_add(direntry, newInode); 610 d_add(direntry, newInode);
611 if (posix_open) { 611 if (posix_open) {
612 filp = lookup_instantiate_filp(nd, direntry, 612 filp = lookup_instantiate_filp(nd, direntry,
@@ -634,9 +634,9 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
634 rc = 0; 634 rc = 0;
635 direntry->d_time = jiffies; 635 direntry->d_time = jiffies;
636 if (pTcon->nocase) 636 if (pTcon->nocase)
637 direntry->d_op = &cifs_ci_dentry_ops; 637 d_set_d_op(direntry, &cifs_ci_dentry_ops);
638 else 638 else
639 direntry->d_op = &cifs_dentry_ops; 639 d_set_d_op(direntry, &cifs_dentry_ops);
640 d_add(direntry, NULL); 640 d_add(direntry, NULL);
641 /* if it was once a directory (but how can we tell?) we could do 641 /* if it was once a directory (but how can we tell?) we could do
642 shrink_dcache_parent(direntry); */ 642 shrink_dcache_parent(direntry); */
@@ -656,6 +656,9 @@ lookup_out:
656static int 656static int
657cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd) 657cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
658{ 658{
659 if (nd->flags & LOOKUP_RCU)
660 return -ECHILD;
661
659 if (direntry->d_inode) { 662 if (direntry->d_inode) {
660 if (cifs_revalidate_dentry(direntry)) 663 if (cifs_revalidate_dentry(direntry))
661 return 0; 664 return 0;
@@ -700,9 +703,10 @@ const struct dentry_operations cifs_dentry_ops = {
700/* d_delete: cifs_d_delete, */ /* not needed except for debugging */ 703/* d_delete: cifs_d_delete, */ /* not needed except for debugging */
701}; 704};
702 705
703static int cifs_ci_hash(struct dentry *dentry, struct qstr *q) 706static int cifs_ci_hash(const struct dentry *dentry, const struct inode *inode,
707 struct qstr *q)
704{ 708{
705 struct nls_table *codepage = CIFS_SB(dentry->d_inode->i_sb)->local_nls; 709 struct nls_table *codepage = CIFS_SB(dentry->d_sb)->local_nls;
706 unsigned long hash; 710 unsigned long hash;
707 int i; 711 int i;
708 712
@@ -715,13 +719,22 @@ static int cifs_ci_hash(struct dentry *dentry, struct qstr *q)
715 return 0; 719 return 0;
716} 720}
717 721
718static int cifs_ci_compare(struct dentry *dentry, struct qstr *a, 722static int cifs_ci_compare(const struct dentry *parent,
719 struct qstr *b) 723 const struct inode *pinode,
724 const struct dentry *dentry, const struct inode *inode,
725 unsigned int len, const char *str, const struct qstr *name)
720{ 726{
727<<<<<<< HEAD
721 struct nls_table *codepage = CIFS_SB(dentry->d_inode->i_sb)->local_nls; 728 struct nls_table *codepage = CIFS_SB(dentry->d_inode->i_sb)->local_nls;
722 729
723 if ((a->len == b->len) && 730 if ((a->len == b->len) &&
724 (nls_strnicmp(codepage, a->name, b->name, a->len) == 0)) 731 (nls_strnicmp(codepage, a->name, b->name, a->len) == 0))
732=======
733 struct nls_table *codepage = CIFS_SB(pinode->i_sb)->local_nls;
734
735 if ((name->len == len) &&
736 (nls_strnicmp(codepage, name->name, str, len) == 0))
737>>>>>>> 0c21e3aaf6ae85bee804a325aa29c325209180fd
725 return 0; 738 return 0;
726 return 1; 739 return 1;
727} 740}