hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/block/zram/zram_drv.c
....@@ -59,40 +59,6 @@
5959 static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,
6060 u32 index, int offset, struct bio *bio);
6161
62
-#ifdef CONFIG_PREEMPT_RT
63
-static void zram_meta_init_table_locks(struct zram *zram, size_t num_pages)
64
-{
65
- size_t index;
66
-
67
- for (index = 0; index < num_pages; index++)
68
- spin_lock_init(&zram->table[index].lock);
69
-}
70
-
71
-static int zram_slot_trylock(struct zram *zram, u32 index)
72
-{
73
- int ret;
74
-
75
- ret = spin_trylock(&zram->table[index].lock);
76
- if (ret)
77
- __set_bit(ZRAM_LOCK, &zram->table[index].flags);
78
- return ret;
79
-}
80
-
81
-static void zram_slot_lock(struct zram *zram, u32 index)
82
-{
83
- spin_lock(&zram->table[index].lock);
84
- __set_bit(ZRAM_LOCK, &zram->table[index].flags);
85
-}
86
-
87
-static void zram_slot_unlock(struct zram *zram, u32 index)
88
-{
89
- __clear_bit(ZRAM_LOCK, &zram->table[index].flags);
90
- spin_unlock(&zram->table[index].lock);
91
-}
92
-
93
-#else
94
-
95
-static void zram_meta_init_table_locks(struct zram *zram, size_t num_pages) { }
9662
9763 static int zram_slot_trylock(struct zram *zram, u32 index)
9864 {
....@@ -108,7 +74,6 @@
10874 {
10975 bit_spin_unlock(ZRAM_LOCK, &zram->table[index].flags);
11076 }
111
-#endif
11277
11378 static inline bool init_done(struct zram *zram)
11479 {
....@@ -1213,7 +1178,6 @@
12131178
12141179 if (!huge_class_size)
12151180 huge_class_size = zs_huge_class_size(zram->mem_pool);
1216
- zram_meta_init_table_locks(zram, num_pages);
12171181 return true;
12181182 }
12191183