Commit 443b3760 authored by Sage Weil's avatar Sage Weil

ceph: fix caps usage accounting for import (non-reserved) case

We need to increase the total and used counters when allocating a new cap
in the non-reserved (cap import) case.
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent ec97f88b
...@@ -244,8 +244,14 @@ static struct ceph_cap *get_cap(struct ceph_cap_reservation *ctx) ...@@ -244,8 +244,14 @@ static struct ceph_cap *get_cap(struct ceph_cap_reservation *ctx)
struct ceph_cap *cap = NULL; struct ceph_cap *cap = NULL;
/* temporary, until we do something about cap import/export */ /* temporary, until we do something about cap import/export */
if (!ctx) if (!ctx) {
return kmem_cache_alloc(ceph_cap_cachep, GFP_NOFS); cap = kmem_cache_alloc(ceph_cap_cachep, GFP_NOFS);
if (cap) {
caps_use_count++;
caps_total_count++;
}
return cap;
}
spin_lock(&caps_list_lock); spin_lock(&caps_list_lock);
dout("get_cap ctx=%p (%d) %d = %d used + %d resv + %d avail\n", dout("get_cap ctx=%p (%d) %d = %d used + %d resv + %d avail\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment