[GFS2] pass formal ino in do_filldir_main
[cascardo/linux.git] / fs / gfs2 / ops_export.c
index b4e7b87..aad9183 100644 (file)
@@ -7,7 +7,6 @@
  * of the GNU General Public License version 2.
  */
 
-#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/completion.h>
@@ -22,6 +21,7 @@
 #include "glock.h"
 #include "glops.h"
 #include "inode.h"
+#include "ops_dentry.h"
 #include "ops_export.h"
 #include "rgrp.h"
 #include "util.h"
@@ -38,14 +38,11 @@ static struct dentry *gfs2_decode_fh(struct super_block *sb,
        struct gfs2_fh_obj fh_obj;
        struct gfs2_inum_host *this, parent;
 
-       if (fh_type != fh_len)
-               return NULL;
-
        this            = &fh_obj.this;
        fh_obj.imode    = DT_UNKNOWN;
        memset(&parent, 0, sizeof(struct gfs2_inum));
 
-       switch (fh_type) {
+       switch (fh_len) {
        case GFS2_LARGE_FH_SIZE:
                parent.no_formal_ino = ((u64)be32_to_cpu(fh[4])) << 32;
                parent.no_formal_ino |= be32_to_cpu(fh[5]);
@@ -112,13 +109,12 @@ struct get_name_filldir {
        char *name;
 };
 
-static int get_name_filldir(void *opaque, const char *name, unsigned int length,
-                           u64 offset, struct gfs2_inum_host *inum,
-                           unsigned int type)
+static int get_name_filldir(void *opaque, const char *name, int length,
+                           loff_t offset, u64 inum, unsigned int type)
 {
-       struct get_name_filldir *gnfd = (struct get_name_filldir *)opaque;
+       struct get_name_filldir *gnfd = opaque;
 
-       if (!gfs2_inum_equal(inum, &gnfd->inum))
+       if (inum != gnfd->inum.no_addr)
                return 0;
 
        memcpy(gnfd->name, name, length);
@@ -189,6 +185,7 @@ static struct dentry *gfs2_get_parent(struct dentry *child)
                return ERR_PTR(-ENOMEM);
        }
 
+       dentry->d_op = &gfs2_dops;
        return dentry;
 }
 
@@ -215,8 +212,7 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb, void *inum_obj)
        }
 
        error = gfs2_glock_nq_num(sdp, inum->no_addr, &gfs2_inode_glops,
-                                 LM_ST_SHARED, LM_FLAG_ANY | GL_LOCAL_EXCL,
-                                 &i_gh);
+                                 LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
        if (error)
                return ERR_PTR(error);
 
@@ -269,6 +265,7 @@ out_inode:
                return ERR_PTR(-ENOMEM);
        }
 
+       dentry->d_op = &gfs2_dops;
        return dentry;
 
 fail_rgd: