/* sem_lock_(check_) routines are called in the paths where the rw_mutex is not held.  */
static struct sem_array* sem_lock(struct ipc_namespace *ns, int id)
/* sem_lock_(check_) routines are called in the paths where the rw_mutex is not held.  */
static struct sem_array* sem_lock(struct ipc_namespace *ns, int id)
{
	struct kern_ipc_perm *ipcp = ipc_lock(&sem_ids(ns), id);
	if (IS_ERR(ipcp))
		return (struct sem_array *)ipcp;
	return container_of(ipcp, struct sem_array, sem_perm);
}