summaryrefslogtreecommitdiff
path: root/Kernel/Storage
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2022-08-11 21:23:26 +0300
committerLinus Groh <mail@linusgroh.de>2022-08-14 01:09:03 +0100
commitcb68619b7f6e20b8ed74f5dd4bcbc128a9060000 (patch)
tree8b8beb42753ae2ae5cd31705938121abd08b7800 /Kernel/Storage
parent0d6315dcc8ba23ef82789f84f57ba1b97d9eec07 (diff)
downloadserenity-cb68619b7f6e20b8ed74f5dd4bcbc128a9060000.zip
Kernel/Storage: Safely increment the Controller atomic ID counter
Diffstat (limited to 'Kernel/Storage')
-rw-r--r--Kernel/Storage/StorageManagement.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Kernel/Storage/StorageManagement.cpp b/Kernel/Storage/StorageManagement.cpp
index d2c096e1ae..71c06ef784 100644
--- a/Kernel/Storage/StorageManagement.cpp
+++ b/Kernel/Storage/StorageManagement.cpp
@@ -246,9 +246,7 @@ MinorNumber StorageManagement::generate_storage_minor_number()
u32 StorageManagement::generate_controller_id()
{
- auto controller_id = s_controller_id.load();
- s_controller_id++;
- return controller_id;
+ return s_controller_id.fetch_add(1);
}
NonnullRefPtr<FileSystem> StorageManagement::root_filesystem() const