ipc-rename-ids-rw_mutex.patch removed from -mm tree
Subject: [merged] ipc-rename-ids-rw_mutex.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Thu, 12 Sep 2013 12:50:55 -0700
The patch titled
Subject: ipc: rename ids->rw_mutex
has been removed from the -mm tree. Its filename was
ipc-rename-ids-rw_mutex.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Davidlohr Bueso <[email protected]>
Subject: ipc: rename ids->rw_mutex
Since in some situations the lock can be shared for readers, we shouldn't be calling it a mutex, rename it to rwsem.
---
include/linux/ipc_namespace.h | 2 - ipc/msg.c | 20 +++++------ ipc/namespace.c | 4 +- ipc/sem.c | 24 ++++++------- ipc/shm.c | 56 ++++++++++++++++---------------- ipc/util.c | 28 ++++++++-------- ipc/util.h | 4 +- 7 files changed, 69 insertions(+), 69 deletions(-)
include/linux/ipc_namespace.h renamed from include/linux/ipc_namespace.h~ipc-rename-ids-rw_mutex +1 -1
@@ -22,7 +22,7 @@ struct ipc_ids {int in_use;unsigned short seq;unsigned short seq_max; -struct rw_semaphore rw_mutex; +struct rw_semaphore rwsem;struct idr ipcs_idr;int next_id; };
ipc/msg.c renamed from ipc/msg.c~ipc-rename-ids-rw_mutex +10 -10
@@ -172,7 +172,7 @@ static inline void msg_rmid(struct ipc_n* @ns: namespace * @params: ptr to the structure that contains the key and msgflg * -* Called with msg_ids.rw_mutex held (writer) +* Called with msg_ids.rwsem held (writer) */ static int newque (struct ipc_namespace *ns,struct ipc_params *params) {
@@ -259,8 +259,8 @@ static void expunge_all(struct msg_queue* removes the message queue from message queue ID IDR, and cleans up all the * messages associated with this queue. * -* msg_ids.rw_mutex (writer) and the spinlock for this message queue are held -* before freeque() is called. msg_ids.rw_mutex remains locked on exit. +* msg_ids.rwsem (writer) and the spinlock for this message queue are held +* before freeque() is called. msg_ids.rwsem remains locked on exit. */ static void freeque (struct ipc_namespace *ns,struct kern_ipc_perm *ipcp) {
@@ -282,7 +282,7 @@ static void freeque(struct ipc_namespace }/* -* Called with msg_ids.rw_mutex and ipcp locked. +* Called with msg_ids.rwsem and ipcp locked. */ static inline int msg_security (struct kern_ipc_perm *ipcp,int msgflg) {
@@ -386,9 +386,9 @@ copy_msqid_from_user(struct msqid64_ds * }/* -* This function handles some msgctl commands which require the rw_mutex +* This function handles some msgctl commands which require the rwsem * to be held in write mode. -* NOTE: no locks must be held, the rw_mutex is taken inside this function. +* NOTE: no locks must be held, the rwsem is taken inside this function. */ static int msgctl_down (struct ipc_namespace *ns,int msqid,int cmd,struct msqid_ds __user *buf,int version)
@@ -403,7 +403,7 @@ static int msgctl_down(struct ipc_namespreturn -EFAULT ; } -down_write (&msg_ids (ns).rw_mutex); +down_write (&msg_ids (ns).rwsem);rcu_read_lock (); ipcp = ipcctl_pre_down_nolock(ns, &msg_ids(ns), msqid, cmd,
@@ -459,7 +459,7 @@ out_unlock0: out_unlock1:rcu_read_unlock (); out_up: -up_write (&msg_ids (ns).rw_mutex); +up_write (&msg_ids (ns).rwsem);return err; }
@@ -494,7 +494,7 @@ static int msgctl_nolock(struct ipc_name msginfo.msgmnb = ns->msg_ctlmnb; msginfo.msgssz =MSGSSZ ; msginfo.msgseg =MSGSEG ; -down_read (&msg_ids (ns).rw_mutex); +down_read (&msg_ids (ns).rwsem);if (cmd ==MSG_INFO ) { msginfo.msgpool =msg_ids (ns).in_use; msginfo.msgmap =atomic_read (&ns->msg_hdrs);
@@ -505,7 +505,7 @@ static int msgctl_nolock(struct ipc_name msginfo.msgtql =MSGTQL ; } max_id =ipc_get_maxid (&msg_ids (ns)); -up_read (&msg_ids (ns).rw_mutex); +up_read (&msg_ids (ns).rwsem);if (copy_to_user (buf, &msginfo,sizeof (struct msginfo )))return -EFAULT ;return (max_id <0 ) ?0 : max_id;
ipc/namespace.c renamed from ipc/namespace.c~ipc-rename-ids-rw_mutex +2 -2
@@ -81,7 +81,7 @@ void free_ipcs(struct ipc_namespace *ns,int next_id;int total, in_use; -down_write (&ids->rw_mutex); +down_write (&ids->rwsem); in_use = ids->in_use;
@@ -93,7 +93,7 @@ void free_ipcs(struct ipc_namespace *ns,free (ns, perm); total++; } -up_write (&ids->rw_mutex); +up_write (&ids->rwsem); }static void free_ipc_ns (struct ipc_namespace *ns)
ipc/sem.c renamed from ipc/sem.c~ipc-rename-ids-rw_mutex +12 -12
@@ -322,7 +322,7 @@ static inline void sem_unlock(struct sem }/* -* sem_lock_(check_) routines are called in the paths where the rw_mutex +* sem_lock_(check_) routines are called in the paths where the rwsem * is not held. * * The caller holds the RCU read lock.
@@ -426,7 +426,7 @@ static inline void sem_rmid(struct ipc_n* @ns: namespace * @params: ptr to the structure that contains key, semflg and nsems * -* Called with sem_ids.rw_mutex held (as a writer) +* Called with sem_ids.rwsem held (as a writer) */ static int newary (struct ipc_namespace *ns,struct ipc_params *params)
@@ -492,7 +492,7 @@ static int newary(struct ipc_namespace */* -* Called with sem_ids.rw_mutex and ipcp locked. +* Called with sem_ids.rwsem and ipcp locked. */ static inline int sem_security (struct kern_ipc_perm *ipcp,int semflg) {
@@ -503,7 +503,7 @@ static inline int sem_security(struct ke }/* -* Called with sem_ids.rw_mutex and ipcp locked. +* Called with sem_ids.rwsem and ipcp locked. */ static inline int sem_more_checks (struct kern_ipc_perm *ipcp,struct ipc_params *params)
@@ -994,8 +994,8 @@ static int count_semzcnt (struct sem_arrreturn semzcnt; } -/* Free a semaphore set. freeary() is called with sem_ids.rw_mutex locked -* as a writer and the spinlock for this semaphore set hold. sem_ids.rw_mutex +/* Free a semaphore set. freeary() is called with sem_ids.rwsem locked +* as a writer and the spinlock for this semaphore set hold. sem_ids.rwsem * remains locked on exit. */ static void freeary (struct ipc_namespace *ns,struct kern_ipc_perm *ipcp)
@@ -1116,7 +1116,7 @@ static int semctl_nolock(struct ipc_name seminfo.semmnu =SEMMNU ; seminfo.semmap =SEMMAP ; seminfo.semume =SEMUME ; -down_read (&sem_ids (ns).rw_mutex); +down_read (&sem_ids (ns).rwsem);if (cmd ==SEM_INFO ) { seminfo.semusz =sem_ids (ns).in_use; seminfo.semaem = ns->used_sems;
@@ -1125,7 +1125,7 @@ static int semctl_nolock(struct ipc_name seminfo.semaem =SEMAEM ; } max_id =ipc_get_maxid (&sem_ids (ns)); -up_read (&sem_ids (ns).rw_mutex); +up_read (&sem_ids (ns).rwsem);if (copy_to_user (p, &seminfo,sizeof (struct seminfo )))return -EFAULT ;return (max_id <0 ) ?0 : max_id;
@@ -1431,9 +1431,9 @@ copy_semid_from_user(struct semid64_ds * }/* -* This function handles some semctl commands which require the rw_mutex +* This function handles some semctl commands which require the rwsem * to be held in write mode. -* NOTE: no locks must be held, the rw_mutex is taken inside this function. +* NOTE: no locks must be held, the rwsem is taken inside this function. */ static int semctl_down (struct ipc_namespace *ns,int semid,int cmd,int version,void __user *p)
@@ -1448,7 +1448,7 @@ static int semctl_down(struct ipc_namespreturn -EFAULT ; } -down_write (&sem_ids (ns).rw_mutex); +down_write (&sem_ids (ns).rwsem);rcu_read_lock (); ipcp = ipcctl_pre_down_nolock(ns, &sem_ids(ns), semid, cmd,
@@ -1487,7 +1487,7 @@ out_unlock0: out_unlock1:rcu_read_unlock (); out_up: -up_write (&sem_ids (ns).rw_mutex); +up_write (&sem_ids (ns).rwsem);return err; }
ipc/shm.c renamed from ipc/shm.c~ipc-rename-ids-rw_mutex +28 -28
196 lines not on this page · raw message
ipc/util.c renamed from ipc/util.c~ipc-rename-ids-rw_mutex +14 -14
@@ -119,7 +119,7 @@ __initcall(ipc_init);void ipc_init_ids (struct ipc_ids *ids) { -init_rwsem (&ids->rw_mutex); +init_rwsem (&ids->rwsem); ids->in_use =0 ; ids->seq =0 ;
@@ -174,7 +174,7 @@ void __init ipc_init_proc_interface(cons* @ids: Identifier set * @key: The key to find * -* Requires ipc_ids.rw_mutex locked. +* Requires ipc_ids.rwsem locked. * Returns the LOCKED pointer to the ipc structure if found or NULL * if not. * If key is found ipc points to the owning ipc structure
@@ -208,7 +208,7 @@ static struct kern_ipc_perm *ipc_findkey* ipc_get_maxid - get the last assigned id * @ids: IPC identifier set * -* Called with ipc_ids.rw_mutex held. +* Called with ipc_ids.rwsem held. */ int ipc_get_maxid (struct ipc_ids *ids)
@@ -246,7 +246,7 @@ int ipc_get_maxid(struct ipc_ids *ids)* is returned. The 'new' entry is returned in a locked state on success. * On failure the entry is not locked and a negative err-code is returned. * -* Called with writer ipc_ids.rw_mutex held. +* Called with writer ipc_ids.rwsem held. */ int ipc_addid (struct ipc_ids * ids,struct kern_ipc_perm * new,int size) {
@@ -312,9 +312,9 @@ static int ipcget_new(struct ipc_namespa {int err; -down_write (&ids->rw_mutex); +down_write (&ids->rwsem); err = ops->getnew (ns, params); -up_write (&ids->rw_mutex); +up_write (&ids->rwsem);return err; }
@@ -331,7 +331,7 @@ static int ipcget_new(struct ipc_namespa* * On success, the IPC id is returned. * -* It is called with ipc_ids.rw_mutex and ipcp->lock held. +* It is called with ipc_ids.rwsem and ipcp->lock held. */ static int ipc_check_perms(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp,
@@ -376,7 +376,7 @@ static int ipcget_public(struct ipc_name* Take the lock as a writer since we are potentially going to add * a new entry + read locks are not "upgradable" */ -down_write (&ids->rw_mutex); +down_write (&ids->rwsem); ipcp =ipc_findkey (ids, params->key);if (ipcp ==NULL ) {/* key not used */
@@ -402,7 +402,7 @@ static int ipcget_public(struct ipc_name }ipc_unlock (ipcp); } -up_write (&ids->rw_mutex); +up_write (&ids->rwsem);return err; }
@@ -413,7 +413,7 @@ static int ipcget_public(struct ipc_name* @ids: IPC identifier set * @ipcp: ipc perm structure containing the identifier to remove * -* ipc_ids.rw_mutex (as a writer) and the spinlock for this ID are held +* ipc_ids.rwsem (as a writer) and the spinlock for this ID are held * before this function is called, and remain locked on the exit. */
@@ -621,7 +621,7 @@ struct kern_ipc_perm *ipc_obtain_object( }/** -* ipc_lock - Lock an ipc structure without rw_mutex held +* ipc_lock - Lock an ipc structure without rwsem held * @ids: IPC identifier set * @id: ipc id to look for *
@@ -748,7 +748,7 @@ int ipc_update_perm(struct ipc64_perm *i* - performs some audit and permission check, depending on the given cmd * - returns a pointer to the ipc object or otherwise, the corresponding error. * -* Call holding the both the rw_mutex and the rcu read lock. +* Call holding the both the rwsem and the rcu read lock. */ struct kern_ipc_perm *ipcctl_pre_down_nolock(struct ipc_namespace *ns, struct ipc_ids *ids, int id, int cmd,
@@ -868,7 +868,7 @@ static void *sysvipc_proc_start(struct s* Take the lock - this will be released by the corresponding * call to stop(). */ -down_read (&ids->rw_mutex); +down_read (&ids->rwsem);/* pos < 0 is invalid */ if (*pos <0 )
@@ -895,7 +895,7 @@ static void sysvipc_proc_stop(struct seq ids = &iter->ns->ids[iface->ids];/* Release the lock we took in start() */ -up_read (&ids->rw_mutex); +up_read (&ids->rwsem); }static int sysvipc_proc_show (struct seq_file *s,void *it)
ipc/util.h renamed from ipc/util.h~ipc-rename-ids-rw_mutex +2 -2
@@ -94,10 +94,10 @@ void __init ipc_init_proc_interface(cons#define ipcid_to_idx (id) ((id) % SEQ_MULTIPLIER)#define ipcid_to_seqx (id) ((id) / SEQ_MULTIPLIER) -/* must be called with ids->rw_mutex acquired for writing */ +/* must be called with ids->rwsem acquired for writing */ int ipc_addid (struct ipc_ids *,struct kern_ipc_perm *,int ); -/* must be called with ids->rw_mutex acquired for reading */ +/* must be called with ids->rwsem acquired for reading */ int ipc_get_maxid (struct ipc_ids *);/* must be called with both locks acquired. */
_
Patches currently in -mm which might be from [email protected] are
origin.patch