Adapt FS to tl::identifier no longer having an invalid value #1
@@ -23,7 +23,7 @@ public:
|
|||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// New API
|
// New API
|
||||||
|
|
||||||
TL_DECLARE_INTEGRAL_ID(PackId, uint64_t, 0)
|
TL_DECLARE_INTEGRAL_ID(PackId, uint64_t)
|
||||||
|
|
||||||
tl::result<PackId> mountFront(AbsPath mountPoint, tl::unique_ref<IPack> pack);
|
tl::result<PackId> mountFront(AbsPath mountPoint, tl::unique_ref<IPack> pack);
|
||||||
tl::result<PackId> mountBack(AbsPath mountPoint, tl::unique_ref<IPack> pack);
|
tl::result<PackId> mountBack(AbsPath mountPoint, tl::unique_ref<IPack> pack);
|
||||||
@@ -74,8 +74,9 @@ private:
|
|||||||
tl::unique_ref<IPack> pack;
|
tl::unique_ref<IPack> pack;
|
||||||
AbsPath mountPoint;
|
AbsPath mountPoint;
|
||||||
|
|
||||||
explicit PackData(tl::unique_ref<IPack>&& pack) noexcept
|
explicit PackData(tl::unique_ref<IPack>&& pack, PackId i_packId) noexcept
|
||||||
: pack(std::move(pack))
|
: pack(std::move(pack))
|
||||||
|
, id(i_packId)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
PackData(PackData&& other) noexcept = default;
|
PackData(PackData&& other) noexcept = default;
|
||||||
|
|||||||
@@ -575,7 +575,6 @@ void CustomFilesystem::convertToPackPath(AbsPath& packPath, const AbsPath& path,
|
|||||||
|
|
||||||
tl::result<CustomFilesystem::PackId> CustomFilesystem::mount(AbsPath mountPoint, tl::unique_ref<IPack> pack, MountPolicy policy)
|
tl::result<CustomFilesystem::PackId> CustomFilesystem::mount(AbsPath mountPoint, tl::unique_ref<IPack> pack, MountPolicy policy)
|
||||||
{
|
{
|
||||||
PackData data(std::move(pack));
|
|
||||||
|
|
||||||
if (!mountPoint.is_valid())
|
if (!mountPoint.is_valid())
|
||||||
return tl::make_generic_error("Invalid mount point");
|
return tl::make_generic_error("Invalid mount point");
|
||||||
@@ -585,7 +584,7 @@ tl::result<CustomFilesystem::PackId> CustomFilesystem::mount(AbsPath mountPoint,
|
|||||||
return tl::make_generic_error("Invalid shadowing (mount point shadowing a file)");
|
return tl::make_generic_error("Invalid shadowing (mount point shadowing a file)");
|
||||||
|
|
||||||
const PackId id(++s_lastId);
|
const PackId id(++s_lastId);
|
||||||
data.id = id;
|
PackData data(std::move(pack), id);
|
||||||
data.mountPoint = std::move(mountPoint);
|
data.mountPoint = std::move(mountPoint);
|
||||||
|
|
||||||
switch (policy)
|
switch (policy)
|
||||||
|
|||||||
Reference in New Issue
Block a user