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][ 05/35] [Suspend2] Filewriter storage available less ignored pages.
Date
Return the number of pages the filewriter will actually use in the provided
storage.

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

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

diff --git a/kernel/power/suspend_file.c b/kernel/power/suspend_file.c
index 41aaed4..9046b80 100644
--- a/kernel/power/suspend_file.c
+++ b/kernel/power/suspend_file.c
@@ -154,3 +154,17 @@ static int has_contiguous_blocks(int pag
return (j == devinfo.blocks_per_page);
}

+static int size_ignoring_ignored_pages(void)
+{
+ int mappable = 0, i;
+
+ if (target_is_normal_file()) {
+ for (i = 0; i < (target_inode->i_size >> PAGE_SHIFT) ; i++)
+ if (has_contiguous_blocks(i))
+ mappable++;
+
+ return mappable;
+ } else
+ return filewriter_storage_available();
+}
+
--
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:07    [W:0.151 / U:2.228 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site