From: Nitin Gupta Date: Mon, 9 Aug 2010 17:26:47 +0000 (+0530) Subject: Staging: zram: Replace ioctls with sysfs interface X-Git-Tag: v2.6.37-rc1~60^2~3^2~734 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33863c21e69e9bd988b63580ada0b729c1d90215;p=pandora-kernel.git Staging: zram: Replace ioctls with sysfs interface Creates per-device sysfs nodes in /sys/block/zram/ Currently following stats are exported: - disksize - num_reads - num_writes - invalid_io - zero_pages - orig_data_size - compr_data_size - mem_used_total By default, disksize is set to 0. So, to start using a zram device, fist write a disksize value and then initialize device by writing any positive value to initstate. For example: # initialize /dev/zram0 with 50MB disksize echo 50*1024*1024 | bc > /sys/block/zram0/disksize echo 1 > /sys/block/zram0/initstate When done using a disk, issue reset to free its memory by writing any positive value to reset node: echo 1 > /sys/block/zram0/reset This change also obviates the need for 'rzscontrol' utility. Signed-off-by: Nitin Gupta Acked-by: Pekka Enberg Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed