We currently don't support zram on-demand device creation. The only way
to have N zram devices is to specify num_devices module parameter (default
value 1). That means that if, for some reason, at some point, user wants
to have N + 1 devies he/she must umount all the existing devices, unload
the module, load the module passing num_devices equals to N + 1. And do
this again, if needed.
This patchset introduces zram-control sysfs class, which has two sysfs
attrs:
- zram_add -- add a new specific (device_id) zram device
- zram_remove -- remove a specific (device_id) zram device
Usage example:
# add a new specific zram device
echo 4 > /sys/class/zram-control/zram_add
# remove a specific zram device
echo 4 > /sys/class/zram-control/zram_remove
The patchset also does some cleanups and huge code reorganization.
This patch (of 8):
Fix a misplaced backslash.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
static unsigned int num_devices = 1;
#define ZRAM_ATTR_RO(name) \
-static ssize_t name##_show(struct device *d, \
+static ssize_t name##_show(struct device *d, \
struct device_attribute *attr, char *b) \
{ \
struct zram *zram = dev_to_zram(d); \