[Ocfs2-commits] jlbec commits r934 - trunk/src/inc
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Mon May 24 21:40:54 CDT 2004
Author: jlbec
Date: 2004-05-24 20:40:52 -0500 (Mon, 24 May 2004)
New Revision: 934
Modified:
trunk/src/inc/io.h
Log:
fix issue with random trailing bits
Modified: trunk/src/inc/io.h
===================================================================
--- trunk/src/inc/io.h 2004-05-25 00:24:56 UTC (rev 933)
+++ trunk/src/inc/io.h 2004-05-25 01:40:52 UTC (rev 934)
@@ -214,10 +214,12 @@
ocfs_bh_sem_unlock(bh);
}
+#define STATE_BH_BITS 8
+#define USED_BH_BITS 23 /* Number of BH bits used up through JBD */
-#define STATE_BIT_MAX (1 << 12)
-#define STATE_BIT_MAX_MASK ((1 << 12)-1)
-#define STATE_BIT_MASK ((~0UL)<<19)
+#define STATE_BIT_MAX (1 << STATE_BH_BITS)
+#define STATE_BIT_MAX_MASK ((1 << STATE_BH_BITS)-1)
+#define STATE_BIT_MASK ((~0UL) << USED_BH_BITS)
static inline void CLEAR_BH_SEQNUM(struct buffer_head *bh)
@@ -229,7 +231,7 @@
static inline void SET_BH_SEQNUM(struct inode *inode, struct buffer_head *bh)
{
unsigned int seq = (atomic_read(GET_INODE_CLEAN_SEQ(inode)) &
- STATE_BIT_MAX_MASK) << 19;
+ STATE_BIT_MAX_MASK) << USED_BH_BITS;
CLEAR_BH_SEQNUM(bh);
bh->b_state |= seq;
@@ -238,7 +240,8 @@
static inline int TEST_BH_SEQNUM(struct inode *inode, struct buffer_head *bh)
{
int ret;
- unsigned int seq = (bh->b_state & STATE_BIT_MASK) >> 19;
+ unsigned int seq =
+ (bh->b_state & STATE_BIT_MASK) >> USED_BH_BITS;
ret = (seq == atomic_read(GET_INODE_CLEAN_SEQ(inode)));
return ret;
More information about the Ocfs2-commits
mailing list