mirror of
https://github.com/torvalds/linux.git
synced 2025-12-01 07:26:02 +07: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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user