Lines Matching refs:bmc
1293 bitmap_counter_t *bmc; in md_bitmap_daemon_work() local
1305 bmc = md_bitmap_get_counter(counts, block, &blocks, 0); in md_bitmap_daemon_work()
1306 if (!bmc) { in md_bitmap_daemon_work()
1310 if (*bmc == 1 && !bitmap->need_sync) { in md_bitmap_daemon_work()
1312 *bmc = 0; in md_bitmap_daemon_work()
1315 } else if (*bmc && *bmc <= 2) { in md_bitmap_daemon_work()
1316 *bmc = 1; in md_bitmap_daemon_work()
1413 bitmap_counter_t *bmc; in md_bitmap_startwrite() local
1416 bmc = md_bitmap_get_counter(&bitmap->counts, offset, &blocks, 1); in md_bitmap_startwrite()
1417 if (!bmc) { in md_bitmap_startwrite()
1422 if (unlikely(COUNTER(*bmc) == COUNTER_MAX)) { in md_bitmap_startwrite()
1436 switch (*bmc) { in md_bitmap_startwrite()
1442 *bmc = 2; in md_bitmap_startwrite()
1445 (*bmc)++; in md_bitmap_startwrite()
1475 bitmap_counter_t *bmc; in md_bitmap_endwrite() local
1478 bmc = md_bitmap_get_counter(&bitmap->counts, offset, &blocks, 0); in md_bitmap_endwrite()
1479 if (!bmc) { in md_bitmap_endwrite()
1491 if (!success && !NEEDED(*bmc)) in md_bitmap_endwrite()
1492 *bmc |= NEEDED_MASK; in md_bitmap_endwrite()
1494 if (COUNTER(*bmc) == COUNTER_MAX) in md_bitmap_endwrite()
1497 (*bmc)--; in md_bitmap_endwrite()
1498 if (*bmc <= 2) { in md_bitmap_endwrite()
1515 bitmap_counter_t *bmc; in __bitmap_start_sync() local
1522 bmc = md_bitmap_get_counter(&bitmap->counts, offset, blocks, 0); in __bitmap_start_sync()
1524 if (bmc) { in __bitmap_start_sync()
1526 if (RESYNC(*bmc)) in __bitmap_start_sync()
1528 else if (NEEDED(*bmc)) { in __bitmap_start_sync()
1531 *bmc |= RESYNC_MASK; in __bitmap_start_sync()
1532 *bmc &= ~NEEDED_MASK; in __bitmap_start_sync()
1566 bitmap_counter_t *bmc; in md_bitmap_end_sync() local
1574 bmc = md_bitmap_get_counter(&bitmap->counts, offset, blocks, 0); in md_bitmap_end_sync()
1575 if (bmc == NULL) in md_bitmap_end_sync()
1578 if (RESYNC(*bmc)) { in md_bitmap_end_sync()
1579 *bmc &= ~RESYNC_MASK; in md_bitmap_end_sync()
1581 if (!NEEDED(*bmc) && aborted) in md_bitmap_end_sync()
1582 *bmc |= NEEDED_MASK; in md_bitmap_end_sync()
1584 if (*bmc <= 2) { in md_bitmap_end_sync()
1671 bitmap_counter_t *bmc; in md_bitmap_set_memory_bits() local
1673 bmc = md_bitmap_get_counter(&bitmap->counts, offset, &secs, 1); in md_bitmap_set_memory_bits()
1674 if (!bmc) { in md_bitmap_set_memory_bits()
1678 if (!*bmc) { in md_bitmap_set_memory_bits()
1679 *bmc = 2; in md_bitmap_set_memory_bits()
1685 *bmc |= NEEDED_MASK; in md_bitmap_set_memory_bits()
2221 bitmap_counter_t *bmc; in md_bitmap_resize() local
2222 bmc = md_bitmap_get_counter(&bitmap->counts, block, &new_blocks, 1); in md_bitmap_resize()
2223 if (bmc) { in md_bitmap_resize()
2227 if (*bmc == 0) { in md_bitmap_resize()
2228 *bmc = NEEDED_MASK | 2; in md_bitmap_resize()