diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-01-11 22:34:26 +0200 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2022-01-12 16:09:09 +0200 |
commit | 06af81fcfb0c00706f28fb46b8f318bd4441763b (patch) | |
tree | e3571f69c80219cbb5f3cbc3650cdf787fec1b6c | |
parent | 4b74f2e3ecc89a57a56bfbcc907126db7f4ee78d (diff) | |
download | serenity-06af81fcfb0c00706f28fb46b8f318bd4441763b.zip |
Kernel: Move NonnullRefPtrVector<NVMeQueue>s instead of copying them
-rw-r--r-- | Kernel/Storage/NVMe/NVMeNameSpace.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Kernel/Storage/NVMe/NVMeNameSpace.cpp b/Kernel/Storage/NVMe/NVMeNameSpace.cpp index 77a8b70e5f..742bc6c8a0 100644 --- a/Kernel/Storage/NVMe/NVMeNameSpace.cpp +++ b/Kernel/Storage/NVMe/NVMeNameSpace.cpp @@ -7,7 +7,6 @@ #include "NVMeNameSpace.h" #include <AK/NonnullOwnPtr.h> #include <Kernel/Devices/DeviceManagement.h> -#include <Kernel/Storage/NVMe/NVMeNameSpace.h> #include <Kernel/Storage/StorageManagement.h> namespace Kernel { @@ -17,15 +16,14 @@ ErrorOr<NonnullRefPtr<NVMeNameSpace>> NVMeNameSpace::try_create(NonnullRefPtrVec auto minor_number = StorageManagement::generate_storage_minor_number(); auto major_number = StorageManagement::storage_type_major_number(); auto device_name_kstring = TRY(KString::formatted("nvme{:d}n{:d}", controller_id, nsid)); - auto device = TRY(DeviceManagement::try_create_device<NVMeNameSpace>(queues, storage_size, lba_size, major_number.value(), minor_number.value(), nsid, move(device_name_kstring))); - + auto device = TRY(DeviceManagement::try_create_device<NVMeNameSpace>(move(queues), storage_size, lba_size, major_number.value(), minor_number.value(), nsid, move(device_name_kstring))); return device; } NVMeNameSpace::NVMeNameSpace(NonnullRefPtrVector<NVMeQueue> queues, size_t max_addresable_block, size_t lba_size, size_t major_number, size_t minor_number, u16 nsid, NonnullOwnPtr<KString> dev_name) : StorageDevice(major_number, minor_number, lba_size, max_addresable_block, move(dev_name)) , m_nsid(nsid) - , m_queues(queues) + , m_queues(move(queues)) { } |