Signed-off-by: Jason Dillaman <dillaman@redhat.com>
assert(m_recorder == NULL);
}
+int Journaler::exists(bool *header_exists) const {
+ int r = m_header_ioctx.stat(m_header_oid, NULL, NULL);
+ if (r < 0 && r != -ENOENT) {
+ return r;
+ }
+
+ *header_exists = (r == 0);
+ return 0;
+}
+
void Journaler::init(Context *on_init) {
m_metadata->init(new C_InitJournaler(this, on_init));
}
const std::string &client_id, double commit_interval);
~Journaler();
+ int exists(bool *header_exists) const;
int create(uint8_t order, uint8_t splay_width, int64_t pool_id);
int remove();
}
};
- librados::IoCtx m_header_ioctx;
+ mutable librados::IoCtx m_header_ioctx;
librados::IoCtx m_data_ioctx;
CephContext *m_cct;
std::string m_client_id;