]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/cifs/dir.c
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
[karo-tx-linux.git] / fs / cifs / dir.c
index 521d841b1fd15ab68ed96aef7b90666c8b02fab4..ce8014345258d579cfb2d306855310ac5662c347 100644 (file)
@@ -135,9 +135,9 @@ static void setup_cifs_dentry(struct cifsTconInfo *tcon,
                              struct inode *newinode)
 {
        if (tcon->nocase)
-               direntry->d_op = &cifs_ci_dentry_ops;
+               d_set_d_op(direntry, &cifs_ci_dentry_ops);
        else
-               direntry->d_op = &cifs_dentry_ops;
+               d_set_d_op(direntry, &cifs_dentry_ops);
        d_instantiate(direntry, newinode);
 }
 
@@ -421,9 +421,9 @@ 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)
-                       direntry->d_op = &cifs_ci_dentry_ops;
+                       d_set_d_op(direntry, &cifs_ci_dentry_ops);
                else
-                       direntry->d_op = &cifs_dentry_ops;
+                       d_set_d_op(direntry, &cifs_dentry_ops);
 
                if (rc == 0)
                        d_instantiate(direntry, newinode);
@@ -604,9 +604,9 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
 
        if ((rc == 0) && (newInode != NULL)) {
                if (pTcon->nocase)
-                       direntry->d_op = &cifs_ci_dentry_ops;
+                       d_set_d_op(direntry, &cifs_ci_dentry_ops);
                else
-                       direntry->d_op = &cifs_dentry_ops;
+                       d_set_d_op(direntry, &cifs_dentry_ops);
                d_add(direntry, newInode);
                if (posix_open) {
                        filp = lookup_instantiate_filp(nd, direntry,
@@ -634,9 +634,9 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
                rc = 0;
                direntry->d_time = jiffies;
                if (pTcon->nocase)
-                       direntry->d_op = &cifs_ci_dentry_ops;
+                       d_set_d_op(direntry, &cifs_ci_dentry_ops);
                else
-                       direntry->d_op = &cifs_dentry_ops;
+                       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); */
@@ -656,6 +656,9 @@ lookup_out:
 static int
 cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
 {
+       if (nd->flags & LOOKUP_RCU)
+               return -ECHILD;
+
        if (direntry->d_inode) {
                if (cifs_revalidate_dentry(direntry))
                        return 0;
@@ -700,9 +703,10 @@ const struct dentry_operations cifs_dentry_ops = {
 /* d_delete:       cifs_d_delete,      */ /* not needed except for debugging */
 };
 
-static int cifs_ci_hash(struct dentry *dentry, struct qstr *q)
+static int cifs_ci_hash(const struct dentry *dentry, const struct inode *inode,
+               struct qstr *q)
 {
-       struct nls_table *codepage = CIFS_SB(dentry->d_inode->i_sb)->local_nls;
+       struct nls_table *codepage = CIFS_SB(dentry->d_sb)->local_nls;
        unsigned long hash;
        int i;
 
@@ -715,13 +719,22 @@ static int cifs_ci_hash(struct dentry *dentry, struct qstr *q)
        return 0;
 }
 
-static int cifs_ci_compare(struct dentry *dentry, struct qstr *a,
-                          struct qstr *b)
+static int cifs_ci_compare(const struct dentry *parent,
+               const struct inode *pinode,
+               const struct dentry *dentry, const struct inode *inode,
+               unsigned int len, const char *str, const struct qstr *name)
 {
+<<<<<<< HEAD
        struct nls_table *codepage = CIFS_SB(dentry->d_inode->i_sb)->local_nls;
 
        if ((a->len == b->len) &&
            (nls_strnicmp(codepage, a->name, b->name, a->len) == 0))
+=======
+       struct nls_table *codepage = CIFS_SB(pinode->i_sb)->local_nls;
+
+       if ((name->len == len) &&
+           (nls_strnicmp(codepage, name->name, str, len) == 0))
+>>>>>>> 0c21e3aaf6ae85bee804a325aa29c325209180fd
                return 0;
        return 1;
 }