Cond cond;
bool ack;
bool safe;
- C_Gather *safeg = new C_Gather(new C_SafeCond(&lock, &cond, &safe));
+ C_Gather *safeg = new C_Gather(&g_ceph_context, new C_SafeCond(&lock, &cond, &safe));
Context *safegref = safeg->new_sub(); // take a ref
while (!t.end()) {
/*
* finish and destroy a list of Contexts
*/
-inline void finish_contexts(std::list<Context*>& finished,
+inline void finish_contexts(CephContext *cct, std::list<Context*>& finished,
int result = 0)
{
if (finished.empty())
list<Context*> ls;
ls.swap(finished); // swap out of place to avoid weird loops
- dout(10) << ls.size() << " contexts to finish with " << result << dendl;
+ ldout(cct,10) << ls.size() << " contexts to finish with " << result << dendl;
for (std::list<Context*>::iterator it = ls.begin();
it != ls.end();
it++) {
Context *c = *it;
- dout(10) << "---- " << c << dendl;
+ ldout(cct,10) << "---- " << c << dendl;
c->finish(result);
delete c;
}
}
-inline void finish_contexts(std::vector<Context*>& finished,
+inline void finish_contexts(CephContext *cct, std::vector<Context*>& finished,
int result = 0)
{
if (finished.empty())
vector<Context*> ls;
ls.swap(finished); // swap out of place to avoid weird loops
- dout(10) << ls.size() << " contexts to finish with " << result << dendl;
+ ldout(cct,10) << ls.size() << " contexts to finish with " << result << dendl;
for (std::vector<Context*>::iterator it = ls.begin();
it != ls.end();
it++) {
Context *c = *it;
- dout(10) << "---- " << c << dendl;
+ ldout(cct,10) << "---- " << c << dendl;
c->finish(result);
delete c;
}
*/
class C_Contexts : public Context {
public:
+ CephContext *cct;
std::list<Context*> contexts;
+ C_Contexts(CephContext *cct_)
+ : cct(cct_)
+ {
+ }
+
void add(Context* c) {
contexts.push_back(c);
}
contexts.splice(contexts.end(), ls);
}
void finish(int r) {
- finish_contexts(contexts, r);
+ finish_contexts(cct, contexts, r);
}
};
*/
class C_Gather : public Context {
private:
+ CephContext *cct;
int result;
Context *onfinish;
#ifdef DEBUG_GATHER
#endif
--sub_existing_count;
- dout(10) << "C_Gather " << this << ".sub_finish(r=" << r << ") " << sub
+ ldout(cct,10) << "C_Gather " << this << ".sub_finish(r=" << r << ") " << sub
#ifdef DEBUG_GATHER
<< " (remaining " << waitfor << ")"
#endif
};
public:
- C_Gather(Context *f=0, bool an=false) : result(0), onfinish(f), sub_created_count(0),
- sub_existing_count(0),
- lock("C_Gather::lock", true, false), //disable lockdep
- any(an),
- activated(onfinish ? true : false) {
- dout(10) << "C_Gather " << this << ".new" << dendl;
+ C_Gather(CephContext *cct_, Context *f=0, bool an=false)
+ : cct(cct_), result(0), onfinish(f), sub_created_count(0),
+ sub_existing_count(0),
+ lock("C_Gather::lock", true, false), //disable lockdep
+ any(an), activated(onfinish ? true : false)
+ {
+ ldout(cct,10) << "C_Gather " << this << ".new" << dendl;
}
~C_Gather() {
- dout(10) << "C_Gather " << this << ".delete" << dendl;
+ ldout(cct,10) << "C_Gather " << this << ".delete" << dendl;
assert(sub_existing_count == 0);
#ifdef DEBUG_GATHER
assert(waitfor.empty());
#ifdef DEBUG_GATHER
waitfor.insert(s);
#endif
- dout(10) << "C_Gather " << this << ".new_sub is " << sub_created_count << " " << s << dendl;
+ ldout(cct,10) << "C_Gather " << this << ".new_sub is " << sub_created_count << " " << s << dendl;
return s;
}
void rm_sub(Context *s) {
list<Context*> finished;
take_waiting(mask, finished);
if (result < 0)
- finish_contexts(finished, result);
+ finish_contexts(&g_ceph_context, finished, result);
else
cache->mds->queue_waiters(finished);
}
new C_Dir_Committed(this, get_version(),
inode->inode.last_renamed_version));
else { // send in a different Context
- C_Gather *gather = new C_Gather(new C_Dir_Committed(this, get_version(),
+ C_Gather *gather = new C_Gather(&g_ceph_context, new C_Dir_Committed(this, get_version(),
inode->inode.last_renamed_version));
while (committed_dn != items.end()) {
ObjectOperation n = ObjectOperation();
dout(10) << "fetch" << dendl;
C_Inode_Fetched *c = new C_Inode_Fetched(this, fin);
- C_Gather *gather = new C_Gather(c);
+ C_Gather *gather = new C_Gather(&g_ceph_context, c);
object_t oid = CInode::get_object_name(ino(), frag_t(), "");
object_locator_t oloc(mdcache->mds->mdsmap->get_metadata_pg_pool());
issue_caps(in);
}
- finish_contexts(finishers);
+ finish_contexts(&g_ceph_context, finishers);
}
void Locker::eval_scatter_gathers(CInode *in)
if (need_issue && in->is_head())
issue_caps(in);
- finish_contexts(finishers);
+ finish_contexts(&g_ceph_context, finishers);
}
void Locker::eval(SimpleLock *lock, bool *need_issue)
{
dout(10) << "parallel_fetch on " << pathmap.size() << " paths" << dendl;
- C_Gather *gather = new C_Gather;
+ C_Gather *gather = new C_Gather(&g_ceph_context);
// scan list
set<CDir*> fetch_queue;
dout(10) << "open_snap_parents" << dendl;
map<client_t,MClientSnap*> splits;
- C_Gather *gather = new C_Gather;
+ C_Gather *gather = new C_Gather(&g_ceph_context);
map<CInode*,map<client_t,set<inodeno_t> > >::iterator p = missing_snap_parents.begin();
while (p != missing_snap_parents.end()) {
p++) {
CDir *dir = *p;
if (!gather)
- gather = new C_Gather(new C_MDC_OpenUndefDirfragsFinish(this));
+ gather = new C_Gather(&g_ceph_context, new C_MDC_OpenUndefDirfragsFinish(this));
dir->fetch(gather->new_sub());
}
}
// waiters
- finish_contexts(error, -ENOENT); // finish errors directly
+ finish_contexts(&g_ceph_context, error, -ENOENT); // finish errors directly
mds->queue_waiters(finished);
// done
return;
}
- C_Gather *gather = new C_Gather(new C_MDC_FragmentFrozen(this, dirs, dir->get_frag(), bits));
+ C_Gather *gather = new C_Gather(&g_ceph_context, new C_MDC_FragmentFrozen(this, dirs, dir->get_frag(), bits));
fragment_freeze_dirs(dirs, gather);
// initial mark+complete pass
int bits = first->get_frag().bits() - frag.bits();
dout(10) << " we are merginb by " << bits << " bits" << dendl;
- C_Gather *gather = new C_Gather(new C_MDC_FragmentFrozen(this, dirs, frag, bits));
+ C_Gather *gather = new C_Gather(&g_ceph_context, new C_MDC_FragmentFrozen(this, dirs, frag, bits));
fragment_freeze_dirs(dirs, gather);
// initial mark+complete pass
if (!dir->is_complete()) {
dout(15) << " fetching incomplete " << *dir << dendl;
if (!gather)
- gather = new C_Gather(new C_MDC_FragmentMarking(this, dirs));
+ gather = new C_Gather(&g_ceph_context,
+ new C_MDC_FragmentMarking(this, dirs));
dir->fetch(gather->new_sub(),
true); // ignore authpinnability
}
*/
// freeze, journal, and store resulting frags
- C_Gather *gather = new C_Gather(new C_MDC_FragmentLoggedAndStored(this, mut, resultfrags, basefrag, bits));
+ C_Gather *gather = new C_Gather(&g_ceph_context,
+ new C_MDC_FragmentLoggedAndStored(this, mut,
+ resultfrags, basefrag, bits));
for (list<CDir*>::iterator p = resultfrags.begin();
p != resultfrags.end();
}
dout(10) << "_replay_thread kicking waiters" << dendl;
- finish_contexts(waitfor_replay, 0);
+ finish_contexts(&g_ceph_context, waitfor_replay, 0);
dout(10) << "_replay_thread finish" << dendl;
mds->mds_lock.Unlock();
{
dout(3) << "boot_create" << dendl;
- C_Gather *fin = new C_Gather(new C_MDS_CreateFinish(this));
+ C_Gather *fin = new C_Gather(&g_ceph_context, new C_MDS_CreateFinish(this));
mdcache->init_layouts();
case 1:
{
- C_Gather *gather = new C_Gather(new C_MDS_BootStart(this, 2));
+ C_Gather *gather = new C_Gather(&g_ceph_context, new C_MDS_BootStart(this, 2));
dout(2) << "boot_start " << step << ": opening inotable" << dendl;
inotable->load(gather->new_sub());
{
dout(2) << "boot_start " << step << ": loading/discovering base inodes" << dendl;
- C_Gather *gather = new C_Gather(new C_MDS_BootStart(this, 3));
+ C_Gather *gather = new C_Gather(&g_ceph_context, new C_MDS_BootStart(this, 3));
mdcache->open_mydir_inode(gather->new_sub());
reopen_log();
server->reconnect_clients();
- finish_contexts(waiting_for_reconnect);
+ finish_contexts(&g_ceph_context, waiting_for_reconnect);
}
void MDS::reconnect_done()
{
void MDS::clientreplay_start()
{
dout(1) << "clientreplay_start" << dendl;
- finish_contexts(waiting_for_replay); // kick waiters
+ finish_contexts(&g_ceph_context, waiting_for_replay); // kick waiters
queue_one_replay();
}
mdcache->clean_open_file_lists();
mdcache->scan_stray_dir();
- finish_contexts(waiting_for_replay); // kick waiters
- finish_contexts(waiting_for_active); // kick waiters
+ finish_contexts(&g_ceph_context, waiting_for_replay); // kick waiters
+ finish_contexts(&g_ceph_context, waiting_for_active); // kick waiters
}
ls.splice(ls.end(), waitfor_save.begin()->second);
waitfor_save.erase(waitfor_save.begin());
}
- finish_contexts(ls,0);
+ finish_contexts(&g_ceph_context, ls,0);
}
assert(g_conf->mds_kill_export_at != 13);
// finish export (adjust local cache state)
- C_Contexts *fin = new C_Contexts;
+ C_Contexts *fin = new C_Contexts(&g_ceph_context);
finish_export_dir(dir, fin->contexts, g_clock.now());
dir->add_waiter(CDir::WAIT_UNFREEZE, fin);
vector<Anchor> trace;
destdn->make_anchor_trace(trace, srcdnl->get_inode());
- anchorgather = new C_Gather(new C_MDS_RetryRequest(mdcache, mdr));
+ anchorgather = new C_Gather(&g_ceph_context, new C_MDS_RetryRequest(mdcache, mdr));
mds->anchorclient->prepare_update(srcdnl->get_inode()->ino(), trace, &mdr->more()->src_reanchor_atid,
anchorgather->new_sub());
}
straydn->make_anchor_trace(trace, destdnl->get_inode());
if (!anchorgather)
- anchorgather = new C_Gather(new C_MDS_RetryRequest(mdcache, mdr));
+ anchorgather = new C_Gather(&g_ceph_context, new C_MDS_RetryRequest(mdcache, mdr));
mds->anchorclient->prepare_update(destdnl->get_inode()->ino(), trace, &mdr->more()->dst_reanchor_atid,
anchorgather->new_sub());
}
<< dendl;
projected = committing = committed = version;
dump();
- finish_contexts(waiting_for_load);
+ finish_contexts(&g_ceph_context, waiting_for_load);
}
dout(10) << "_save_finish v" << v << dendl;
committed = v;
- finish_contexts(commit_waiters[v]);
+ finish_contexts(&g_ceph_context, commit_waiters[v]);
commit_waiters.erase(v);
}
dout(20) << " dirty_inode " << **p << dendl;
assert((*p)->is_auth());
if ((*p)->is_base()) {
- if (!gather) gather = new C_Gather;
+ if (!gather) gather = new C_Gather(&g_ceph_context);
(*p)->store(gather->new_sub());
} else
commit.insert((*p)->get_parent_dn()->get_dir());
}
if (!commit.empty()) {
- if (!gather) gather = new C_Gather;
+ if (!gather) gather = new C_Gather(&g_ceph_context);
for (set<CDir*>::iterator p = commit.begin();
p != commit.end();
p != uncommitted_masters.end();
p++) {
dout(10) << "try_to_expire waiting for slaves to ack commit on " << *p << dendl;
- if (!gather) gather = new C_Gather;
+ if (!gather) gather = new C_Gather(&g_ceph_context);
mds->mdcache->wait_for_uncommitted_master(*p, gather->new_sub());
}
for (elist<CInode*>::iterator p = dirty_dirfrag_dir.begin(); !p.end(); ++p) {
CInode *in = *p;
dout(10) << "try_to_expire waiting for dirlock flush on " << *in << dendl;
- if (!gather) gather = new C_Gather;
+ if (!gather) gather = new C_Gather(&g_ceph_context);
mds->locker->scatter_nudge(&in->filelock, gather->new_sub());
}
for (elist<CInode*>::iterator p = dirty_dirfrag_dirfragtree.begin(); !p.end(); ++p) {
CInode *in = *p;
dout(10) << "try_to_expire waiting for dirfragtreelock flush on " << *in << dendl;
- if (!gather) gather = new C_Gather;
+ if (!gather) gather = new C_Gather(&g_ceph_context);
mds->locker->scatter_nudge(&in->dirfragtreelock, gather->new_sub());
}
for (elist<CInode*>::iterator p = dirty_dirfrag_nest.begin(); !p.end(); ++p) {
CInode *in = *p;
dout(10) << "try_to_expire waiting for nest flush on " << *in << dendl;
- if (!gather) gather = new C_Gather;
+ if (!gather) gather = new C_Gather(&g_ceph_context);
mds->locker->scatter_nudge(&in->nestlock, gather->new_sub());
}
}
}
if (le) {
- if (!gather) gather = new C_Gather;
+ if (!gather) gather = new C_Gather(&g_ceph_context);
mds->mdlog->submit_entry(le, gather->new_sub());
dout(10) << "try_to_expire waiting for open files to rejournal" << dendl;
}
CInode *in = *p;
dout(10) << "try_to_expire waiting for dir parent pointer update on " << *in << dendl;
assert(in->state_test(CInode::STATE_DIRTYPARENT));
- if (!gather) gather = new C_Gather;
+ if (!gather) gather = new C_Gather(&g_ceph_context);
in->store_parent(gather->new_sub());
}
MDSlaveUpdate *su = *p;
dout(10) << "try_to_expire waiting on slave update " << su << dendl;
assert(su->waiter == 0);
- if (!gather) gather = new C_Gather;
+ if (!gather) gather = new C_Gather(&g_ceph_context);
su->waiter = gather->new_sub();
}
<< ", committed is " << mds->inotable->get_committed_version()
<< " (" << mds->inotable->get_committing_version() << ")"
<< dendl;
- if (!gather) gather = new C_Gather;
+ if (!gather) gather = new C_Gather(&g_ceph_context);
mds->inotable->save(gather->new_sub(), inotablev);
}
<< ", committed is " << mds->sessionmap.committed
<< " (" << mds->sessionmap.committing << ")"
<< dendl;
- if (!gather) gather = new C_Gather;
+ if (!gather) gather = new C_Gather(&g_ceph_context);
mds->sessionmap.save(gather->new_sub(), sessionmapv);
}
for (hash_set<version_t>::iterator q = p->second.begin();
q != p->second.end();
++q) {
- if (!gather) gather = new C_Gather;
+ if (!gather) gather = new C_Gather(&g_ceph_context);
dout(10) << "try_to_expire " << get_mdstable_name(p->first) << " transaction " << *q
<< " pending commit (not yet acked), waiting" << dendl;
assert(!client->has_committed(*q));
if (p->second > server->get_committed_version()) {
dout(10) << "try_to_expire waiting for " << get_mdstable_name(p->first)
<< " to save, need " << p->second << dendl;
- if (!gather) gather = new C_Gather;
+ if (!gather) gather = new C_Gather(&g_ceph_context);
server->save(gather->new_sub());
}
}
p != truncating_inodes.end();
p++) {
dout(10) << "try_to_expire waiting for truncate of " << **p << dendl;
- if (!gather) gather = new C_Gather;
+ if (!gather) gather = new C_Gather(&g_ceph_context);
(*p)->add_waiter(CInode::WAIT_TRUNC, gather->new_sub());
}
void finish_waiting(uint64_t mask, int result = 0) {
list<Context*> finished;
take_waiting(mask, finished);
- finish_contexts(finished, result);
+ finish_contexts(&g_ceph_context, finished, result);
}
extend_lease();
// wake people up
- finish_contexts(waiting_for_active);
- finish_contexts(waiting_for_readable);
- finish_contexts(waiting_for_writeable);
+ finish_contexts(&g_ceph_context, waiting_for_active);
+ finish_contexts(&g_ceph_context, waiting_for_readable);
+ finish_contexts(&g_ceph_context, waiting_for_writeable);
}
}
} else {
// we're alone, take it easy
commit();
state = STATE_ACTIVE;
- finish_contexts(waiting_for_active);
- finish_contexts(waiting_for_commit);
- finish_contexts(waiting_for_readable);
- finish_contexts(waiting_for_writeable);
+ finish_contexts(&g_ceph_context, waiting_for_active);
+ finish_contexts(&g_ceph_context, waiting_for_commit);
+ finish_contexts(&g_ceph_context, waiting_for_readable);
+ finish_contexts(&g_ceph_context, waiting_for_writeable);
update_observers();
return;
}
extend_lease();
// wake people up
- finish_contexts(waiting_for_active);
- finish_contexts(waiting_for_commit);
- finish_contexts(waiting_for_readable);
- finish_contexts(waiting_for_writeable);
+ finish_contexts(&g_ceph_context, waiting_for_active);
+ finish_contexts(&g_ceph_context, waiting_for_commit);
+ finish_contexts(&g_ceph_context, waiting_for_readable);
+ finish_contexts(&g_ceph_context, waiting_for_writeable);
}
accept->put();
}
commit->put();
- finish_contexts(waiting_for_commit);
+ finish_contexts(&g_ceph_context, waiting_for_commit);
}
void Paxos::extend_lease()
trim_to(lease->first_committed);
// kick waiters
- finish_contexts(waiting_for_active);
+ finish_contexts(&g_ceph_context, waiting_for_active);
if (is_readable())
- finish_contexts(waiting_for_readable);
+ finish_contexts(&g_ceph_context, waiting_for_readable);
lease->put();
}
dout(10) << "peon_init -- i am a peon" << dendl;
// no chance to write now!
- finish_contexts(waiting_for_writeable, -1);
- finish_contexts(waiting_for_commit, -1);
+ finish_contexts(&g_ceph_context, waiting_for_writeable, -1);
+ finish_contexts(&g_ceph_context, waiting_for_commit, -1);
}
void Paxos::election_starting()
cancel_events();
new_value.clear();
- finish_contexts(waiting_for_commit, -1);
+ finish_contexts(&g_ceph_context, waiting_for_commit, -1);
}
}
lock.Lock();
- finish_contexts(fin, 0);
+ finish_contexts(&g_ceph_context, fin, 0);
fin.clear();
if (!sync_waiters.empty()) {
dout(10) << "sync_entry more waiters, committing again" << dendl;
// ok, create PG locally using provided Info and History
*pt = new ObjectStore::Transaction;
- *pfin = new C_Contexts;
+ *pfin = new C_Contexts(&g_ceph_context);
if (create) {
pg = _create_lock_new_pg(info.pgid, acting, **pt);
} else {
return NULL;
}
*pt = new ObjectStore::Transaction;
- *pfin = new C_Contexts;
+ *pfin = new C_Contexts(&g_ceph_context);
}
return pg;
}
had_map_since = g_clock.now();
}
- C_Contexts *fin = new C_Contexts;
+ C_Contexts *fin = new C_Contexts(&g_ceph_context);
if (osdmap->is_up(whoami) &&
osdmap->get_addr(whoami) == client_messenger->get_myaddr()) {
// create and lock children
ObjectStore::Transaction *t = new ObjectStore::Transaction;
- C_Contexts *fin = new C_Contexts;
+ C_Contexts *fin = new C_Contexts(&g_ceph_context);
map<pg_t,PG*> children;
for (set<pg_t>::iterator q = p->second.begin();
q != p->second.end();
if (can_create_pg(pgid)) {
ObjectStore::Transaction *t = new ObjectStore::Transaction;
- C_Contexts *fin = new C_Contexts;
+ C_Contexts *fin = new C_Contexts(&g_ceph_context);
PG *pg = _create_lock_new_pg(pgid, creating_pgs[pgid].acting, *t);
creating_pgs.erase(pgid);
map< int, map<pg_t,PG::Query> > query_map;
map< int, MOSDPGInfo* > info_map;
ObjectStore::Transaction *t = new ObjectStore::Transaction;
- C_Contexts *fin = new C_Contexts;
+ C_Contexts *fin = new C_Contexts(&g_ceph_context);
PG::RecoveryCtx rctx(&query_map, &info_map, 0, &fin->contexts, t);
if (!pg->generate_backlog_epoch) {
dout(10) << __func__ << ": all OSDs in the PG are up-to-date!" << dendl;
log.reset_recovery_pointers();
ObjectStore::Transaction *t = new ObjectStore::Transaction;
- C_Contexts *fin = new C_Contexts;
+ C_Contexts *fin = new C_Contexts(&g_ceph_context);
finish_recovery(*t, fin->contexts);
int tr = osd->store->queue_transaction(&osr, t, new ObjectStore::C_DeleteTransaction(t), fin);
assert(tr == 0);
} else {
C_Gather *gack = 0, *gcom = 0;
if (onack)
- gack = new C_Gather(onack);
+ gack = new C_Gather(&g_ceph_context, onack);
if (oncommit)
- gcom = new C_Gather(oncommit);
+ gcom = new C_Gather(&g_ceph_context, oncommit);
for (vector<ObjectExtent>::iterator p = extents.begin(); p != extents.end(); p++) {
vector<OSDOp> ops(1);
ops[0].op.op = CEPH_OSD_OP_TRIMTRUNC;
} else {
C_Gather *gack = 0, *gcom = 0;
if (onack)
- gack = new C_Gather(onack);
+ gack = new C_Gather(&g_ceph_context, onack);
if (oncommit)
- gcom = new C_Gather(oncommit);
+ gcom = new C_Gather(&g_ceph_context, oncommit);
for (vector<ObjectExtent>::iterator p = extents.begin(); p != extents.end(); p++) {
if (p->offset == 0 && p->length == layout->fl_object_size)
objecter->remove(p->oid, p->oloc,
state = STATE_ACTIVE;
list<Context*> ls;
ls.swap(waitfor_recover);
- finish_contexts(ls, 0);
+ finish_contexts(&g_ceph_context, ls, 0);
return;
}
<< magic << "'" << dendl;
list<Context*> ls;
ls.swap(waitfor_recover);
- finish_contexts(ls, -EINVAL);
+ finish_contexts(&g_ceph_context, ls, -EINVAL);
return;
}
// done.
list<Context*> ls;
ls.swap(waitfor_recover);
- finish_contexts(ls, 0);
+ finish_contexts(&g_ceph_context, ls, 0);
}
class Journaler::C_RereadHeadProbe : public Context
while (!waitfor_safe.empty()) {
if (waitfor_safe.begin()->first > safe_pos)
break;
- finish_contexts(waitfor_safe.begin()->second);
+ finish_contexts(&g_ceph_context, waitfor_safe.begin()->second);
waitfor_safe.erase(waitfor_safe.begin());
}
}
// finishers?
while (!waitfor_trim.empty() &&
waitfor_trim.begin()->first <= trimmed_pos) {
- finish_contexts(waitfor_trim.begin()->second, 0);
+ finish_contexts(&g_ceph_context, waitfor_trim.begin()->second, 0);
waitfor_trim.erase(waitfor_trim.begin());
}
}
p++)
ls.splice(ls.end(), p->second);
bh->waitfor_read.clear();
- finish_contexts(ls);
+ finish_contexts(&g_ceph_context, ls);
// clean up?
ob->try_merge_bh(bh);
<< " tid " << tid << " obsolete" << dendl;
}
- finish_contexts(ls);
+ finish_contexts(&g_ceph_context, ls);
}
}
list<Context*> ls;
ls.splice(ls.begin(), ob->waitfor_ack[tid]);
ob->waitfor_ack.erase(tid);
- finish_contexts(ls);
+ finish_contexts(&g_ceph_context, ls);
}
// is the entire object set now clean?
list<Context*> ls;
ls.splice(ls.begin(), ob->waitfor_commit[tid]);
ob->waitfor_commit.erase(tid);
- finish_contexts(ls);
+ finish_contexts(&g_ceph_context, ls);
}
// is the entire object set now clean and fully committed?
if (!flush(ob)) {
// we'll need to gather...
if (!gather && onfinish)
- gather = new C_Gather(onfinish);
+ gather = new C_Gather(&g_ceph_context, onfinish);
safe = false;
dout(10) << "flush_set " << oset << " will wait for ack tid "
dout(10) << "commit_set " << oset << " " << *ob
<< " will finish on commit tid " << ob->last_write_tid
<< dendl;
- if (!gather && onfinish) gather = new C_Gather(onfinish);
+ if (!gather && onfinish) gather = new C_Gather(&g_ceph_context, onfinish);
safe = false;
if (gather)
ob->waitfor_commit[ob->last_write_tid].push_back( gather->new_sub() );
ls.splice(ls.begin(), ob->waitfor_wr);
}
- finish_contexts(ls);
+ finish_contexts(&g_ceph_context, ls);
}
void ObjectCacher::kick_sync_readers(ObjectSet *oset)
ls.splice(ls.begin(), ob->waitfor_rd);
}
- finish_contexts(ls);
+ finish_contexts(&g_ceph_context, ls);
}
read_trunc(extents[0].oid, extents[0].oloc, extents[0].offset, extents[0].length,
snap, bl, flags, trunc_size, trunc_seq, onfinish);
} else {
- C_Gather *g = new C_Gather;
+ C_Gather *g = new C_Gather(&g_ceph_context);
vector<bufferlist> resultbl(extents.size());
int i=0;
for (vector<ObjectExtent>::iterator p = extents.begin(); p != extents.end(); p++) {
} else {
C_Gather *gack = 0, *gcom = 0;
if (onack)
- gack = new C_Gather(onack);
+ gack = new C_Gather(&g_ceph_context, onack);
if (oncommit)
- gcom = new C_Gather(oncommit);
+ gcom = new C_Gather(&g_ceph_context, oncommit);
for (vector<ObjectExtent>::iterator p = extents.begin(); p != extents.end(); p++) {
bufferlist cur;
for (map<__u32,__u32>::iterator bit = p->buffer_extents.begin();
};
TEST(ContextGather, Constructor) {
- C_Gather *gather = new C_Gather();
+ C_Gather *gather = new C_Gather(&g_ceph_context );
EXPECT_TRUE(gather->empty());
EXPECT_EQ(0, gather->get_num());
EXPECT_EQ(0, gather->get_num_remaining());
}
TEST(ContextGather, OneSub) {
- C_Gather *gather = new C_Gather();
+ C_Gather *gather = new C_Gather(&g_ceph_context);
Context *sub = gather->new_sub();
EXPECT_EQ(1, gather->get_num());
EXPECT_EQ(1, gather->get_num_remaining());
}
TEST(ContextGather, ManySubs) {
- C_Gather *gather = new C_Gather();
+ C_Gather *gather = new C_Gather(&g_ceph_context);
int sub_count = 8;
bool finish_called = false;
int result = 0;
}
TEST(ContextGather, AlternatingSubCreateFinish) {
- C_Gather *gather = new C_Gather();
+ C_Gather *gather = new C_Gather(&g_ceph_context);
int sub_count = 8;
bool finish_called = false;
int result = 0;