diff options
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/msgutil.c | 20 | ||||
-rw-r--r-- | ipc/util.c | 4 | ||||
-rw-r--r-- | ipc/util.h | 4 |
3 files changed, 13 insertions, 15 deletions
diff --git a/ipc/msgutil.c b/ipc/msgutil.c index 491e71f2a1b8..7e7095974d54 100644 --- a/ipc/msgutil.c +++ b/ipc/msgutil.c | |||
@@ -41,15 +41,15 @@ struct msg_msgseg { | |||
41 | /* the next part of the message follows immediately */ | 41 | /* the next part of the message follows immediately */ |
42 | }; | 42 | }; |
43 | 43 | ||
44 | #define DATALEN_MSG (int)(PAGE_SIZE-sizeof(struct msg_msg)) | 44 | #define DATALEN_MSG ((size_t)PAGE_SIZE-sizeof(struct msg_msg)) |
45 | #define DATALEN_SEG (int)(PAGE_SIZE-sizeof(struct msg_msgseg)) | 45 | #define DATALEN_SEG ((size_t)PAGE_SIZE-sizeof(struct msg_msgseg)) |
46 | 46 | ||
47 | 47 | ||
48 | static struct msg_msg *alloc_msg(int len) | 48 | static struct msg_msg *alloc_msg(size_t len) |
49 | { | 49 | { |
50 | struct msg_msg *msg; | 50 | struct msg_msg *msg; |
51 | struct msg_msgseg **pseg; | 51 | struct msg_msgseg **pseg; |
52 | int alen; | 52 | size_t alen; |
53 | 53 | ||
54 | alen = min(len, DATALEN_MSG); | 54 | alen = min(len, DATALEN_MSG); |
55 | msg = kmalloc(sizeof(*msg) + alen, GFP_KERNEL); | 55 | msg = kmalloc(sizeof(*msg) + alen, GFP_KERNEL); |
@@ -80,12 +80,12 @@ out_err: | |||
80 | return NULL; | 80 | return NULL; |
81 | } | 81 | } |
82 | 82 | ||
83 | struct msg_msg *load_msg(const void __user *src, int len) | 83 | struct msg_msg *load_msg(const void __user *src, size_t len) |
84 | { | 84 | { |
85 | struct msg_msg *msg; | 85 | struct msg_msg *msg; |
86 | struct msg_msgseg *seg; | 86 | struct msg_msgseg *seg; |
87 | int err = -EFAULT; | 87 | int err = -EFAULT; |
88 | int alen; | 88 | size_t alen; |
89 | 89 | ||
90 | msg = alloc_msg(len); | 90 | msg = alloc_msg(len); |
91 | if (msg == NULL) | 91 | if (msg == NULL) |
@@ -117,8 +117,8 @@ out_err: | |||
117 | struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst) | 117 | struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst) |
118 | { | 118 | { |
119 | struct msg_msgseg *dst_pseg, *src_pseg; | 119 | struct msg_msgseg *dst_pseg, *src_pseg; |
120 | int len = src->m_ts; | 120 | size_t len = src->m_ts; |
121 | int alen; | 121 | size_t alen; |
122 | 122 | ||
123 | BUG_ON(dst == NULL); | 123 | BUG_ON(dst == NULL); |
124 | if (src->m_ts > dst->m_ts) | 124 | if (src->m_ts > dst->m_ts) |
@@ -147,9 +147,9 @@ struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst) | |||
147 | return ERR_PTR(-ENOSYS); | 147 | return ERR_PTR(-ENOSYS); |
148 | } | 148 | } |
149 | #endif | 149 | #endif |
150 | int store_msg(void __user *dest, struct msg_msg *msg, int len) | 150 | int store_msg(void __user *dest, struct msg_msg *msg, size_t len) |
151 | { | 151 | { |
152 | int alen; | 152 | size_t alen; |
153 | struct msg_msgseg *seg; | 153 | struct msg_msgseg *seg; |
154 | 154 | ||
155 | alen = min(len, DATALEN_MSG); | 155 | alen = min(len, DATALEN_MSG); |
diff --git a/ipc/util.c b/ipc/util.c index 7684f41bce76..3ae17a4ace5b 100644 --- a/ipc/util.c +++ b/ipc/util.c | |||
@@ -90,10 +90,8 @@ static int ipc_memory_callback(struct notifier_block *self, | |||
90 | * In order not to keep the lock on the hotplug memory chain | 90 | * In order not to keep the lock on the hotplug memory chain |
91 | * for too long, queue a work item that will, when waken up, | 91 | * for too long, queue a work item that will, when waken up, |
92 | * activate the ipcns notification chain. | 92 | * activate the ipcns notification chain. |
93 | * No need to keep several ipc work items on the queue. | ||
94 | */ | 93 | */ |
95 | if (!work_pending(&ipc_memory_wq)) | 94 | schedule_work(&ipc_memory_wq); |
96 | schedule_work(&ipc_memory_wq); | ||
97 | break; | 95 | break; |
98 | case MEM_GOING_ONLINE: | 96 | case MEM_GOING_ONLINE: |
99 | case MEM_GOING_OFFLINE: | 97 | case MEM_GOING_OFFLINE: |
diff --git a/ipc/util.h b/ipc/util.h index f2f5036f2eed..59d78aa94987 100644 --- a/ipc/util.h +++ b/ipc/util.h | |||
@@ -148,9 +148,9 @@ int ipc_parse_version (int *cmd); | |||
148 | #endif | 148 | #endif |
149 | 149 | ||
150 | extern void free_msg(struct msg_msg *msg); | 150 | extern void free_msg(struct msg_msg *msg); |
151 | extern struct msg_msg *load_msg(const void __user *src, int len); | 151 | extern struct msg_msg *load_msg(const void __user *src, size_t len); |
152 | extern struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst); | 152 | extern struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst); |
153 | extern int store_msg(void __user *dest, struct msg_msg *msg, int len); | 153 | extern int store_msg(void __user *dest, struct msg_msg *msg, size_t len); |
154 | 154 | ||
155 | extern void recompute_msgmni(struct ipc_namespace *); | 155 | extern void recompute_msgmni(struct ipc_namespace *); |
156 | 156 | ||