bali 61 drivers/scsi/cxlflash/vlun.c struct ba_lun_info *bali = NULL; bali 78 drivers/scsi/cxlflash/vlun.c bali = kzalloc(sizeof(struct ba_lun_info), GFP_KERNEL); bali 79 drivers/scsi/cxlflash/vlun.c if (unlikely(!bali)) { bali 85 drivers/scsi/cxlflash/vlun.c bali->total_aus = lun_size_au; bali 86 drivers/scsi/cxlflash/vlun.c bali->lun_bmap_size = lun_size_au / BITS_PER_LONG; bali 89 drivers/scsi/cxlflash/vlun.c bali->lun_bmap_size++; bali 92 drivers/scsi/cxlflash/vlun.c bali->lun_alloc_map = kzalloc((bali->lun_bmap_size * sizeof(u64)), bali 94 drivers/scsi/cxlflash/vlun.c if (unlikely(!bali->lun_alloc_map)) { bali 97 drivers/scsi/cxlflash/vlun.c kfree(bali); bali 102 drivers/scsi/cxlflash/vlun.c bali->free_aun_cnt = lun_size_au; bali 104 drivers/scsi/cxlflash/vlun.c for (i = 0; i < bali->lun_bmap_size; i++) bali 105 drivers/scsi/cxlflash/vlun.c bali->lun_alloc_map[i] = 0xFFFFFFFFFFFFFFFFULL; bali 108 drivers/scsi/cxlflash/vlun.c last_word_underflow = (bali->lun_bmap_size * BITS_PER_LONG); bali 109 drivers/scsi/cxlflash/vlun.c last_word_underflow -= bali->free_aun_cnt; bali 111 drivers/scsi/cxlflash/vlun.c lam = &bali->lun_alloc_map[bali->lun_bmap_size - 1]; bali 119 drivers/scsi/cxlflash/vlun.c bali->free_high_idx = bali->lun_bmap_size; bali 122 drivers/scsi/cxlflash/vlun.c bali->aun_clone_map = kzalloc((bali->total_aus * sizeof(u8)), bali 124 drivers/scsi/cxlflash/vlun.c if (unlikely(!bali->aun_clone_map)) { bali 127 drivers/scsi/cxlflash/vlun.c kfree(bali->lun_alloc_map); bali 128 drivers/scsi/cxlflash/vlun.c kfree(bali); bali 133 drivers/scsi/cxlflash/vlun.c ba_lun->ba_lun_handle = bali; bali 137 drivers/scsi/cxlflash/vlun.c __func__, ba_lun->lun_id, bali->lun_bmap_size, bali 138 drivers/scsi/cxlflash/vlun.c bali->free_aun_cnt); bali 153 drivers/scsi/cxlflash/vlun.c struct ba_lun_info *bali, int *bit_word) bali 160 drivers/scsi/cxlflash/vlun.c if (bali->lun_alloc_map[i] != 0) { bali 161 drivers/scsi/cxlflash/vlun.c lam = (ulong *)&bali->lun_alloc_map[i]; bali 167 drivers/scsi/cxlflash/vlun.c __func__, bit_pos, bali->lun_alloc_map[i], i); bali 170 drivers/scsi/cxlflash/vlun.c bali->free_aun_cnt--; bali 188 drivers/scsi/cxlflash/vlun.c struct ba_lun_info *bali = NULL; bali 190 drivers/scsi/cxlflash/vlun.c bali = ba_lun->ba_lun_handle; bali 194 drivers/scsi/cxlflash/vlun.c __func__, ba_lun->lun_id, bali->free_aun_cnt); bali 196 drivers/scsi/cxlflash/vlun.c if (bali->free_aun_cnt == 0) { bali 203 drivers/scsi/cxlflash/vlun.c bit_pos = find_free_range(bali->free_curr_idx, bali 204 drivers/scsi/cxlflash/vlun.c bali->free_high_idx, bali, &bit_word); bali 206 drivers/scsi/cxlflash/vlun.c bit_pos = find_free_range(bali->free_low_idx, bali 207 drivers/scsi/cxlflash/vlun.c bali->free_curr_idx, bali 208 drivers/scsi/cxlflash/vlun.c bali, &bit_word); bali 218 drivers/scsi/cxlflash/vlun.c bali->free_curr_idx = bit_word + 1; bali 220 drivers/scsi/cxlflash/vlun.c bali->free_curr_idx = bit_word; bali 225 drivers/scsi/cxlflash/vlun.c bali->free_aun_cnt); bali 237 drivers/scsi/cxlflash/vlun.c static int validate_alloc(struct ba_lun_info *bali, u64 aun) bali 244 drivers/scsi/cxlflash/vlun.c if (test_bit(bit_pos, (ulong *)&bali->lun_alloc_map[idx])) bali 260 drivers/scsi/cxlflash/vlun.c struct ba_lun_info *bali = NULL; bali 262 drivers/scsi/cxlflash/vlun.c bali = ba_lun->ba_lun_handle; bali 264 drivers/scsi/cxlflash/vlun.c if (validate_alloc(bali, to_free)) { bali 272 drivers/scsi/cxlflash/vlun.c bali->free_aun_cnt); bali 274 drivers/scsi/cxlflash/vlun.c if (bali->aun_clone_map[to_free] > 0) { bali 277 drivers/scsi/cxlflash/vlun.c bali->aun_clone_map[to_free]); bali 278 drivers/scsi/cxlflash/vlun.c bali->aun_clone_map[to_free]--; bali 285 drivers/scsi/cxlflash/vlun.c set_bit(bit_pos, (ulong *)&bali->lun_alloc_map[idx]); bali 286 drivers/scsi/cxlflash/vlun.c bali->free_aun_cnt++; bali 288 drivers/scsi/cxlflash/vlun.c if (idx < bali->free_low_idx) bali 289 drivers/scsi/cxlflash/vlun.c bali->free_low_idx = idx; bali 290 drivers/scsi/cxlflash/vlun.c else if (idx > bali->free_high_idx) bali 291 drivers/scsi/cxlflash/vlun.c bali->free_high_idx = idx; bali 295 drivers/scsi/cxlflash/vlun.c ba_lun->lun_id, bali->free_aun_cnt); bali 309 drivers/scsi/cxlflash/vlun.c struct ba_lun_info *bali = ba_lun->ba_lun_handle; bali 311 drivers/scsi/cxlflash/vlun.c if (validate_alloc(bali, to_clone)) { bali 320 drivers/scsi/cxlflash/vlun.c if (bali->aun_clone_map[to_clone] == MAX_AUN_CLONE_CNT) { bali 326 drivers/scsi/cxlflash/vlun.c bali->aun_clone_map[to_clone]++; bali 339 drivers/scsi/cxlflash/vlun.c struct ba_lun_info *bali = ba_lun->ba_lun_handle; bali 341 drivers/scsi/cxlflash/vlun.c return bali->free_aun_cnt; bali 352 drivers/scsi/cxlflash/vlun.c struct ba_lun_info *bali = ba_lun->ba_lun_handle; bali 354 drivers/scsi/cxlflash/vlun.c if (bali) { bali 355 drivers/scsi/cxlflash/vlun.c kfree(bali->aun_clone_map); bali 356 drivers/scsi/cxlflash/vlun.c kfree(bali->lun_alloc_map); bali 357 drivers/scsi/cxlflash/vlun.c kfree(bali);