mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:37:44 +00:00
Kernel: Convert Mount::absolute_path to ErrorOr<NonnullOwnPtr<KString>>
This commit is contained in:
parent
6be2a51b10
commit
4e7d307166
3 changed files with 10 additions and 5 deletions
|
@ -27,11 +27,11 @@ Mount::Mount(Inode& source, Custody& host_custody, int flags)
|
|||
{
|
||||
}
|
||||
|
||||
String Mount::absolute_path() const
|
||||
ErrorOr<NonnullOwnPtr<KString>> Mount::absolute_path() const
|
||||
{
|
||||
if (!m_host_custody)
|
||||
return "/";
|
||||
return m_host_custody->absolute_path();
|
||||
return KString::try_create("/"sv);
|
||||
return m_host_custody->try_serialize_absolute_path();
|
||||
}
|
||||
|
||||
Inode* Mount::host()
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
FileSystem const& guest_fs() const { return *m_guest_fs; }
|
||||
FileSystem& guest_fs() { return *m_guest_fs; }
|
||||
|
||||
String absolute_path() const;
|
||||
ErrorOr<NonnullOwnPtr<KString>> absolute_path() const;
|
||||
|
||||
int flags() const { return m_flags; }
|
||||
void set_flags(int flags) { m_flags = flags; }
|
||||
|
|
|
@ -358,7 +358,12 @@ private:
|
|||
fs_object.add("free_block_count", fs.free_block_count());
|
||||
fs_object.add("total_inode_count", fs.total_inode_count());
|
||||
fs_object.add("free_inode_count", fs.free_inode_count());
|
||||
fs_object.add("mount_point", mount.absolute_path());
|
||||
auto mount_point_or_error = mount.absolute_path();
|
||||
if (mount_point_or_error.is_error()) {
|
||||
result = mount_point_or_error.release_error();
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
fs_object.add("mount_point", mount_point_or_error.value()->view());
|
||||
fs_object.add("block_size", static_cast<u64>(fs.block_size()));
|
||||
fs_object.add("readonly", fs.is_readonly());
|
||||
fs_object.add("mount_flags", mount.flags());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue