- dev_name,
- fs_name,
- options,
- errno);
- vfs_d_assign_sb(mnt_point, old_sb);
- vfs_sb_free(sb);
- __vfs_release_vmnt(mnt_point->mnt);
+ dev_name, fsname, options, errno);
+
+ __vfs_detach_vmnt(mnt_point->mnt);
+ vfs_d_assign_vmnt(mnt_point, parent_mnt);
+
+ mnt_point->mnt = parent_mnt;
+
+ return errno;
+}
+
+int
+vfs_mount_at(const char* fs_name,
+ struct device* device,
+ struct v_dnode* mnt_point,
+ int options)
+{
+ if (fs_name) {
+ struct filesystem* fs = fsm_get(fs_name);
+ if (!fs) {
+ return ENODEV;
+ }
+
+ return vfs_mount_fsat(fs, device, mnt_point, options);
+ }
+
+ int errno = ENODEV;
+ struct fs_iter fsi;
+
+ fsm_itbegin(&fsi);
+ while (fsm_itnext(&fsi))
+ {
+ if ((fsi.fs->types & FSTYPE_PSEUDO)) {
+ continue;
+ }
+
+ INFO("mount attempt: %s", HSTR_VAL(fsi.fs->fs_name));
+ errno = vfs_mount_fsat(fsi.fs, device, mnt_point, options);
+ if (!errno) {
+ break;
+ }
+ }