Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-block.git] / include / linux / mount.h
index b43191fe6af7eb9cbac588e41599e05bd32be5f4..5d92a7e1a742d6c91403854282779426f5bfcbb9 100644 (file)
@@ -72,8 +72,15 @@ struct vfsmount {
        struct dentry *mnt_root;        /* root of the mounted tree */
        struct super_block *mnt_sb;     /* pointer to superblock */
        int mnt_flags;
+       struct user_namespace *mnt_userns;
 } __randomize_layout;
 
+static inline struct user_namespace *mnt_user_ns(const struct vfsmount *mnt)
+{
+       /* Pairs with smp_store_release() in do_idmap_mount(). */
+       return smp_load_acquire(&mnt->mnt_userns);
+}
+
 struct file; /* forward dec */
 struct path;