|
|
@@ -52,6 +52,16 @@ static size_t huge_class_size;
|
|
|
|
|
|
static void zram_free_page(struct zram *zram, size_t index);
|
|
|
|
|
|
+static void zram_slot_lock(struct zram *zram, u32 index)
|
|
|
+{
|
|
|
+ bit_spin_lock(ZRAM_LOCK, &zram->table[index].value);
|
|
|
+}
|
|
|
+
|
|
|
+static void zram_slot_unlock(struct zram *zram, u32 index)
|
|
|
+{
|
|
|
+ bit_spin_unlock(ZRAM_LOCK, &zram->table[index].value);
|
|
|
+}
|
|
|
+
|
|
|
static inline bool init_done(struct zram *zram)
|
|
|
{
|
|
|
return zram->disksize;
|
|
|
@@ -753,16 +763,6 @@ static DEVICE_ATTR_RO(io_stat);
|
|
|
static DEVICE_ATTR_RO(mm_stat);
|
|
|
static DEVICE_ATTR_RO(debug_stat);
|
|
|
|
|
|
-static void zram_slot_lock(struct zram *zram, u32 index)
|
|
|
-{
|
|
|
- bit_spin_lock(ZRAM_ACCESS, &zram->table[index].value);
|
|
|
-}
|
|
|
-
|
|
|
-static void zram_slot_unlock(struct zram *zram, u32 index)
|
|
|
-{
|
|
|
- bit_spin_unlock(ZRAM_ACCESS, &zram->table[index].value);
|
|
|
-}
|
|
|
-
|
|
|
static void zram_meta_free(struct zram *zram, u64 disksize)
|
|
|
{
|
|
|
size_t num_pages = disksize >> PAGE_SHIFT;
|