diff options
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/mqueue.c | 2 | ||||
-rw-r--r-- | ipc/msg.c | 8 | ||||
-rw-r--r-- | ipc/sem.c | 6 | ||||
-rw-r--r-- | ipc/shm.c | 12 | ||||
-rw-r--r-- | ipc/util.c | 11 | ||||
-rw-r--r-- | ipc/util.h | 8 |
6 files changed, 14 insertions, 33 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index a242c83d89d..145d5a0d299 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -1253,7 +1253,7 @@ static int __init init_mqueue_fs(void) mqueue_inode_cachep = kmem_cache_create("mqueue_inode_cache", sizeof(struct mqueue_inode_info), 0, - SLAB_HWCACHE_ALIGN, init_once, NULL); + SLAB_HWCACHE_ALIGN, init_once); if (mqueue_inode_cachep == NULL) return -ENOMEM; diff --git a/ipc/msg.c b/ipc/msg.c index a388824740e..a03fcb522ff 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -87,7 +87,7 @@ static int newque (struct ipc_namespace *ns, key_t key, int msgflg); static int sysvipc_msg_proc_show(struct seq_file *s, void *it); #endif -static void __ipc_init __msg_init_ns(struct ipc_namespace *ns, struct ipc_ids *ids) +static void __msg_init_ns(struct ipc_namespace *ns, struct ipc_ids *ids) { ns->ids[IPC_MSG_IDS] = ids; ns->msg_ctlmax = MSGMAX; @@ -96,7 +96,6 @@ static void __ipc_init __msg_init_ns(struct ipc_namespace *ns, struct ipc_ids *i ipc_init_ids(ids, ns->msg_ctlmni); } -#ifdef CONFIG_IPC_NS int msg_init_ns(struct ipc_namespace *ns) { struct ipc_ids *ids; @@ -128,7 +127,6 @@ void msg_exit_ns(struct ipc_namespace *ns) kfree(ns->ids[IPC_MSG_IDS]); ns->ids[IPC_MSG_IDS] = NULL; } -#endif void __init msg_init(void) { @@ -387,7 +385,7 @@ copy_msqid_from_user(struct msq_setbuf *out, void __user *buf, int version) asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf) { struct kern_ipc_perm *ipcp; - struct msq_setbuf setbuf; + struct msq_setbuf uninitialized_var(setbuf); struct msg_queue *msq; int err, version; struct ipc_namespace *ns; @@ -511,7 +509,7 @@ asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf) err = audit_ipc_obj(ipcp); if (err) goto out_unlock_up; - if (cmd==IPC_SET) { + if (cmd == IPC_SET) { err = audit_ipc_set_perm(setbuf.qbytes, setbuf.uid, setbuf.gid, setbuf.mode); if (err) diff --git a/ipc/sem.c b/ipc/sem.c index 9964b2224c7..b676fef6d20 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -121,7 +121,7 @@ static int sysvipc_sem_proc_show(struct seq_file *s, void *it); #define sc_semopm sem_ctls[2] #define sc_semmni sem_ctls[3] -static void __ipc_init __sem_init_ns(struct ipc_namespace *ns, struct ipc_ids *ids) +static void __sem_init_ns(struct ipc_namespace *ns, struct ipc_ids *ids) { ns->ids[IPC_SEM_IDS] = ids; ns->sc_semmsl = SEMMSL; @@ -132,7 +132,6 @@ static void __ipc_init __sem_init_ns(struct ipc_namespace *ns, struct ipc_ids *i ipc_init_ids(ids, ns->sc_semmni); } -#ifdef CONFIG_IPC_NS int sem_init_ns(struct ipc_namespace *ns) { struct ipc_ids *ids; @@ -164,7 +163,6 @@ void sem_exit_ns(struct ipc_namespace *ns) kfree(ns->ids[IPC_SEM_IDS]); ns->ids[IPC_SEM_IDS] = NULL; } -#endif void __init sem_init (void) { @@ -858,7 +856,7 @@ static int semctl_down(struct ipc_namespace *ns, int semid, int semnum, { struct sem_array *sma; int err; - struct sem_setbuf setbuf; + struct sem_setbuf uninitialized_var(setbuf); struct kern_ipc_perm *ipcp; if(cmd == IPC_SET) { diff --git a/ipc/shm.c b/ipc/shm.c index 0852f206d89..d0259e3ad1c 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -77,7 +77,7 @@ static void shm_destroy (struct ipc_namespace *ns, struct shmid_kernel *shp); static int sysvipc_shm_proc_show(struct seq_file *s, void *it); #endif -static void __ipc_init __shm_init_ns(struct ipc_namespace *ns, struct ipc_ids *ids) +static void __shm_init_ns(struct ipc_namespace *ns, struct ipc_ids *ids) { ns->ids[IPC_SHM_IDS] = ids; ns->shm_ctlmax = SHMMAX; @@ -98,7 +98,6 @@ static void do_shm_rmid(struct ipc_namespace *ns, struct shmid_kernel *shp) shm_destroy(ns, shp); } -#ifdef CONFIG_IPC_NS int shm_init_ns(struct ipc_namespace *ns) { struct ipc_ids *ids; @@ -130,7 +129,6 @@ void shm_exit_ns(struct ipc_namespace *ns) kfree(ns->ids[IPC_SHM_IDS]); ns->ids[IPC_SHM_IDS] = NULL; } -#endif void __init shm_init (void) { @@ -226,13 +224,12 @@ static void shm_close(struct vm_area_struct *vma) mutex_unlock(&shm_ids(ns).mutex); } -static struct page *shm_nopage(struct vm_area_struct *vma, - unsigned long address, int *type) +static int shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) { struct file *file = vma->vm_file; struct shm_file_data *sfd = shm_file_data(file); - return sfd->vm_ops->nopage(vma, address, type); + return sfd->vm_ops->fault(vma, vmf); } #ifdef CONFIG_NUMA @@ -271,6 +268,7 @@ static int shm_mmap(struct file * file, struct vm_area_struct * vma) if (ret != 0) return ret; sfd->vm_ops = vma->vm_ops; + BUG_ON(!sfd->vm_ops->fault); vma->vm_ops = &shm_vm_ops; shm_open(vma); @@ -329,7 +327,7 @@ static const struct file_operations shm_file_operations = { static struct vm_operations_struct shm_vm_ops = { .open = shm_open, /* callback for a new vm-area open */ .close = shm_close, /* callback for when the vm-area is released */ - .nopage = shm_nopage, + .fault = shm_fault, #if defined(CONFIG_NUMA) .set_policy = shm_set_policy, .get_policy = shm_get_policy, diff --git a/ipc/util.c b/ipc/util.c index 7536a7292d4..44e5135aee4 100644 --- a/ipc/util.c +++ b/ipc/util.c @@ -50,7 +50,6 @@ struct ipc_namespace init_ipc_ns = { }, }; -#ifdef CONFIG_IPC_NS static struct ipc_namespace *clone_ipc_ns(struct ipc_namespace *old_ns) { int err; @@ -110,14 +109,6 @@ void free_ipc_ns(struct kref *kref) shm_exit_ns(ns); kfree(ns); } -#else -struct ipc_namespace *copy_ipcs(unsigned long flags, struct ipc_namespace *ns) -{ - if (flags & CLONE_NEWIPC) - return ERR_PTR(-EINVAL); - return ns; -} -#endif /** * ipc_init - initialise IPC subsystem @@ -145,7 +136,7 @@ __initcall(ipc_init); * array itself. */ -void __ipc_init ipc_init_ids(struct ipc_ids* ids, int size) +void ipc_init_ids(struct ipc_ids* ids, int size) { int i; diff --git a/ipc/util.h b/ipc/util.h index e3aa2c5c97d..333e891bcac 100644 --- a/ipc/util.h +++ b/ipc/util.h @@ -41,12 +41,8 @@ struct ipc_ids { }; struct seq_file; -#ifdef CONFIG_IPC_NS -#define __ipc_init -#else -#define __ipc_init __init -#endif -void __ipc_init ipc_init_ids(struct ipc_ids *ids, int size); + +void ipc_init_ids(struct ipc_ids *ids, int size); #ifdef CONFIG_PROC_FS void __init ipc_init_proc_interface(const char *path, const char *header, int ids, int (*show)(struct seq_file *, void *)); |