From c6609c0a1c34fc097152b28b496236625673924f Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Thu, 24 Nov 2016 08:03:41 +1100 Subject: vfs: add path_is_mountpoint() helper d_mountpoint() can only be used reliably to establish if a dentry is not mounted in any namespace. It isn't aware of the possibility there may be multiple mounts using a given dentry that may be in a different namespace. Add helper functions, path_is_mountpoint(), that checks if a struct path is a mountpoint for this case. Link: http://lkml.kernel.org/r/20161011053358.27645.9729.stgit@pluto.themaw.net Signed-off-by: Ian Kent Cc: Al Viro Cc: Eric W. Biederman Cc: Omar Sandoval Signed-off-by: Andrew Morton Signed-off-by: Al Viro --- include/linux/mount.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/mount.h') diff --git a/include/linux/mount.h b/include/linux/mount.h index 1172cce949a4..5b6dd004bfdc 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -98,4 +98,6 @@ extern dev_t name_to_dev_t(const char *name); extern unsigned int sysctl_mount_max; +extern bool path_is_mountpoint(const struct path *path); + #endif /* _LINUX_MOUNT_H */ -- cgit v1.2.3-59-g8ed1b