27
28
int write_bl_ss(bufferlist& bl, const char *a, const char *b, bool append, bool sync=true);
31
class Error : public std::exception
34
static Error FromErrno(const char *prefix,
35
const char *prefix2, int errno_);
36
Error(const std::string &str_);
37
virtual ~Error() throw ();
38
const char *what() const throw ();
29
43
MonitorStore(const char *d) : dir(d) { }
30
44
~MonitorStore() { }
52
66
bool exists_bl_sn(const char *a, version_t b) {
54
sprintf(bs, "%llu", (unsigned long long)b);
68
snprintf(bs, sizeof(bs), "%llu", (unsigned long long)b);
55
69
return exists_bl_ss(a, bs);
57
71
int get_bl_sn(bufferlist& bl, const char *a, version_t b) {
59
sprintf(bs, "%llu", (unsigned long long)b);
73
snprintf(bs, sizeof(bs), "%llu", (unsigned long long)b);
60
74
return get_bl_ss(bl, a, bs);
62
76
int put_bl_sn(bufferlist& bl, const char *a, version_t b, bool sync=true) {
64
sprintf(bs, "%llu", (unsigned long long)b);
78
snprintf(bs, sizeof(bs), "%llu", (unsigned long long)b);
65
79
return put_bl_ss(bl, a, bs, sync);
68
82
int erase_ss(const char *a, const char *b);
69
83
int erase_sn(const char *a, version_t b) {
71
sprintf(bs, "%llu", (unsigned long long)b);
85
snprintf(bs, sizeof(bs), "%llu", (unsigned long long)b);
72
86
return erase_ss(a, bs);