diff options
author | Minchan Kim <minchan@kernel.org> | 2013-01-30 11:41:40 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-03 17:52:49 -0800 |
commit | 0231c403bb065307493fe997ad170487b4d55eb8 (patch) | |
tree | 7d213005b1dc78e21d44f4dd40bae05aadb3a589 /drivers/staging/zram/zram_sysfs.c | |
parent | 7e5a5104c6af709a8d97d5f4711e7c917761d464 (diff) |
zram: force disksize setting before using zram
Now zram document syas "set disksize is optional"
but partly it's wrong. When you try to use zram firstly after
booting, you must set disksize, otherwise zram can't work because
zram gendisk's size is 0. But once you do it, you can use zram freely
after reset because reset doesn't reset to zero paradoxically.
So in this time, disksize setting is optional.:(
It's inconsitent for user behavior and not straightforward.
This patch forces always setting disksize firstly before using zram.
Yes. It changes current behavior so someone could complain when
he upgrades zram. Apparently it could be a problem if zram is mainline
but it still lives in staging so behavior could be changed for right
way to go. Let them excuse.
Acked-by: Jerome Marchand <jmarchand@redhat.com>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/zram/zram_sysfs.c')
-rw-r--r-- | drivers/staging/zram/zram_sysfs.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/staging/zram/zram_sysfs.c b/drivers/staging/zram/zram_sysfs.c index de1eacf65dbd..4143af9fcc1b 100644 --- a/drivers/staging/zram/zram_sysfs.c +++ b/drivers/staging/zram/zram_sysfs.c @@ -110,11 +110,7 @@ static ssize_t reset_store(struct device *dev, if (bdev) fsync_bdev(bdev); - down_write(&zram->init_lock); - if (zram->init_done) - __zram_reset_device(zram); - up_write(&zram->init_lock); - + zram_reset_device(zram); return len; } |