From: Colin Patrick McCabe Date: Mon, 27 Sep 2010 19:06:06 +0000 (-0700) Subject: Rename interval_set::begin and end X-Git-Tag: v0.22~95 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fb41b8f823ab0787cce366dadef5146021fd4db1;p=ceph.git Rename interval_set::begin and end Rename interval_set::begin and end to interval_set::range_begin and interval_set::range_end, respectively. --- diff --git a/src/client/Client.h b/src/client/Client.h index 31903dc3fa89..b173a803aed8 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -907,7 +907,7 @@ protected: hash_map fd_map; int get_fd() { - int fd = free_fd_set.start(); + int fd = free_fd_set.range_start(); free_fd_set.erase(fd, 1); return fd; } diff --git a/src/include/interval_set.h b/src/include/interval_set.h index 39c0d34930ed..a8e7fc53e41e 100644 --- a/src/include/interval_set.h +++ b/src/include/interval_set.h @@ -151,12 +151,12 @@ class interval_set { bool empty() const { return m.empty(); } - T start() const { + T range_start() const { assert(!empty()); typename map::const_iterator p = m.begin(); return p->first; } - T end() const { + T range_end() const { assert(!empty()); typename map::const_iterator p = m.end(); p--; diff --git a/src/mds/InoTable.cc b/src/mds/InoTable.cc index 1e305117d4f8..7f3cf4d5481a 100644 --- a/src/mds/InoTable.cc +++ b/src/mds/InoTable.cc @@ -45,7 +45,7 @@ inodeno_t InoTable::project_alloc_id(inodeno_t id) dout(10) << "project_alloc_id " << id << " to " << projected_free << "/" << free << dendl; assert(is_active()); if (!id) - id = projected_free.start(); + id = projected_free.range_start(); projected_free.erase(id); ++projected_version; return id; @@ -61,7 +61,7 @@ void InoTable::project_alloc_ids(interval_set& ids, int want) { assert(is_active()); while (want > 0) { - inodeno_t start = projected_free.start(); + inodeno_t start = projected_free.range_start(); inodeno_t end = projected_free.end_after(start); inodeno_t num = end - start; if (num > (inodeno_t)want) diff --git a/src/mds/SessionMap.h b/src/mds/SessionMap.h index 661a6bd61b47..375136755eb7 100644 --- a/src/mds/SessionMap.h +++ b/src/mds/SessionMap.h @@ -95,7 +95,7 @@ public: inodeno_t next_ino() { if (prealloc_inos.empty()) return 0; - return prealloc_inos.start(); + return prealloc_inos.range_start(); } inodeno_t take_ino(inodeno_t ino = 0) { assert(!prealloc_inos.empty()); @@ -107,7 +107,7 @@ public: ino = 0; } if (!ino) { - ino = prealloc_inos.start(); + ino = prealloc_inos.range_start(); prealloc_inos.erase(ino); } used_inos.insert(ino, 1); diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 0c6371b87875..dab596a81a2c 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -3722,7 +3722,7 @@ void OSD::_process_pg_info(epoch_t epoch, int from, dout(10) << " purged_snaps " << pg->info.purged_snaps << " -> " << info.purged_snaps << " removed " << p << dendl; - snapid_t sn = p.start(); + snapid_t sn = p.range_start(); coll_t c = coll_t::build_snap_pg_coll(info.pgid, sn); t->remove_collection(c); diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 77e14e54c640..db7c0ecc5b8b 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -11,7 +11,6 @@ * */ - #include "ReplicatedPG.h" #include "OSD.h" #include "PGLS.h" @@ -494,7 +493,7 @@ bool ReplicatedPG::snap_trimmer() is_primary() && is_active()) { - snapid_t sn = snap_trimq.start(); + snapid_t sn = snap_trimq.range_start(); coll_t c = coll_t::build_snap_pg_coll(info.pgid, sn); vector ls; osd->store->collection_list(c, ls); @@ -2963,15 +2962,15 @@ void ReplicatedPG::sub_op_push_reply(MOSDSubOpReply *reply) bool complete = false; if (pi->data_subset.empty() || - pi->data_subset.end() == pi->data_subset_pushing.end()) + pi->data_subset.range_end() == pi->data_subset_pushing.range_end()) complete = true; if (!complete) { // push more - uint64_t from = pi->data_subset_pushing.end(); + uint64_t from = pi->data_subset_pushing.range_end(); pi->data_subset_pushing.span_of(pi->data_subset, from, g_conf.osd_recovery_max_chunk); dout(10) << " pushing more, " << pi->data_subset_pushing << " of " << pi->data_subset << dendl; - complete = pi->data_subset.end() == pi->data_subset_pushing.end(); + complete = pi->data_subset.range_end() == pi->data_subset_pushing.range_end(); send_push_op(soid, peer, pi->size, false, complete, pi->data_subset_pushing, pi->clone_subsets); } else { // done! @@ -3032,7 +3031,7 @@ void ReplicatedPG::sub_op_pull(MOSDSubOp *op) uint64_t size = st.st_size; bool complete = false; - if (!op->data_subset.empty() && op->data_subset.end() >= size) + if (!op->data_subset.empty() && op->data_subset.range_end() >= size) complete = true; // complete==true implies we are definitely complete. @@ -3205,7 +3204,7 @@ void ReplicatedPG::sub_op_push(MOSDSubOp *op) if (pi->data_subset.empty()) { complete = true; } else { - complete = pi->data_subset.end() == data_subset.end(); + complete = pi->data_subset.range_end() == data_subset.range_end(); } if (op->complete && !complete) { @@ -3362,7 +3361,7 @@ void ReplicatedPG::sub_op_push(MOSDSubOp *op) uptodate_set.insert(osd->get_nodeid()); } else { // pull more - pi->data_subset_pulling.span_of(pi->data_subset, data_subset.end(), g_conf.osd_recovery_max_chunk); + pi->data_subset_pulling.span_of(pi->data_subset, data_subset.range_end(), g_conf.osd_recovery_max_chunk); dout(10) << " pulling more, " << pi->data_subset_pulling << " of " << pi->data_subset << dendl; send_pull_op(soid, v, false, pi->data_subset_pulling, pi->from); }