aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2005-07-13 15:15:43 -0400
committerTony Luck <tony.luck@intel.com>2005-07-13 15:15:43 -0400
commit99ad25a313bda566a346b46a6015afa65bc0a02b (patch)
treeb9443fed1ab74f320c4ee0791864ee96d7c069df /kernel
parentf62c4a96f74d6c6dd56d1742697e94a5c2085e87 (diff)
parent9a556e89081b0c1c2f83cee915363b15a68a6f2d (diff)
Auto merge with /home/aegl/GIT/linus
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fork.c4
-rw-r--r--kernel/power/disk.c2
-rw-r--r--kernel/power/main.c16
-rw-r--r--kernel/power/swsusp.c3
-rw-r--r--kernel/sys_ni.c3
-rw-r--r--kernel/sysctl.c14
-rw-r--r--kernel/user.c4
7 files changed, 41 insertions, 5 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index cdef6cea89..b65187f0c7 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -208,8 +208,10 @@ static inline int dup_mmap(struct mm_struct * mm, struct mm_struct * oldmm)
208 struct file *file; 208 struct file *file;
209 209
210 if (mpnt->vm_flags & VM_DONTCOPY) { 210 if (mpnt->vm_flags & VM_DONTCOPY) {
211 long pages = vma_pages(mpnt);
212 mm->total_vm -= pages;
211 __vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file, 213 __vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file,
212 -vma_pages(mpnt)); 214 -pages);
213 continue; 215 continue;
214 } 216 }
215 charge = 0; 217 charge = 0;
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index c51a4d96d4..3ec789c6b5 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -16,6 +16,8 @@
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/fs.h> 18#include <linux/fs.h>
19#include <linux/mount.h>
20
19#include "power.h" 21#include "power.h"
20 22
21 23
diff --git a/kernel/power/main.c b/kernel/power/main.c
index c94cb9e950..71aa0fd220 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -19,6 +19,9 @@
19 19
20#include "power.h" 20#include "power.h"
21 21
22/*This is just an arbitrary number */
23#define FREE_PAGE_NUMBER (100)
24
22DECLARE_MUTEX(pm_sem); 25DECLARE_MUTEX(pm_sem);
23 26
24struct pm_ops * pm_ops = NULL; 27struct pm_ops * pm_ops = NULL;
@@ -49,6 +52,7 @@ void pm_set_ops(struct pm_ops * ops)
49static int suspend_prepare(suspend_state_t state) 52static int suspend_prepare(suspend_state_t state)
50{ 53{
51 int error = 0; 54 int error = 0;
55 unsigned int free_pages;
52 56
53 if (!pm_ops || !pm_ops->enter) 57 if (!pm_ops || !pm_ops->enter)
54 return -EPERM; 58 return -EPERM;
@@ -67,6 +71,16 @@ static int suspend_prepare(suspend_state_t state)
67 goto Thaw; 71 goto Thaw;
68 } 72 }
69 73
74 if ((free_pages = nr_free_pages()) < FREE_PAGE_NUMBER) {
75 pr_debug("PM: free some memory\n");
76 shrink_all_memory(FREE_PAGE_NUMBER - free_pages);
77 if (nr_free_pages() < FREE_PAGE_NUMBER) {
78 error = -ENOMEM;
79 printk(KERN_ERR "PM: No enough memory\n");
80 goto Thaw;
81 }
82 }
83
70 if (pm_ops->prepare) { 84 if (pm_ops->prepare) {
71 if ((error = pm_ops->prepare(state))) 85 if ((error = pm_ops->prepare(state)))
72 goto Thaw; 86 goto Thaw;
@@ -194,7 +208,7 @@ int software_suspend(void)
194 208
195int pm_suspend(suspend_state_t state) 209int pm_suspend(suspend_state_t state)
196{ 210{
197 if (state > PM_SUSPEND_ON && state < PM_SUSPEND_MAX) 211 if (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX)
198 return enter_state(state); 212 return enter_state(state);
199 return -EINVAL; 213 return -EINVAL;
200} 214}
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index 7d7801cd01..f2bc71b9fe 100644
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -63,6 +63,7 @@
63#include <linux/console.h> 63#include <linux/console.h>
64#include <linux/highmem.h> 64#include <linux/highmem.h>
65#include <linux/bio.h> 65#include <linux/bio.h>
66#include <linux/mount.h>
66 67
67#include <asm/uaccess.h> 68#include <asm/uaccess.h>
68#include <asm/mmu_context.h> 69#include <asm/mmu_context.h>
@@ -1260,8 +1261,6 @@ static int data_read(struct pbe *pblist)
1260 return error; 1261 return error;
1261} 1262}
1262 1263
1263extern dev_t name_to_dev_t(const char *line);
1264
1265/** 1264/**
1266 * read_pagedir - Read page backup list pages from swap 1265 * read_pagedir - Read page backup list pages from swap
1267 */ 1266 */
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 29196ce9b4..42b40ae5ea 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -80,6 +80,9 @@ cond_syscall(sys_keyctl);
80cond_syscall(compat_sys_keyctl); 80cond_syscall(compat_sys_keyctl);
81cond_syscall(compat_sys_socketcall); 81cond_syscall(compat_sys_socketcall);
82cond_syscall(sys_set_zone_reclaim); 82cond_syscall(sys_set_zone_reclaim);
83cond_syscall(sys_inotify_init);
84cond_syscall(sys_inotify_add_watch);
85cond_syscall(sys_inotify_rm_watch);
83 86
84/* arch-specific weak syscall entries */ 87/* arch-specific weak syscall entries */
85cond_syscall(sys_pciconfig_read); 88cond_syscall(sys_pciconfig_read);
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 270ee7fadb..e60b9c36f1 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -146,6 +146,9 @@ extern ctl_table random_table[];
146#ifdef CONFIG_UNIX98_PTYS 146#ifdef CONFIG_UNIX98_PTYS
147extern ctl_table pty_table[]; 147extern ctl_table pty_table[];
148#endif 148#endif
149#ifdef CONFIG_INOTIFY
150extern ctl_table inotify_table[];
151#endif
149 152
150#ifdef HAVE_ARCH_PICK_MMAP_LAYOUT 153#ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
151int sysctl_legacy_va_layout; 154int sysctl_legacy_va_layout;
@@ -218,6 +221,7 @@ static ctl_table root_table[] = {
218 .mode = 0555, 221 .mode = 0555,
219 .child = dev_table, 222 .child = dev_table,
220 }, 223 },
224
221 { .ctl_name = 0 } 225 { .ctl_name = 0 }
222}; 226};
223 227
@@ -950,6 +954,14 @@ static ctl_table fs_table[] = {
950 .mode = 0644, 954 .mode = 0644,
951 .proc_handler = &proc_dointvec, 955 .proc_handler = &proc_dointvec,
952 }, 956 },
957#ifdef CONFIG_INOTIFY
958 {
959 .ctl_name = FS_INOTIFY,
960 .procname = "inotify",
961 .mode = 0555,
962 .child = inotify_table,
963 },
964#endif
953#endif 965#endif
954 { 966 {
955 .ctl_name = KERN_SETUID_DUMPABLE, 967 .ctl_name = KERN_SETUID_DUMPABLE,
@@ -968,7 +980,7 @@ static ctl_table debug_table[] = {
968 980
969static ctl_table dev_table[] = { 981static ctl_table dev_table[] = {
970 { .ctl_name = 0 } 982 { .ctl_name = 0 }
971}; 983};
972 984
973extern void init_irq_proc (void); 985extern void init_irq_proc (void);
974 986
diff --git a/kernel/user.c b/kernel/user.c
index 734575d557..89e562feb1 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -120,6 +120,10 @@ struct user_struct * alloc_uid(uid_t uid)
120 atomic_set(&new->processes, 0); 120 atomic_set(&new->processes, 0);
121 atomic_set(&new->files, 0); 121 atomic_set(&new->files, 0);
122 atomic_set(&new->sigpending, 0); 122 atomic_set(&new->sigpending, 0);
123#ifdef CONFIG_INOTIFY
124 atomic_set(&new->inotify_watches, 0);
125 atomic_set(&new->inotify_devs, 0);
126#endif
123 127
124 new->mq_bytes = 0; 128 new->mq_bytes = 0;
125 new->locked_shm = 0; 129 new->locked_shm = 0;