allow attaching fs_pin to a group not associated with some superblock

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/fs/fs_pin.c b/fs/fs_pin.c
index 5eb39a9..50ef7d2 100644
--- a/fs/fs_pin.c
+++ b/fs/fs_pin.c
@@ -14,14 +14,20 @@
 	spin_unlock(&pin_lock);
 }
 
-void pin_insert(struct fs_pin *pin, struct vfsmount *m)
+void pin_insert_group(struct fs_pin *pin, struct vfsmount *m, struct hlist_head *p)
 {
 	spin_lock(&pin_lock);
-	hlist_add_head(&pin->s_list, &m->mnt_sb->s_pins);
+	if (p)
+		hlist_add_head(&pin->s_list, p);
 	hlist_add_head(&pin->m_list, &real_mount(m)->mnt_pins);
 	spin_unlock(&pin_lock);
 }
 
+void pin_insert(struct fs_pin *pin, struct vfsmount *m)
+{
+	pin_insert_group(pin, m, &m->mnt_sb->s_pins);
+}
+
 void mnt_pin_kill(struct mount *m)
 {
 	while (1) {
@@ -38,18 +44,18 @@
 	}
 }
 
-void sb_pin_kill(struct super_block *sb)
+void group_pin_kill(struct hlist_head *p)
 {
 	while (1) {
-		struct hlist_node *p;
+		struct hlist_node *q;
 		struct fs_pin *pin;
 		rcu_read_lock();
-		p = ACCESS_ONCE(sb->s_pins.first);
-		if (!p) {
+		q = ACCESS_ONCE(p->first);
+		if (!q) {
 			rcu_read_unlock();
 			break;
 		}
-		pin = hlist_entry(p, struct fs_pin, s_list);
+		pin = hlist_entry(q, struct fs_pin, s_list);
 		pin->kill(pin);
 	}
 }
diff --git a/fs/internal.h b/fs/internal.h
index e9a61fe..a6efd2f 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -145,7 +145,7 @@
 /*
  * fs_pin.c
  */
-extern void sb_pin_kill(struct super_block *sb);
+extern void group_pin_kill(struct hlist_head *p);
 extern void mnt_pin_kill(struct mount *m);
 
 /*
diff --git a/fs/super.c b/fs/super.c
index eae088f..2d82245 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -706,9 +706,9 @@
 	remount_ro = (flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY);
 
 	if (remount_ro) {
-		if (sb->s_pins.first) {
+		if (!hlist_empty(&sb->s_pins)) {
 			up_write(&sb->s_umount);
-			sb_pin_kill(sb);
+			group_pin_kill(&sb->s_pins);
 			down_write(&sb->s_umount);
 			if (!sb->s_root)
 				return 0;