Skip to content

Commit

Permalink
ceph: fix caps usage accounting for import (non-reserved) case
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sage Weil committed Jun 29, 2010
1 parent ec97f88 commit 443b376
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fs/ceph/caps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 443b376

Please sign in to comment.