mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 11:47:35 +00:00
Kernel: Use TRY() in sys$umount()
This commit is contained in:
parent
76f2596ce8
commit
3580c5a72e
1 changed files with 3 additions and 9 deletions
|
@ -142,15 +142,9 @@ KResultOr<FlatPtr> Process::sys$umount(Userspace<const char*> user_mountpoint, s
|
||||||
|
|
||||||
REQUIRE_NO_PROMISES;
|
REQUIRE_NO_PROMISES;
|
||||||
|
|
||||||
auto mountpoint = get_syscall_path_argument(user_mountpoint, mountpoint_length);
|
auto mountpoint = TRY(get_syscall_path_argument(user_mountpoint, mountpoint_length));
|
||||||
if (mountpoint.is_error())
|
auto custody = TRY(VirtualFileSystem::the().resolve_path(mountpoint->view(), current_directory()));
|
||||||
return mountpoint.error();
|
auto& guest_inode = custody->inode();
|
||||||
|
|
||||||
auto custody_or_error = VirtualFileSystem::the().resolve_path(mountpoint.value()->view(), current_directory());
|
|
||||||
if (custody_or_error.is_error())
|
|
||||||
return custody_or_error.error();
|
|
||||||
|
|
||||||
auto& guest_inode = custody_or_error.value()->inode();
|
|
||||||
return VirtualFileSystem::the().unmount(guest_inode);
|
return VirtualFileSystem::the().unmount(guest_inode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue