+
+__DEFINE_LXSYSCALL4(int,
+ mount,
+ const char*,
+ source,
+ const char*,
+ target,
+ const char*,
+ fstype,
+ int,
+ options)
+{
+ struct device* device = NULL;
+ struct v_dnode *dev = NULL, *mnt = NULL;
+ int errno = 0;
+
+ // It is fine if source is not exist, as some mounting don't require it
+ vfs_walk(__current->cwd, source, &dev, NULL, 0);
+
+ if ((errno = vfs_walk(__current->cwd, target, &mnt, NULL, 0))) {
+ goto done;
+ }
+
+ if (mnt->ref_count > 1) {
+ errno = EBUSY;
+ goto done;
+ }
+
+ if (mnt->mnt->mnt_point == mnt) {
+ errno = EBUSY;
+ goto done;
+ }
+
+ if (dev) {
+ if (!check_voldev_node(dev->inode)) {
+ errno = ENOTDEV;
+ goto done;
+ }
+
+ device = resolve_device(dev->inode->data);
+ assert(device);
+ }
+
+ errno = vfs_mount_at(fstype, device, mnt, options);
+
+done:
+ return DO_STATUS(errno);
+}
+
+__DEFINE_LXSYSCALL1(int, unmount, const char*, target)
+{
+ return vfs_unmount(target);
+}
\ No newline at end of file