# include <libaio.h>
#endif
+/**
+ * Implements journaling on top of block device or file.
+ *
+ * Lock ordering is write_lock > aio_lock > queue_lock > flush_lock
+ */
class FileJournal : public Journal {
public:
+ /// Protected by queue_lock
struct completion_item {
uint64_t seq;
Context *finish;
void submit_entry(uint64_t seq, bufferlist& bl, int alignment,
Context *oncommit,
TrackedOpRef osd_op = TrackedOpRef());
+ /// End protected by queue_lock
/*
* journal header
private:
string fn;
+ /// Protected by flush_lock
Mutex flush_lock;
Cond write_empty_cond;
bool writing;
+ /// End protected by flush_lock
char *zero_buf;
#ifdef HAVE_LIBAIO
/// state associated with an in-flight aio request
+ /// Protected by aio_lock
struct aio_info {
struct iocb iocb;
bufferlist bl;
io_context_t aio_ctx;
list<aio_info> aio_queue;
int aio_num, aio_bytes;
+ /// End protected by aio_lock
#endif
uint64_t last_committed_seq;