Skip to content

Commit

Permalink
fs: add put_mnt_ns() cleanup helper
Browse files Browse the repository at this point in the history
Add a simple helper to put a mount namespace reference.

Link: https://lore.kernel.org/r/20240719-work-mount-namespace-v1-3-834113cab0d2@kernel.org
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
  • Loading branch information
Christian Brauner committed Aug 9, 2024
1 parent 7b9d14a commit 5fcf329
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/linux/mnt_namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#define _NAMESPACE_H_
#ifdef __KERNEL__

#include <linux/cleanup.h>
#include <linux/err.h>

struct mnt_namespace;
struct fs_struct;
struct user_namespace;
Expand All @@ -11,6 +14,7 @@ struct ns_common;
extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
struct user_namespace *, struct fs_struct *);
extern void put_mnt_ns(struct mnt_namespace *ns);
DEFINE_FREE(put_mnt_ns, struct mnt_namespace *, if (!IS_ERR_OR_NULL(_T)) put_mnt_ns(_T))
extern struct ns_common *from_mnt_ns(struct mnt_namespace *);

extern const struct file_operations proc_mounts_operations;
Expand Down

0 comments on commit 5fcf329

Please sign in to comment.