• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/include/linux/raid/

Lines Matching refs:bitmap

2  * bitmap.h: Copyright (C) Peter T. Breuer (ptb@ot.uc3m.es) 2003
10 /* version 4 insists the bitmap is in little-endian order
19 * in-memory bitmap:
109 #define CHUNK_BLOCK_RATIO(bitmap) ((bitmap)->chunksize >> 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)
115 #define PAGEPTR_BLOCK_RATIO(bitmap) \
116 (CHUNK_BLOCK_RATIO(bitmap) << PAGE_COUNTER_SHIFT >> 1)
117 #define PAGEPTR_BLOCK_SHIFT(bitmap) \
118 (CHUNK_BLOCK_SHIFT(bitmap) + PAGE_COUNTER_SHIFT - 1)
119 #define PAGEPTR_BLOCK_MASK(bitmap) (PAGEPTR_BLOCK_RATIO(bitmap) - 1)
122 * on-disk bitmap:
124 * Use one bit per "chunk" (block set). We do the disk I/O on the bitmap
134 * bitmap structures:
139 /* use these for bitmap->flags and bitmap->sb->state bit-fields */
141 BITMAP_ACTIVE = 0x001, /* the bitmap is in use */
142 BITMAP_STALE = 0x002, /* the bitmap file is out of date or had -EIO */
147 /* the superblock at the front of the bitmap file -- little endian */
150 __le32 version; /* 4 the bitmap major for now, could change... */
152 __le64 events; /* 24 event counter for the bitmap (1)*/
155 __le32 state; /* 48 bitmap state information */
156 __le32 chunksize; /* 52 the bitmap chunk size in bytes */
165 * When a bitmap is loaded, it is only accepted if this event counter is equal
171 * higher, it is accepted as conforming to the bitmap.
172 * (3)This is the number of sectors represented by the bitmap, and is the range that
179 /* the in-memory bitmap is represented by bitmap_pages */
196 /* keep track of bitmap file pages that have pending writes on them */
202 /* the main bitmap structure - one per mddev */
203 struct bitmap {
205 unsigned long pages; /* total number of pages in the bitmap */
208 mddev_t *mddev; /* the md device that the bitmap is for */
212 /* bitmap chunksize -- how much data does each bit represent? */
226 /* bitmap spinlock */
231 struct page *sb_page; /* cached copy of the bitmap file superblock */
243 * the bitmap daemon - periodically wakes up and sweeps the bitmap
249 atomic_t pending_writes; /* pending writes to the bitmap file */
255 /* the bitmap API */
257 /* these are used only by md/bitmap */
261 int bitmap_active(struct bitmap *bitmap);
264 void bitmap_print_sb(struct bitmap *bitmap);
265 int bitmap_update_sb(struct bitmap *bitmap);
267 int bitmap_setallbits(struct bitmap *bitmap);
268 void bitmap_write_all(struct bitmap *bitmap);
270 void bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long e);
273 int bitmap_startwrite(struct bitmap *bitmap, sector_t offset,
275 void bitmap_endwrite(struct bitmap *bitmap, sector_t offset,
277 int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded);
278 void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted);
279 void bitmap_close_sync(struct bitmap *bitmap);
281 int bitmap_unplug(struct bitmap *bitmap);
282 int bitmap_daemon_work(struct bitmap *bitmap);