Commit 40cffcc0 authored by NeilBrown's avatar NeilBrown

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: default avatarNeilBrown <neilb@suse.de>
parent 63c68268
This diff is collapsed.
...@@ -172,22 +172,25 @@ struct bitmap_page { ...@@ -172,22 +172,25 @@ struct bitmap_page {
/* the main bitmap structure - one per mddev */ /* the main bitmap structure - one per mddev */
struct bitmap { struct bitmap {
struct bitmap_counts {
spinlock_t lock;
struct bitmap_page *bp; struct bitmap_page *bp;
unsigned long pages; /* total number of pages in the bitmap */ unsigned long pages; /* total number of pages
unsigned long missing_pages; /* number of pages not yet allocated */ * 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;
struct mddev *mddev; /* the md device that the bitmap is for */ struct mddev *mddev; /* the md device that the bitmap is for */
/* 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 */
__u64 events_cleared; __u64 events_cleared;
int need_sync; int need_sync;
/* bitmap spinlock */
spinlock_t lock;
struct bitmap_storage { struct bitmap_storage {
struct file *file; /* backing disk file */ struct file *file; /* backing disk file */
struct page *sb_page; /* cached copy of the bitmap struct page *sb_page; /* cached copy of the bitmap
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment