mirror of
https://github.com/ceph/ceph
synced 2025-01-04 02:02:36 +00:00
librbd: replace atomic_t with std::atomic<int>
it fails to compile with clang, and turns out it should be `ceph::atomic_t`, but I take this chance to replace it with std::atomic<> to phase out atomic_t. Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
64361c3986
commit
9c3f821936
@ -52,7 +52,7 @@ int Operations<I>::flatten(ProgressContext &prog_ctx) {
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t request_id = m_async_request_seq.inc();
|
||||
uint64_t request_id = ++m_async_request_seq;
|
||||
r = invoke_async_request("flatten", false,
|
||||
boost::bind(&Operations<I>::flatten, this,
|
||||
boost::ref(prog_ctx), _1),
|
||||
@ -129,7 +129,7 @@ int Operations<I>::rebuild_object_map(ProgressContext &prog_ctx) {
|
||||
return r;
|
||||
}
|
||||
|
||||
uint64_t request_id = m_async_request_seq.inc();
|
||||
uint64_t request_id = ++m_async_request_seq;
|
||||
r = invoke_async_request("rebuild object map", true,
|
||||
boost::bind(&Operations<I>::rebuild_object_map, this,
|
||||
boost::ref(prog_ctx), _1),
|
||||
@ -245,7 +245,7 @@ int Operations<I>::resize(uint64_t size, ProgressContext& prog_ctx) {
|
||||
return r;
|
||||
}
|
||||
|
||||
uint64_t request_id = m_async_request_seq.inc();
|
||||
uint64_t request_id = ++m_async_request_seq;
|
||||
r = invoke_async_request("resize", false,
|
||||
boost::bind(&Operations<I>::resize, this,
|
||||
size, boost::ref(prog_ctx), _1, 0),
|
||||
|
@ -5,7 +5,7 @@
|
||||
#define CEPH_LIBRBD_OPERATIONS_H
|
||||
|
||||
#include "include/int_types.h"
|
||||
#include "include/atomic.h"
|
||||
#include <atomic>
|
||||
#include <string>
|
||||
#include <boost/function.hpp>
|
||||
|
||||
@ -59,7 +59,7 @@ public:
|
||||
|
||||
private:
|
||||
ImageCtxT &m_image_ctx;
|
||||
atomic_t m_async_request_seq;
|
||||
std::atomic<int> m_async_request_seq;
|
||||
|
||||
int invoke_async_request(const std::string& request_type,
|
||||
bool permit_snapshot,
|
||||
|
Loading…
Reference in New Issue
Block a user