lkml.org 
[lkml]   [2006]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[Suspend2][ 25/32] [Suspend2] Do io on a page in the image proper.
    Date
    Advance one page and perform the requested i/o.

    Signed-off-by: Nigel Cunningham <nigel@suspend2.net>

    kernel/power/suspend_block_io.c | 35 +++++++++++++++++++++++++++++++++++
    1 files changed, 35 insertions(+), 0 deletions(-)

    diff --git a/kernel/power/suspend_block_io.c b/kernel/power/suspend_block_io.c
    index ffc2e16..c746f9f 100644
    --- a/kernel/power/suspend_block_io.c
    +++ b/kernel/power/suspend_block_io.c
    @@ -821,3 +821,38 @@ static void set_extra_page_forward(void)
    extra_page_forward = 1;
    }

    +static int suspend_rw_page(int rw, struct page *page,
    + int readahead_index, int sync, int debug)
    +{
    + int i, current_chain;
    + struct submit_params submit_params;
    +
    + if (test_action_state(SUSPEND_TEST_FILTER_SPEED))
    + return 0;
    +
    + submit_params.readahead_index = readahead_index;
    + submit_params.page = page;
    +
    + if (forward_one_page()) {
    + printk("Failed to advance a page in the extent data.\n");
    + return -ENODATA;
    + }
    +
    + current_chain = suspend_writer_posn.current_chain;
    + submit_params.dev = suspend_devinfo[current_chain].bdev;
    + submit_params.block[0] = suspend_writer_posn.current_offset <<
    + suspend_devinfo[current_chain].bmap_shift;
    +
    + if (debug)
    + printk("%s: %lx:%lx.\n", rw ? "Write" : "Read",
    + (long) submit_params.dev->bd_dev,
    + (long) submit_params.block[0]);
    +
    + i = suspend_do_io(rw, &submit_params, sync);
    +
    + if (i)
    + return -EIO;
    +
    + return 0;
    +}
    +
    --
    Nigel Cunningham nigel at suspend2 dot net
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-06-27 01:13    [W:0.022 / U:62.396 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site