summaryrefslogtreecommitdiffstats
path: root/fs/mount.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-09-29 17:24:49 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2013-10-25 05:34:59 +0200
commit719ea2fbb553ab3f61a174a4b5861289dcc46cb1 (patch)
tree00c1e2c71caf2338cfe27f2854cf331515b4f411 /fs/mount.h
parentdon't bother with vfsmount_lock in mounts_poll() (diff)
downloadlinux-719ea2fbb553ab3f61a174a4b5861289dcc46cb1.tar.xz
linux-719ea2fbb553ab3f61a174a4b5861289dcc46cb1.zip
new helpers: lock_mount_hash/unlock_mount_hash
aka br_write_{lock,unlock} of vfsmount_lock. Inlines in fs/mount.h, vfsmount_lock extern moved over there as well. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/mount.h')
-rw-r--r--fs/mount.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/mount.h b/fs/mount.h
index 3168dc41bad5..7076f25af35d 100644
--- a/fs/mount.h
+++ b/fs/mount.h
@@ -1,6 +1,7 @@
#include <linux/mount.h>
#include <linux/seq_file.h>
#include <linux/poll.h>
+#include <linux/lglock.h>
struct mnt_namespace {
atomic_t count;
@@ -83,6 +84,18 @@ static inline void get_mnt_ns(struct mnt_namespace *ns)
atomic_inc(&ns->count);
}
+extern struct lglock vfsmount_lock;
+
+static inline void lock_mount_hash(void)
+{
+ br_write_lock(&vfsmount_lock);
+}
+
+static inline void unlock_mount_hash(void)
+{
+ br_write_unlock(&vfsmount_lock);
+}
+
struct proc_mounts {
struct seq_file m;
struct mnt_namespace *ns;