#include "NVMEDevice.h"
#endif
+#include "common/debug.h"
+
+#define dout_subsys ceph_subsys_bdev
+#undef dout_prefix
+#define dout_prefix *_dout << "bdev "
+
+void IOContext::aio_wait()
+{
+ Mutex::Locker l(lock);
+ // see _aio_thread for waker logic
+ num_waiting.inc();
+ while (num_running.read() > 0 || num_reading.read() > 0) {
+ dout(10) << __func__ << " " << this
+ << " waiting for " << num_running.read() << " aios and/or "
+ << num_reading.read() << " readers to complete" << dendl;
+ cond.Wait(lock);
+ }
+ num_waiting.dec();
+ dout(20) << __func__ << " " << this << " done" << dendl;
+}
+
BlockDevice *BlockDevice::create(const string& type, aio_callback_t cb, void *cbpriv)
{
if (type == "kernel") {
#ifndef CEPH_OS_BLUESTORE_BLOCKDEVICE_H
#define CEPH_OS_BLUESTORE_BLOCKDEVICE_H
+#include "os/fs/FS.h"
+
/// track in-flight io
struct IOContext {
void *priv;
class BlockDevice {
public:
+ virtual ~BlockDevice() {}
typedef void (*aio_callback_t)(void *handle, void *aio);
- static BlockDevice *create(CephContext *cct, const string& type,
- aio_callback_t cb, void *cbpriv);
+ static BlockDevice *create(
+ const string& type, aio_callback_t cb, void *cbpriv);
virtual void aio_submit(IOContext *ioc) = 0;
#ifndef CEPH_OS_BLUESTORE_NVMEDEVICE
#define CEPH_OS_BLUESTORE_NVMEDEVICE
-#include "include/interval_set.h"
-
#include "BlockDevice.h"
class NVMEDevice : public BlockDevice {