Lines Matching refs:blk_idx
506 unsigned long blk_idx = 1; in alloc_block_bdev() local
509 blk_idx = find_next_zero_bit(zram->bitmap, zram->nr_pages, blk_idx); in alloc_block_bdev()
510 if (blk_idx == zram->nr_pages) in alloc_block_bdev()
513 if (test_and_set_bit(blk_idx, zram->bitmap)) in alloc_block_bdev()
517 return blk_idx; in alloc_block_bdev()
520 static void free_block_bdev(struct zram *zram, unsigned long blk_idx) in free_block_bdev() argument
524 was_set = test_and_clear_bit(blk_idx, zram->bitmap); in free_block_bdev()
583 unsigned long blk_idx = 0; in writeback_store() local
624 if (!blk_idx) { in writeback_store()
625 blk_idx = alloc_block_bdev(zram); in writeback_store()
626 if (!blk_idx) { in writeback_store()
665 bio.bi_iter.bi_sector = blk_idx * (PAGE_SIZE >> 9); in writeback_store()
709 zram_set_element(zram, index, blk_idx); in writeback_store()
710 blk_idx = 0; in writeback_store()
720 if (blk_idx) in writeback_store()
721 free_block_bdev(zram, blk_idx); in writeback_store()
796 static void free_block_bdev(struct zram *zram, unsigned long blk_idx) {}; in free_block_bdev() argument