summaryrefslogtreecommitdiff
path: root/drivers/md/bitmap.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-05-22 13:55:24 +1000
committerNeilBrown <neilb@suse.de>2012-05-22 13:55:24 +1000
commit40cffcc0e8f9f6e295630cb8b8d58a13baa6c7f9 (patch)
treeeb23aa8ac3866c93708a1aee36fd6ae15a6a863f /drivers/md/bitmap.h
parent63c68268b2fc63f7f612dfebecb5c9cbbd3ebeaf (diff)
md/bitmap: create a 'struct bitmap_counts' substructure of 'struct bitmap'
The new "struct bitmap_counts" contains all the fields that are related to counting the number of active writes in each bitmap chunk. Having this separate will make it easier to change the chunksize or overall size of a bitmap atomically. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/bitmap.h')
-rw-r--r--drivers/md/bitmap.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/md/bitmap.h b/drivers/md/bitmap.h
index e2d999a62ba9..6bde180e987b 100644
--- a/drivers/md/bitmap.h
+++ b/drivers/md/bitmap.h
@@ -172,22 +172,25 @@ struct bitmap_page {
/* the main bitmap structure - one per mddev */
struct bitmap {
- struct bitmap_page *bp;
- unsigned long pages; /* total number of pages in the bitmap */
- unsigned long missing_pages; /* number of pages not yet allocated */
- struct mddev *mddev; /* the md device that the bitmap is for */
+ struct bitmap_counts {
+ spinlock_t lock;
+ struct bitmap_page *bp;
+ unsigned long pages; /* total number of pages
+ * in the bitmap */
+ unsigned long missing_pages; /* number of pages
+ * not yet allocated */
+ unsigned long chunkshift; /* chunksize = 2^chunkshift
+ * (for bitops) */
+ unsigned long chunks; /* Total number of data
+ * chunks for the array */
+ } counts;
- /* bitmap chunksize -- how much data does each bit represent? */
- unsigned long chunkshift; /* chunksize = 2^(chunkshift+9) (for bitops) */
- unsigned long chunks; /* total number of data chunks for the array */
+ struct mddev *mddev; /* the md device that the bitmap is for */
__u64 events_cleared;
int need_sync;
- /* bitmap spinlock */
- spinlock_t lock;
-
struct bitmap_storage {
struct file *file; /* backing disk file */
struct page *sb_page; /* cached copy of the bitmap