]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
ceph: fix caps usage accounting
authorYehuda Sadeh <yehuda@hq.newdream.net>
Sat, 19 Jun 2010 00:03:31 +0000 (17:03 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 21 Jun 2010 21:30:54 +0000 (14:30 -0700)
Needed to increase total and use count of caps in get_cap()
when ctx was NULL.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
fs/ceph/caps.c

index df97c3e5e41716b3dd1ecfd54697c21554697ab0..61c4c11aab4ef298a7622624aa75a8f05c880239 100644 (file)
@@ -235,8 +235,11 @@ static struct ceph_cap *get_cap(struct ceph_mds_client *mdsc,
        struct ceph_cap *cap = NULL;
 
        /* temporary, until we do something about cap import/export */
-       if (!ctx)
+       if (!ctx) {
+               mdsc->caps_use_count++;
+               mdsc->caps_total_count++;
                return kmem_cache_alloc(ceph_cap_cachep, GFP_NOFS);
+       }
 
        spin_lock(&mdsc->caps_list_lock);
        dout("get_cap ctx=%p (%d) %d = %d used + %d resv + %d avail\n",