]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objecter: Support new, filtered MStatfs
authorDouglas Fuller <dfuller@redhat.com>
Mon, 17 Jul 2017 21:19:53 +0000 (17:19 -0400)
committerDouglas Fuller <dfuller@redhat.com>
Thu, 3 Aug 2017 18:11:46 +0000 (14:11 -0400)
Extend the Objecter's StatfsOp to support MStatfs::data_pool. This
requests statistics for a single data pool in the case of a filesystem
that has exactly one.

Signed-off-by: Douglas Fuller <dfuller@redhat.com>
src/osdc/Objecter.cc
src/osdc/Objecter.h

index b91cf4385a7b9f86dbd9064e06c57b7455a4e199..615ea32685929b0c4d1fc68506b69b715d17e0cf 100644 (file)
@@ -4235,7 +4235,9 @@ void Objecter::_finish_pool_stat_op(PoolStatOp *op, int r)
   delete op;
 }
 
-void Objecter::get_fs_stats(ceph_statfs& result, Context *onfinish)
+void Objecter::get_fs_stats(ceph_statfs& result,
+                           boost::optional<int64_t> data_pool,
+                           Context *onfinish)
 {
   ldout(cct, 10) << "get_fs_stats" << dendl;
   unique_lock l(rwlock);
@@ -4243,6 +4245,7 @@ void Objecter::get_fs_stats(ceph_statfs& result, Context *onfinish)
   StatfsOp *op = new StatfsOp;
   op->tid = ++last_tid;
   op->stats = &result;
+  op->data_pool = data_pool;
   op->onfinish = onfinish;
   if (mon_timeout > timespan(0)) {
     op->ontimeout = timer.add_event(mon_timeout,
@@ -4265,6 +4268,7 @@ void Objecter::_fs_stats_submit(StatfsOp *op)
 
   ldout(cct, 10) << "fs_stats_submit" << op->tid << dendl;
   monc->send_mon_message(new MStatfs(monc->get_fsid(), op->tid,
+                                    op->data_pool,
                                     last_seen_pgmap_version));
   op->last_submit = ceph::mono_clock::now();
 
index edcee5b922d9f52eda5702d030a6326ac35cb80c..527022b5d2ac830318965a8723bef33111e4cc45 100644 (file)
@@ -1555,6 +1555,7 @@ public:
   struct StatfsOp {
     ceph_tid_t tid;
     struct ceph_statfs *stats;
+    boost::optional<int64_t> data_pool;
     Context *onfinish;
     uint64_t ontimeout;
 
@@ -2929,7 +2930,8 @@ private:
   void _fs_stats_submit(StatfsOp *op);
 public:
   void handle_fs_stats_reply(MStatfsReply *m);
-  void get_fs_stats(struct ceph_statfs& result, Context *onfinish);
+  void get_fs_stats(struct ceph_statfs& result, boost::optional<int64_t> poolid,
+                   Context *onfinish);
   int statfs_op_cancel(ceph_tid_t tid, int r);
   void _finish_statfs_op(StatfsOp *op, int r);