@@ -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)
@@ -11904,7 +11888,7 @@ void Client::C_nonblocking_fsync_state::advance()
1190411888 ldout (clnt->cct , 15 ) << " waiting on unsafe requests, last tid " << req->get_tid () << dendl;
1190511889
1190611890 req->get ();
11907- clnt-> add_nonblocking_onfinish_to_context_list ( req->waitfor_safe , advancer);
11891+ req->waitfor_safe . push_back ( advancer);
1190811892 // ------------ here is a state machine break point
1190911893 return ;
1191011894 }
@@ -11930,7 +11914,7 @@ void Client::C_nonblocking_fsync_state::advance()
1193011914 ldout (clnt->cct , 10 ) << " ino " << in->ino << " has " << in->cap_refs [CEPH_CAP_FILE_BUFFER]
1193111915 << " uncommitted, waiting" << dendl;
1193211916 advancer = new C_nonblocking_fsync_state_advancer (clnt, this );
11933- clnt-> add_nonblocking_onfinish_to_context_list ( in->waitfor_commit , advancer);
11917+ in->waitfor_commit . push_back ( advancer);
1193411918 // ------------ here is a state machine break point but we have to
1193511919 // return to this case because this might loop.
1193611920 progress = 1 ;
@@ -11988,9 +11972,9 @@ void Client::C_nonblocking_fsync_state::advance()
1198811972 << " for C_nonblocking_fsync_state " << this
1198911973 << dendl;
1199011974 if (progress == 3 )
11991- clnt-> add_nonblocking_onfinish_to_context_list ( in->waitfor_caps , advancer);
11975+ in->waitfor_caps . push_back ( advancer);
1199211976 else
11993- clnt-> add_nonblocking_onfinish_to_context_list ( in->waitfor_caps_pending , advancer);
11977+ in->waitfor_caps_pending . push_back ( advancer);
1199411978 // ------------ here is a state machine break point
1199511979 // the advancer completion will resume with case 3
1199611980 progress = 4 ;
@@ -16796,7 +16780,7 @@ void Client::ms_handle_remote_reset(Connection *con)
1679616780 case MetaSession::STATE_OPENING:
1679716781 {
1679816782 ldout (cct, 1 ) << " reset from mds we were opening; retrying" << dendl;
16799- list <Context*> waiters;
16783+ std::vector <Context*> waiters;
1680016784 waiters.swap (s->waiting_for_open );
1680116785 _closed_mds_session (s.get ());
1680216786 auto news = _get_or_open_mds_session (mds);
0 commit comments