From 0a952e9b5d39deddfa1bef250224b03257588796 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Sat, 8 May 2021 10:15:05 +0200 Subject: [PATCH] librbd/cache/pwl: fix AbstractWriteLog::check_allocation() signature All parameters are integers and none of them are (in-)out, so don't take them by reference. Additionally num_lanes, num_log_entries and num_unpublished_reserves don't need to be 64-bit as their respective fields in AbstractWriteLog are 32-bit. Signed-off-by: Ilya Dryomov (cherry picked from commit 74ecc4b76a10c53be928807b5be077f080d34724) --- src/librbd/cache/pwl/AbstractWriteLog.cc | 8 ++++---- src/librbd/cache/pwl/AbstractWriteLog.h | 8 +++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/librbd/cache/pwl/AbstractWriteLog.cc b/src/librbd/cache/pwl/AbstractWriteLog.cc index 36539034e8f..5332424d42a 100644 --- a/src/librbd/cache/pwl/AbstractWriteLog.cc +++ b/src/librbd/cache/pwl/AbstractWriteLog.cc @@ -1458,10 +1458,10 @@ void AbstractWriteLog::alloc_and_dispatch_io_req(C_BlockIORequestT *req) } template -bool AbstractWriteLog::check_allocation(C_BlockIORequestT *req, - uint64_t &bytes_cached, uint64_t &bytes_dirtied, uint64_t &bytes_allocated, - uint64_t &num_lanes, uint64_t &num_log_entries, - uint64_t &num_unpublished_reserves) { +bool AbstractWriteLog::check_allocation( + C_BlockIORequestT *req, uint64_t bytes_cached, uint64_t bytes_dirtied, + uint64_t bytes_allocated, uint32_t num_lanes, uint32_t num_log_entries, + uint32_t num_unpublished_reserves) { bool alloc_succeeds = true; bool no_space = false; { diff --git a/src/librbd/cache/pwl/AbstractWriteLog.h b/src/librbd/cache/pwl/AbstractWriteLog.h index 5e61965bfc5..09c20d4683b 100644 --- a/src/librbd/cache/pwl/AbstractWriteLog.h +++ b/src/librbd/cache/pwl/AbstractWriteLog.h @@ -351,11 +351,9 @@ protected: void complete_op_log_entries(pwl::GenericLogOperations &&ops, const int r); bool check_allocation( - C_BlockIORequestT *req, - uint64_t &bytes_cached, uint64_t &bytes_dirtied, - uint64_t &bytes_allocated, - uint64_t &num_lanes, uint64_t &num_log_entries, - uint64_t &num_unpublished_reserves); + C_BlockIORequestT *req, uint64_t bytes_cached, uint64_t bytes_dirtied, + uint64_t bytes_allocated, uint32_t num_lanes, uint32_t num_log_entries, + uint32_t num_unpublished_reserves); void append_scheduled( pwl::GenericLogOperations &ops, bool &ops_remain, bool &appending, bool isRWL=false); -- 2.47.3