git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
arch
/
s390
/
mm
/
cmm.c
diff --git
a/arch/s390/mm/cmm.c
b/arch/s390/mm/cmm.c
index
095a564
..
51596f4
100644
(file)
--- a/
arch/s390/mm/cmm.c
+++ b/
arch/s390/mm/cmm.c
@@
-20,6
+20,11
@@
#include <asm/pgalloc.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
#include <asm/uaccess.h>
+static char *sender = "VMRMSVM";
+module_param(sender, charp, 0400);
+MODULE_PARM_DESC(sender,
+ "Guest name that may send SMSG messages (default VMRMSVM)");
+
#include "../../../drivers/s390/net/smsgiucv.h"
#define CMM_NR_PAGES ((PAGE_SIZE / sizeof(unsigned long)) - 2)
#include "../../../drivers/s390/net/smsgiucv.h"
#define CMM_NR_PAGES ((PAGE_SIZE / sizeof(unsigned long)) - 2)
@@
-37,8
+42,8
@@
static volatile long cmm_timed_pages_target = 0;
static long cmm_timeout_pages = 0;
static long cmm_timeout_seconds = 0;
static long cmm_timeout_pages = 0;
static long cmm_timeout_seconds = 0;
-static struct cmm_page_array *cmm_page_list =
0
;
-static struct cmm_page_array *cmm_timed_page_list =
0
;
+static struct cmm_page_array *cmm_page_list =
NULL
;
+static struct cmm_page_array *cmm_timed_page_list =
NULL
;
static unsigned long cmm_thread_active = 0;
static struct work_struct cmm_thread_starter;
static unsigned long cmm_thread_active = 0;
static struct work_struct cmm_thread_starter;
@@
-123,7
+128,6
@@
cmm_thread(void *dummy)
int rc;
daemonize("cmmthread");
int rc;
daemonize("cmmthread");
- set_cpus_allowed(current, cpumask_of_cpu(0));
while (1) {
rc = wait_event_interruptible(cmm_thread_wait,
(cmm_pages != cmm_pages_target ||
while (1) {
rc = wait_event_interruptible(cmm_thread_wait,
(cmm_pages != cmm_pages_target ||
@@
-255,13
+259,13
@@
static struct ctl_table cmm_table[];
static int
cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
static int
cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
- void
*buffer, size_t *lenp
)
+ void
__user *buffer, size_t *lenp, loff_t *ppos
)
{
char buf[16], *p;
long pages;
int len;
{
char buf[16], *p;
long pages;
int len;
- if (!*lenp || (
filp->f_
pos && !write)) {
+ if (!*lenp || (
*p
pos && !write)) {
*lenp = 0;
return 0;
}
*lenp = 0;
return 0;
}
@@
-290,19
+294,19
@@
cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
return -EFAULT;
}
*lenp = len;
return -EFAULT;
}
*lenp = len;
-
filp->f_
pos += len;
+
*p
pos += len;
return 0;
}
static int
cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
return 0;
}
static int
cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
- void
*buffer, size_t *lenp
)
+ void
__user *buffer, size_t *lenp, loff_t *ppos
)
{
char buf[64], *p;
long pages, seconds;
int len;
{
char buf[64], *p;
long pages, seconds;
int len;
- if (!*lenp || (
filp->f_
pos && !write)) {
+ if (!*lenp || (
*p
pos && !write)) {
*lenp = 0;
return 0;
}
*lenp = 0;
return 0;
}
@@
-327,7
+331,7
@@
cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
return -EFAULT;
}
*lenp = len;
return -EFAULT;
}
*lenp = len;
-
filp->f_
pos += len;
+
*p
pos += len;
return 0;
}
return 0;
}
@@
-335,19
+339,19
@@
static struct ctl_table cmm_table[] = {
{
.ctl_name = VM_CMM_PAGES,
.procname = "cmm_pages",
{
.ctl_name = VM_CMM_PAGES,
.procname = "cmm_pages",
- .mode = 06
00
,
+ .mode = 06
44
,
.proc_handler = &cmm_pages_handler,
},
{
.ctl_name = VM_CMM_TIMED_PAGES,
.procname = "cmm_timed_pages",
.proc_handler = &cmm_pages_handler,
},
{
.ctl_name = VM_CMM_TIMED_PAGES,
.procname = "cmm_timed_pages",
- .mode = 06
00
,
+ .mode = 06
44
,
.proc_handler = &cmm_pages_handler,
},
{
.ctl_name = VM_CMM_TIMEOUT,
.procname = "cmm_timeout",
.proc_handler = &cmm_pages_handler,
},
{
.ctl_name = VM_CMM_TIMEOUT,
.procname = "cmm_timeout",
- .mode = 06
00
,
+ .mode = 06
44
,
.proc_handler = &cmm_timeout_handler,
},
{ .ctl_name = 0 }
.proc_handler = &cmm_timeout_handler,
},
{ .ctl_name = 0 }
@@
-368,10
+372,12
@@
static struct ctl_table cmm_dir_table[] = {
#ifdef CONFIG_CMM_IUCV
#define SMSG_PREFIX "CMM"
static void
#ifdef CONFIG_CMM_IUCV
#define SMSG_PREFIX "CMM"
static void
-cmm_smsg_target(char *msg)
+cmm_smsg_target(char *
from, char *
msg)
{
long pages, seconds;
{
long pages, seconds;
+ if (strlen(sender) > 0 && strcmp(from, sender) != 0)
+ return;
if (!cmm_skip_blanks(msg + strlen(SMSG_PREFIX), &msg))
return;
if (strncmp(msg, "SHRINK", 6) == 0) {
if (!cmm_skip_blanks(msg + strlen(SMSG_PREFIX), &msg))
return;
if (strncmp(msg, "SHRINK", 6) == 0) {
@@
-413,7
+419,7
@@
cmm_init (void)
#ifdef CONFIG_CMM_IUCV
smsg_register_callback(SMSG_PREFIX, cmm_smsg_target);
#endif
#ifdef CONFIG_CMM_IUCV
smsg_register_callback(SMSG_PREFIX, cmm_smsg_target);
#endif
- INIT_WORK(&cmm_thread_starter, (void *) cmm_start_thread,
0
);
+ INIT_WORK(&cmm_thread_starter, (void *) cmm_start_thread,
NULL
);
init_waitqueue_head(&cmm_thread_wait);
init_timer(&cmm_timer);
return 0;
init_waitqueue_head(&cmm_thread_wait);
init_timer(&cmm_timer);
return 0;