|
@@ -8,14 +8,10 @@
|
|
|
|
|
|
namespace Kernel::Memory {
|
|
|
|
|
|
-LockRefPtr<ScatterGatherList> ScatterGatherList::try_create(AsyncBlockDeviceRequest& request, Span<NonnullRefPtr<PhysicalPage>> allocated_pages, size_t device_block_size)
|
|
|
+ErrorOr<LockRefPtr<ScatterGatherList>> ScatterGatherList::try_create(AsyncBlockDeviceRequest& request, Span<NonnullRefPtr<PhysicalPage>> allocated_pages, size_t device_block_size)
|
|
|
{
|
|
|
- auto maybe_vm_object = AnonymousVMObject::try_create_with_physical_pages(allocated_pages);
|
|
|
- if (maybe_vm_object.is_error()) {
|
|
|
- // FIXME: Would be nice to be able to return a ErrorOr here.
|
|
|
- return {};
|
|
|
- }
|
|
|
- return adopt_lock_ref_if_nonnull(new (nothrow) ScatterGatherList(maybe_vm_object.release_value(), request, device_block_size));
|
|
|
+ auto vm_object = TRY(AnonymousVMObject::try_create_with_physical_pages(allocated_pages));
|
|
|
+ return adopt_lock_ref_if_nonnull(new (nothrow) ScatterGatherList(vm_object, request, device_block_size));
|
|
|
}
|
|
|
|
|
|
ScatterGatherList::ScatterGatherList(NonnullLockRefPtr<AnonymousVMObject> vm_object, AsyncBlockDeviceRequest& request, size_t device_block_size)
|