lkml.org 
[lkml]   [2006]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[ 07/10] [Suspend2] Header storage for modules.
    Date

    Calculate the space in an image header required for storing module
    configuration data.

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

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

    diff --git a/kernel/power/modules.c b/kernel/power/modules.c
    index dd53b27..7d56ce0 100644
    --- a/kernel/power/modules.c
    +++ b/kernel/power/modules.c
    @@ -16,6 +16,27 @@ static int num_filters = 0, num_ui = 0;
    int num_writers = 0, num_modules = 0;

    /*
    + * header_storage_for_modules
    + *
    + * Returns the amount of space needed to store configuration
    + * data needed by the modules prior to copying back the original
    + * kernel. We can exclude data for pageset2 because it will be
    + * available anyway once the kernel is copied back.
    + */
    +unsigned long header_storage_for_modules(void)
    +{
    + struct suspend_module_ops *this_module;
    + unsigned long bytes = 0;
    +
    + list_for_each_entry(this_module, &suspend_modules, module_list) {
    + if (this_module->disabled)
    + continue;
    + if (this_module->storage_needed)
    + bytes += this_module->storage_needed();
    + }
    +
    + return bytes;
    +}
    * suspend_register_module
    *
    * Register a module.
    --
    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-02-01 12:45    [W:0.038 / U:1.232 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site