[Ocfs2-commits] jlbec commits r1127 - branches/format-changes/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Jun 17 13:00:02 CDT 2004
Author: jlbec
Date: 2004-06-17 11:59:59 -0500 (Thu, 17 Jun 2004)
New Revision: 1127
Modified:
branches/format-changes/src/bitmap.c
branches/format-changes/src/ocfs.h
Log:
o Remove OCFS_CHUNK_TO_GLOBAL_OFF and OCFS_GLOBAL_OFF_TO_CHUNK.
o Replace with ocfs_bitmap_block_for_off and ocfs_bitmap_off_for_block.
Modified: branches/format-changes/src/bitmap.c
===================================================================
--- branches/format-changes/src/bitmap.c 2004-06-17 16:48:05 UTC (rev 1126)
+++ branches/format-changes/src/bitmap.c 2004-06-17 16:59:59 UTC (rev 1127)
@@ -246,8 +246,9 @@
if (localstart >= size)
goto nextbh;
- globaloff = OCFS_CHUNK_TO_GLOBAL_OFF(osb->sb, c,
- bitoff) + 1;
+ globaloff =
+ ocfs_bitmap_off_for_block(osb->sb, c,
+ bitoff) + 1;
} else if (bitoff == localstart) {
/*LOG_TRACE_ARGS("bitoff == localstart (%u)\n",
bitoff);*/
@@ -260,8 +261,9 @@
bitoff, localstart);*/
/* we had to skip over some ones */
count = 1;
- globaloff = OCFS_CHUNK_TO_GLOBAL_OFF(osb->sb, c,
- bitoff) + 1;
+ globaloff =
+ ocfs_bitmap_off_for_block(osb->sb, c,
+ bitoff) + 1;
localstart = bitoff + 1;
}
Modified: branches/format-changes/src/ocfs.h
===================================================================
--- branches/format-changes/src/ocfs.h 2004-06-17 16:48:05 UTC (rev 1126)
+++ branches/format-changes/src/ocfs.h 2004-06-17 16:59:59 UTC (rev 1127)
@@ -46,15 +46,6 @@
#define OCFS_BITS_IN_CHUNK(sb) ((sb)->s_blocksize * 8)
-#define OCFS_CHUNK_TO_GLOBAL_OFF(sb, index, localoffset) \
- ((index) * OCFS_BITS_IN_CHUNK(sb) + (localoffset))
-#define OCFS_GLOBAL_OFF_TO_CHUNK(sb, globaloffset) \
- ((globaloffset) / OCFS_BITS_IN_CHUNK(sb))
-#define OCFS_GLOBAL_OFF_TO_LOCAL(sb, globaloffset) \
- ((globaloffset) % OCFS_BITS_IN_CHUNK(sb))
-#define OCFS_BITMAP_RANGE_BITS(sb, startbh, startoff, endbh, endoff) \
- (OCFS_CHUNK_TO_GLOBAL_OFF((sb), (endbh), (endoff)) - \
- OCFS_CHUNK_TO_GLOBAL_OFF((sb), (startbh), (startoff)))
typedef struct _ocfs_alloc_bm
{
@@ -1416,6 +1407,13 @@
*block_off = bm_off % OCFS_BITS_IN_CHUNK(sb);
}
+static inline unsigned int ocfs_bitmap_off_for_block(struct super_block *sb,
+ unsigned int block,
+ unsigned int block_off)
+{
+ return ((block * OCFS_BITS_IN_CHUNK(sb)) + block_off);
+}
+
static inline int ocfs_bitmap_blocks_affected(struct super_block *sb,
unsigned int start_bit,
unsigned int num_bits,
More information about the Ocfs2-commits
mailing list