From 94968e749b224f01fbb9009ed0285e55f6441784 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 10 Jun 2011 17:55:09 -0400 Subject: libext2fs: teach bitmap functions about bigalloc/cluster This patch makes the following changes: * ext2fs_allocate_block_bitmap() now allocates a bitmap with cluster granularity for bigalloc file systems. For mke2fs and e2fsck, a newly added function, ext2fs_allocate_subcluster_bitmap() allocates a bitmap with block granularity (even for bigalloc file systems). The newly added function ext2fs_get_bitmap_granularity() will return the number of bits (log2) of the granularity used by the bitmap. * The ext2fs_{mark,unmark,test}_block_bitmap2() functions will shift their passed-in argument by log2(cluster_ganularity) bits right. This means that the arguments for the single-argument bitmap functions will be interpreted with block granluarity, since this minimizes code changes in the rest of the code base. * The ext2fs_{get,set}_block_bitmap_range() functions will interpret their arguments in cluster granularity. This is a bit inconsistent, but the caller of those functions will need to be taught about the subtleties of clusters for bigalloc file systems. Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/bmap64.h | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/ext2fs/bmap64.h') diff --git a/lib/ext2fs/bmap64.h b/lib/ext2fs/bmap64.h index b0aa84c1..30565440 100644 --- a/lib/ext2fs/bmap64.h +++ b/lib/ext2fs/bmap64.h @@ -16,6 +16,7 @@ struct ext2fs_struct_generic_bitmap { int flags; __u64 start, end; __u64 real_end; + int cluster_bits; char *description; void *private; errcode_t base_error_code; -- cgit v1.2.3