aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/zram/zram_sysfs.c
Commit message (Collapse)AuthorAgeFilesLines
* merge opensource jb u5codeworkx2012-09-221-2/+38
| | | | Change-Id: I1aaec157aa196f3448eff8636134fce89a814cf2
* Staging: zram: round up the disk size provided by userJerome Marchand2011-01-201-1/+2
| | | | | | | | | Currently disksize_store() round down the disk size provided by user. This is probably not what one would expect, so round up instead. Signed-off-by: Jerome Marchand <jmarchan@redhat.com> Acked-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: zram: make ZRAM depends on SYSFSJerome Marchand2011-01-201-4/+0
| | | | | | | | | We can not configure zram device without sysfs anyway, so make zram depends on it. Signed-off-by: Jerome Marchand <jmarchan@redhat.com> Acked-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: zram: fix up my fixup for some sysfs attribute permissionsGreg Kroah-Hartman2010-11-181-2/+2
| | | | | | | | | | | They should be writable by root, not readable. Doh, stupid me with the wrong flags. Reported-by: Jonathan Cameron <jic23@cam.ac.uk> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Pekka Enberg <penberg@cs.helsinki.fi> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: zram: fix up some sysfs attribute permissionsGreg Kroah-Hartman2010-11-161-2/+2
| | | | | | | | | | They should not be writable by any user Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Pekka Enberg <penberg@cs.helsinki.fi> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: zram: Remove need for explicit device initializationNitin Gupta2010-08-311-22/+4
| | | | | | | | | | | | | | | | | | | | Currently, the user has to explicitly write a positive value to initstate sysfs node before the device can be used. This event triggers allocation of per-device metadata like memory pool, table array and so on. We do not pre-initialize all zram devices since the 'table' array, mapping disk blocks to compressed chunks, takes considerable amount of memory (8 bytes per page). So, pre-initializing all devices will be quite wasteful if only few or none of the devices are actually used. This explicit device initialization from user is an odd requirement and can be easily avoided. We now initialize the device when first write is done to the device. Signed-off-by: Nitin Gupta <ngupta@vflare.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: zram: Replace ioctls with sysfs interfaceNitin Gupta2010-08-311-0/+242
Creates per-device sysfs nodes in /sys/block/zram<id>/ 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 <ngupta@vflare.org> Acked-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>