aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fscache/cookie.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2009-11-19 13:11:08 -0500
committerDavid Howells <dhowells@redhat.com>2009-11-19 13:11:08 -0500
commit52bd75fdb135d6133d878ae60c6e7e3f4ebc1cfc (patch)
tree4fad4fa37ce533c520a4575e5b7df90e19c6a666 /fs/fscache/cookie.c
parent4fbf4291aa15926cd4fdca0ffe9122e89d0459db (diff)
FS-Cache: Add counters for entry/exit to/from cache operation functions
Count entries to and exits from cache operation table functions. Maintain these as a single counter that's added to or removed from as appropriate. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/fscache/cookie.c')
-rw-r--r--fs/fscache/cookie.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
index 9b5187328230..432482edc738 100644
--- a/fs/fscache/cookie.c
+++ b/fs/fscache/cookie.c
@@ -249,7 +249,9 @@ static int fscache_alloc_object(struct fscache_cache *cache,
249 249
250 /* ask the cache to allocate an object (we may end up with duplicate 250 /* ask the cache to allocate an object (we may end up with duplicate
251 * objects at this stage, but we sort that out later) */ 251 * objects at this stage, but we sort that out later) */
252 fscache_stat(&fscache_n_cop_alloc_object);
252 object = cache->ops->alloc_object(cache, cookie); 253 object = cache->ops->alloc_object(cache, cookie);
254 fscache_stat_d(&fscache_n_cop_alloc_object);
253 if (IS_ERR(object)) { 255 if (IS_ERR(object)) {
254 fscache_stat(&fscache_n_object_no_alloc); 256 fscache_stat(&fscache_n_object_no_alloc);
255 ret = PTR_ERR(object); 257 ret = PTR_ERR(object);
@@ -270,8 +272,11 @@ static int fscache_alloc_object(struct fscache_cache *cache,
270 /* only attach if we managed to allocate all we needed, otherwise 272 /* only attach if we managed to allocate all we needed, otherwise
271 * discard the object we just allocated and instead use the one 273 * discard the object we just allocated and instead use the one
272 * attached to the cookie */ 274 * attached to the cookie */
273 if (fscache_attach_object(cookie, object) < 0) 275 if (fscache_attach_object(cookie, object) < 0) {
276 fscache_stat(&fscache_n_cop_put_object);
274 cache->ops->put_object(object); 277 cache->ops->put_object(object);
278 fscache_stat_d(&fscache_n_cop_put_object);
279 }
275 280
276 _leave(" = 0"); 281 _leave(" = 0");
277 return 0; 282 return 0;
@@ -287,7 +292,9 @@ object_already_extant:
287 return 0; 292 return 0;
288 293
289error_put: 294error_put:
295 fscache_stat(&fscache_n_cop_put_object);
290 cache->ops->put_object(object); 296 cache->ops->put_object(object);
297 fscache_stat_d(&fscache_n_cop_put_object);
291error: 298error:
292 _leave(" = %d", ret); 299 _leave(" = %d", ret);
293 return ret; 300 return ret;