Lines Matching refs:bmc
1294 bitmap_counter_t *bmc; in md_bitmap_daemon_work() local
1306 bmc = md_bitmap_get_counter(counts, block, &blocks, 0); in md_bitmap_daemon_work()
1307 if (!bmc) { in md_bitmap_daemon_work()
1311 if (*bmc == 1 && !bitmap->need_sync) { in md_bitmap_daemon_work()
1313 *bmc = 0; in md_bitmap_daemon_work()
1316 } else if (*bmc && *bmc <= 2) { in md_bitmap_daemon_work()
1317 *bmc = 1; in md_bitmap_daemon_work()
1414 bitmap_counter_t *bmc; in md_bitmap_startwrite() local
1417 bmc = md_bitmap_get_counter(&bitmap->counts, offset, &blocks, 1); in md_bitmap_startwrite()
1418 if (!bmc) { in md_bitmap_startwrite()
1423 if (unlikely(COUNTER(*bmc) == COUNTER_MAX)) { in md_bitmap_startwrite()
1437 switch (*bmc) { in md_bitmap_startwrite()
1443 *bmc = 2; in md_bitmap_startwrite()
1446 (*bmc)++; in md_bitmap_startwrite()
1476 bitmap_counter_t *bmc; in md_bitmap_endwrite() local
1479 bmc = md_bitmap_get_counter(&bitmap->counts, offset, &blocks, 0); in md_bitmap_endwrite()
1480 if (!bmc) { in md_bitmap_endwrite()
1492 if (!success && !NEEDED(*bmc)) in md_bitmap_endwrite()
1493 *bmc |= NEEDED_MASK; in md_bitmap_endwrite()
1495 if (COUNTER(*bmc) == COUNTER_MAX) in md_bitmap_endwrite()
1498 (*bmc)--; in md_bitmap_endwrite()
1499 if (*bmc <= 2) { in md_bitmap_endwrite()
1516 bitmap_counter_t *bmc; in __bitmap_start_sync() local
1523 bmc = md_bitmap_get_counter(&bitmap->counts, offset, blocks, 0); in __bitmap_start_sync()
1525 if (bmc) { in __bitmap_start_sync()
1527 if (RESYNC(*bmc)) in __bitmap_start_sync()
1529 else if (NEEDED(*bmc)) { in __bitmap_start_sync()
1532 *bmc |= RESYNC_MASK; in __bitmap_start_sync()
1533 *bmc &= ~NEEDED_MASK; in __bitmap_start_sync()
1567 bitmap_counter_t *bmc; in md_bitmap_end_sync() local
1575 bmc = md_bitmap_get_counter(&bitmap->counts, offset, blocks, 0); in md_bitmap_end_sync()
1576 if (bmc == NULL) in md_bitmap_end_sync()
1579 if (RESYNC(*bmc)) { in md_bitmap_end_sync()
1580 *bmc &= ~RESYNC_MASK; in md_bitmap_end_sync()
1582 if (!NEEDED(*bmc) && aborted) in md_bitmap_end_sync()
1583 *bmc |= NEEDED_MASK; in md_bitmap_end_sync()
1585 if (*bmc <= 2) { in md_bitmap_end_sync()
1672 bitmap_counter_t *bmc; in md_bitmap_set_memory_bits() local
1674 bmc = md_bitmap_get_counter(&bitmap->counts, offset, &secs, 1); in md_bitmap_set_memory_bits()
1675 if (!bmc) { in md_bitmap_set_memory_bits()
1679 if (!*bmc) { in md_bitmap_set_memory_bits()
1680 *bmc = 2; in md_bitmap_set_memory_bits()
1686 *bmc |= NEEDED_MASK; in md_bitmap_set_memory_bits()
2228 bitmap_counter_t *bmc; in md_bitmap_resize() local
2229 bmc = md_bitmap_get_counter(&bitmap->counts, block, &new_blocks, 1); in md_bitmap_resize()
2230 if (bmc) { in md_bitmap_resize()
2234 if (*bmc == 0) { in md_bitmap_resize()
2235 *bmc = NEEDED_MASK | 2; in md_bitmap_resize()