[Ocfs2-commits] manish commits r949 - trunk/src/inc

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed May 26 21:56:07 CDT 2004


Author: manish
Date: 2004-05-26 20:56:05 -0500 (Wed, 26 May 2004)
New Revision: 949

Modified:
   trunk/src/inc/journal.h
Log:
inline ocfs_handle_set_{checkpoint,sync}, minor cleanup


Modified: trunk/src/inc/journal.h
===================================================================
--- trunk/src/inc/journal.h	2004-05-27 01:54:21 UTC (rev 948)
+++ trunk/src/inc/journal.h	2004-05-27 01:56:05 UTC (rev 949)
@@ -33,6 +33,12 @@
 
 #undef 	OCFS_JOURNAL_USE_CB
 
+enum ocfs_journal_state {
+	OCFS_JOURNAL_FREE = 0,
+	OCFS_JOURNAL_LOADED,
+	OCFS_JOURNAL_IN_SHUTDOWN,
+};
+
 struct _ocfs_super;
 struct _ocfs_file_entry;
 struct _ocfs_journal_handle;
@@ -41,11 +47,7 @@
  * trans_lock. BEWARE. */
 typedef struct _ocfs_journal ocfs_journal;
 struct _ocfs_journal {
-	enum {
-		OCFS_JOURNAL_FREE = 0,
-		OCFS_JOURNAL_LOADED,
-		OCFS_JOURNAL_IN_SHUTDOWN,
-	}                         state;      /* Journals current state   */
+	enum ocfs_journal_state   state;      /* Journals current state   */
 
 	journal_t                 *k_journal; /* The kernels journal type */
 	struct inode              *k_inode;   /* Kernel inode pointing to
@@ -164,21 +166,24 @@
 #define OCFS_HANDLE_CHECKPOINT			1
 /* should we sync-commit this handle? */
 #define OCFS_HANDLE_SYNC			2
-#define ocfs_handle_set_checkpoint(handle, val) 			      \
-do { 									      \
-	if (val) 							      \
-		(handle)->flags |= OCFS_HANDLE_CHECKPOINT;		      \
-	else								      \
-		(handle)->flags &= ~OCFS_HANDLE_CHECKPOINT;		      \
-} while(0)
-#define ocfs_handle_set_sync(handle, val) 				      \
-do { 									      \
-	if (val) 							      \
-		(handle)->flags |= OCFS_HANDLE_SYNC;			      \
-	else								      \
-		(handle)->flags &= ~OCFS_HANDLE_SYNC;			      \
-} while(0)
 
+static inline void ocfs_handle_set_checkpoint(ocfs_journal_handle *handle,
+					      int checkpoint)
+{
+	if (checkpoint)
+		handle->flags |= OCFS_HANDLE_CHECKPOINT;
+	else
+		handle->flags &= ~OCFS_HANDLE_CHECKPOINT;
+}
+
+static inline void ocfs_handle_set_sync(ocfs_journal_handle *handle, int sync)
+{
+	if (sync)
+		handle->flags |= OCFS_HANDLE_SYNC;
+	else
+		handle->flags &= ~OCFS_HANDLE_SYNC;
+}
+
 /* TODO: turn both of these into static inlines, once the include file
  * mess is sorted out. */
 #define ocfs_handle_add_commit_bits(handle, len, fileoff, nodenum, type)      \
@@ -386,4 +391,5 @@
 /* On very rare open operations (it's a first open and we're not in
  * the open map), we have to change the file entry. */
 #define OCFS_OPEN_CREDITS 1
+
 #endif /* _OCFSJOURNAL_H_ */



More information about the Ocfs2-commits mailing list