+static int
+_sysio_sub_fsswop_mount(const char *source,
+ unsigned flags,
+ const void *data __IS_UNUSED,
+ struct pnode *tocover,
+ struct mount **mntp)
+{
+ int err;
+ struct nameidata nameidata;
+ struct mount *mnt;
+
+ /*
+ * How can we make a sub-mount from nothing?
+ */
+ if (!_sysio_root)
+ return -EBUSY;
+
+ /*
+ * Lookup the source.
+ */
+ ND_INIT(&nameidata, 0, source, _sysio_root, NULL);
+ err = _sysio_path_walk(_sysio_root, &nameidata);
+ if (err)
+ return err;
+
+ /*
+ * Mount the rooted sub-tree at the given position.
+ */
+ err =
+ _sysio_do_mount(nameidata.nd_pno->p_mount->mnt_fs,
+ nameidata.nd_pno->p_base,
+ nameidata.nd_pno->p_mount->mnt_flags & flags,
+ tocover,
+ &mnt);
+
+ /*
+ * Clean up and return.
+ */
+ if (!err) {
+ FS_REF(nameidata.nd_pno->p_mount->mnt_fs);
+ *mntp = mnt;
+ }
+ P_RELE(nameidata.nd_pno);
+ return err;
+}
+