diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-24 06:48:46 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-24 06:48:46 -0400 |
commit | 8c82a17e9c924c0e9f13e75e4c2f6bca19a4b516 (patch) | |
tree | d535f46a917e14e90deccb29ad00aac016ad18dd /ipc | |
parent | 4ce72a2c063a7fa8e42a9435440ae3364115a58d (diff) | |
parent | 57f8f7b60db6f1ed2c6918ab9230c4623a9dbe37 (diff) |
Merge commit 'v2.6.28-rc1' into sched/urgent
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/mqueue.c | 20 | ||||
-rw-r--r-- | ipc/shm.c | 6 |
2 files changed, 19 insertions, 7 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 96fb36cd9874..68eb857cfdea 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -52,6 +52,14 @@ | |||
52 | #define HARD_MSGMAX (131072/sizeof(void*)) | 52 | #define HARD_MSGMAX (131072/sizeof(void*)) |
53 | #define DFLT_MSGSIZEMAX 8192 /* max message size */ | 53 | #define DFLT_MSGSIZEMAX 8192 /* max message size */ |
54 | 54 | ||
55 | /* | ||
56 | * Define the ranges various user-specified maximum values can | ||
57 | * be set to. | ||
58 | */ | ||
59 | #define MIN_MSGMAX 1 /* min value for msg_max */ | ||
60 | #define MAX_MSGMAX HARD_MSGMAX /* max value for msg_max */ | ||
61 | #define MIN_MSGSIZEMAX 128 /* min value for msgsize_max */ | ||
62 | #define MAX_MSGSIZEMAX (8192*128) /* max value for msgsize_max */ | ||
55 | 63 | ||
56 | struct ext_wait_queue { /* queue of sleeping tasks */ | 64 | struct ext_wait_queue { /* queue of sleeping tasks */ |
57 | struct task_struct *task; | 65 | struct task_struct *task; |
@@ -134,8 +142,8 @@ static struct inode *mqueue_get_inode(struct super_block *sb, int mode, | |||
134 | info->qsize = 0; | 142 | info->qsize = 0; |
135 | info->user = NULL; /* set when all is ok */ | 143 | info->user = NULL; /* set when all is ok */ |
136 | memset(&info->attr, 0, sizeof(info->attr)); | 144 | memset(&info->attr, 0, sizeof(info->attr)); |
137 | info->attr.mq_maxmsg = DFLT_MSGMAX; | 145 | info->attr.mq_maxmsg = msg_max; |
138 | info->attr.mq_msgsize = DFLT_MSGSIZEMAX; | 146 | info->attr.mq_msgsize = msgsize_max; |
139 | if (attr) { | 147 | if (attr) { |
140 | info->attr.mq_maxmsg = attr->mq_maxmsg; | 148 | info->attr.mq_maxmsg = attr->mq_maxmsg; |
141 | info->attr.mq_msgsize = attr->mq_msgsize; | 149 | info->attr.mq_msgsize = attr->mq_msgsize; |
@@ -1191,11 +1199,11 @@ static struct file_system_type mqueue_fs_type = { | |||
1191 | .kill_sb = kill_litter_super, | 1199 | .kill_sb = kill_litter_super, |
1192 | }; | 1200 | }; |
1193 | 1201 | ||
1194 | static int msg_max_limit_min = DFLT_MSGMAX; | 1202 | static int msg_max_limit_min = MIN_MSGMAX; |
1195 | static int msg_max_limit_max = HARD_MSGMAX; | 1203 | static int msg_max_limit_max = MAX_MSGMAX; |
1196 | 1204 | ||
1197 | static int msg_maxsize_limit_min = DFLT_MSGSIZEMAX; | 1205 | static int msg_maxsize_limit_min = MIN_MSGSIZEMAX; |
1198 | static int msg_maxsize_limit_max = INT_MAX; | 1206 | static int msg_maxsize_limit_max = MAX_MSGSIZEMAX; |
1199 | 1207 | ||
1200 | static ctl_table mq_sysctls[] = { | 1208 | static ctl_table mq_sysctls[] = { |
1201 | { | 1209 | { |
@@ -737,6 +737,10 @@ asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf) | |||
737 | case SHM_LOCK: | 737 | case SHM_LOCK: |
738 | case SHM_UNLOCK: | 738 | case SHM_UNLOCK: |
739 | { | 739 | { |
740 | struct file *uninitialized_var(shm_file); | ||
741 | |||
742 | lru_add_drain_all(); /* drain pagevecs to lru lists */ | ||
743 | |||
740 | shp = shm_lock_check(ns, shmid); | 744 | shp = shm_lock_check(ns, shmid); |
741 | if (IS_ERR(shp)) { | 745 | if (IS_ERR(shp)) { |
742 | err = PTR_ERR(shp); | 746 | err = PTR_ERR(shp); |
@@ -813,7 +817,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr) | |||
813 | struct ipc_namespace *ns; | 817 | struct ipc_namespace *ns; |
814 | struct shm_file_data *sfd; | 818 | struct shm_file_data *sfd; |
815 | struct path path; | 819 | struct path path; |
816 | mode_t f_mode; | 820 | fmode_t f_mode; |
817 | 821 | ||
818 | err = -EINVAL; | 822 | err = -EINVAL; |
819 | if (shmid < 0) | 823 | if (shmid < 0) |