aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fscache/page.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2009-11-19 13:11:04 -0500
committerDavid Howells <dhowells@redhat.com>2009-11-19 13:11:04 -0500
commit4fbf4291aa15926cd4fdca0ffe9122e89d0459db (patch)
treeec2195c39ef8117acea598af4a5c20c77f67aa0b /fs/fscache/page.c
parent440f0affe247e9990c8f8778f1861da4fd7d5e50 (diff)
FS-Cache: Allow the current state of all objects to be dumped
Allow the current state of all fscache objects to be dumped by doing: cat /proc/fs/fscache/objects By default, all objects and all fields will be shown. This can be restricted by adding a suitable key to one of the caller's keyrings (such as the session keyring): keyctl add user fscache:objlist "<restrictions>" @s The <restrictions> are: K Show hexdump of object key (don't show if not given) A Show hexdump of object aux data (don't show if not given) And paired restrictions: C Show objects that have a cookie c Show objects that don't have a cookie B Show objects that are busy b Show objects that aren't busy W Show objects that have pending writes w Show objects that don't have pending writes R Show objects that have outstanding reads r Show objects that don't have outstanding reads S Show objects that have slow work queued s Show objects that don't have slow work queued If neither side of a restriction pair is given, then both are implied. For example: keyctl add user fscache:objlist KB @s shows objects that are busy, and lists their object keys, but does not dump their auxiliary data. It also implies "CcWwRrSs", but as 'B' is given, 'b' is not implied. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/fscache/page.c')
-rw-r--r--fs/fscache/page.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/fscache/page.c b/fs/fscache/page.c
index e8bbc395cef6..c5973e38ce39 100644
--- a/fs/fscache/page.c
+++ b/fs/fscache/page.c
@@ -275,6 +275,9 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie,
275 275
276 ASSERTCMP(object->state, >, FSCACHE_OBJECT_LOOKING_UP); 276 ASSERTCMP(object->state, >, FSCACHE_OBJECT_LOOKING_UP);
277 277
278 atomic_inc(&object->n_reads);
279 set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags);
280
278 if (fscache_submit_op(object, &op->op) < 0) 281 if (fscache_submit_op(object, &op->op) < 0)
279 goto nobufs_unlock; 282 goto nobufs_unlock;
280 spin_unlock(&cookie->lock); 283 spin_unlock(&cookie->lock);
@@ -386,6 +389,9 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
386 object = hlist_entry(cookie->backing_objects.first, 389 object = hlist_entry(cookie->backing_objects.first,
387 struct fscache_object, cookie_link); 390 struct fscache_object, cookie_link);
388 391
392 atomic_inc(&object->n_reads);
393 set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags);
394
389 if (fscache_submit_op(object, &op->op) < 0) 395 if (fscache_submit_op(object, &op->op) < 0)
390 goto nobufs_unlock; 396 goto nobufs_unlock;
391 spin_unlock(&cookie->lock); 397 spin_unlock(&cookie->lock);