|
36 | 36 | #include <linux/kernel_read_file.h> |
37 | 37 |
|
38 | 38 | #include "zram_drv.h" |
| 39 | +#include "zram_wb.h" |
39 | 40 |
|
40 | 41 | static DEFINE_IDR(zram_index_idr); |
41 | 42 | /* idr index must be protected */ |
@@ -233,22 +234,6 @@ static void zram_accessed(struct zram *zram, u32 index) |
233 | 234 | } |
234 | 235 |
|
235 | 236 | #if defined CONFIG_ZRAM_WRITEBACK || defined CONFIG_ZRAM_MULTI_COMP |
236 | | -struct zram_pp_slot { |
237 | | - unsigned long index; |
238 | | - struct list_head entry; |
239 | | -}; |
240 | | - |
241 | | -/* |
242 | | - * A post-processing bucket is, essentially, a size class, this defines |
243 | | - * the range (in bytes) of pp-slots sizes in particular bucket. |
244 | | - */ |
245 | | -#define PP_BUCKET_SIZE_RANGE 64 |
246 | | -#define NUM_PP_BUCKETS ((PAGE_SIZE / PP_BUCKET_SIZE_RANGE) + 1) |
247 | | - |
248 | | -struct zram_pp_ctl { |
249 | | - struct list_head pp_buckets[NUM_PP_BUCKETS]; |
250 | | -}; |
251 | | - |
252 | 237 | static struct zram_pp_ctl *init_pp_ctl(void) |
253 | 238 | { |
254 | 239 | struct zram_pp_ctl *ctl; |
@@ -697,31 +682,6 @@ static ssize_t backing_dev_store(struct device *dev, |
697 | 682 | return err; |
698 | 683 | } |
699 | 684 |
|
700 | | -static unsigned long alloc_block_bdev(struct zram *zram) |
701 | | -{ |
702 | | - unsigned long blk_idx = 1; |
703 | | -retry: |
704 | | - /* skip 0 bit to confuse zram.handle = 0 */ |
705 | | - blk_idx = find_next_zero_bit(zram->bitmap, zram->nr_pages, blk_idx); |
706 | | - if (blk_idx == zram->nr_pages) |
707 | | - return 0; |
708 | | - |
709 | | - if (test_and_set_bit(blk_idx, zram->bitmap)) |
710 | | - goto retry; |
711 | | - |
712 | | - atomic64_inc(&zram->stats.bd_count); |
713 | | - return blk_idx; |
714 | | -} |
715 | | - |
716 | | -static void free_block_bdev(struct zram *zram, unsigned long blk_idx) |
717 | | -{ |
718 | | - int was_set; |
719 | | - |
720 | | - was_set = test_and_clear_bit(blk_idx, zram->bitmap); |
721 | | - WARN_ON_ONCE(!was_set); |
722 | | - atomic64_dec(&zram->stats.bd_count); |
723 | | -} |
724 | | - |
725 | 685 | static void read_from_bdev_async(struct zram *zram, struct page *page, |
726 | 686 | unsigned long entry, struct bio *parent) |
727 | 687 | { |
@@ -1111,8 +1071,6 @@ static int read_from_bdev(struct zram *zram, struct page *page, |
1111 | 1071 | { |
1112 | 1072 | return -EIO; |
1113 | 1073 | } |
1114 | | - |
1115 | | -static void free_block_bdev(struct zram *zram, unsigned long blk_idx) {}; |
1116 | 1074 | #endif |
1117 | 1075 |
|
1118 | 1076 | #ifdef CONFIG_ZRAM_MEMORY_TRACKING |
|
0 commit comments