Lines Matching defs:bitmap
35 * - bitmap read-ahead (proposed by Oleg Drokin aka green)
93 * mapped to the buddy and bitmap information regarding different
97 * block bitmap and buddy information. The information are stored in the
101 * [ group 0 bitmap][ group 0 buddy] [group 1][ group 1]...
104 * one block each for bitmap and buddy information. So for each group we
143 * not, we search in the specific group using bitmap for best extents. The
161 * - on-disk bitmap
162 * - in-core buddy (actually includes buddy and bitmap)
182 * in-core buddy = on-disk bitmap + preallocation descriptors
193 * blocks: how many blocks marked used/free in on-disk bitmap, buddy and PA.
202 * note: 'buddy -= on-disk - PA' is used to show that on-disk bitmap
204 * bits from PA, only from on-disk bitmap
215 * on-disk bitmap if buddy has same bit set or/and PA covers corresponded
224 * we need to make sure that either on-disk bitmap or PA has uptodate data
253 * - PA is referenced until block isn't marked in on-disk bitmap
254 * - PA changes only after on-disk bitmap
257 * - buddy init as sum of on-disk bitmap and PAs is done atomically
270 * mark bits in on-disk bitmap
276 * mark bits in on-disk bitmap
282 * mark bits in on-disk bitmap
288 * load on-disk bitmap
317 * - generate in-core bitmap:
349 static void ext4_mb_generate_from_pa(struct super_block *sb, void *bitmap,
351 static void ext4_mb_generate_from_freelist(struct super_block *sb, void *bitmap,
518 static void mb_cmp_bitmaps(struct ext4_buddy *e4b, void *bitmap)
522 if (memcmp(e4b->bd_info->bb_bitmap, bitmap, e4b->bd_sb->s_blocksize)) {
526 b2 = (unsigned char *) bitmap;
576 static inline void mb_cmp_bitmaps(struct ext4_buddy *e4b, void *bitmap)
711 * Clear the bits in bitmap which the blocks of the chunk(s) covered,
773 void *buddy, void *bitmap, ext4_group_t group,
785 /* initialize buddy from bitmap which is aggregation
786 * of on-disk bitmap and preallocations */
787 i = mb_find_next_zero_bit(bitmap, max, 0);
792 i = mb_find_next_bit(bitmap, max, i);
800 i = mb_find_next_zero_bit(bitmap, max, i);
806 "block bitmap and bg descriptor "
811 * corrupt and update bb_free using bitmap value
847 * block bitmap and buddy information. The information are
851 * [ group 0 bitmap][ group 0 buddy] [group 1][ group 1]...
854 * one block each for bitmap and buddy information.
879 char *bitmap;
931 mb_debug(sb, "read bitmap for group %u\n", group);
967 bitmap = bh[group - first_group]->b_data;
970 * We place the buddy block and bitmap block
989 * incore got set to the group block bitmap below
998 /* this is block of bitmap */
1000 mb_debug(sb, "put bitmap for group %u in page %lu/%x\n",
1006 memcpy(data, bitmap, blocksize);
1008 /* mark all preallocated blks used in in-core bitmap */
1032 * Lock the buddy and bitmap pages. This make sure other parallel init_group
1034 * Return locked buddy and bitmap pages on e4b struct. If buddy and bitmap
1050 * the buddy cache inode stores the block bitmap
1065 /* buddy and bitmap are on the same page */
1140 * If both the bitmap and buddy are in
1206 * the buddy cache inode stores the block bitmap
1406 static inline int mb_buddy_adjust_border(int* bit, void* bitmap, int side)
1408 if (mb_test_bit(*bit + side, bitmap)) {
1409 mb_clear_bit(*bit, bitmap);
1415 mb_set_bit(*bit, bitmap);
1521 "freeing already freed block (bit %u); block bitmap corrupt.",
1542 * adjust bitmap bb_counters and borders appropriately.
1728 * group until we update the bitmap. That would mean we
1960 * The routine scans buddy structures (not bitmap!) from given order
2019 void *bitmap = e4b->bd_bitmap;
2031 i = mb_find_next_zero_bit(bitmap,
2035 * IF we have corrupt bitmap, we won't find any
2041 "group info. But bitmap says 0",
2060 * indicate that the bitmap is corrupt. So exit
2085 void *bitmap = e4b->bd_bitmap;
2102 if (!mb_test_bit(i, bitmap)) {
2117 * This is also called BEFORE we load the buddy bitmap.
2287 * Prefetching reads the block bitmap into the buffer cache; but we
2288 * need to make sure that the buddy bitmap in the page cache has been
2293 * TODO: We should actually kick off the buddy bitmap setup in a work
2295 * waiting for the block allocation bitmap read to finish when
2954 /* order 0 is regular bitmap */
3342 * Fix the bitmap and return EFSCORRUPTED
3852 * in on-disk bitmap -- see ext4_mb_release_context()
3978 * but not yet committed and marks them used in in-core bitmap.
3979 * buddy must be generated from this bitmap
3982 static void ext4_mb_generate_from_freelist(struct super_block *sb, void *bitmap,
3996 ext4_set_bits(bitmap, entry->efd_start_cluster, entry->efd_count);
4004 * used in in-core bitmap. buddy must be generated from this bitmap
4008 void ext4_mb_generate_from_pa(struct super_block *sb, void *bitmap,
4040 ext4_set_bits(bitmap, start, len);
4116 * copy on-disk bitmap to buddy
4117 * mark B in on-disk bitmap
4302 * finds all unused blocks in on-disk bitmap, frees them in
4303 * in-core bitmap and buddy.
4355 * from the bitmap and continue.
4417 "Error %d reading block bitmap for %u",
4589 ext4_error_err(sb, -err, "Error %d reading block bitmap for %u",
5284 * on-disk bitmap and lose not-yet-available
5359 pr_warn("Failed to read block bitmap\n");
5409 pr_warn("Failed to read block bitmap\n");
5568 /* need to update group_info->bb_free and bitmap
5615 /* We dirtied the bitmap block */
5616 BUFFER_TRACE(bitmap_bh, "dirtied bitmap block");
5749 * This marks the blocks as free in the bitmap and buddy.
5837 * need to update group_info->bb_free and bitmap
5862 /* We dirtied the bitmap block */
5863 BUFFER_TRACE(bitmap_bh, "dirtied bitmap block");
5886 * one will allocate those blocks, mark it as used in buddy bitmap. This must
5944 void *bitmap;
5947 bitmap = e4b->bd_bitmap;
5956 start = mb_find_next_zero_bit(bitmap, max + 1, start);
5960 next = mb_find_next_bit(bitmap, last + 1, start);
6001 * ext4_trim_all_free walks through group's buddy bitmap searching for free
6006 * ext4_trim_all_free walks through group's block bitmap searching for free
6008 * bitmap. Then issue a TRIM command on this extent and free the extent in
6009 * the group buddy bitmap. This is done until whole group is scanned.
6157 void *bitmap;
6165 bitmap = e4b.bd_bitmap;
6174 start = mb_find_next_zero_bit(bitmap, end + 1, start);
6177 next = mb_find_next_bit(bitmap, end + 1, start);