@@ -524,7 +524,7 @@ void Client::dump_inode(Formatter *f, Inode *in, set<Inode*>& did, bool disconne
524524 did.insert (in);
525525 if (in->dir ) {
526526 ldout (cct, 1 ) << " dir " << in->dir << " size " << in->dir ->dentries .size () << dendl;
527- for (ceph::unordered_map<string, Dentry*>::iterator it = in->dir ->dentries .begin ();
527+ for (auto it = in->dir ->dentries .begin ();
528528 it != in->dir ->dentries .end ();
529529 ++it) {
530530 ldout (cct, 1 ) << " " << in->ino << " dn " << it->first << " " << it->second << " ref " << it->second ->ref << dendl;
@@ -552,9 +552,7 @@ void Client::dump_cache(Formatter *f)
552552 dump_inode (f, root.get (), did, true );
553553
554554 // make a second pass to catch anything disconnected
555- for (ceph::unordered_map<vinodeno_t , Inode*>::iterator it = inode_map.begin ();
556- it != inode_map.end ();
557- ++it) {
555+ for (auto it = inode_map.begin (); it != inode_map.end (); ++it) {
558556 if (did.count (it->second ))
559557 continue ;
560558 dump_inode (f, it->second , did, true );
@@ -1876,7 +1874,7 @@ int Client::verify_reply_trace(int r, MetaSession *session,
18761874 bufferlist extra_bl;
18771875 inodeno_t created_ino;
18781876 bool got_created_ino = false ;
1879- ceph ::unordered_map<vinodeno_t , Inode*>::iterator p;
1877+ std ::unordered_map<vinodeno_t , Inode*>::iterator p;
18801878
18811879 extra_bl = reply->get_extra_bl ();
18821880 if (extra_bl.length () >= 8 ) {
@@ -2858,9 +2856,7 @@ void Client::_handle_full_flag(int64_t pool)
28582856 // field with -ENOSPC as long as we're sure all the ops we cancelled were
28592857 // affecting this pool, and all the objectsets we're purging were also
28602858 // in this pool.
2861- for (unordered_map<vinodeno_t ,Inode*>::iterator i = inode_map.begin ();
2862- i != inode_map.end (); ++i)
2863- {
2859+ for (auto i = inode_map.begin (); i != inode_map.end (); ++i) {
28642860 Inode *inode = i->second ;
28652861 if (inode->oset .dirty_or_tx
28662862 && (pool == -1 || inode->layout .pool_id == pool)) {
@@ -3178,10 +3174,8 @@ void Client::send_reconnect(MetaSession *session)
31783174 bool allow_multi = session->mds_features .test (CEPHFS_FEATURE_MULTI_RECONNECT);
31793175
31803176 // i have an open session.
3181- ceph::unordered_set<inodeno_t > did_snaprealm;
3182- for (ceph::unordered_map<vinodeno_t , Inode*>::iterator p = inode_map.begin ();
3183- p != inode_map.end ();
3184- ++p) {
3177+ std::unordered_set<inodeno_t > did_snaprealm;
3178+ for (auto p = inode_map.begin (); p != inode_map.end (); ++p) {
31853179 Inode *in = p->second ;
31863180 auto it = in->caps .find (mds);
31873181 if (it != in->caps .end ()) {
@@ -4726,7 +4720,7 @@ void Client::_invalidate_kernel_dcache()
47264720
47274721 if (can_invalidate_dentries) {
47284722 if (dentry_invalidate_cb && root->dir ) {
4729- for (ceph::unordered_map<string, Dentry*>::iterator p = root->dir ->dentries .begin ();
4723+ for (auto p = root->dir ->dentries .begin ();
47304724 p != root->dir ->dentries .end ();
47314725 ++p) {
47324726 if (p->second ->inode )
@@ -10208,7 +10202,7 @@ int Client::_lookup_vino(vinodeno_t vino, const UserPerm& perms, Inode **inode)
1020810202
1020910203 int r = make_request (req, perms, NULL , NULL , rand () % mdsmap->get_num_in_mds ());
1021010204 if (r == 0 && inode != NULL ) {
10211- unordered_map< vinodeno_t ,Inode*>::iterator p = inode_map.find (vino);
10205+ auto p = inode_map.find (vino);
1021210206 ceph_assert (p != inode_map.end ());
1021310207 *inode = p->second ;
1021410208 _ll_get (*inode);
@@ -13244,7 +13238,7 @@ int Client::ll_lookup_vino(
1324413238 ldout (cct, 3 ) << __func__ << " " << vino << dendl;
1324513239
1324613240 // Check the cache first
13247- unordered_map< vinodeno_t ,Inode*>::iterator p = inode_map.find (vino);
13241+ auto p = inode_map.find (vino);
1324813242 if (p != inode_map.end ()) {
1324913243 *inode = p->second ;
1325013244 _ll_get (*inode);
@@ -13400,10 +13394,8 @@ void Client::_ll_drop_pins()
1340013394{
1340113395 ldout (cct, 10 ) << __func__ << dendl;
1340213396 std::set<InodeRef> to_be_put; // this set will be deconstructed item by item when exit
13403- ceph::unordered_map<vinodeno_t , Inode*>::iterator next;
13404- for (ceph::unordered_map<vinodeno_t , Inode*>::iterator it = inode_map.begin ();
13405- it != inode_map.end ();
13406- it = next) {
13397+ std::unordered_map<vinodeno_t , Inode*>::iterator next;
13398+ for (auto it = inode_map.begin (); it != inode_map.end (); it = next) {
1340713399 Inode *in = it->second ;
1340813400 next = it;
1340913401 ++next;
@@ -13480,7 +13472,7 @@ Inode *Client::ll_get_inode(ino_t ino)
1348013472 std::scoped_lock lock (client_lock);
1348113473
1348213474 vinodeno_t vino = _map_faked_ino (ino);
13483- unordered_map< vinodeno_t ,Inode*>::iterator p = inode_map.find (vino);
13475+ auto p = inode_map.find (vino);
1348413476 if (p == inode_map.end ())
1348513477 return NULL ;
1348613478 Inode *in = p->second ;
@@ -13499,7 +13491,7 @@ Inode *Client::ll_get_inode(vinodeno_t vino)
1349913491
1350013492 std::scoped_lock lock (client_lock);
1350113493
13502- unordered_map< vinodeno_t ,Inode*>::iterator p = inode_map.find (vino);
13494+ auto p = inode_map.find (vino);
1350313495 if (p == inode_map.end ())
1350413496 return NULL ;
1350513497 Inode *in = p->second ;
0 commit comments