summaryrefslogtreecommitdiffstats
path: root/src/os/Journal.h
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2008-05-20 21:11:56 +0200
committerSage Weil <sage@newdream.net>2008-05-20 21:11:56 +0200
commit59c757cc572f9436eeec3593392963648d5139c2 (patch)
treed27827980bc6c542e25b15bf2cfaea106a7fe9f0 /src/os/Journal.h
parentmon: shutdown cleanup. fixed leak of MOSDFailure. (diff)
downloadceph-59c757cc572f9436eeec3593392963648d5139c2.tar.xz
ceph-59c757cc572f9436eeec3593392963648d5139c2.zip
filestore, not fakestore. add os/ dir
Diffstat (limited to 'src/os/Journal.h')
-rw-r--r--src/os/Journal.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/os/Journal.h b/src/os/Journal.h
new file mode 100644
index 00000000000..a2aff3130f6
--- /dev/null
+++ b/src/os/Journal.h
@@ -0,0 +1,49 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation. See file COPYING.
+ *
+ */
+
+
+#ifndef __EBOFS_JOURNAL_H
+#define __EBOFS_JOURNAL_H
+
+#include "include/buffer.h"
+#include "include/Context.h"
+#include "common/Finisher.h"
+
+class Journal {
+protected:
+ __u64 fsid;
+ Finisher *finisher;
+
+public:
+ Journal(__u64 f, Finisher *fin) : fsid(f), finisher(fin) { }
+ virtual ~Journal() { }
+
+ virtual int create() = 0;
+ virtual int open(epoch_t epoch) = 0;
+ virtual void close() = 0;
+
+ // writes
+ virtual bool is_writeable() = 0;
+ virtual void make_writeable() = 0;
+ virtual void submit_entry(epoch_t epoch, bufferlist& e, Context *oncommit) = 0;
+ virtual void commit_epoch_start(epoch_t) = 0; // mark epoch boundary
+ virtual void commit_epoch_finish(epoch_t) = 0; // mark prior epoch as committed (we can expire)
+ virtual bool read_entry(bufferlist& bl, epoch_t &e) = 0;
+ virtual bool is_full() = 0;
+
+ // reads/recovery
+
+};
+
+#endif