mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 03:54:02 +00:00
ipc,rcu: Convert call_rcu(free_un) to kfree_rcu()
The rcu callback free_un() just calls a kfree(), so we use kfree_rcu() instead of the call_rcu(free_un). Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Manfred Spraul <manfred@colorfullife.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
This commit is contained in:
parent
449a68cc65
commit
693a8b6eec
1 changed files with 2 additions and 8 deletions
10
ipc/sem.c
10
ipc/sem.c
|
@ -689,12 +689,6 @@ static int count_semzcnt (struct sem_array * sma, ushort semnum)
|
||||||
return semzcnt;
|
return semzcnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void free_un(struct rcu_head *head)
|
|
||||||
{
|
|
||||||
struct sem_undo *un = container_of(head, struct sem_undo, rcu);
|
|
||||||
kfree(un);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Free a semaphore set. freeary() is called with sem_ids.rw_mutex locked
|
/* 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
|
* as a writer and the spinlock for this semaphore set hold. sem_ids.rw_mutex
|
||||||
* remains locked on exit.
|
* remains locked on exit.
|
||||||
|
@ -714,7 +708,7 @@ static void freeary(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp)
|
||||||
un->semid = -1;
|
un->semid = -1;
|
||||||
list_del_rcu(&un->list_proc);
|
list_del_rcu(&un->list_proc);
|
||||||
spin_unlock(&un->ulp->lock);
|
spin_unlock(&un->ulp->lock);
|
||||||
call_rcu(&un->rcu, free_un);
|
kfree_rcu(un, rcu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wake up all pending processes and let them fail with EIDRM. */
|
/* Wake up all pending processes and let them fail with EIDRM. */
|
||||||
|
@ -1612,7 +1606,7 @@ void exit_sem(struct task_struct *tsk)
|
||||||
sem_unlock(sma);
|
sem_unlock(sma);
|
||||||
wake_up_sem_queue_do(&tasks);
|
wake_up_sem_queue_do(&tasks);
|
||||||
|
|
||||||
call_rcu(&un->rcu, free_un);
|
kfree_rcu(un, rcu);
|
||||||
}
|
}
|
||||||
kfree(ulp);
|
kfree(ulp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue