@@ -4265,7 +4265,7 @@ void Client::signal_cond_list(list<ceph::condition_variable*>& ls)
42654265 }
42664266}
42674267
4268- void Client::wait_on_context_list (list <Context*>& ls)
4268+ void Client::wait_on_context_list (std::vector <Context*>& ls)
42694269{
42704270 ceph::condition_variable cond;
42714271 bool done = false ;
@@ -4276,30 +4276,14 @@ void Client::wait_on_context_list(list<Context*>& ls)
42764276 l.release ();
42774277}
42784278
4279- void Client::signal_context_list (list<Context*>& ls)
4280- {
4281- while (!ls.empty ()) {
4282- ls.front ()->complete (0 );
4283- ls.pop_front ();
4284- }
4285- }
4286-
42874279void Client::signal_caps_inode (Inode *in)
42884280{
42894281 // Process the waitfor_caps list
4290- while (!in->waitfor_caps .empty ()) {
4291- in->waitfor_caps .front ()->complete (0 );
4292- in->waitfor_caps .pop_front ();
4293- }
4282+ signal_context_list (in->waitfor_caps );
42944283
42954284 // New items may have been added to the pending list, move them onto the
42964285 // waitfor_caps list
4297- while (!in->waitfor_caps_pending .empty ()) {
4298- Context *ctx = in->waitfor_caps_pending .front ();
4299-
4300- in->waitfor_caps_pending .pop_front ();
4301- in->waitfor_caps .push_back (ctx);
4302- }
4286+ std::swap (in->waitfor_caps , in->waitfor_caps_pending );
43034287}
43044288
43054289void Client::wake_up_session_caps (MetaSession *s, bool reconnect)
@@ -11914,7 +11898,7 @@ void Client::C_nonblocking_fsync_state::advance()
1191411898 ldout (clnt->cct , 15 ) << " waiting on unsafe requests, last tid " << req->get_tid () << dendl;
1191511899
1191611900 req->get ();
11917- clnt-> add_nonblocking_onfinish_to_context_list ( req->waitfor_safe , advancer);
11901+ req->waitfor_safe . push_back ( advancer);
1191811902 // ------------ here is a state machine break point
1191911903 return ;
1192011904 }
@@ -11940,7 +11924,7 @@ void Client::C_nonblocking_fsync_state::advance()
1194011924 ldout (clnt->cct , 10 ) << " ino " << in->ino << " has " << in->cap_refs [CEPH_CAP_FILE_BUFFER]
1194111925 << " uncommitted, waiting" << dendl;
1194211926 advancer = new C_nonblocking_fsync_state_advancer (clnt, this );
11943- clnt-> add_nonblocking_onfinish_to_context_list ( in->waitfor_commit , advancer);
11927+ in->waitfor_commit . push_back ( advancer);
1194411928 // ------------ here is a state machine break point but we have to
1194511929 // return to this case because this might loop.
1194611930 progress = 1 ;
@@ -11998,9 +11982,9 @@ void Client::C_nonblocking_fsync_state::advance()
1199811982 << " for C_nonblocking_fsync_state " << this
1199911983 << dendl;
1200011984 if (progress == 3 )
12001- clnt-> add_nonblocking_onfinish_to_context_list ( in->waitfor_caps , advancer);
11985+ in->waitfor_caps . push_back ( advancer);
1200211986 else
12003- clnt-> add_nonblocking_onfinish_to_context_list ( in->waitfor_caps_pending , advancer);
11987+ in->waitfor_caps_pending . push_back ( advancer);
1200411988 // ------------ here is a state machine break point
1200511989 // the advancer completion will resume with case 3
1200611990 progress = 4 ;
@@ -16808,7 +16792,7 @@ void Client::ms_handle_remote_reset(Connection *con)
1680816792 case MetaSession::STATE_OPENING:
1680916793 {
1681016794 ldout (cct, 1 ) << " reset from mds we were opening; retrying" << dendl;
16811- list <Context*> waiters;
16795+ std::vector <Context*> waiters;
1681216796 waiters.swap (s->waiting_for_open );
1681316797 _closed_mds_session (s.get ());
1681416798 auto news = _get_or_open_mds_session (mds);
0 commit comments