#include <asm/pgalloc.h>
#include <asm/uaccess.h>
+#include <asm/smp.h>
#include "../../../drivers/s390/net/smsgiucv.h"
static int
cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
- void *buffer, size_t *lenp)
+ void *buffer, size_t *lenp, loff_t *ppos)
{
char buf[16], *p;
long pages;
int len;
- if (!*lenp || (filp->f_pos && !write)) {
+ if (!*lenp || (*ppos && !write)) {
*lenp = 0;
return 0;
}
return -EFAULT;
}
*lenp = len;
- filp->f_pos += len;
+ *ppos += len;
return 0;
}
static int
cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
- void *buffer, size_t *lenp)
+ void *buffer, size_t *lenp, loff_t *ppos)
{
char buf[64], *p;
long pages, seconds;
int len;
- if (!*lenp || (filp->f_pos && !write)) {
+ if (!*lenp || (*ppos && !write)) {
*lenp = 0;
return 0;
}
return -EFAULT;
}
*lenp = len;
- filp->f_pos += len;
+ *ppos += len;
return 0;
}
static int
cmm_init (void)
{
+ int rc;
+
+ /* Prevent logical cpu 0 from being set offline. */
+ rc = smp_get_cpu(cpumask_of_cpu(0));
+ if (rc) {
+ printk(KERN_ERR "CMM: unable to reserve cpu 0\n");
+ return rc;
+ }
#ifdef CONFIG_CMM_PROC
cmm_sysctl_header = register_sysctl_table(cmm_dir_table, 1);
#endif
#ifdef CONFIG_CMM_IUCV
smsg_unregister_callback(SMSG_PREFIX, cmm_smsg_target);
#endif
+ /* Allow logical cpu 0 to be set offline again. */
+ smp_put_cpu(0);
}
module_init(cmm_init);