aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bitmap.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-05-21 23:55:24 -0400
committerNeilBrown <neilb@suse.de>2012-05-21 23:55:24 -0400
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 {
172 172
173/* the main bitmap structure - one per mddev */ 173/* the main bitmap structure - one per mddev */
174struct bitmap { 174struct bitmap {
175 struct bitmap_page *bp;
176 unsigned long pages; /* total number of pages in the bitmap */
177 unsigned long missing_pages; /* number of pages not yet allocated */
178 175
179 struct mddev *mddev; /* the md device that the bitmap is for */ 176 struct bitmap_counts {
177 spinlock_t lock;
178 struct bitmap_page *bp;
179 unsigned long pages; /* total number of pages
180 * in the bitmap */
181 unsigned long missing_pages; /* number of pages
182 * not yet allocated */
183 unsigned long chunkshift; /* chunksize = 2^chunkshift
184 * (for bitops) */
185 unsigned long chunks; /* Total number of data
186 * chunks for the array */
187 } counts;
180 188
181 /* bitmap chunksize -- how much data does each bit represent? */ 189 struct mddev *mddev; /* the md device that the bitmap is for */
182 unsigned long chunkshift; /* chunksize = 2^(chunkshift+9) (for bitops) */
183 unsigned long chunks; /* total number of data chunks for the array */
184 190
185 __u64 events_cleared; 191 __u64 events_cleared;
186 int need_sync; 192 int need_sync;
187 193
188 /* bitmap spinlock */
189 spinlock_t lock;
190
191 struct bitmap_storage { 194 struct bitmap_storage {
192 struct file *file; /* backing disk file */ 195 struct file *file; /* backing disk file */
193 struct page *sb_page; /* cached copy of the bitmap 196 struct page *sb_page; /* cached copy of the bitmap