mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
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/[email protected] Signed-off-by: Ian Kent <[email protected]> Cc: Al Viro <[email protected]> Cc: Eric W. Biederman <[email protected]> Cc: Omar Sandoval <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
fb5f51c742
commit
c6609c0a1c
3 changed files with 37 additions and 0 deletions
|
|
@ -94,6 +94,12 @@ extern struct mount *__lookup_mnt_last(struct vfsmount *, struct dentry *);
|
|||
extern int __legitimize_mnt(struct vfsmount *, unsigned);
|
||||
extern bool legitimize_mnt(struct vfsmount *, unsigned);
|
||||
|
||||
static inline bool __path_is_mountpoint(const struct path *path)
|
||||
{
|
||||
struct mount *m = __lookup_mnt(path->mnt, path->dentry);
|
||||
return m && likely(!(m->mnt.mnt_flags & MNT_SYNC_UMOUNT));
|
||||
}
|
||||
|
||||
extern void __detach_mounts(struct dentry *dentry);
|
||||
|
||||
static inline void detach_mounts(struct dentry *dentry)
|
||||
|
|
|
|||
Loading…
Reference in a new issue