Whamcloud - gitweb
libext2fs: teach bitmap functions about bigalloc/cluster
authorTheodore Ts'o <tytso@mit.edu>
Fri, 10 Jun 2011 21:55:09 +0000 (17:55 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 10 Jun 2011 21:55:09 +0000 (17:55 -0400)
commit94968e749b224f01fbb9009ed0285e55f6441784
tree3b6252f26e18d728fece57ffac89a210f1956a58
parent1afb468b9a80031b39eab37272709f45727fb221
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" <tytso@mit.edu>
lib/ext2fs/bitmaps.c
lib/ext2fs/bmap64.h
lib/ext2fs/ext2fs.h
lib/ext2fs/gen_bitmap64.c