aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/user.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-05-06 17:50:45 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:12:59 -0400
commit0709db6072c2e799eba1aa61bd19e0d7f38aa2cd (patch)
treee348c73adbfdcb46b05b23f36dc420ecdd62ca8a /kernel/power/user.c
parent1525a2ad76f991eba9755f75c9b6d4d97abad25e (diff)
swsusp: use GFP_KERNEL for creating basic data structures
Make swsusp call create_basic_memory_bitmaps() before processes are frozen, so that GFP_KERNEL allocations can be made in it. Additionally, ensure that the swsusp's userland interface won't be used while either pm_suspend_disk() or software_resume() is being executed. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/power/user.c')
-rw-r--r--kernel/power/user.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c
index bd1771f7a64e..72dbfd01408e 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -40,21 +40,21 @@ static struct snapshot_data {
40 char platform_suspend; 40 char platform_suspend;
41} snapshot_state; 41} snapshot_state;
42 42
43static atomic_t device_available = ATOMIC_INIT(1); 43atomic_t snapshot_device_available = ATOMIC_INIT(1);
44 44
45static int snapshot_open(struct inode *inode, struct file *filp) 45static int snapshot_open(struct inode *inode, struct file *filp)
46{ 46{
47 struct snapshot_data *data; 47 struct snapshot_data *data;
48 48
49 if (!atomic_add_unless(&device_available, -1, 0)) 49 if (!atomic_add_unless(&snapshot_device_available, -1, 0))
50 return -EBUSY; 50 return -EBUSY;
51 51
52 if ((filp->f_flags & O_ACCMODE) == O_RDWR) { 52 if ((filp->f_flags & O_ACCMODE) == O_RDWR) {
53 atomic_inc(&device_available); 53 atomic_inc(&snapshot_device_available);
54 return -ENOSYS; 54 return -ENOSYS;
55 } 55 }
56 if(create_basic_memory_bitmaps()) { 56 if(create_basic_memory_bitmaps()) {
57 atomic_inc(&device_available); 57 atomic_inc(&snapshot_device_available);
58 return -ENOMEM; 58 return -ENOMEM;
59 } 59 }
60 nonseekable_open(inode, filp); 60 nonseekable_open(inode, filp);
@@ -92,7 +92,7 @@ static int snapshot_release(struct inode *inode, struct file *filp)
92 enable_nonboot_cpus(); 92 enable_nonboot_cpus();
93 mutex_unlock(&pm_mutex); 93 mutex_unlock(&pm_mutex);
94 } 94 }
95 atomic_inc(&device_available); 95 atomic_inc(&snapshot_device_available);
96 return 0; 96 return 0;
97} 97}
98 98