[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [RFC] gfs1 changes to build and work with 2.6.24-rc1 (gfs2-nwm tree)



Hi guys,

could somebody be so kind to review the patch and queue it? this is required to
build and work against $topic. Patch is against CVS HEAD.

Thanks
Fabio

-- 
I'm going to make him an offer he can't refuse.
diff --git a/gfs-kernel/src/gfs/main.c b/gfs-kernel/src/gfs/main.c
index 96b0002..813fa34 100644
--- a/gfs-kernel/src/gfs/main.c
+++ b/gfs-kernel/src/gfs/main.c
@@ -21,6 +21,7 @@
 #include <linux/proc_fs.h>
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/time.h>
 
 #include "gfs.h"
 #include "ops_fstype.h"
@@ -36,6 +37,7 @@
 int __init init_gfs_fs(void)
 {
 	int error;
+	struct timespec tv;
 
 /*	gfs2_init_lmh(); gfs2 should do this for us*/
 
@@ -46,7 +48,8 @@ int __init init_gfs_fs(void)
 	if (error)
 		goto fail;
 
-	gfs_random_number = xtime.tv_nsec;
+	getnstimeofday(&tv);
+	gfs_random_number = tv.tv_nsec; 
 
 	gfs_glock_cachep = kmem_cache_create("gfs_glock", sizeof(struct gfs_glock),
 					     0, 0,
diff --git a/gfs-kernel/src/gfs/ops_export.c b/gfs-kernel/src/gfs/ops_export.c
index c82d82b..7a76754 100644
--- a/gfs-kernel/src/gfs/ops_export.c
+++ b/gfs-kernel/src/gfs/ops_export.c
@@ -44,49 +44,6 @@ struct get_name_filldir
 };
 
 /**
- * gfs_decode_fh -
- * @param1: description
- * @param2: description
- * @param3: description
- *
- * Function description
- *
- * Returns: what is returned
- */
-
-struct dentry *
-gfs_decode_fh(struct super_block *sb, __u32 *fh, int fh_len, int fh_type,
-	      int (*acceptable)(void *context, struct dentry *dentry),
-	      void *context)
-{
-	struct inode_cookie this, parent;
-
-	atomic_inc(&get_v2sdp(sb)->sd_ops_export);
-
-	memset(&parent, 0, sizeof(struct inode_cookie));
-
-	switch (fh_type) {
-	case 6:
-		parent.gen_valid = TRUE;
-		parent.gen = gfs32_to_cpu(fh[5]);
-	case 5:
-		parent.formal_ino = ((uint64_t)gfs32_to_cpu(fh[3])) << 32;
-		parent.formal_ino |= (uint64_t)gfs32_to_cpu(fh[4]);
-	case 3:
-		this.gen_valid = TRUE;
-		this.gen = gfs32_to_cpu(fh[2]);
-		this.formal_ino = ((uint64_t)gfs32_to_cpu(fh[0])) << 32;
-		this.formal_ino |= (uint64_t)gfs32_to_cpu(fh[1]);
-		break;
-	default:
-		return NULL;
-	}
-
-	return gfs_export_ops.find_exported_dentry(sb, &this, &parent,
-						   acceptable, context);
-}
-
-/**
  * gfs_encode_fh -
  * @param1: description
  * @param2: description
@@ -290,10 +247,9 @@ gfs_get_parent(struct dentry *child)
  */
 
 struct dentry *
-gfs_get_dentry(struct super_block *sb, void *inump)
+gfs_get_dentry(struct super_block *sb, struct inode_cookie *cookie)
 {
 	struct gfs_sbd *sdp = get_v2sdp(sb);
-	struct inode_cookie *cookie = (struct inode_cookie *)inump;
 	struct gfs_inum inum;
 	struct gfs_holder i_gh, ri_gh, rgd_gh;
 	struct gfs_rgrpd *rgd;
@@ -406,11 +362,55 @@ gfs_get_dentry(struct super_block *sb, void *inump)
 	return ERR_PTR(error);
 }
 
-struct export_operations gfs_export_ops = {
-	.decode_fh = gfs_decode_fh,
+static struct dentry *gfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
+		int fh_len, int fh_type)
+{
+	struct inode_cookie this;
+	__u32 *fh = fid->raw;
+
+	atomic_inc(&get_v2sdp(sb)->sd_ops_export);
+
+	switch (fh_type) {
+	case 6:
+	case 5:
+	case 3:
+		this.gen_valid = TRUE;
+		this.gen = gfs32_to_cpu(fh[2]);
+		this.formal_ino = ((uint64_t)gfs32_to_cpu(fh[0])) << 32;
+		this.formal_ino |= (uint64_t)gfs32_to_cpu(fh[1]);
+		return gfs_get_dentry(sb, &this);
+	default:
+		return NULL;
+	}
+}
+
+static struct dentry *gfs_fh_to_parent(struct super_block *sb, struct fid *fid,
+		int fh_len, int fh_type)
+{
+	struct inode_cookie parent;
+	__u32 *fh = fid->raw;
+
+	atomic_inc(&get_v2sdp(sb)->sd_ops_export);
+
+	switch (fh_type) {
+	case 6:
+		parent.gen_valid = TRUE;
+		parent.gen = gfs32_to_cpu(fh[5]);
+	case 5:
+		parent.formal_ino = ((uint64_t)gfs32_to_cpu(fh[3])) << 32;
+		parent.formal_ino |= (uint64_t)gfs32_to_cpu(fh[4]);
+	default:
+		return NULL;
+	}
+
+	return gfs_get_dentry(sb, &parent);
+}
+
+const struct export_operations gfs_export_ops = {
 	.encode_fh = gfs_encode_fh,
+	.fh_to_dentry = gfs_fh_to_dentry,
+	.fh_to_parent = gfs_fh_to_parent,
 	.get_name = gfs_get_name,
 	.get_parent = gfs_get_parent,
-	.get_dentry = gfs_get_dentry,
 };
 
diff --git a/gfs-kernel/src/gfs/ops_export.h b/gfs-kernel/src/gfs/ops_export.h
index 31983d7..36910e2 100644
--- a/gfs-kernel/src/gfs/ops_export.h
+++ b/gfs-kernel/src/gfs/ops_export.h
@@ -14,6 +14,6 @@
 #ifndef __OPS_EXPORT_DOT_H__
 #define __OPS_EXPORT_DOT_H__
 
-extern struct export_operations gfs_export_ops;
+extern const struct export_operations gfs_export_ops;
 
 #endif /* __OPS_EXPORT_DOT_H__ */
diff --git a/gfs-kernel/src/gfs/sys.c b/gfs-kernel/src/gfs/sys.c
index a4f411d..de64a3f 100644
--- a/gfs-kernel/src/gfs/sys.c
+++ b/gfs-kernel/src/gfs/sys.c
@@ -86,7 +86,6 @@ static struct kobj_type gfs_ktype = {
 };
 
 static struct kset gfs_kset = {
-	.kobj   = {.name = "gfs",},
 	.ktype  = &gfs_ktype,
 };
 
@@ -120,6 +119,7 @@ int gfs_sys_init(void)
 {
 	gfs_sys_margs = NULL;
 	spin_lock_init(&gfs_sys_margs_lock);
+	kobject_set_name(&gfs_kset.kobj, "gfs");
 	kobj_set_kset_s(&gfs_kset, fs_subsys);
 	return kset_register(&gfs_kset);
 }

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]