Staging: zram: initialize device on first read
authorJerome Marchand <jmarchan@redhat.com>
Thu, 17 Feb 2011 16:11:49 +0000 (17:11 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Feb 2011 21:26:12 +0000 (13:26 -0800)
commit6642a67c552e6d525913bb5fb4a00b2008213451
tree959e96168aecfc0a38e23193c05284d5a0ae49ce
parent69648bed5383d5e9454aa9dc922dee4db2eef794
Staging: zram: initialize device on first read

Currently the device is initialized when first write is done to the
device. Any read attempt before the first write would fail, including
"hidden" read the user may not know about (as for example if he tries
to write a partial block).

This patch initializes the device on first request, whether read or
write.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/zram/zram_drv.c