Lines Matching refs:blk_idx
570 unsigned long blk_idx = 1; in alloc_block_bdev() local
573 blk_idx = find_next_zero_bit(zram->bitmap, zram->nr_pages, blk_idx); in alloc_block_bdev()
574 if (blk_idx == zram->nr_pages) in alloc_block_bdev()
577 if (test_and_set_bit(blk_idx, zram->bitmap)) in alloc_block_bdev()
581 return blk_idx; in alloc_block_bdev()
584 static void free_block_bdev(struct zram *zram, unsigned long blk_idx) in free_block_bdev() argument
588 was_set = test_and_clear_bit(blk_idx, zram->bitmap); in free_block_bdev()
648 unsigned long blk_idx = 0; in writeback_store() local
700 if (!blk_idx) { in writeback_store()
701 blk_idx = alloc_block_bdev(zram); in writeback_store()
702 if (!blk_idx) { in writeback_store()
741 bio.bi_iter.bi_sector = blk_idx * (PAGE_SIZE >> 9); in writeback_store()
784 zram_set_element(zram, index, blk_idx); in writeback_store()
785 blk_idx = 0; in writeback_store()
795 if (blk_idx) in writeback_store()
796 free_block_bdev(zram, blk_idx); in writeback_store()
871 static void free_block_bdev(struct zram *zram, unsigned long blk_idx) {}; in free_block_bdev() argument