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][ 14/35] [Suspend2] Allocate filewriter header storage
    Date
    Having already allocated storage, set aside a number of pages at the start
    of the image for the header and record where pageset2 will start.

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

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

    diff --git a/kernel/power/suspend_file.c b/kernel/power/suspend_file.c
    index 257acca..6b04eb5 100644
    --- a/kernel/power/suspend_file.c
    +++ b/kernel/power/suspend_file.c
    @@ -427,3 +427,24 @@ static int filewriter_release_storage(vo
    return 0;
    }

    +static int filewriter_allocate_header_space(int space_requested)
    +{
    + int i;
    +
    + if (!block_chain.first)
    + return 0;
    +
    + suspend_extent_state_goto_start(&suspend_writer_posn);
    + suspend_bio_ops.forward_one_page(); /* To first page */
    +
    + for (i = 0; i < space_requested; i++)
    + if (suspend_bio_ops.forward_one_page())
    + return -ENOSPC;
    +
    + /* The end of header pages will be the start of pageset 2 */
    + suspend_extent_state_save(&suspend_writer_posn,
    + &suspend_writer_posn_save[2]);
    + header_pages = space_requested;
    + 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:09    [W:0.022 / U:30.676 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site