Lines Matching refs:blk_idx
554 unsigned long blk_idx = 1; in alloc_block_bdev() local
557 blk_idx = find_next_zero_bit(zram->bitmap, zram->nr_pages, blk_idx); in alloc_block_bdev()
558 if (blk_idx == zram->nr_pages) in alloc_block_bdev()
561 if (test_and_set_bit(blk_idx, zram->bitmap)) in alloc_block_bdev()
565 return blk_idx; in alloc_block_bdev()
568 static void free_block_bdev(struct zram *zram, unsigned long blk_idx) in free_block_bdev() argument
572 was_set = test_and_clear_bit(blk_idx, zram->bitmap); in free_block_bdev()
631 unsigned long blk_idx = 0; in writeback_store() local
672 if (!blk_idx) { in writeback_store()
673 blk_idx = alloc_block_bdev(zram); in writeback_store()
674 if (!blk_idx) { in writeback_store()
713 bio.bi_iter.bi_sector = blk_idx * (PAGE_SIZE >> 9); in writeback_store()
752 zram_set_element(zram, index, blk_idx); in writeback_store()
753 blk_idx = 0; in writeback_store()
763 if (blk_idx) in writeback_store()
764 free_block_bdev(zram, blk_idx); in writeback_store()
840 static void free_block_bdev(struct zram *zram, unsigned long blk_idx) {}; in free_block_bdev() argument