lkml.org 
[lkml]   [2010]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3/7] Set block size to PAGE_SIZE
    Date
    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>
    ---
    drivers/staging/ramzswap/ramzswap_drv.c | 4 ++++
    1 files changed, 4 insertions(+), 0 deletions(-)

    diff --git a/drivers/staging/ramzswap/ramzswap_drv.c b/drivers/staging/ramzswap/ramzswap_drv.c
    index 3567ee3..2021ad6 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;
    --
    1.6.2.5


    \
     
     \ /
      Last update: 2010-01-28 16:49    [W:0.022 / U:0.488 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site