summaryrefslogtreecommitdiff
path: root/fs/ceph/metric.c
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2020-06-30 03:52:16 -0400
committerIlya Dryomov <idryomov@gmail.com>2020-08-03 11:05:15 +0200
commit4f1d756def68588b88068af1d5a4a3b6dc7e6e2a (patch)
treeedfa235e919db5e27474367a2d7ea5e69a367086 /fs/ceph/metric.c
parent3e699bd865527004773012da38febdf444fd5fa8 (diff)
ceph: add global total_caps to count the mdsc's total caps number
This will help to reduce using the global mdsc->mutex lock in many places. Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/metric.c')
-rw-r--r--fs/ceph/metric.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ceph/metric.c b/fs/ceph/metric.c
index 9217f35bc2b9..269eacbd2a15 100644
--- a/fs/ceph/metric.c
+++ b/fs/ceph/metric.c
@@ -22,6 +22,7 @@ int ceph_metric_init(struct ceph_client_metric *m)
if (ret)
goto err_d_lease_mis;
+ atomic64_set(&m->total_caps, 0);
ret = percpu_counter_init(&m->i_caps_hit, 0, GFP_KERNEL);
if (ret)
goto err_i_caps_hit;