blob: d82e47aaaa097bb4bf1e88ac1f19fd79f08c4282 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#ifndef CEPH_LIBRBD_WATCHCTX_H
#define CEPH_LIBRBD_WATCHCTX_H
#include <inttypes.h>
#include "include/buffer.h"
#include "include/rados/librados.hpp"
#include "common/Mutex.h"
class ImageCtx;
namespace librbd {
class WatchCtx : public librados::WatchCtx {
ImageCtx *ictx;
bool valid;
Mutex lock;
public:
uint64_t cookie;
WatchCtx(ImageCtx *ctx) : ictx(ctx),
valid(true),
lock("librbd::WatchCtx"),
cookie(0) {}
virtual ~WatchCtx() {}
void invalidate();
virtual void notify(uint8_t opcode, uint64_t ver, ceph::bufferlist& bl);
};
}
#endif
|