]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mempool: allow pool counts to be adjusted explicitly
authorSage Weil <sage@redhat.com>
Mon, 29 May 2017 01:19:44 +0000 (21:19 -0400)
committerSage Weil <sage@redhat.com>
Wed, 31 May 2017 18:47:28 +0000 (14:47 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/mempool.cc
src/include/mempool.h

index 15643567b9b2e0541b5f36d1eb4352a14a8abdbd..ccb74dd1ea0a9900f58bb96461999f69ba72120c 100644 (file)
@@ -77,6 +77,13 @@ size_t mempool::pool_t::allocated_items() const
   return (size_t) result;
 }
 
+void mempool::pool_t::adjust_count(ssize_t items, ssize_t bytes)
+{
+  shard_t *shard = pick_a_shard();
+  shard->items += items;
+  shard->bytes += bytes;
+}
+
 void mempool::pool_t::get_stats(
   stats_t *total,
   std::map<std::string, stats_t> *by_type) const
index 016b76b9c66ef7ba10473dc3a7553599012cbff6..4914313a3009bfbbebbfac7f80c48d1b18ee5879 100644 (file)
@@ -218,6 +218,8 @@ public:
   size_t allocated_bytes() const;
   size_t allocated_items() const;
 
+  void adjust_count(ssize_t items, ssize_t bytes);
+
   shard_t* pick_a_shard() {
     // Dirt cheap, see:
     //   http://fossies.org/dox/glibc-2.24/pthread__self_8c_source.html