From: Douglas Fuller Date: Mon, 17 Jul 2017 21:19:53 +0000 (-0400) Subject: objecter: Support new, filtered MStatfs X-Git-Tag: v12.1.3~24^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=76fc99a0a5112847ecc0eb7de8730c1a56c5930c;p=ceph.git objecter: Support new, filtered MStatfs 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 --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index b91cf4385a7..615ea326859 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -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 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(); diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index edcee5b922d..527022b5d2a 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -1555,6 +1555,7 @@ public: struct StatfsOp { ceph_tid_t tid; struct ceph_statfs *stats; + boost::optional 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 poolid, + Context *onfinish); int statfs_op_cancel(ceph_tid_t tid, int r); void _finish_statfs_op(StatfsOp *op, int r);