Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115955
b: refs/heads/master
c: b231cca
h: refs/heads/master
i:
  115953: 181e002
  115951: a0ef2e3
v: v3
  • Loading branch information
Joe Korty authored and Linus Torvalds committed Oct 20, 2008
1 parent f80b8ca commit 82ccb03
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: acd99dbf54020f5c80b9aa2f2ea86f43cb285b02
refs/heads/master: b231cca4381ee15ec99afbfb244fbc0324869927
20 changes: 14 additions & 6 deletions trunk/ipc/mqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@
#define HARD_MSGMAX (131072/sizeof(void*))
#define DFLT_MSGSIZEMAX 8192 /* max message size */

/*
* Define the ranges various user-specified maximum values can
* be set to.
*/
#define MIN_MSGMAX 1 /* min value for msg_max */
#define MAX_MSGMAX HARD_MSGMAX /* max value for msg_max */
#define MIN_MSGSIZEMAX 128 /* min value for msgsize_max */
#define MAX_MSGSIZEMAX (8192*128) /* max value for msgsize_max */

struct ext_wait_queue { /* queue of sleeping tasks */
struct task_struct *task;
Expand Down Expand Up @@ -134,8 +142,8 @@ static struct inode *mqueue_get_inode(struct super_block *sb, int mode,
info->qsize = 0;
info->user = NULL; /* set when all is ok */
memset(&info->attr, 0, sizeof(info->attr));
info->attr.mq_maxmsg = DFLT_MSGMAX;
info->attr.mq_msgsize = DFLT_MSGSIZEMAX;
info->attr.mq_maxmsg = msg_max;
info->attr.mq_msgsize = msgsize_max;
if (attr) {
info->attr.mq_maxmsg = attr->mq_maxmsg;
info->attr.mq_msgsize = attr->mq_msgsize;
Expand Down Expand Up @@ -1191,11 +1199,11 @@ static struct file_system_type mqueue_fs_type = {
.kill_sb = kill_litter_super,
};

static int msg_max_limit_min = DFLT_MSGMAX;
static int msg_max_limit_max = HARD_MSGMAX;
static int msg_max_limit_min = MIN_MSGMAX;
static int msg_max_limit_max = MAX_MSGMAX;

static int msg_maxsize_limit_min = DFLT_MSGSIZEMAX;
static int msg_maxsize_limit_max = INT_MAX;
static int msg_maxsize_limit_min = MIN_MSGSIZEMAX;
static int msg_maxsize_limit_max = MAX_MSGSIZEMAX;

static ctl_table mq_sysctls[] = {
{
Expand Down

0 comments on commit 82ccb03

Please sign in to comment.