aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fscache
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fscache')
-rw-r--r--fs/fscache/internal.h1
-rw-r--r--fs/fscache/object.c10
-rw-r--r--fs/fscache/stats.c4
3 files changed, 13 insertions, 2 deletions
diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h
index 5b49a373689b..0ca2566e038c 100644
--- a/fs/fscache/internal.h
+++ b/fs/fscache/internal.h
@@ -215,6 +215,7 @@ extern atomic_t fscache_n_object_no_alloc;
215extern atomic_t fscache_n_object_lookups; 215extern atomic_t fscache_n_object_lookups;
216extern atomic_t fscache_n_object_lookups_negative; 216extern atomic_t fscache_n_object_lookups_negative;
217extern atomic_t fscache_n_object_lookups_positive; 217extern atomic_t fscache_n_object_lookups_positive;
218extern atomic_t fscache_n_object_lookups_timed_out;
218extern atomic_t fscache_n_object_created; 219extern atomic_t fscache_n_object_created;
219extern atomic_t fscache_n_object_avail; 220extern atomic_t fscache_n_object_avail;
220extern atomic_t fscache_n_object_dead; 221extern atomic_t fscache_n_object_dead;
diff --git a/fs/fscache/object.c b/fs/fscache/object.c
index f3f952cf887e..e513ac599c8e 100644
--- a/fs/fscache/object.c
+++ b/fs/fscache/object.c
@@ -468,6 +468,7 @@ static void fscache_lookup_object(struct fscache_object *object)
468{ 468{
469 struct fscache_cookie *cookie = object->cookie; 469 struct fscache_cookie *cookie = object->cookie;
470 struct fscache_object *parent; 470 struct fscache_object *parent;
471 int ret;
471 472
472 _enter(""); 473 _enter("");
473 474
@@ -493,12 +494,19 @@ static void fscache_lookup_object(struct fscache_object *object)
493 494
494 fscache_stat(&fscache_n_object_lookups); 495 fscache_stat(&fscache_n_object_lookups);
495 fscache_stat(&fscache_n_cop_lookup_object); 496 fscache_stat(&fscache_n_cop_lookup_object);
496 object->cache->ops->lookup_object(object); 497 ret = object->cache->ops->lookup_object(object);
497 fscache_stat_d(&fscache_n_cop_lookup_object); 498 fscache_stat_d(&fscache_n_cop_lookup_object);
498 499
499 if (test_bit(FSCACHE_OBJECT_EV_ERROR, &object->events)) 500 if (test_bit(FSCACHE_OBJECT_EV_ERROR, &object->events))
500 set_bit(FSCACHE_COOKIE_UNAVAILABLE, &cookie->flags); 501 set_bit(FSCACHE_COOKIE_UNAVAILABLE, &cookie->flags);
501 502
503 if (ret == -ETIMEDOUT) {
504 /* probably stuck behind another object, so move this one to
505 * the back of the queue */
506 fscache_stat(&fscache_n_object_lookups_timed_out);
507 set_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events);
508 }
509
502 _leave(""); 510 _leave("");
503} 511}
504 512
diff --git a/fs/fscache/stats.c b/fs/fscache/stats.c
index 05f77caf4a2d..46435f3aae68 100644
--- a/fs/fscache/stats.c
+++ b/fs/fscache/stats.c
@@ -98,6 +98,7 @@ atomic_t fscache_n_object_no_alloc;
98atomic_t fscache_n_object_lookups; 98atomic_t fscache_n_object_lookups;
99atomic_t fscache_n_object_lookups_negative; 99atomic_t fscache_n_object_lookups_negative;
100atomic_t fscache_n_object_lookups_positive; 100atomic_t fscache_n_object_lookups_positive;
101atomic_t fscache_n_object_lookups_timed_out;
101atomic_t fscache_n_object_created; 102atomic_t fscache_n_object_created;
102atomic_t fscache_n_object_avail; 103atomic_t fscache_n_object_avail;
103atomic_t fscache_n_object_dead; 104atomic_t fscache_n_object_dead;
@@ -160,10 +161,11 @@ static int fscache_stats_show(struct seq_file *m, void *v)
160 atomic_read(&fscache_n_acquires_nobufs), 161 atomic_read(&fscache_n_acquires_nobufs),
161 atomic_read(&fscache_n_acquires_oom)); 162 atomic_read(&fscache_n_acquires_oom));
162 163
163 seq_printf(m, "Lookups: n=%u neg=%u pos=%u crt=%u\n", 164 seq_printf(m, "Lookups: n=%u neg=%u pos=%u crt=%u tmo=%u\n",
164 atomic_read(&fscache_n_object_lookups), 165 atomic_read(&fscache_n_object_lookups),
165 atomic_read(&fscache_n_object_lookups_negative), 166 atomic_read(&fscache_n_object_lookups_negative),
166 atomic_read(&fscache_n_object_lookups_positive), 167 atomic_read(&fscache_n_object_lookups_positive),
168 atomic_read(&fscache_n_object_lookups_timed_out),
167 atomic_read(&fscache_n_object_created)); 169 atomic_read(&fscache_n_object_created));
168 170
169 seq_printf(m, "Updates: n=%u nul=%u run=%u\n", 171 seq_printf(m, "Updates: n=%u nul=%u run=%u\n",