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][ 07/35] [Suspend2] Filewriter cleanup.
Date
Cleanup when returning control to userspace.

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

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

diff --git a/kernel/power/suspend_file.c b/kernel/power/suspend_file.c
index 97f97be..e2ad8dc 100644
--- a/kernel/power/suspend_file.c
+++ b/kernel/power/suspend_file.c
@@ -235,3 +235,27 @@ static void populate_block_list(void)
devinfo.blocks_per_page - 1);
}

+static void filewriter_cleanup(int finishing_cycle)
+{
+ if (filewriter_target_bdev) {
+ if (target_claim) {
+ bd_release(filewriter_target_bdev);
+ target_claim = 0;
+ }
+
+ if (used_devt) {
+ blkdev_put(filewriter_target_bdev);
+ used_devt = 0;
+ }
+ filewriter_target_bdev = NULL;
+ target_inode = NULL;
+ set_devinfo(NULL, 0);
+ target_storage_available = 0;
+ }
+
+ if (target_file > 0) {
+ filp_close(target_file, NULL);
+ target_file = NULL;
+ }
+}
+
--
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:08    [W:0.190 / U:0.956 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site