Lines Matching refs:dbi
188 uint32_t *dbi; member
494 #define tcmu_cmd_set_dbi(cmd, index) ((cmd)->dbi[(cmd)->dbi_cur++] = (index))
495 #define tcmu_cmd_get_dbi(cmd) ((cmd)->dbi[(cmd)->dbi_cur++])
503 clear_bit(tcmu_cmd->dbi[i], udev->data_bitmap); in tcmu_cmd_free_data()
512 int i, cnt, dbi, dpi; in tcmu_get_empty_block() local
515 dbi = find_first_zero_bit(udev->data_bitmap, udev->dbi_thresh); in tcmu_get_empty_block()
516 if (dbi == udev->dbi_thresh) in tcmu_get_empty_block()
519 dpi = dbi * udev->data_pages_per_blk; in tcmu_get_empty_block()
542 if (i && dbi > udev->dbi_max) in tcmu_get_empty_block()
543 udev->dbi_max = dbi; in tcmu_get_empty_block()
545 set_bit(dbi, udev->data_bitmap); in tcmu_get_empty_block()
546 tcmu_cmd_set_dbi(tcmu_cmd, dbi); in tcmu_get_empty_block()
548 if (dbi != prev_dbi + 1) in tcmu_get_empty_block()
551 return i == page_cnt ? dbi : -1; in tcmu_get_empty_block()
558 int dbi = -2; in tcmu_get_empty_blocks() local
564 dbi = tcmu_get_empty_block(udev, tcmu_cmd, dbi, blk_data_len, in tcmu_get_empty_blocks()
566 if (dbi < 0) in tcmu_get_empty_blocks()
574 kfree(tcmu_cmd->dbi); in tcmu_free_cmd()
600 int dbi = tcmu_cmd_get_dbi(cmd); in new_block_to_iov() local
609 if (dbi != prev_dbi + 1) { in new_block_to_iov()
615 (udev->data_off + dbi * udev->data_blk_size); in new_block_to_iov()
619 return dbi; in new_block_to_iov()
626 int dbi = -2; in tcmu_setup_iovs() local
630 dbi = new_block_to_iov(udev, cmd, iov, dbi, data_length); in tcmu_setup_iovs()
648 tcmu_cmd->dbi = kcalloc(tcmu_cmd->dbi_cnt, sizeof(uint32_t), in tcmu_alloc_cmd()
650 if (!tcmu_cmd->dbi) { in tcmu_alloc_cmd()
708 int dbi = -2; in tcmu_copy_data() local
724 dbi = new_block_to_iov(udev, tcmu_cmd, iov, dbi, in tcmu_copy_data()
727 dbi = tcmu_cmd_get_dbi(tcmu_cmd); in tcmu_copy_data()
733 dpi = dbi * udev->data_pages_per_blk; in tcmu_copy_data()