summaryrefslogtreecommitdiff
path: root/src/os/DBObjectMap.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/DBObjectMap.h')
-rw-r--r--src/os/DBObjectMap.h98
1 files changed, 49 insertions, 49 deletions
diff --git a/src/os/DBObjectMap.h b/src/os/DBObjectMap.h
index ba05dff6c6f..459447f9c97 100644
--- a/src/os/DBObjectMap.h
+++ b/src/os/DBObjectMap.h
@@ -26,7 +26,7 @@
* @see user_prefix
* @see sys_prefix
*
- * - HOBJECT_TO_SEQ: Contains leaf mapping from hobject_t->seq and
+ * - GHOBJECT_TO_SEQ: Contains leaf mapping from ghobject_t->hobj.seq and
* corresponding omap header
* - SYS_PREFIX: GLOBAL_STATE_KEY - contains next seq number
* @see State
@@ -66,89 +66,89 @@ public:
* Set of headers currently in use
*/
set<uint64_t> in_use;
- set<hobject_t> map_header_in_use;
+ set<ghobject_t> map_header_in_use;
DBObjectMap(KeyValueDB *db) : db(db),
header_lock("DBOBjectMap")
{}
int set_keys(
- const hobject_t &hoid,
+ const ghobject_t &oid,
const map<string, bufferlist> &set,
const SequencerPosition *spos=0
);
int set_header(
- const hobject_t &hoid,
+ const ghobject_t &oid,
const bufferlist &bl,
const SequencerPosition *spos=0
);
int get_header(
- const hobject_t &hoid,
+ const ghobject_t &oid,
bufferlist *bl
);
int clear(
- const hobject_t &hoid,
+ const ghobject_t &oid,
const SequencerPosition *spos=0
);
int rm_keys(
- const hobject_t &hoid,
+ const ghobject_t &oid,
const set<string> &to_clear,
const SequencerPosition *spos=0
);
int get(
- const hobject_t &hoid,
+ const ghobject_t &oid,
bufferlist *header,
map<string, bufferlist> *out
);
int get_keys(
- const hobject_t &hoid,
+ const ghobject_t &oid,
set<string> *keys
);
int get_values(
- const hobject_t &hoid,
+ const ghobject_t &oid,
const set<string> &keys,
map<string, bufferlist> *out
);
int check_keys(
- const hobject_t &hoid,
+ const ghobject_t &oid,
const set<string> &keys,
set<string> *out
);
int get_xattrs(
- const hobject_t &hoid,
+ const ghobject_t &oid,
const set<string> &to_get,
map<string, bufferlist> *out
);
int get_all_xattrs(
- const hobject_t &hoid,
+ const ghobject_t &oid,
set<string> *out
);
int set_xattrs(
- const hobject_t &hoid,
+ const ghobject_t &oid,
const map<string, bufferlist> &to_set,
const SequencerPosition *spos=0
);
int remove_xattrs(
- const hobject_t &hoid,
+ const ghobject_t &oid,
const set<string> &to_remove,
const SequencerPosition *spos=0
);
int clone(
- const hobject_t &hoid,
- const hobject_t &target,
+ const ghobject_t &oid,
+ const ghobject_t &target,
const SequencerPosition *spos=0
);
@@ -162,13 +162,13 @@ public:
bool check(std::ostream &out);
/// Ensure that all previous operations are durable
- int sync(const hobject_t *hoid=0, const SequencerPosition *spos=0);
+ int sync(const ghobject_t *oid=0, const SequencerPosition *spos=0);
/// Util, list all objects, there must be no other concurrent access
- int list_objects(vector<hobject_t> *objs ///< [out] objects
+ int list_objects(vector<ghobject_t> *objs ///< [out] objects
);
- ObjectMapIterator get_iterator(const hobject_t &hoid);
+ ObjectMapIterator get_iterator(const ghobject_t &oid);
static const string USER_PREFIX;
static const string XATTR_PREFIX;
@@ -223,7 +223,7 @@ public:
uint64_t num_children;
coll_t c;
- hobject_t hoid;
+ ghobject_t oid;
SequencerPosition spos;
@@ -233,7 +233,7 @@ public:
::encode(parent, bl);
::encode(num_children, bl);
::encode(c, bl);
- ::encode(hoid, bl);
+ ::encode(oid, bl);
::encode(spos, bl);
ENCODE_FINISH(bl);
}
@@ -244,7 +244,7 @@ public:
::decode(parent, bl);
::decode(num_children, bl);
::decode(c, bl);
- ::decode(hoid, bl);
+ ::decode(oid, bl);
if (struct_v >= 2)
::decode(spos, bl);
DECODE_FINISH(bl);
@@ -255,7 +255,7 @@ public:
f->dump_unsigned("parent", parent);
f->dump_unsigned("num_children", num_children);
f->dump_stream("coll") << c;
- f->dump_stream("oid") << hoid;
+ f->dump_stream("oid") << oid;
}
static void generate_test_instances(list<_Header*> &o) {
@@ -269,15 +269,15 @@ public:
};
/// String munging (public for testing)
- static string hobject_key(const hobject_t &hoid);
- static string hobject_key_v0(coll_t c, const hobject_t &hoid);
- static bool parse_hobject_key_v0(const string &in,
- coll_t *c, hobject_t *hoid);
+ static string ghobject_key(const ghobject_t &oid);
+ static string ghobject_key_v0(coll_t c, const ghobject_t &oid);
+ static bool parse_ghobject_key_v0(const string &in,
+ coll_t *c, ghobject_t *oid);
private:
/// Implicit lock on Header->seq
typedef std::tr1::shared_ptr<_Header> Header;
- string map_header_key(const hobject_t &hoid);
+ string map_header_key(const ghobject_t &oid);
string header_key(uint64_t seq);
string complete_prefix(Header header);
string user_prefix(Header header);
@@ -368,40 +368,40 @@ private:
/// Set node containing input to new contents
void set_header(Header input, KeyValueDB::Transaction t);
- /// Remove leaf node corresponding to hoid in c
- void remove_map_header(const hobject_t &hoid,
+ /// Remove leaf node corresponding to oid in c
+ void remove_map_header(const ghobject_t &oid,
Header header,
KeyValueDB::Transaction t);
- /// Set leaf node for c and hoid to the value of header
- void set_map_header(const hobject_t &hoid, _Header header,
+ /// Set leaf node for c and oid to the value of header
+ void set_map_header(const ghobject_t &oid, _Header header,
KeyValueDB::Transaction t);
- /// Set leaf node for c and hoid to the value of header
- bool check_spos(const hobject_t &hoid,
+ /// Set leaf node for c and oid to the value of header
+ bool check_spos(const ghobject_t &oid,
Header header,
const SequencerPosition *spos);
- /// Lookup or create header for c hoid
- Header lookup_create_map_header(const hobject_t &hoid,
+ /// Lookup or create header for c oid
+ Header lookup_create_map_header(const ghobject_t &oid,
KeyValueDB::Transaction t);
/**
- * Generate new header for c hoid with new seq number
+ * Generate new header for c oid with new seq number
*
* Has the side effect of syncronously saving the new DBObjectMap state
*/
- Header _generate_new_header(const hobject_t &hoid, Header parent);
- Header generate_new_header(const hobject_t &hoid, Header parent) {
+ Header _generate_new_header(const ghobject_t &oid, Header parent);
+ Header generate_new_header(const ghobject_t &oid, Header parent) {
Mutex::Locker l(header_lock);
- return _generate_new_header(hoid, parent);
+ return _generate_new_header(oid, parent);
}
- /// Lookup leaf header for c hoid
- Header _lookup_map_header(const hobject_t &hoid);
- Header lookup_map_header(const hobject_t &hoid) {
+ /// Lookup leaf header for c oid
+ Header _lookup_map_header(const ghobject_t &oid);
+ Header lookup_map_header(const ghobject_t &oid) {
Mutex::Locker l(header_lock);
- return _lookup_map_header(hoid);
+ return _lookup_map_header(oid);
}
/// Lookup header node for input
@@ -448,12 +448,12 @@ private:
class RemoveMapHeaderOnDelete {
public:
DBObjectMap *db;
- hobject_t obj;
- RemoveMapHeaderOnDelete(DBObjectMap *db, const hobject_t &obj) :
- db(db), obj(obj) {}
+ ghobject_t oid;
+ RemoveMapHeaderOnDelete(DBObjectMap *db, const ghobject_t &oid) :
+ db(db), oid(oid) {}
void operator() (_Header *header) {
Mutex::Locker l(db->header_lock);
- db->map_header_in_use.erase(obj);
+ db->map_header_in_use.erase(oid);
db->map_header_cond.Signal();
delete header;
}