diff options
Diffstat (limited to 'drivers/staging/zram/zram_drv.h')
-rw-r--r-- | drivers/staging/zram/zram_drv.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/staging/zram/zram_drv.h b/drivers/staging/zram/zram_drv.h index df2eec4..2d1a3f1 100644 --- a/drivers/staging/zram/zram_drv.h +++ b/drivers/staging/zram/zram_drv.h @@ -28,9 +28,6 @@ static const unsigned max_num_devices = 32; /*-- Configurable parameters */ -/* Default zram disk size: 25% of total RAM */ -static const unsigned default_disksize_perc_ram = 25; - /* * Pages that compress to size greater than this are stored * uncompressed in memory. @@ -86,11 +83,15 @@ struct zram_stats { u32 bad_compress; /* % of pages with compression ratio>=75% */ }; -struct zram { - struct zs_pool *mem_pool; +struct zram_meta { void *compress_workmem; void *compress_buffer; struct table *table; + struct zs_pool *mem_pool; +}; + +struct zram { + struct zram_meta *meta; spinlock_t stat64_lock; /* protect 64-bit stats */ struct rw_semaphore lock; /* protect compression buffers and table * against concurrent read and writes */ @@ -114,7 +115,9 @@ unsigned int zram_get_num_devices(void); extern struct attribute_group zram_disk_attr_group; #endif -extern int zram_init_device(struct zram *zram); -extern void __zram_reset_device(struct zram *zram); +extern void zram_reset_device(struct zram *zram); +extern struct zram_meta *zram_meta_alloc(u64 disksize); +extern void zram_meta_free(struct zram_meta *meta); +extern void zram_init_device(struct zram *zram, struct zram_meta *meta); #endif |