diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2021-11-27 00:54:16 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2021-11-27 00:54:16 +0100 |
commit | 2448eab44034d9603c97ca17760a53d4d6e4b60c (patch) | |
tree | 7f323cea55258e94e0c7c70b63d02c9effb00c1f /include/linux/ipc_namespace.h | |
parent | deee705a1c9cce9c7eb699d529f1c0b3c80d339d (diff) | |
parent | 136057256686de39cc3a07c2e39ef6bc43003ff6 (diff) |
Merge tag 'v5.16-rc2' into devel
Linux 5.16-rc2 is needed because nonurgent fixes headed
for next are strongly textually dependent on a fix that
was applied for rc2.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/ipc_namespace.h')
-rw-r--r-- | include/linux/ipc_namespace.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index 05e22770af51..b75395ec8d52 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h @@ -131,6 +131,16 @@ static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *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)) + return ns; + } + + return NULL; +} + extern void put_ipc_ns(struct ipc_namespace *ns); #else static inline struct ipc_namespace *copy_ipcs(unsigned long flags, @@ -147,6 +157,11 @@ static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) return ns; } +static inline struct ipc_namespace *get_ipc_ns_not_zero(struct ipc_namespace *ns) +{ + return ns; +} + static inline void put_ipc_ns(struct ipc_namespace *ns) { } |