std::atomic_int ioc_reap_count = {0};
protected:
- uint64_t size;
- uint64_t block_size;
+ uint64_t size = 0;
+ uint64_t block_size = 0;
bool support_discard = false;
bool rotational = true;
bool lock_exclusive = true;
void *aio_callback_priv;
BlockDevice(CephContext* cct, aio_callback_t cb, void *cbpriv)
: cct(cct),
- size(0),
- block_size(0),
aio_callback(cb),
aio_callback_priv(cbpriv)
{}
struct FileReaderBuffer {
MEMPOOL_CLASS_HELPERS();
- uint64_t bl_off; ///< prefetch buffer logical offset
+ uint64_t bl_off = 0; ///< prefetch buffer logical offset
bufferlist bl; ///< prefetch buffer
- uint64_t pos; ///< current logical offset
+ uint64_t pos = 0; ///< current logical offset
uint64_t max_prefetch; ///< max allowed prefetch
explicit FileReaderBuffer(uint64_t mpf)
- : bl_off(0),
- pos(0),
- max_prefetch(mpf) {}
+ : max_prefetch(mpf) {}
- uint64_t get_buf_end() {
+ uint64_t get_buf_end() const {
return bl_off + bl.length();
}
- uint64_t get_buf_remaining(uint64_t p) {
+ uint64_t get_buf_remaining(uint64_t p) const {
if (p >= bl_off && p < bl_off + bl.length())
return bl_off + bl.length() - p;
return 0;