[Ocfs2-commits] manish commits r924 - in trunk/src: . inc

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon May 17 19:29:08 CDT 2004


Author: manish
Date: 2004-05-17 18:29:06 -0500 (Mon, 17 May 2004)
New Revision: 924

Modified:
   trunk/src/heartbeat.c
   trunk/src/inc/ocfs.h
   trunk/src/osb.c
Log:
OcfsQuerySystemTime replaced by ocfs_get_publish_time, which just
uses jiffies.

node_map->scan_{rate,time} unused, so code deleted and removed from
the structure.

redundant redudant node_map->time[i] assignment removed from
ocfs_update_publish_map (first_time)


Modified: trunk/src/heartbeat.c
===================================================================
--- trunk/src/heartbeat.c	2004-05-17 23:26:51 UTC (rev 923)
+++ trunk/src/heartbeat.c	2004-05-17 23:29:06 UTC (rev 924)
@@ -77,7 +77,7 @@
 			publish->dirty = 0; 
 		}
 		/* Write the current time in local node's publish sector */
-		OcfsQuerySystemTime (&publish->time);
+		publish->time = ocfs_get_publish_time();
 		publish->hbm[osb->node_num] = osb->hbm;
 		spin_lock (&OcfsGlobalCtxt.comm_seq_lock);
 		publish->comm_seq_num = OcfsGlobalCtxt.comm_seq_num;
@@ -120,7 +120,6 @@
 {
 	ocfs_publish *publish;
 	ocfs_vol_node_map *node_map;
-	__u64 curr_time = 0;
 	__u32 i;
 	__u32 num_nodes;
 
@@ -128,9 +127,6 @@
 
 	num_nodes = OCFS_MAXIMUM_NODES;
 	node_map = &(osb->vol_node_map);
-#if !defined(USERSPACE_TOOL)
-	OcfsQuerySystemTime (&curr_time);
-#endif
 
 	/* First time thru, update buffer with timestamps for all nodes */
 	if (first_time) {
@@ -146,8 +142,6 @@
 		for (i = 0;  i < num_nodes; i++) {
 			publish = (ocfs_publish *) OCFS_BH_GET_DATA_READ(bhs[i]); /* read */
 			node_map->time[i] = publish->time;
-			node_map->scan_rate[i] = publish->hbm[i];
-			node_map->scan_time[i] = curr_time;
 			if (publish->mounted && i != osb->node_num) {
 				printk("ocfs2: Adding %s (node %d) to "
 				       "clustered device (%u,%u)\n",
@@ -155,7 +149,6 @@
 				       MAJOR(osb->sb->s_dev), 
 				       MINOR(osb->sb->s_dev));
 				node_map->miss_cnt[i] = 0;
-				node_map->time[i] = publish->time;
 				UPDATE_PUBLISH_MAP(osb->publ_map, i, 
 						   OCFS_PUBLISH_SET, 
 						   num_nodes);
@@ -186,6 +179,7 @@
 							    num_nodes);
 				} else
 					(node_map->miss_cnt[i])++;
+
 				if (node_map->miss_cnt[i] > MISS_COUNT_VALUE) {
 #if !defined(USERSPACE_TOOL)
 					printk ("ocfs2: Removing %s (node %d) "
@@ -234,7 +228,6 @@
 			}
 #endif
 		}
-		node_map->scan_time[i] = curr_time;
 		OCFS_BH_PUT_DATA(bhs[i]);
 	}
 

Modified: trunk/src/inc/ocfs.h
===================================================================
--- trunk/src/inc/ocfs.h	2004-05-17 23:26:51 UTC (rev 923)
+++ trunk/src/inc/ocfs.h	2004-05-17 23:29:06 UTC (rev 924)
@@ -200,24 +200,19 @@
 
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-#define OcfsQuerySystemTime(t)						      \
-	do {								      \
-		*t = (__u64)(CURRENT_TIME.tv_sec) * (__u64) 10000000;	      \
-		*t += (__u64)(CURRENT_TIME.tv_nsec) / (__u64) 100;	      \
-	} while (0)
 #define OCFS_CURRENT_TIME   (CURRENT_TIME.tv_sec)
 #define OCFS_SET_INODE_TIME(i, x, y)   (i->x.tv_sec = (y))
 #else
-/* time is in 0.1 microsecs */
-#define OcfsQuerySystemTime(t)                                                \
-			  do {                                                \
-			    (*t)  = (__u64)((__u64)CURRENT_TIME * (__u64)10000000); \
-			    (*t) += (__u64)((__u64)xtime.tv_usec * (__u64)10);      \
-			  } while (0)
 #define OCFS_CURRENT_TIME   (CURRENT_TIME)
 #define OCFS_SET_INODE_TIME(i, x, y)   i->x = (y)
 #endif
 
+static inline __u64 ocfs_get_publish_time(void)
+{
+	unsigned long ret = jiffies;
+	return (ret != 0 ? ret : 1);
+}
+
 #ifdef __KERNEL__
 #define ocfs_getpid()               current->pid
 #else
@@ -1712,12 +1707,6 @@
 typedef struct _ocfs_vol_node_map
 {
 	__u64 time[OCFS_MAXIMUM_NODES];
-	__u64 scan_time[OCFS_MAXIMUM_NODES];
-	__u8 scan_rate[OCFS_MAXIMUM_NODES];
-#ifdef UNUSED
-	__u8 exp_scan_rate[OCFS_MAXIMUM_NODES];
-	__u64 exp_rate_chng_time[OCFS_MAXIMUM_NODES];
-#endif
 	__u32 miss_cnt[OCFS_MAXIMUM_NODES];
 	atomic_t dismount[OCFS_MAXIMUM_NODES];
 	__u64 largest_seq_num;

Modified: trunk/src/osb.c
===================================================================
--- trunk/src/osb.c	2004-05-17 23:26:51 UTC (rev 923)
+++ trunk/src/osb.c	2004-05-17 23:29:06 UTC (rev 924)
@@ -198,9 +198,7 @@
 	}
 	publish = (ocfs_publish *) OCFS_BH_GET_DATA_WRITE(publish_bh); /* write */
 
-	/*  Zero out the time stamp to write a new value */
-	publish->time = 0;
-	OcfsQuerySystemTime (&publish->time);
+	publish->time = ocfs_get_publish_time();
 
 	OCFS_BH_PUT_DATA(publish_bh);
 	publish = NULL;



More information about the Ocfs2-commits mailing list