Return the amount of storage available and llocated for swapwriter use.
Signed-off-by: Nigel Cunningham <[email protected]>
kernel/power/suspend_swap.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/kernel/power/suspend_swap.c b/kernel/power/suspend_swap.c
index af6640f..792bcc8 100644
--- a/kernel/power/suspend_swap.c
+++ b/kernel/power/suspend_swap.c
@@ -418,3 +418,14 @@ static void get_main_pool_phys_params(vo
swapwriter_allocate_header_space(prev_header_pages_allocated);
}
+static int swapwriter_storage_allocated(void)
+{
+ return swapextents.size;
+}
+
+static int swapwriter_storage_available(void)
+{
+ si_swapinfo(&swapinfo);
+ return swapinfo.freeswap + swapwriter_storage_allocated();
+}
+
--
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]