Messages in this thread Patch in this message | | | From | Nigel Cunningham <> | Subject | [Suspend2][ 12/35] [Suspend2] Get filewriter storage allocated. | Date | Tue, 27 Jun 2006 08:39:44 +1000 |
| |
Return the amount of filewriter storage that is currently allocated.
Signed-off-by: Nigel Cunningham <nigel@suspend2.net>
kernel/power/suspend_file.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/kernel/power/suspend_file.c b/kernel/power/suspend_file.c index 002f73c..74d97a0 100644 --- a/kernel/power/suspend_file.c +++ b/kernel/power/suspend_file.c @@ -400,3 +400,18 @@ static int prepare_signature(struct file return 0; } +static int filewriter_storage_allocated(void) +{ + int result; + + if (!target_inode) + return 0; + + if (target_is_normal_file()) { + result = (int) target_storage_available; + } else + result = header_pages + main_pages; + + return result; +} + -- 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/
| |