Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
0e948558
Commit
0e948558
authored
Jul 31, 2002
by
Pavel Machek
Committed by
Linus Torvalds
Jul 31, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] swsusp: comment updates and warning fixes
Better comments and less warnings, please apply
parent
4306e20b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
kernel/suspend.c
kernel/suspend.c
+19
-7
No files found.
kernel/suspend.c
View file @
0e948558
...
...
@@ -65,6 +65,7 @@
#include <linux/swapops.h>
extern
void
signal_wake_up
(
struct
task_struct
*
t
);
extern
int
sys_sync
(
void
);
unsigned
char
software_suspend_enabled
=
0
;
...
...
@@ -814,17 +815,17 @@ void do_magic_suspend_2(void)
PRINTK
(
KERN_WARNING
"%sLeaving do_magic_suspend_2...
\n
"
,
name_suspend
);
}
/*
* We try to swap out as much as we can then make a copy of the
* occupied pages in memory so we can make a copy of kernel state
* atomically, the I/O needed by saving won't bother us anymore.
*/
void
do_software_suspend
(
void
)
{
arch_prepare_suspend
();
if
(
prepare_suspend_console
())
printk
(
"%sCan't allocate a console... proceeding
\n
"
,
name_suspend
);
if
(
!
prepare_suspend_processes
())
{
/* At this point, all user processes and "dangerous"
kernel threads are stopped. Free some memory, as we
need half of memory free. */
free_some_memory
();
/* No need to invalidate any vfsmnt list -- they will be valid after resume, anyway.
...
...
@@ -834,8 +835,19 @@ void do_software_suspend(void)
*/
PRINTK
(
"Syncing disks before copy
\n
"
);
do_suspend_sync
();
/* Save state of all device drivers, and stop them. */
if
(
drivers_suspend
()
==
0
)
do_magic
(
0
);
/* This function returns after machine woken up from resume */
/* If stopping device drivers worked, we proceed basically into
* suspend_save_image.
*
* do_magic(0) returns after system is resumed.
*
* do_magic() copies all "used" memory to "free" memory, then
* unsuspends all device drivers, and writes memory to disk
* using normal kernel mechanism.
*/
do_magic
(
0
);
PRINTK
(
"Restarting processes...
\n
"
);
thaw_processes
();
}
...
...
@@ -1003,8 +1015,8 @@ static int bdev_read_page(struct block_device *bdev, long pos, void *buf)
static
int
bdev_write_page
(
struct
block_device
*
bdev
,
long
pos
,
void
*
buf
)
{
struct
buffer_head
*
bh
;
#if 0
struct buffer_head *bh;
BUG_ON (pos%PAGE_SIZE);
bh = __bread(bdev, pos/PAGE_SIZE, PAGE_SIZE);
if (!bh || (!bh->b_data)) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment