summaryrefslogtreecommitdiffstats
path: root/src/mds/SnapServer.cc
diff options
context:
space:
mode:
authorVicente Cheng <vicente_cheng@bigtera.com>2017-05-23 09:37:10 +0200
committerVicente Cheng <vicente_cheng@bigtera.com>2017-05-25 04:50:19 +0200
commitde0ce386ee59dbf70a010696d4aa91d46ed73b20 (patch)
tree0ea64f4d06fe6ae9bf134620160c612562f0d93a /src/mds/SnapServer.cc
parentMerge pull request #15235 from smithfarm/wip-doc-empowers (diff)
downloadceph-de0ce386ee59dbf70a010696d4aa91d46ed73b20.tar.xz
ceph-de0ce386ee59dbf70a010696d4aa91d46ed73b20.zip
mds: change the type of data_pools
Change the type of data_pools from `set` to `vector` In following scenario, we found something strange here. Here we have two pools as following: - data_pool1 id: 20 - data_pool2 id: 21 First, we create ceph fs with `data_pool2` and default data_pool is `data_pool2`. Then, add the new data pool `data_pool1`. Now, the default data_pool will be data_pool1. Because set will sort, we can't remain the default data_pool as we wish. (we assume that the default data_pool should be the data_pool that we create cephfs) It seems vector is more suitable than set. Signed-off-by: Vicente Cheng <vicente_cheng@bigtera.com>
Diffstat (limited to 'src/mds/SnapServer.cc')
-rw-r--r--src/mds/SnapServer.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mds/SnapServer.cc b/src/mds/SnapServer.cc
index 4518abef6cf..ea78bff1d08 100644
--- a/src/mds/SnapServer.cc
+++ b/src/mds/SnapServer.cc
@@ -166,11 +166,9 @@ bool SnapServer::_commit(version_t tid, MMDSTableRequest *req)
dout(7) << "commit " << tid << " destroy " << sn << " seq " << seq << dendl;
snaps.erase(sn);
- for (set<int64_t>::const_iterator p = mds->mdsmap->get_data_pools().begin();
- p != mds->mdsmap->get_data_pools().end();
- ++p) {
- need_to_purge[*p].insert(sn);
- need_to_purge[*p].insert(seq);
+ for (const auto p : mds->mdsmap->get_data_pools()) {
+ need_to_purge[p].insert(sn);
+ need_to_purge[p].insert(seq);
}
pending_destroy.erase(tid);