[Ocfs2-commits] rev 29 - in trunk/src: . inc

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Feb 6 16:11:49 CST 2004


Author: manish
Date: 2004-02-06 16:11:47 -0600 (Fri, 06 Feb 2004)
New Revision: 29

Modified:
   trunk/src/alloc.c
   trunk/src/bitmap.c
   trunk/src/dcache.c
   trunk/src/dir.c
   trunk/src/dlm.c
   trunk/src/extmap.c
   trunk/src/file.c
   trunk/src/hash.c
   trunk/src/inc/io.h
   trunk/src/inc/ocfs.h
   trunk/src/inode.c
   trunk/src/io.c
   trunk/src/journal.c
   trunk/src/namei.c
   trunk/src/nm.c
   trunk/src/oin.c
   trunk/src/osb.c
   trunk/src/sem.c
   trunk/src/super.c
   trunk/src/symlink.c
   trunk/src/sysfile.c
   trunk/src/util.c
   trunk/src/volcfg.c
   trunk/src/vote.c
Log:
update the buffer functions to be more uniform.
changes for debug context
fix updatelockstate for local requests
fixed umount hang on journal shutdown


Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/alloc.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -8,7 +8,7 @@
 
 
 /* Tracing */
-#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_EXTENT
+#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_ALLOC
 
 static int ocfs_allocate_new_data_node (ocfs_super * osb, 
 				 ocfs_file_entry * FileEntry,
@@ -673,11 +673,7 @@
 		memset(buff, 0, osb->sect_size);
 
 		/* TODO: Do we really need to do this? */
-#ifdef LINUX_2_5
 		set_buffer_uptodate(header_bhs[i]);
-#else
-		mark_buffer_uptodate(header_bhs[i], true);
-#endif
 		OCFS_BH_PUT_DATA(header_bhs[i]);
 	}
 
@@ -901,11 +897,7 @@
 		}
 		buf = OCFS_BH_GET_DATA_WRITE(bhs[i]);  /* write */
 		memset(buf, 0, osb->sect_size);
-#ifdef LINUX_2_5
 		set_buffer_uptodate(bhs[i]);
-#else
-		mark_buffer_uptodate(bhs[i], true);
-#endif
 		OCFS_BH_PUT_DATA(bhs[i]);
 	}
 

Modified: trunk/src/bitmap.c
===================================================================
--- trunk/src/bitmap.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/bitmap.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -32,7 +32,7 @@
 #endif
 
 /* Tracing */
-#define OCFS_DEBUG_CONTEXT  OCFS_DEBUG_CONTEXT_PORT
+#define OCFS_DEBUG_CONTEXT  OCFS_DEBUG_CONTEXT_BITMAP
 
 /*
  * ocfs_initialize_bitmap()

Modified: trunk/src/dcache.c
===================================================================
--- trunk/src/dcache.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/dcache.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,6 +1,6 @@
 #include  <ocfs.h>
 
-#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_EXTENT
+#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_DCACHE
 
 
 static int ocfs_empty_func(struct dentry *dentry, void *ignore);

Modified: trunk/src/dir.c
===================================================================
--- trunk/src/dir.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/dir.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,7 +1,7 @@
 #include  <ocfs.h>
 
 
-#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_EXTENT
+#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_DIR
 
 static int ocfs_insert_dir_node (ocfs_super * osb, struct buffer_head *bhs[], ocfs_file_entry * InsertEntry, struct buffer_head *lockbh, __s32 * IndexOffset, struct buffer_head **insert_bh, ocfs_journal_handle * handle, struct inode *dir_inode, struct inode *file_inode);
 static bool ocfs_search_dir_node (ocfs_super * osb, struct buffer_head *bhs[], struct qstr * SearchName, struct buffer_head ** found_fe_bh, ocfs_file * OFile, struct inode *dir_inode, bool sync);
@@ -806,7 +806,7 @@
 		freeOffset = 0;
 	}
 	
-	mark_buffer_uptodate(bhs[freeOffset+1], true);
+	set_buffer_uptodate(bhs[freeOffset+1]);
 	status = ocfs_journal_access(handle, bhs[freeOffset+1], 
 				     OCFS_JOURNAL_ACCESS_WRITE);
 	if (status < 0) {
@@ -1248,7 +1248,7 @@
 				newbhs[i] = getblk(OCFS_GET_BLOCKDEV(osb->sb),
 						   blk++, 
 						   osb->sb->s_blocksize);
-				mark_buffer_uptodate(newbhs[i], true);
+				set_buffer_uptodate(newbhs[i]);
 				/* clear all 128k, all garbage currently */
 				status = ocfs_journal_access(handle, newbhs[i],
 						    OCFS_JOURNAL_ACCESS_WRITE);

Modified: trunk/src/dlm.c
===================================================================
--- trunk/src/dlm.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/dlm.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,5 +1,5 @@
 /*
- * ocfsgendlm.c
+ * dlm.c
  *
  * Distributed lock manager. Requests and processes lock votes.
  *
@@ -84,6 +84,11 @@
 	ocfs_acquire_lockres (lockres);
 	votemap = (1 << lockres->master_node_num);
 
+	if (votemap == (1 << osb->node_num)) {
+		status = 0;
+		goto vote_success;
+	}
+
 	if (comm_voting && !*disk_vote) {
 		LOG_TRACE_STR ("Network vote");
 		jif = jiffies;

Modified: trunk/src/extmap.c
===================================================================
--- trunk/src/extmap.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/extmap.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,6 +1,6 @@
 #include  <ocfs.h>
 
-#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_EXTENT
+#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_EXTMAP
 
 /* Crazy wacky extent map stuff */
 /* works ok in userland debugocfs stuff too */

Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/file.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,5 +1,5 @@
 #include  <ocfs.h>
-#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_EXTENT
+#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_FILE
 
 static int ocfs_change_file_attrib (ocfs_super * osb, __u64 parent_off, ocfs_inode * oin, __u64 file_size, __u64 file_off, struct iattr *attr, struct inode *inode);
 static int ocfs_truncate_file (ocfs_super * osb, __u64 file_off, __u64 file_size, ocfs_inode * oin, struct inode *inode);

Modified: trunk/src/hash.c
===================================================================
--- trunk/src/hash.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/hash.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,5 +1,5 @@
 /*
- * ocfshash.c
+ * hash.c
  *
  * Allows for creation and destruction of a hash table which one
  * can use to read, write and delete data.

Modified: trunk/src/inc/io.h
===================================================================
--- trunk/src/inc/io.h	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/inc/io.h	2004-02-06 22:11:47 UTC (rev 29)
@@ -50,11 +50,43 @@
 #define OCFS_NONCACHED(osb,off)  ((off) < (osb)->vol_layout.data_start_off)
 
 #define BH_Modified 18
-#define buffer_modified(bh)		__buffer_state((bh),Modified)
-#define set_buffer_modified(bh)		set_bit(BH_Modified, &(bh)->b_state);
-#define clear_buffer_modified(bh)	clear_bit(BH_Modified, &(bh)->b_state);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+/* 
+ * BUFFER_FNS is the new marcro magic intruduced in 2.5.x kernel for defining
+ * set_buffer_XXX, clear_buffer_XXX, and buffer_XXX functions
+ */
+BUFFER_FNS(Modified, modified)
 
+#else /* 2.4.x kernel */
+
+/*
+ * Copied right out of the 2.6.2 kernel's buffer_head.h:
+ * macro tricks to expand the set_buffer_foo(), clear_buffer_foo()
+ * and buffer_foo() functions.
+ */
+#define BUFFER_FNS(bit, name)						\
+static inline void set_buffer_##name(struct buffer_head *bh)		\
+{									\
+	set_bit(BH_##bit, &(bh)->b_state);				\
+}									\
+static inline void clear_buffer_##name(struct buffer_head *bh)		\
+{									\
+	clear_bit(BH_##bit, &(bh)->b_state);				\
+}									\
+static inline int buffer_##name(struct buffer_head *bh)			\
+{									\
+	return test_bit(BH_##bit, &(bh)->b_state);			\
+}
+
+#undef buffer_uptodate
+#undef buffer_dirty
+BUFFER_FNS(Uptodate, uptodate)
+BUFFER_FNS(Modified, modified)
+BUFFER_FNS(Dirty, dirty)
+
+#endif /* 2.4.x kernel */
+
 static inline void * OCFS_BH_GET_DATA_READ(struct buffer_head *bh)
 {
 	unsigned char *kaddr;

Modified: trunk/src/inc/ocfs.h
===================================================================
--- trunk/src/inc/ocfs.h	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/inc/ocfs.h	2004-02-06 22:11:47 UTC (rev 29)
@@ -1177,40 +1177,33 @@
 #define OCFS_DEBUG_LEVEL_PRINTK        0x00001000
 
 /* Tracing Contexts */
-#define OCFS_DEBUG_CONTEXT_INIT        0x00000001	/* ocfsgeninit.c,ocfsmain.c */
-#define OCFS_DEBUG_CONTEXT_MEM         0x00000002	/* ocfs_memcheck() in ocfsmain.c */
+#define OCFS_DEBUG_CONTEXT_ALLOC       0x00000001	/* alloc.c    */
+#define OCFS_DEBUG_CONTEXT_DIR         0x00000002	/* dir.c      */
+#define OCFS_DEBUG_CONTEXT_EXTMAP      0x00000004	/* extmap.c   */
+#define OCFS_DEBUG_CONTEXT_HEARTBEAT   0x00000008	/* hearbeat.c */
+#define OCFS_DEBUG_CONTEXT_IOCTL       0x00000010	/* ioctl.c    */
+#define OCFS_DEBUG_CONTEXT_NM          0x00000020	/* nm.c       */
+#define OCFS_DEBUG_CONTEXT_PROC        0x00000040	/* proc.c     */
+#define OCFS_DEBUG_CONTEXT_SYMLINK     0x00000080	/* symlink.c  */
+#define OCFS_DEBUG_CONTEXT_BITMAP      0x00000100	/* bitmap.c   */
+#define OCFS_DEBUG_CONTEXT_FILE        0x00000200	/* file.c     */
+#define OCFS_DEBUG_CONTEXT_INODE       0x00000400	/* inode.c    */
+#define OCFS_DEBUG_CONTEXT_JOURNAL     0x00000800	/* journal.c  */
+#define OCFS_DEBUG_CONTEXT_OIN         0x00001000	/* oin.c      */
+#define OCFS_DEBUG_CONTEXT_SEM         0x00002000	/* sem.c      */
+#define OCFS_DEBUG_CONTEXT_SYSFILE     0x00004000	/* sysfile.c  */
+#define OCFS_DEBUG_CONTEXT_VOLCFG      0x00008000	/* volcfg.c   */
+#define OCFS_DEBUG_CONTEXT_DCACHE      0x00010000	/* dcache.c   */
+#define OCFS_DEBUG_CONTEXT_DLM         0x00020000	/* dlm.c      */
+#define OCFS_DEBUG_CONTEXT_HASH        0x00040000	/* hash.c     */
+#define OCFS_DEBUG_CONTEXT_IO          0x00080000	/* io.c       */
+#define OCFS_DEBUG_CONTEXT_NAMEI       0x00100000	/* namei.c    */
+#define OCFS_DEBUG_CONTEXT_OSB         0x00200000	/* osb.c      */
+#define OCFS_DEBUG_CONTEXT_SUPER       0x00400000	/* super.c    */
+#define OCFS_DEBUG_CONTEXT_UTIL        0x00800000	/* util.c     */
+#define OCFS_DEBUG_CONTEXT_VOTE        0x01000000	/* vote.c     */
 
-#define OCFS_DEBUG_CONTEXT_NM          0x00000010	/* ocfsgennm.c */
-#define OCFS_DEBUG_CONTEXT_DLM         0x00000020	/* ocfsgendlm.c */
-#define OCFS_DEBUG_CONTEXT_VOTE        0x00000040	/* ocfsgenvote.c */
-#define OCFS_DEBUG_CONTEXT_IPC         0x00000080	/* ocfsipc.c */
 
-#define OCFS_DEBUG_CONTEXT_VOLCFG      0x00000100	/* ocfsgenvolcfg.c */
-#define OCFS_DEBUG_CONTEXT_HEARTBEAT   0x00000200	/* ocfsgenheartbeat.c */
-
-#define OCFS_DEBUG_CONTEXT_MOUNT       0x00001000	/* ocfsmount.c */
-#define OCFS_DEBUG_CONTEXT_SHUTDOWN    0x00002000	/* ocfsgenshutdn.c */
-#define OCFS_DEBUG_CONTEXT_SUPER       0x00004000	/* super.c */
-#define OCFS_DEBUG_CONTEXT_CLOSE       0x00008000	/* genclose.c, ocfsclose.c */
-
-#define OCFS_DEBUG_CONTEXT_EXTENT      0x00010000	/* ocfsgenalloc.c */
-#define OCFS_DEBUG_CONTEXT_DIRINFO     0x00020000	/* ocfsgendirnode.c */
-#define OCFS_DEBUG_CONTEXT_FILEINFO    0x00040000	/* ocfsfile.c */
-#define OCFS_DEBUG_CONTEXT_TRANS       0x00080000	/* ocfsgentrans.c */
-
-#define OCFS_DEBUG_CONTEXT_DISKIO      0x00100000	/* ocfsgenio.c */
-#define OCFS_DEBUG_CONTEXT_MISC        0x00200000	/* ocfsgenmisc.c */
-
-#define OCFS_DEBUG_CONTEXT_UTIL        0x01000000	/* ocfsgenutil.c */
-#define OCFS_DEBUG_CONTEXT_HASH        0x02000000	/* ocfshash.h */
-#define OCFS_DEBUG_CONTEXT_PORT        0x08000000	/* ocfsport.c */
-
-#define OCFS_DEBUG_CONTEXT_IOCTL       0x10000000	/* ocfsioctl.c */
-#define OCFS_DEBUG_CONTEXT_PROC        0x20000000	/* proc.c */
-#define OCFS_DEBUG_CONTEXT_IOSUP       0x40000000	/* iosup.c */
-#define OCFS_DEBUG_CONTEXT_JOURNAL     0x80000000      /*  journal.c */
-
-
 #ifdef OCFS_DBG_TIMING
 typedef union _my_timing_t
 {

Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/inode.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,6 +1,6 @@
 #include  <ocfs.h>
 
-#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_EXTENT
+#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_INODE
 
 
 static int ocfs_readpage (struct file *file, struct page *page);

Modified: trunk/src/io.c
===================================================================
--- trunk/src/io.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/io.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -26,7 +26,7 @@
 
 #include <ocfs.h>
 
-#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_DISKIO
+#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_IO
 
 static int ocfs_read_bhs_iarr (ocfs_super * osb, __u64 off, __u64 len, 
 				 struct buffer_head *bhs[], int flags, 
@@ -265,12 +265,8 @@
 		}
 
 		lock_buffer(bh);
-
-#ifdef LINUX_2_5
 		set_buffer_uptodate(bh);
-#else
-		mark_buffer_uptodate(bh, true);
-#endif
+
 		/* remove from dirty list before I/O. */
 		mark_buffer_clean(bh);
 
@@ -418,11 +414,7 @@
 			}
 
 			lock_buffer(bh);
-#ifdef LINUX_2_5
 			clear_buffer_uptodate(bh);
-#else
-			mark_buffer_uptodate(bh, false);
-#endif
 			bh->b_end_io = ocfs_end_buffer_io_sync;
 			submit_bh(READ, bh);
 			continue;
@@ -547,11 +539,7 @@
 
 		lock_buffer(bh);
 
-#ifdef LINUX_2_5
 		set_buffer_uptodate(bh);
-#else
-		mark_buffer_uptodate(bh, true);
-#endif
 		/* remove from dirty list before I/O. */
 		mark_buffer_clean(bh);
 
@@ -699,11 +687,7 @@
 			}
 
 			lock_buffer(bh);
-#ifdef LINUX_2_5
 			clear_buffer_uptodate(bh);
-#else
-			mark_buffer_uptodate(bh, false);
-#endif
 			bh->b_end_io = ocfs_end_buffer_io_sync;
 			submit_bh(READ, bh);
 			continue;

Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/journal.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -511,12 +511,8 @@
 		 * gets written to disk inadvertantly by someone
 		 * else. */
 
-#ifdef LINUX_2_5
 		clear_buffer_uptodate(bh);
-#else
-		mark_buffer_uptodate(bh, false);
-#endif
-		clear_bit(BH_Dirty, &bh->b_state);
+		clear_buffer_dirty(bh);
 
 		unlock_buffer(bh);
 		/* journal_forget will bforget the buffers for us too. */
@@ -1002,26 +998,30 @@
 		LOG_TRACE_ARGS("Shutting down journal: must wait on %d"
 			       " running transactions!\n", num_running_trans);
 
+	/* Do a commit_cache here. It will flush our journal, *and*
+	 * release any locks that are still held.
+	 * set the SHUTDOWN flag and release the trans lock.
+	 * the commit thread will take the trans lock for us below. */
 	down(&osb->trans_lock);
-	/* Do a commit_cache here. It will flush our journal, *and*
-	 * release any locks that are still held The
-	 * OCFS_JOURNAL_IN_SHUTDOWN will signal to commit_cache to not
-	 * drop the trans_lock (which we want to hold until we
-	 * completely destroy the journal. */
 	journal->state = OCFS_JOURNAL_IN_SHUTDOWN;
-	
+	up(&osb->trans_lock);
+
+	/* wake the commit thread */
 	atomic_set (&osb->flush_event_woken, 1);
 	wake_up (&osb->flush_event);
 
-	/* Wait for the commit thread */
+	/* The OCFS_JOURNAL_IN_SHUTDOWN will signal to commit_cache to not
+	 * drop the trans_lock (which we want to hold until we
+	 * completely destroy the journal. */
 	if (osb->commit && osb->commit->c_task) {
+		/* Wait for the commit thread */
 		LOG_TRACE_STR ("Waiting for ocfs2commit to exit....");
 		send_sig (SIGINT, osb->commit->c_task, 0);
 		wait_for_completion(&osb->commit->c_complete);
 		osb->commit->c_task = NULL;
 		ocfs_free(osb->commit);
 	}
-
+	
 	/* Shutdown the kernel journal system */
 	journal_destroy(journal->k_journal);
 
@@ -1699,6 +1699,7 @@
 
 #define OCFS_COMMIT_MISS_MAX  5
 #define OCFS_COMMIT_INTERVAL  2000 // in ms
+
 int ocfs_commit_thread(void *arg)
 {
 	int status = 0, misses = 0, finish = 0;
@@ -1706,6 +1707,7 @@
 	ocfs_commit_task *commit = osb->commit;
 	struct list_head *head = &commit->c_list;
 	char name[16];
+	ocfs_journal * journal = &osb->journal;
 
 	sprintf (name, "ocfs2cmt-%d", osb->osb_id);
 	ocfs_daemonize (name, strlen(name));
@@ -1756,6 +1758,11 @@
 			misses = 0;
 		}
 
+		/* journal shutdown has asked me to do one last commit cache */
+		/* this commit cache will leave trans lock held! */
+		if (journal->state == OCFS_JOURNAL_IN_SHUTDOWN)
+			finish = 1;
+
 		status = ocfs_commit_cache (osb, false);
 		if (status < 0)
 			LOG_ERROR_STATUS(status);
@@ -1930,7 +1937,7 @@
 		BUFFER_TRACE(bh, "marking dirty");
 		mark_buffer_dirty(bh);
 		BUFFER_TRACE(bh, "marking uptodate");
-		mark_buffer_uptodate(bh, 1);
+		set_buffer_uptodate(bh);
 		brelse(bh);
 	}
 

Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/namei.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,6 +1,6 @@
 #include  <ocfs.h>
 
-#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_EXTENT
+#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_NAMEI
 
 static int ocfs_fe_smash (ocfs_super * osb, __u64 lock_node_off, __u32 flags, __u64 file_off, ocfs_journal_handle *passed_handle, ocfs_bitmap_free_head **ret_head, struct dentry *dentry, struct inode *parent_inode);
 static int ocfs_rename_file (ocfs_super * osb, ocfs_journal_handle *handle, __u64 parent_off, struct dentry *dentry, __u64 file_off, struct inode *dir_inode);
@@ -425,7 +425,7 @@
 			dirbhs[i] = getblk (OCFS_GET_BLOCKDEV(osb->sb), 
 					    blk++, osb->sb->s_blocksize);
 
-			mark_buffer_uptodate(dirbhs[i], true);
+			set_buffer_uptodate(dirbhs[i]);
 			status = ocfs_journal_access(handle, dirbhs[i], 
 					     OCFS_JOURNAL_ACCESS_WRITE);
 			if (status < 0) {

Modified: trunk/src/nm.c
===================================================================
--- trunk/src/nm.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/nm.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -223,7 +223,7 @@
 	int status = 0;
 	__u8 *buffer = NULL;
 	ocfs_publish *publish;
-	__u32 i;
+	__u32 i, j;
 	__u32 highest_vote_node;
 	__u64 offset = 0;
 	__u32 num_nodes = 0;
@@ -257,6 +257,9 @@
 		if (OcfsGlobalCtxt.hbm == 0)
 			OcfsGlobalCtxt.hbm = DISK_HBEAT_NO_COMM;
 
+		if (!time_after (jiffies, (unsigned long) (osb->hbt)))
+			goto finally;
+
 		/* try to prune some bh_sem hash entries if list is too long */
 		pruned = ocfs_bh_sem_hash_prune();
 		LOG_TRACE_ARGS("pruned %d entries from nm thread\n", pruned);
@@ -385,6 +388,7 @@
 				goto finally;
 			}
 		}
+		osb->hbt = 50 + jiffies;
 
 finally:
 		status = 0;
@@ -392,7 +396,12 @@
 		if ((OcfsGlobalCtxt.flags & OCFS_FLAG_SHUTDOWN_VOL_THREAD) ||
 		    (osb->osb_flags & OCFS_OSB_FLAGS_BEING_DISMOUNTED))
 			break;
-		schedule_timeout (50);
+		j = jiffies;
+		if (time_after (j, (unsigned long) (osb->hbt))) {
+			osb->hbt = 50 + j;
+		}
+		set_current_state (TASK_INTERRUPTIBLE);
+		schedule_timeout (osb->hbt - j);
 	}
 
         /* Flush all scheduled tasks */
@@ -578,9 +587,6 @@
 	return status;
 }				/* ocfs_find_update_res */
 
-#undef OCFS_DEBUG_CONTEXT
-#define OCFS_DEBUG_CONTEXT	OCFS_DEBUG_CONTEXT_DLM
-
 static inline int get_process_vote_action(ocfs_super * osb, ocfs_lock_res *lockres, __u32 node_num, 
 					  __u32 flags, int status, bool *master_alive, ocfs_inode **oin)
 {

Modified: trunk/src/oin.c
===================================================================
--- trunk/src/oin.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/oin.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,6 +1,6 @@
 #include  <ocfs.h>
 
-#define OCFS_DEBUG_CONTEXT      OCFS_DEBUG_CONTEXT_IOSUP
+#define OCFS_DEBUG_CONTEXT      OCFS_DEBUG_CONTEXT_OIN
 
 
 
@@ -576,7 +576,7 @@
 
 	if (hdr_bh) {
 		lock_buffer(hdr_bh);
-		mark_buffer_uptodate(hdr_bh, false);
+		clear_buffer_uptodate(hdr_bh);
 		unlock_buffer(hdr_bh);
 		brelse(hdr_bh);
 	}

Modified: trunk/src/osb.c
===================================================================
--- trunk/src/osb.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/osb.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,6 +1,6 @@
 #include  <ocfs.h>
 
-#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_EXTENT
+#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_OSB
 
 
 /*

Modified: trunk/src/sem.c
===================================================================
--- trunk/src/sem.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/sem.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,6 +1,6 @@
 #include  <ocfs.h>
 
-#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_EXTENT
+#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_SEM
 
 /*
  * ocfs_init_sem()

Modified: trunk/src/super.c
===================================================================
--- trunk/src/super.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/super.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -707,7 +707,7 @@
 
 	OCFS_BH_PUT_DATA(bh);
 	lock_buffer(bh);
-	mark_buffer_uptodate(bh, false);
+	clear_buffer_uptodate(bh);
 	unlock_buffer(bh);
 	brelse(bh);
 
@@ -812,11 +812,7 @@
 
 		lock_buffer(bhs[i]);
 		if (!buffer_dirty(bhs[i]))
-#ifdef LINUX_2_5
 			clear_buffer_uptodate(bhs[i]);
-#else
-			mark_buffer_uptodate(bhs[i], false);
-#endif
 		unlock_buffer(bhs[i]);
 	}
 

Modified: trunk/src/symlink.c
===================================================================
--- trunk/src/symlink.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/symlink.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -33,7 +33,7 @@
 #include <ocfs.h>
 #include <linux/utsname.h>
 
-#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_EXTENT
+#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_SYMLINK
 
 struct ocfs_symlink_ops {
 	const char *name;

Modified: trunk/src/sysfile.c
===================================================================
--- trunk/src/sysfile.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/sysfile.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,5 +1,5 @@
 /*
- * ocfsgensysfile.c
+ * sysfile.c
  *
  * Initialize, read, write, etc. system files.
  *
@@ -32,7 +32,7 @@
 #endif
 
 /* Tracing */
-#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_MISC
+#define OCFS_DEBUG_CONTEXT    OCFS_DEBUG_CONTEXT_SYSFILE
 
 static int ocfs_find_extents_of_system_file (ocfs_super * osb, __u64 file_off, __u64 Length, ocfs_file_entry * fe, void **Buffer, __u32 * NumEntries);
 

Modified: trunk/src/util.c
===================================================================
--- trunk/src/util.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/util.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,7 +1,7 @@
 /*
- * ocfsport.c
+ * util.c
  *
- * Linux specific utilities
+ * General purpose code
  *
  * Copyright (C) 2002 Oracle Corporation.  All rights reserved.
  *
@@ -31,7 +31,7 @@
 #endif
 
 /* Tracing */
-#define OCFS_DEBUG_CONTEXT  OCFS_DEBUG_CONTEXT_PORT
+#define OCFS_DEBUG_CONTEXT  OCFS_DEBUG_CONTEXT_UTIL
 
 
 #ifndef USERSPACE_TOOL
@@ -403,7 +403,10 @@
 	if (!uptodate)
 		LOG_ERROR_STATUS(-EIO);
 
-	mark_buffer_uptodate(bh, uptodate);
+	if (uptodate)
+		set_buffer_uptodate(bh);
+	else
+		clear_buffer_uptodate(bh);
 	unlock_buffer(bh);
 
 //	LOG_EXIT();

Modified: trunk/src/volcfg.c
===================================================================
--- trunk/src/volcfg.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/volcfg.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,5 +1,5 @@
 /* 
- * ocfsgenvolcfg.c
+ * volcfg.c
  *
  * Auto configuration, namely, node number.
  *
@@ -28,6 +28,7 @@
 
 /* Tracing */
 #define  OCFS_DEBUG_CONTEXT  OCFS_DEBUG_CONTEXT_VOLCFG
+
 static void ocfs_worker (void *arg);
 static void ocfs_assert_lock_owned (unsigned long arg);
 static int ocfs_add_to_disk_config (ocfs_super * osb, __u32 pref_node_num, ocfs_disk_node_config_info * new_disk_node);

Modified: trunk/src/vote.c
===================================================================
--- trunk/src/vote.c	2004-02-06 22:06:21 UTC (rev 28)
+++ trunk/src/vote.c	2004-02-06 22:11:47 UTC (rev 29)
@@ -1,5 +1,5 @@
 /*
- * ocfsgenvote.c
+ * vote.c
  *
  * IPC based DLM
  *



More information about the Ocfs2-commits mailing list