diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/md/bitmap.h | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/md/bitmap.h')
-rw-r--r-- | drivers/md/bitmap.h | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/md/bitmap.h b/drivers/md/bitmap.h index e98900671ca9..cb821d76d1b4 100644 --- a/drivers/md/bitmap.h +++ b/drivers/md/bitmap.h | |||
@@ -106,7 +106,7 @@ typedef __u16 bitmap_counter_t; | |||
106 | #define BITMAP_BLOCK_SHIFT 9 | 106 | #define BITMAP_BLOCK_SHIFT 9 |
107 | 107 | ||
108 | /* how many blocks per chunk? (this is variable) */ | 108 | /* how many blocks per chunk? (this is variable) */ |
109 | #define CHUNK_BLOCK_RATIO(bitmap) ((bitmap)->chunksize >> BITMAP_BLOCK_SHIFT) | 109 | #define CHUNK_BLOCK_RATIO(bitmap) ((bitmap)->mddev->bitmap_info.chunksize >> BITMAP_BLOCK_SHIFT) |
110 | #define CHUNK_BLOCK_SHIFT(bitmap) ((bitmap)->chunkshift - BITMAP_BLOCK_SHIFT) | 110 | #define CHUNK_BLOCK_SHIFT(bitmap) ((bitmap)->chunkshift - BITMAP_BLOCK_SHIFT) |
111 | #define CHUNK_BLOCK_MASK(bitmap) (CHUNK_BLOCK_RATIO(bitmap) - 1) | 111 | #define CHUNK_BLOCK_MASK(bitmap) (CHUNK_BLOCK_RATIO(bitmap) - 1) |
112 | 112 | ||
@@ -118,16 +118,6 @@ typedef __u16 bitmap_counter_t; | |||
118 | (CHUNK_BLOCK_SHIFT(bitmap) + PAGE_COUNTER_SHIFT - 1) | 118 | (CHUNK_BLOCK_SHIFT(bitmap) + PAGE_COUNTER_SHIFT - 1) |
119 | #define PAGEPTR_BLOCK_MASK(bitmap) (PAGEPTR_BLOCK_RATIO(bitmap) - 1) | 119 | #define PAGEPTR_BLOCK_MASK(bitmap) (PAGEPTR_BLOCK_RATIO(bitmap) - 1) |
120 | 120 | ||
121 | /* | ||
122 | * on-disk bitmap: | ||
123 | * | ||
124 | * Use one bit per "chunk" (block set). We do the disk I/O on the bitmap | ||
125 | * file a page at a time. There's a superblock at the start of the file. | ||
126 | */ | ||
127 | |||
128 | /* map chunks (bits) to file pages - offset by the size of the superblock */ | ||
129 | #define CHUNK_BIT_OFFSET(chunk) ((chunk) + (sizeof(bitmap_super_t) << 3)) | ||
130 | |||
131 | #endif | 121 | #endif |
132 | 122 | ||
133 | /* | 123 | /* |
@@ -209,7 +199,6 @@ struct bitmap { | |||
209 | int counter_bits; /* how many bits per block counter */ | 199 | int counter_bits; /* how many bits per block counter */ |
210 | 200 | ||
211 | /* bitmap chunksize -- how much data does each bit represent? */ | 201 | /* bitmap chunksize -- how much data does each bit represent? */ |
212 | unsigned long chunksize; | ||
213 | unsigned long chunkshift; /* chunksize = 2^chunkshift (for bitops) */ | 202 | unsigned long chunkshift; /* chunksize = 2^chunkshift (for bitops) */ |
214 | unsigned long chunks; /* total number of data chunks for the array */ | 203 | unsigned long chunks; /* total number of data chunks for the array */ |
215 | 204 | ||
@@ -226,7 +215,6 @@ struct bitmap { | |||
226 | /* bitmap spinlock */ | 215 | /* bitmap spinlock */ |
227 | spinlock_t lock; | 216 | spinlock_t lock; |
228 | 217 | ||
229 | long offset; /* offset from superblock if file is NULL */ | ||
230 | struct file *file; /* backing disk file */ | 218 | struct file *file; /* backing disk file */ |
231 | struct page *sb_page; /* cached copy of the bitmap file superblock */ | 219 | struct page *sb_page; /* cached copy of the bitmap file superblock */ |
232 | struct page **filemap; /* list of cache pages for the file */ | 220 | struct page **filemap; /* list of cache pages for the file */ |
@@ -238,7 +226,6 @@ struct bitmap { | |||
238 | 226 | ||
239 | int allclean; | 227 | int allclean; |
240 | 228 | ||
241 | unsigned long max_write_behind; /* write-behind mode */ | ||
242 | atomic_t behind_writes; | 229 | atomic_t behind_writes; |
243 | 230 | ||
244 | /* | 231 | /* |
@@ -246,7 +233,6 @@ struct bitmap { | |||
246 | * file, cleaning up bits and flushing out pages to disk as necessary | 233 | * file, cleaning up bits and flushing out pages to disk as necessary |
247 | */ | 234 | */ |
248 | unsigned long daemon_lastrun; /* jiffies of last run */ | 235 | unsigned long daemon_lastrun; /* jiffies of last run */ |
249 | unsigned long daemon_sleep; /* how many seconds between updates? */ | ||
250 | unsigned long last_end_sync; /* when we lasted called end_sync to | 236 | unsigned long last_end_sync; /* when we lasted called end_sync to |
251 | * update bitmap with resync progress */ | 237 | * update bitmap with resync progress */ |
252 | 238 | ||
@@ -254,6 +240,7 @@ struct bitmap { | |||
254 | wait_queue_head_t write_wait; | 240 | wait_queue_head_t write_wait; |
255 | wait_queue_head_t overflow_wait; | 241 | wait_queue_head_t overflow_wait; |
256 | 242 | ||
243 | struct sysfs_dirent *sysfs_can_clear; | ||
257 | }; | 244 | }; |
258 | 245 | ||
259 | /* the bitmap API */ | 246 | /* the bitmap API */ |
@@ -282,7 +269,7 @@ void bitmap_close_sync(struct bitmap *bitmap); | |||
282 | void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector); | 269 | void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector); |
283 | 270 | ||
284 | void bitmap_unplug(struct bitmap *bitmap); | 271 | void bitmap_unplug(struct bitmap *bitmap); |
285 | void bitmap_daemon_work(struct bitmap *bitmap); | 272 | void bitmap_daemon_work(mddev_t *mddev); |
286 | #endif | 273 | #endif |
287 | 274 | ||
288 | #endif | 275 | #endif |