diff options
author | David Howells <dhowells@redhat.com> | 2009-11-19 13:11:45 -0500 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2009-11-19 13:11:45 -0500 |
commit | 60d543ca724be155c2b6166e36a00c80b21bd810 (patch) | |
tree | 90ec6edd77ddb7666dbf7069aa2e001f155cea49 /fs/fscache/internal.h | |
parent | d461d26dde901b0523c46b0317e7fccf574a3933 (diff) |
FS-Cache: Start processing an object's operations on that object's death
Start processing an object's operations when that object moves into the DYING
state as the object cannot be destroyed until all its outstanding operations
have completed.
Furthermore, make sure that read and allocation operations handle being woken
up on a dead object. Such events are recorded in the Allocs.abt and
Retrvls.abt statistics as viewable through /proc/fs/fscache/stats.
The code for waiting for object activation for the read and allocation
operations is also extracted into its own function as it is much the same in
all cases, differing only in the stats incremented.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/fscache/internal.h')
-rw-r--r-- | fs/fscache/internal.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h index 2bf463d26080..5b49a373689b 100644 --- a/fs/fscache/internal.h +++ b/fs/fscache/internal.h | |||
@@ -156,6 +156,7 @@ extern atomic_t fscache_n_allocs_ok; | |||
156 | extern atomic_t fscache_n_allocs_wait; | 156 | extern atomic_t fscache_n_allocs_wait; |
157 | extern atomic_t fscache_n_allocs_nobufs; | 157 | extern atomic_t fscache_n_allocs_nobufs; |
158 | extern atomic_t fscache_n_allocs_intr; | 158 | extern atomic_t fscache_n_allocs_intr; |
159 | extern atomic_t fscache_n_allocs_object_dead; | ||
159 | extern atomic_t fscache_n_alloc_ops; | 160 | extern atomic_t fscache_n_alloc_ops; |
160 | extern atomic_t fscache_n_alloc_op_waits; | 161 | extern atomic_t fscache_n_alloc_op_waits; |
161 | 162 | ||
@@ -166,6 +167,7 @@ extern atomic_t fscache_n_retrievals_nodata; | |||
166 | extern atomic_t fscache_n_retrievals_nobufs; | 167 | extern atomic_t fscache_n_retrievals_nobufs; |
167 | extern atomic_t fscache_n_retrievals_intr; | 168 | extern atomic_t fscache_n_retrievals_intr; |
168 | extern atomic_t fscache_n_retrievals_nomem; | 169 | extern atomic_t fscache_n_retrievals_nomem; |
170 | extern atomic_t fscache_n_retrievals_object_dead; | ||
169 | extern atomic_t fscache_n_retrieval_ops; | 171 | extern atomic_t fscache_n_retrieval_ops; |
170 | extern atomic_t fscache_n_retrieval_op_waits; | 172 | extern atomic_t fscache_n_retrieval_op_waits; |
171 | 173 | ||
@@ -249,9 +251,12 @@ static inline void fscache_stat_d(atomic_t *stat) | |||
249 | atomic_dec(stat); | 251 | atomic_dec(stat); |
250 | } | 252 | } |
251 | 253 | ||
254 | #define __fscache_stat(stat) (stat) | ||
255 | |||
252 | extern const struct file_operations fscache_stats_fops; | 256 | extern const struct file_operations fscache_stats_fops; |
253 | #else | 257 | #else |
254 | 258 | ||
259 | #define __fscache_stat(stat) (NULL) | ||
255 | #define fscache_stat(stat) do {} while (0) | 260 | #define fscache_stat(stat) do {} while (0) |
256 | #endif | 261 | #endif |
257 | 262 | ||