18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  linux/fs/pnode.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * (C) Copyright IBM Corporation 2005.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci#ifndef _LINUX_PNODE_H
88c2ecf20Sopenharmony_ci#define _LINUX_PNODE_H
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#include <linux/list.h>
118c2ecf20Sopenharmony_ci#include "mount.h"
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#define IS_MNT_SHARED(m) ((m)->mnt.mnt_flags & MNT_SHARED)
148c2ecf20Sopenharmony_ci#define IS_MNT_SLAVE(m) ((m)->mnt_master)
158c2ecf20Sopenharmony_ci#define IS_MNT_NEW(m)  (!(m)->mnt_ns || is_anon_ns((m)->mnt_ns))
168c2ecf20Sopenharmony_ci#define CLEAR_MNT_SHARED(m) ((m)->mnt.mnt_flags &= ~MNT_SHARED)
178c2ecf20Sopenharmony_ci#define IS_MNT_UNBINDABLE(m) ((m)->mnt.mnt_flags & MNT_UNBINDABLE)
188c2ecf20Sopenharmony_ci#define IS_MNT_MARKED(m) ((m)->mnt.mnt_flags & MNT_MARKED)
198c2ecf20Sopenharmony_ci#define SET_MNT_MARK(m) ((m)->mnt.mnt_flags |= MNT_MARKED)
208c2ecf20Sopenharmony_ci#define CLEAR_MNT_MARK(m) ((m)->mnt.mnt_flags &= ~MNT_MARKED)
218c2ecf20Sopenharmony_ci#define IS_MNT_LOCKED(m) ((m)->mnt.mnt_flags & MNT_LOCKED)
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#define CL_EXPIRE    		0x01
248c2ecf20Sopenharmony_ci#define CL_SLAVE     		0x02
258c2ecf20Sopenharmony_ci#define CL_COPY_UNBINDABLE	0x04
268c2ecf20Sopenharmony_ci#define CL_MAKE_SHARED 		0x08
278c2ecf20Sopenharmony_ci#define CL_PRIVATE 		0x10
288c2ecf20Sopenharmony_ci#define CL_SHARED_TO_SLAVE	0x20
298c2ecf20Sopenharmony_ci#define CL_COPY_MNT_NS_FILE	0x40
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#define CL_COPY_ALL		(CL_COPY_UNBINDABLE | CL_COPY_MNT_NS_FILE)
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_cistatic inline void set_mnt_shared(struct mount *mnt)
348c2ecf20Sopenharmony_ci{
358c2ecf20Sopenharmony_ci	mnt->mnt.mnt_flags &= ~MNT_SHARED_MASK;
368c2ecf20Sopenharmony_ci	mnt->mnt.mnt_flags |= MNT_SHARED;
378c2ecf20Sopenharmony_ci}
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_civoid change_mnt_propagation(struct mount *, int);
408c2ecf20Sopenharmony_ciint propagate_mnt(struct mount *, struct mountpoint *, struct mount *,
418c2ecf20Sopenharmony_ci		struct hlist_head *);
428c2ecf20Sopenharmony_ciint propagate_umount(struct list_head *);
438c2ecf20Sopenharmony_ciint propagate_mount_busy(struct mount *, int);
448c2ecf20Sopenharmony_civoid propagate_mount_unlock(struct mount *);
458c2ecf20Sopenharmony_civoid mnt_release_group_id(struct mount *);
468c2ecf20Sopenharmony_ciint get_dominating_id(struct mount *mnt, const struct path *root);
478c2ecf20Sopenharmony_ciint mnt_get_count(struct mount *mnt);
488c2ecf20Sopenharmony_civoid mnt_set_mountpoint(struct mount *, struct mountpoint *,
498c2ecf20Sopenharmony_ci			struct mount *);
508c2ecf20Sopenharmony_civoid mnt_change_mountpoint(struct mount *parent, struct mountpoint *mp,
518c2ecf20Sopenharmony_ci			   struct mount *mnt);
528c2ecf20Sopenharmony_cistruct mount *copy_tree(struct mount *, struct dentry *, int);
538c2ecf20Sopenharmony_cibool is_path_reachable(struct mount *, struct dentry *,
548c2ecf20Sopenharmony_ci			 const struct path *root);
558c2ecf20Sopenharmony_ciint count_mounts(struct mnt_namespace *ns, struct mount *mnt);
568c2ecf20Sopenharmony_ci#endif /* _LINUX_PNODE_H */
57