mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
Rename interval_set::begin and end
Rename interval_set::begin and end to interval_set::range_begin and interval_set::range_end, respectively.
This commit is contained in:
parent
5a9a5e74df
commit
fb41b8f823
@ -907,7 +907,7 @@ protected:
|
||||
hash_map<int, Fh*> 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;
|
||||
}
|
||||
|
@ -151,12 +151,12 @@ class interval_set {
|
||||
bool empty() const {
|
||||
return m.empty();
|
||||
}
|
||||
T start() const {
|
||||
T range_start() const {
|
||||
assert(!empty());
|
||||
typename map<T,T>::const_iterator p = m.begin();
|
||||
return p->first;
|
||||
}
|
||||
T end() const {
|
||||
T range_end() const {
|
||||
assert(!empty());
|
||||
typename map<T,T>::const_iterator p = m.end();
|
||||
p--;
|
||||
|
@ -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<inodeno_t>& 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)
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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<sobject_t> 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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user