aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/ramzswap
diff options
context:
space:
mode:
authorNitin Gupta <ngupta@vflare.org>2010-01-28 21:13:39 +0530
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-03 16:42:53 -0800
commit5d83d5a0b5ee332b724978d657c0af17f14e807e (patch)
tree7d6d8edf314453b6653caa163d746182aea27ff7 /drivers/staging/ramzswap
parent7eef7533909f3ea50e8b375777242f778e8da11e (diff)
Staging: ramzswap: Set block size to PAGE_SIZE
ramzswap block size needs to be set equal to PAGE_SIZE to avoid receiving any unaligned block I/O requests (happens due to readahead logic during swapon). These unaligned accesses produce unnecessary I/O errors, scaring users. Signed-off-by: Nitin Gupta <ngupta@vflare.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/ramzswap')
-rw-r--r--drivers/staging/ramzswap/ramzswap_drv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/ramzswap/ramzswap_drv.c b/drivers/staging/ramzswap/ramzswap_drv.c
index 3567ee3991b..2021ad6fb01 100644
--- a/drivers/staging/ramzswap/ramzswap_drv.c
+++ b/drivers/staging/ramzswap/ramzswap_drv.c
@@ -1335,6 +1335,10 @@ static int create_device(struct ramzswap *rzs, int device_id)
* or set equal to backing swap device (if provided)
*/
set_capacity(rzs->disk, 0);
+
+ blk_queue_physical_block_size(rzs->disk->queue, PAGE_SIZE);
+ blk_queue_logical_block_size(rzs->disk->queue, PAGE_SIZE);
+
add_disk(rzs->disk);
rzs->init_done = 0;