aboutsummaryrefslogtreecommitdiff
path: root/ipc
AgeCommit message (Collapse)AuthorFilesLines
2009-01-05mm: update my addressAlan Cox1-1/+1
Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2009-01-05zero i_uid/i_gid on inode allocationAl Viro1-1/+0
... and don't bother in callers. Don't bother with zeroing i_blocks, while we are at it - it's already been zeroed. i_mode is not worth the effort; it has no common default value. Signed-off-by: Al Viro <[email protected]>
2009-01-04sanitize audit_mq_open()Al Viro1-12/+11
* don't bother with allocations * don't do double copy_from_user() * don't duplicate parts of check for audit_dummy_context() Signed-off-by: Al Viro <[email protected]>
2009-01-04sanitize AUDIT_MQ_SENDRECVAl Viro1-24/+30
* logging the original value of *msg_prio in mq_timedreceive(2) is insane - the argument is write-only (i.e. syscall always ignores the original value and only overwrites it). * merge __audit_mq_timed{send,receive} * don't do copy_from_user() twice * don't mess with allocations in auditsc part * ... and don't bother checking !audit_enabled and !context in there - we'd already checked for audit_dummy_context(). Signed-off-by: Al Viro <[email protected]>
2009-01-04sanitize audit_mq_notify()Al Viro1-7/+7
* don't copy_from_user() twice * don't bother with allocations * don't duplicate parts of audit_dummy_context() * make it return void Signed-off-by: Al Viro <[email protected]>
2009-01-04sanitize audit_mq_getsetattr()Al Viro1-5/+1
* get rid of allocations * make it return void * don't duplicate parts of audit_dummy_context() Signed-off-by: Al Viro <[email protected]>
2009-01-04sanitize audit_ipc_set_perm()Al Viro1-7/+2
* get rid of allocations * make it return void * simplify callers Signed-off-by: Al Viro <[email protected]>
2009-01-04sanitize audit_ipc_obj()Al Viro2-9/+4
* get rid of allocations * make it return void * simplify callers Signed-off-by: Al Viro <[email protected]>
2008-12-04Merge branch 'master' into nextJames Morris1-5/+9
Conflicts: fs/nfsd/nfs4recover.c Manually fixed above to use new creds API functions, e.g. nfs4_save_creds(). Signed-off-by: James Morris <[email protected]>
2008-11-19sysvipc: fix the ipc structures initializationNadia Derbey1-5/+9
A problem was found while reviewing the code after Bugzilla bug http://bugzilla.kernel.org/show_bug.cgi?id=11796. In ipc_addid(), the newly allocated ipc structure is inserted into the ipcs tree (i.e made visible to readers) without locking it. This is not correct since its initialization continues after it has been inserted in the tree. This patch moves the ipc structure lock initialization + locking before the actual insertion. Signed-off-by: Nadia Derbey <[email protected]> Reported-by: Clement Calmels <[email protected]> Cc: Manfred Spraul <[email protected]> Cc: <[email protected]> [2.6.27.x] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-11-14CRED: Pass credentials through dentry_open()David Howells1-4/+7
Pass credentials through dentry_open() so that the COW creds patch can have SELinux's flush_unauthorized_files() pass the appropriate creds back to itself when it opens its null chardev. The security_dentry_open() call also now takes a creds pointer, as does the dentry_open hook in struct security_operations. Signed-off-by: David Howells <[email protected]> Acked-by: James Morris <[email protected]> Signed-off-by: James Morris <[email protected]>
2008-11-14CRED: Wrap current->cred and a few other accessorsDavid Howells2-3/+3
Wrap current->cred and a few other accessors to hide their actual implementation. Signed-off-by: David Howells <[email protected]> Acked-by: James Morris <[email protected]> Acked-by: Serge Hallyn <[email protected]> Signed-off-by: James Morris <[email protected]>
2008-11-14CRED: Separate task security context from task_structDavid Howells2-3/+3
Separate the task security context from task_struct. At this point, the security data is temporarily embedded in the task_struct with two pointers pointing to it. Note that the Alpha arch is altered as it refers to (E)UID and (E)GID in entry.S via asm-offsets. With comment fixes Signed-off-by: Marc Dionne <[email protected]> Signed-off-by: David Howells <[email protected]> Acked-by: James Morris <[email protected]> Acked-by: Serge Hallyn <[email protected]> Signed-off-by: James Morris <[email protected]>
2008-11-14CRED: Wrap task credential accesses in the SYSV IPC subsystemDavid Howells3-10/+19
Wrap access to task credentials so that they can be separated more easily from the task_struct during the introduction of COW creds. Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id(). Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more sense to use RCU directly rather than a convenient wrapper; these will be addressed by later patches. Signed-off-by: David Howells <[email protected]> Reviewed-by: James Morris <[email protected]> Acked-by: Serge Hallyn <[email protected]> Signed-off-by: James Morris <[email protected]>
2008-10-21[PATCH] introduce fmode_t, do annotationsAl Viro1-1/+1
Signed-off-by: Al Viro <[email protected]>
2008-10-20message queues: increase range limitsJoe Korty1-6/+14
Increase the range of various posix message queue limits. Posix gives the message queue user the ability to 'trade off' the maximum size of messages with the number of possible messages that can be 'in flight'. Linux currently makes this trade off more restrictive than it needs to be. In particular, the maximum message size today can be made no smaller than 8192. This greatly restricts those applications that would like to have the ability to post large numbers of very small messages. So this task lowers the limit that the maximum message size can be set to, from 8192 to 128. It also lowers the limit that the maximum #number of messages in flight can be set to, from 10 to 1. With these changes the message queue user can make better trade offs between #messages and message size, in order to get everything to fit within the setrlimit(RLIMIT_MSGQUEUE) limit for that particular user. This patch also applies the values in /proc/sys/fs/mqueue/msg_max /proc/sys/fs/mqueue/msgsize_max as the defaults for the max #messages allowed and the max message size allowed, respectively, for those applications that do not supply these. Previously, the defaults were hardwired to 10 and 8192, respectively. [[email protected]: coding-style fixes] Signed-off-by: Joe Korty <[email protected]> Cc: Al Viro <[email protected]> Cc: Manfred Spraul <[email protected]> Cc: Nadia Derbey <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-10-20SHM_LOCKED pages are unevictableLee Schermerhorn1-0/+4
Shmem segments locked into memory via shmctl(SHM_LOCKED) should not be kept on the normal LRU, since scanning them is a waste of time and might throw off kswapd's balancing algorithms. Place them on the unevictable LRU list instead. Use the AS_UNEVICTABLE flag to mark address_space of SHM_LOCKed shared memory regions as unevictable. Then these pages will be culled off the normal LRU lists during vmscan. Add new wrapper function to clear the mapping's unevictable state when/if shared memory segment is munlocked. Add 'scan_mapping_unevictable_page()' to mm/vmscan.c to scan all pages in the shmem segment's mapping [struct address_space] for evictability now that they're no longer locked. If so, move them to the appropriate zone lru list. Changes depend on [CONFIG_]UNEVICTABLE_LRU. [[email protected]: revert shm change] Signed-off-by: Lee Schermerhorn <[email protected]> Signed-off-by: Rik van Riel <[email protected]> Signed-off-by: Kosaki Motohiro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-10-16ipc/sem.c: make free_un() staticAdrian Bunk1-1/+1
Signed-off-by: Adrian Bunk <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-10-16sysctl: simplify ->strategyAlexey Dobriyan1-5/+4
name and nlen parameters passed to ->strategy hook are unused, remove them. In general ->strategy hook should know what it's doing, and don't do something tricky for which, say, pointer to original userspace array may be needed (name). Signed-off-by: Alexey Dobriyan <[email protected]> Acked-by: David S. Miller <[email protected]> [ networking bits ] Cc: Ralf Baechle <[email protected]> Cc: David Howells <[email protected]> Cc: Matt Mackall <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-26[PATCH] kill nameidata passing to permission(), rename to inode_permission()Al Viro1-1/+1
Incidentally, the name that gives hundreds of false positives on grep is not a good idea... Signed-off-by: Al Viro <[email protected]>
2008-07-26SL*B: drop kmem cache argument from constructorAlexey Dobriyan1-1/+1
Kmem cache passed to constructor is only needed for constructors that are themselves multiplexeres. Nobody uses this "feature", nor does anybody uses passed kmem cache in non-trivial way, so pass only pointer to object. Non-trivial places are: arch/powerpc/mm/init_64.c arch/powerpc/mm/hugetlbpage.c This is flag day, yes. Signed-off-by: Alexey Dobriyan <[email protected]> Acked-by: Pekka Enberg <[email protected]> Acked-by: Christoph Lameter <[email protected]> Cc: Jon Tollefson <[email protected]> Cc: Nick Piggin <[email protected]> Cc: Matt Mackall <[email protected]> [[email protected]: fix arch/powerpc/mm/hugetlbpage.c] [[email protected]: fix mm/slab.c] [[email protected]: fix ubifs] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-25ipc: do not use a negative value to re-enable msgmni automatic recomputingNadia Derbey2-18/+74
This patch proposes an alternative to the "magical positive-versus-negative number trick" Andrew complained about last week in http://lkml.org/lkml/2008/6/24/418. This had been introduced with the patches that scale msgmni to the amount of lowmem. With these patches, msgmni has a registered notification routine that recomputes msgmni value upon memory add/remove or ipc namespace creation/ removal. When msgmni is changed from user space (i.e. value written to the proc file), that notification routine is unregistered, and the way to make it registered back is to write a negative value into the proc file. This is the "magical positive-versus-negative number trick". To fix this, a new proc file is introduced: /proc/sys/kernel/auto_msgmni. This file acts as ON/OFF for msgmni automatic recomputing. With this patch, the process is the following: 1) kernel boots in "automatic recomputing mode" /proc/sys/kernel/msgmni contains the value that has been computed (depends on lowmem) /proc/sys/kernel/automatic_msgmni contains "1" 2) echo <val> > /proc/sys/kernel/msgmni . sets msg_ctlmni to <val> . de-activates automatic recomputing (i.e. if, say, some memory is added msgmni won't be recomputed anymore) . /proc/sys/kernel/automatic_msgmni now contains "0" 3) echo "0" > /proc/sys/kernel/automatic_msgmni . de-activates msgmni automatic recomputing this has the same effect as 2) except that msg_ctlmni's value stays blocked at its current value) 3) echo "1" > /proc/sys/kernel/automatic_msgmni . recomputes msgmni's value based on the current available memory size and number of ipc namespaces . re-activates automatic recomputing for msgmni. Signed-off-by: Nadia Derbey <[email protected]> Cc: Solofo Ramangalahy <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-25ipc: use simple_read_from_buffer()Akinobu Mita1-18/+7
Also this patch kills unneccesary trailing NULL character. Signed-off-by: Akinobu Mita <[email protected]> Cc: Nadia Derbey <[email protected]> Cc: Manfred Spraul <[email protected]> Cc: Pierre Peiffer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-25ipc/sem.c: rewrite undo list lockingManfred Spraul1-54/+93
The attached patch: - reverses the locking order of ulp->lock and sem_lock: Previously, it was first ulp->lock, then inside sem_lock. Now it's the other way around. - converts the undo structure to rcu. Benefits: - With the old locking order, IPC_RMID could not kfree the undo structures. The stale entries remained in the linked lists and were released later. - The patch fixes a a race in semtimedop(): if both IPC_RMID and a semget() that recreates exactly the same id happen between find_alloc_undo() and sem_lock, then semtimedop() would access already kfree'd memory. [[email protected]: coding-style fixes] Signed-off-by: Manfred Spraul <[email protected]> Reviewed-by: Nadia Derbey <[email protected]> Cc: Pierre Peiffer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-25ipc/sem.c: convert sem_array.sem_pending to struct list_headManfred Spraul1-57/+35
sem_array.sem_pending is a double linked list, the attached patch converts it to struct list_head. [[email protected]: coding-style fixes] Signed-off-by: Manfred Spraul <[email protected]> Reviewed-by: Nadia Derbey <[email protected]> Cc: Pierre Peiffer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-25ipc/sem.c: remove unused entries from struct sem_queueManfred Spraul1-2/+0
sem_queue.sma and sem_queue.id were never used, the attached patch removes them. Signed-off-by: Manfred Spraul <[email protected]> Reviewed-by: Nadia Derbey <[email protected]> Cc: Pierre Peiffer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-25ipc/sem.c: convert undo structures to struct list_headManfred Spraul1-74/+89
The undo structures contain two linked lists, the attached patch replaces them with generic struct list_head lists. [[email protected]: coding-style fixes] Signed-off-by: Manfred Spraul <[email protected]> Cc: Nadia Derbey <[email protected]> Cc: Pierre Peiffer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-25ipc: get rid of ipc_lock_down()Nadia Derbey3-75/+4
Remove the ipc_lock_down() routines: they used to call idr_find() locklessly (given that the ipc ids lock was already held), so they are not needed anymore. Signed-off-by: Nadia Derbey <[email protected]> Acked-by: "Paul E. McKenney" <[email protected]> Cc: Manfred Spraul <[email protected]> Cc: Jim Houston <[email protected]> Cc: Pierre Peiffer <[email protected]> Acked-by: Rik van Riel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-25ipc: call idr_find() without locking in ipc_lock()Nadia Derbey1-9/+0
Call idr_find() locklessly from ipc_lock(), since the idr tree is now RCU protected. Signed-off-by: Nadia Derbey <[email protected]> Acked-by: "Paul E. McKenney" <[email protected]> Cc: Manfred Spraul <[email protected]> Cc: Jim Houston <[email protected]> Cc: Pierre Peiffer <[email protected]> Acked-by: Rik van Riel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-07-24hugetlb: modular state for hugetlb page sizeAndi Kleen1-1/+2
The goal of this patchset is to support multiple hugetlb page sizes. This is achieved by introducing a new struct hstate structure, which encapsulates the important hugetlb state and constants (eg. huge page size, number of huge pages currently allocated, etc). The hstate structure is then passed around the code which requires these fields, they will do the right thing regardless of the exact hstate they are operating on. This patch adds the hstate structure, with a single global instance of it (default_hstate), and does the basic work of converting hugetlb to use the hstate. Future patches will add more hstate structures to allow for different hugetlbfs mounts to have different page sizes. [[email protected]: coding-style fixes] Acked-by: Adam Litke <[email protected]> Acked-by: Nishanth Aravamudan <[email protected]> Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Nick Piggin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-06-13Merge branch 'master' of ↵David S. Miller2-17/+14
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/smc911x.c
2008-06-12/proc/sysvipc/shm: fix 32-bit truncation of segment sizesPaul Menage1-8/+8
sysvipc_shm_proc_show() picks between format strings (based on the expected maximum length of a SHM segment) in a way that prevents gcc from performing format checks on the seq_printf() parameters. This hid two format errors - shp->shm_segsz and shp->shm_nattach are both unsigned long, but were being printed as unsigned int and signed int respectively. This leads to 32-bit truncation of SHM segment sizes reported in /proc/sysvipc/shm. (And for nattach, but that's less of a problem for most users). This patch makes the format string directly visible to gcc's format specifier checker, and fixes the two broken format specifiers. Signed-off-by: Paul Menage <[email protected]> Cc: Nadia Derbey <[email protected]> Cc: Manfred Spraul <[email protected]> Cc: Pierre Peiffer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-06-10shm: Remove silly double assignmentNeil Horman1-2/+0
Found a silly double assignment of err is do_shmat. Silly, but good to clean up the useless code. Signed-off-by: Neil Horman <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-06-06ipc: only output msgmni value at boot timeNadia Derbey1-7/+6
When posting: [PATCH 1/8] Scaling msgmni to the amount of lowmem (see http://lkml.org/lkml/2008/2/11/171), I have added a KERN_INFO message that is output each time msgmni is recomputed. In http://lkml.org/lkml/2008/4/29/575 Tony Luck complained that this message references an ipc namespace address that is useless. I first thought of using an audit_log instead of a printk, as suggested by Serge Hallyn. But unfortunately, we do not have any other information than the namespace address to provide here too. So I chose to move the message and output it only at boot time, removing the reference to the namespace. Signed-off-by: Nadia Derbey <[email protected]> Cc: Pierre Peiffer <[email protected]> Cc: Manfred Spraul <[email protected]> Acked-by: Tony Luck <[email protected]> Cc: "Serge E. Hallyn" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-06-05netlink: Remove nonblock parameter from netlink_attachskbDenis V. Lunev1-1/+1
Signed-off-by: Denis V. Lunev <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-05-03tiny mq_open optimizationUlrich Drepper1-2/+1
A very small cleanup for mq_open. We do not have to call set_close_on_exit if we create the file descriptor right away with the flag set. We have a function for this now. The resulting code is smaller and a tiny bit faster. Signed-off-by: Ulrich Drepper <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29sysvipc: use non-racy method for proc entries creationDenis V. Lunev1-7/+6
Use proc_create_data() to make sure that ->proc_fops and ->data be setup before gluing PDE to main tree. Signed-off-by: Denis V. Lunev <[email protected]> Cc: Alexey Dobriyan <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Nadia Derbey <[email protected]> Cc: Pierre Peiffer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29ipc: sysvsem: implement sys_unshare(CLONE_SYSVSEM)Manfred Spraul1-0/+1
sys_unshare(CLONE_NEWIPC) doesn't handle the undo lists properly, this can cause a kernel memory corruption. CLONE_NEWIPC must detach from the existing undo lists. Fix, part 1: add support for sys_unshare(CLONE_SYSVSEM) The original reason to not support it was the potential (inevitable?) confusion due to the fact that sys_unshare(CLONE_SYSVSEM) has the inverse meaning of clone(CLONE_SYSVSEM). Our two most reasonable options then appear to be (1) fully support CLONE_SYSVSEM, or (2) continue to refuse explicit CLONE_SYSVSEM, but always do it anyway on unshare(CLONE_SYSVSEM). This patch does (1). Changelog: Apr 16: SEH: switch to Manfred's alternative patch which removes the unshare_semundo() function which always refused CLONE_SYSVSEM. Signed-off-by: Manfred Spraul <[email protected]> Signed-off-by: Serge E. Hallyn <[email protected]> Acked-by: "Eric W. Biederman" <[email protected]> Cc: Pavel Emelyanov <[email protected]> Cc: Michael Kerrisk <[email protected]> Cc: Pierre Peiffer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29ipc: add definitions of USHORT_MAX and othersZhang, Yanmin3-9/+8
Add definitions of USHORT_MAX and others into kernel. ipc uses it and slub implementation might also use it. [[email protected]: coding-style fixes] Signed-off-by: Zhang Yanmin <[email protected]> Reviewed-by: Christoph Lameter <[email protected]> Cc: Nadia Derbey <[email protected]> Cc: "Pierre Peiffer" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29IPC: consolidate all xxxctl_down() functionsPierre Peiffer5-119/+66
semctl_down(), msgctl_down() and shmctl_down() are used to handle the same set of commands for each kind of IPC. They all start to do the same job (they retrieve the ipc and do some permission checks) before handling the commands on their own. This patch proposes to consolidate this by moving these same pieces of code into one common function called ipcctl_pre_down(). It simplifies a little these xxxctl_down() functions and increases a little the maintainability. Signed-off-by: Pierre Peiffer <[email protected]> Acked-by: Serge Hallyn <[email protected]> Cc: Nadia Derbey <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29IPC: introduce ipc_update_perm()Pierre Peiffer5-12/+17
The IPC_SET command performs the same permission setting for all IPCs. This patch introduces a common ipc_update_perm() function to update these permissions and makes use of it for all IPCs. Signed-off-by: Pierre Peiffer <[email protected]> Acked-by: Serge Hallyn <[email protected]> Cc: Nadia Derbey <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29IPC: get rid of the use *_setbuf structure.Pierre Peiffer3-86/+46
All IPCs make use of an intermetiate *_setbuf structure to handle the IPC_SET command. This is not really needed and, moreover, it complicates a little bit the code. This patch gets rid of the use of it and uses directly the semid64_ds/ msgid64_ds/shmid64_ds structure. In addition of removing one struture declaration, it also simplifies and improves a little bit the common 64-bits path. Signed-off-by: Pierre Peiffer <[email protected]> Acked-by: Serge Hallyn <[email protected]> Cc: Nadia Derbey <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29IPC/semaphores: remove one unused parameter from semctl_down()Pierre Peiffer1-3/+3
semctl_down() takes one unused parameter: semnum. This patch proposes to get rid of it. Signed-off-by: Pierre Peiffer <[email protected]> Acked-by: Serge Hallyn <[email protected]> Cc: Nadia Derbey <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29IPC/semaphores: move the rwmutex handling inside semctl_downPierre Peiffer1-11/+13
semctl_down is called with the rwmutex (the one which protects the list of ipcs) taken in write mode. This patch moves this rwmutex taken in write-mode inside semctl_down. This has the advantages of reducing a little bit the window during which this rwmutex is taken, clarifying sys_semctl, and finally of having a coherent behaviour with [shm|msg]ctl_down Signed-off-by: Pierre Peiffer <[email protected]> Acked-by: Serge Hallyn <[email protected]> Cc: Nadia Derbey <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29IPC/message queues: introduce msgctl_downPierre Peiffer1-73/+89
Currently, sys_msgctl is not easy to read. This patch tries to improve that by introducing the msgctl_down function to handle all commands requiring the rwmutex to be taken in write mode (ie IPC_SET and IPC_RMID for now). It is the equivalent function of semctl_down for message queues. This greatly changes the readability of sys_msgctl and also harmonizes the way these commands are handled among all IPCs. Signed-off-by: Pierre Peiffer <[email protected]> Acked-by: Serge Hallyn <[email protected]> Cc: Nadia Derbey <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29IPC/shared memory: introduce shmctl_downPierre Peiffer1-88/+72
Currently, the way the different commands are handled in sys_shmctl introduces some duplicated code. This patch introduces the shmctl_down function to handle all the commands requiring the rwmutex to be taken in write mode (ie IPC_SET and IPC_RMID for now). It is the equivalent function of semctl_down for shared memory. This removes some duplicated code for handling these both commands and harmonizes the way they are handled among all IPCs. Signed-off-by: Pierre Peiffer <[email protected]> Acked-by: Serge Hallyn <[email protected]> Cc: Nadia Derbey <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29IPC/semaphores: code factorisationPierre Peiffer1-30/+31
Trivial patch which adds some small locking functions and makes use of them to factorize some part of the code and to make it cleaner. Signed-off-by: Pierre Peiffer <[email protected]> Acked-by: Serge Hallyn <[email protected]> Cc: Nadia Derbey <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29ipc: re-enable msgmni automatic recomputing msgmni if set to negativeNadia Derbey2-10/+44
The enhancement as asked for by Yasunori: if msgmni is set to a negative value, register it back into the ipcns notifier chain. A new interface has been added to the notification mechanism: notifier_chain_cond_register() registers a notifier block only if not already registered. With that new interface we avoid taking care of the states changes in procfs. Signed-off-by: Nadia Derbey <[email protected]> Cc: Yasunori Goto <[email protected]> Cc: Matt Helsley <[email protected]> Cc: Mingming Cao <[email protected]> Cc: Pierre Peiffer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29ipc: do not recompute msgmni anymore if explicitly set by userNadia Derbey1-2/+41
Make msgmni not recomputed anymore upon ipc namespace creation / removal or memory add/remove, as soon as it has been set from userland. As soon as msgmni is explicitly set via procfs or sysctl(), the associated callback routine is unregistered from the ipc namespace notifier chain. Signed-off-by: Nadia Derbey <[email protected]> Cc: Yasunori Goto <[email protected]> Cc: Matt Helsley <[email protected]> Cc: Mingming Cao <[email protected]> Cc: Pierre Peiffer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-29ipc: recompute msgmni on ipc namespace creation/removalNadia Derbey3-2/+15
Introduce a notification mechanism that aims at recomputing msgmni each time an ipc namespace is created or removed. The ipc namespace notifier chain already defined for memory hotplug management is used for that purpose too. Each time a new ipc namespace is allocated or an existing ipc namespace is removed, the ipcns notifier chain is notified. The callback routine for each registered ipc namespace is then activated in order to recompute msgmni for that namespace. Signed-off-by: Nadia Derbey <[email protected]> Cc: Yasunori Goto <[email protected]> Cc: Matt Helsley <[email protected]> Cc: Mingming Cao <[email protected]> Cc: Pierre Peiffer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>