]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: add new command 'lspools [uid]' to OSDMonitor
authorGreg Farnum <gregf@hq.newdream.net>
Mon, 5 Apr 2010 20:41:37 +0000 (13:41 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Mon, 5 Apr 2010 20:45:41 +0000 (13:45 -0700)
src/mon/OSDMonitor.cc

index 8204eaa9e4de3de26e3b0decdb0562bff110d31a..6dd03f010721098098bf3b17b0f1d3e78bcd401f 100644 (file)
@@ -1018,7 +1018,20 @@ bool OSDMonitor::preprocess_command(MMonCommand *m)
          ss << "osd" << osd << " is not up";
       }
     }
-
+    else if (m->cmd[1] == "lspools") {
+      __u64 uid_pools = 0;
+      if (m->cmd.size() > 2) {
+       uid_pools = strtol(m->cmd[2].c_str(), NULL, 10);
+      }
+      for (map<int, pg_pool_t>::iterator p = osdmap.pools.begin();
+          p !=osdmap.pools.end();
+          ++p) {
+       if (!uid_pools || p->second.v.auid == uid_pools) {
+         ss << p->first << ' ' << osdmap.pool_name[p->first] << ',';
+       }
+      }
+      r = 0;
+    }
   }
   if (r != -1) {
     string rs;