diff options
author | Sage Weil <sage@newdream.net> | 2010-06-29 09:28:39 -0700 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-06-29 09:31:56 -0700 |
commit | 443b3760a06860187f135c1ecd56c2c7d4ad1022 (patch) | |
tree | d6a3ec8b77f133066bd7795acca33f461eee821a /fs/ceph | |
parent | ec97f88ba6d4256927fde516033ee76d5d85b54a (diff) | |
download | kernel_samsung_aries-443b3760a06860187f135c1ecd56c2c7d4ad1022.zip kernel_samsung_aries-443b3760a06860187f135c1ecd56c2c7d4ad1022.tar.gz kernel_samsung_aries-443b3760a06860187f135c1ecd56c2c7d4ad1022.tar.bz2 |
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: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/caps.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index d4fcdda..74144d6 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -244,8 +244,14 @@ static struct ceph_cap *get_cap(struct ceph_cap_reservation *ctx) struct ceph_cap *cap = NULL; /* temporary, until we do something about cap import/export */ - if (!ctx) - return kmem_cache_alloc(ceph_cap_cachep, GFP_NOFS); + if (!ctx) { + cap = kmem_cache_alloc(ceph_cap_cachep, GFP_NOFS); + if (cap) { + caps_use_count++; + caps_total_count++; + } + return cap; + } spin_lock(&caps_list_lock); dout("get_cap ctx=%p (%d) %d = %d used + %d resv + %d avail\n", |