1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

sys_fs: Improved lv2_fs_object constructor

This commit is contained in:
brian218 2023-05-01 21:07:24 +08:00 committed by Ivan
parent a7e1bc34de
commit 43184a271f
2 changed files with 5 additions and 7 deletions

View File

@ -307,7 +307,6 @@ bool lv2_fs_object::vfs_unmount(std::string_view vpath)
lv2_fs_object::lv2_fs_object(utils::serial& ar, bool)
: name(ar)
, mp(get_mp(name.data()))
{
}

View File

@ -173,12 +173,11 @@ struct lv2_fs_object
const std::array<char, 0x420> name;
// Mount Point
const std::add_pointer_t<lv2_fs_mount_point> mp;
lv2_fs_mount_point* const mp = get_mp(name.data());
protected:
lv2_fs_object(lv2_fs_mount_point* mp, std::string_view filename)
lv2_fs_object(std::string_view filename)
: name(get_name(filename))
, mp(mp)
{
}
@ -235,7 +234,7 @@ struct lv2_file final : lv2_fs_object
} restore_data{};
lv2_file(std::string_view filename, fs::file&& file, s32 mode, s32 flags, const std::string& real_path, lv2_file_type type = {})
: lv2_fs_object(lv2_fs_object::get_mp(filename), filename)
: lv2_fs_object(filename)
, file(std::move(file))
, mode(mode)
, flags(flags)
@ -245,7 +244,7 @@ struct lv2_file final : lv2_fs_object
}
lv2_file(const lv2_file& host, fs::file&& file, s32 mode, s32 flags, const std::string& real_path, lv2_file_type type = {})
: lv2_fs_object(host.mp, host.name.data())
: lv2_fs_object(host.name.data())
, file(std::move(file))
, mode(mode)
, flags(flags)
@ -309,7 +308,7 @@ struct lv2_dir final : lv2_fs_object
atomic_t<u64> pos{0};
lv2_dir(std::string_view filename, std::vector<fs::dir_entry>&& entries)
: lv2_fs_object(lv2_fs_object::get_mp(filename), filename)
: lv2_fs_object(filename)
, entries(std::move(entries))
{
}