mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
ipc: port to ns_ref_*() helpers
Stop accessing ns.count directly. Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
06099e374f
commit
d4825c99d6
2 changed files with 3 additions and 3 deletions
|
|
@ -140,14 +140,14 @@ extern struct ipc_namespace *copy_ipcs(unsigned long flags,
|
|||
static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
|
||||
{
|
||||
if (ns)
|
||||
refcount_inc(&ns->ns.count);
|
||||
ns_ref_inc(ns);
|
||||
return ns;
|
||||
}
|
||||
|
||||
static inline struct ipc_namespace *get_ipc_ns_not_zero(struct ipc_namespace *ns)
|
||||
{
|
||||
if (ns) {
|
||||
if (refcount_inc_not_zero(&ns->ns.count))
|
||||
if (ns_ref_get(ns))
|
||||
return ns;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ static void free_ipc(struct work_struct *unused)
|
|||
*/
|
||||
void put_ipc_ns(struct ipc_namespace *ns)
|
||||
{
|
||||
if (refcount_dec_and_lock(&ns->ns.count, &mq_lock)) {
|
||||
if (ns_ref_put_and_lock(ns, &mq_lock)) {
|
||||
mq_clear_sbinfo(ns);
|
||||
spin_unlock(&mq_lock);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue