[Ocfs2-commits] mfasheh commits r2178 - trunk/fs/ocfs2/cluster

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Apr 26 13:56:38 CDT 2005


Author: mfasheh
Signed-off-by: jlbec
Date: 2005-04-26 13:56:36 -0500 (Tue, 26 Apr 2005)
New Revision: 2178

Modified:
   trunk/fs/ocfs2/cluster/nodemanager.c
   trunk/fs/ocfs2/cluster/ocfs2_nodemanager.h
Log:
* export some interface revision information so tools can determine whether 
  they are out of date.

Signed-off-by: jlbec



Modified: trunk/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.c	2005-04-26 05:58:14 UTC (rev 2177)
+++ trunk/fs/ocfs2/cluster/nodemanager.c	2005-04-26 18:56:36 UTC (rev 2178)
@@ -733,6 +733,31 @@
 	config_item_put(item);
 }
 
+static struct configfs_attribute nm_cluster_group_version = {
+	.ca_owner = THIS_MODULE,
+	.ca_name  = "interface_revision",
+	.ca_mode  = S_IRUSR | S_IRGRP | S_IROTH,
+};
+
+static struct configfs_attribute *nm_cluster_group_attrs[] = {
+	&nm_cluster_group_version,
+	NULL,
+};
+
+static ssize_t nm_cluster_group_show_revision(struct config_item *item,
+					      struct configfs_attribute *attr,
+					      char *page)
+{
+	unsigned int ret;
+
+	ret = sprintf(page, "%u\n", NM_API_VERSION);
+	return ret;
+}
+
+static struct configfs_item_operations nm_cluster_group_item_ops = {
+	.show_attribute	= nm_cluster_group_show_revision,
+};
+
 static struct configfs_group_operations nm_cluster_group_group_ops = {
 	.make_group	= nm_cluster_group_make_group,
 	.drop_item	= nm_cluster_group_drop_item,
@@ -741,6 +766,8 @@
 static struct config_item_type nm_cluster_group_type = {
 	.ct_group_ops	= &nm_cluster_group_group_ops,
 	.ct_owner	= THIS_MODULE,
+	.ct_attrs	= nm_cluster_group_attrs,
+	.ct_item_ops	= &nm_cluster_group_item_ops,
 };
 
 static struct nm_cluster_group nm_cluster_group = {

Modified: trunk/fs/ocfs2/cluster/ocfs2_nodemanager.h
===================================================================
--- trunk/fs/ocfs2/cluster/ocfs2_nodemanager.h	2005-04-26 05:58:14 UTC (rev 2177)
+++ trunk/fs/ocfs2/cluster/ocfs2_nodemanager.h	2005-04-26 18:56:36 UTC (rev 2178)
@@ -30,10 +30,11 @@
 
 #include "ocfs2_heartbeat.h"
 
-#define NM_MAX_IFACES            2
-#define NM_MAX_NODES             255
-#define NM_INVALID_SLOT_NUM      255
+#define NM_API_VERSION		1
 
+#define NM_MAX_NODES		255
+#define NM_INVALID_SLOT_NUM	255
+
 /* host name, group name, cluster name all 64 bytes */
 #define NM_MAX_NAME_LEN          64    // __NEW_UTS_LEN
 



More information about the Ocfs2-commits mailing list