drm/rockchip: vop: report error when check resource error
[firefly-linux-kernel-4.4.55.git] / fs / pnode.c
index 99899705b1055411723c3e5919ecbc1f50139e14..cbaa998ad6252ae36ba587bd3856d812bde7dd1f 100644 (file)
@@ -458,3 +458,32 @@ int propagate_umount(struct list_head *list)
                __propagate_umount(mnt);
        return 0;
 }
+
+/*
+ *  Iterates over all slaves, and slaves of slaves.
+ */
+static struct mount *next_descendent(struct mount *root, struct mount *cur)
+{
+       if (!IS_MNT_NEW(cur) && !list_empty(&cur->mnt_slave_list))
+               return first_slave(cur);
+       do {
+               if (cur->mnt_slave.next != &cur->mnt_master->mnt_slave_list)
+                       return next_slave(cur);
+               cur = cur->mnt_master;
+       } while (cur != root);
+       return NULL;
+}
+
+void propagate_remount(struct mount *mnt)
+{
+       struct mount *m = mnt;
+       struct super_block *sb = mnt->mnt.mnt_sb;
+
+       if (sb->s_op->copy_mnt_data) {
+               m = next_descendent(mnt, m);
+               while (m) {
+                       sb->s_op->copy_mnt_data(m->mnt.data, mnt->mnt.data);
+                       m = next_descendent(mnt, m);
+               }
+       }
+}