diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/fscache.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/fscache.h b/include/linux/fscache.h index b195c2e1ef6a..245b48646efa 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h | |||
| @@ -178,6 +178,13 @@ extern void __fscache_unregister_netfs(struct fscache_netfs *); | |||
| 178 | extern struct fscache_cache_tag *__fscache_lookup_cache_tag(const char *); | 178 | extern struct fscache_cache_tag *__fscache_lookup_cache_tag(const char *); |
| 179 | extern void __fscache_release_cache_tag(struct fscache_cache_tag *); | 179 | extern void __fscache_release_cache_tag(struct fscache_cache_tag *); |
| 180 | 180 | ||
| 181 | extern struct fscache_cookie *__fscache_acquire_cookie( | ||
| 182 | struct fscache_cookie *, | ||
| 183 | const struct fscache_cookie_def *, | ||
| 184 | void *); | ||
| 185 | extern void __fscache_relinquish_cookie(struct fscache_cookie *, int); | ||
| 186 | extern void __fscache_update_cookie(struct fscache_cookie *); | ||
| 187 | |||
| 181 | /** | 188 | /** |
| 182 | * fscache_register_netfs - Register a filesystem as desiring caching services | 189 | * fscache_register_netfs - Register a filesystem as desiring caching services |
| 183 | * @netfs: The description of the filesystem | 190 | * @netfs: The description of the filesystem |
| @@ -269,7 +276,10 @@ struct fscache_cookie *fscache_acquire_cookie( | |||
| 269 | const struct fscache_cookie_def *def, | 276 | const struct fscache_cookie_def *def, |
| 270 | void *netfs_data) | 277 | void *netfs_data) |
| 271 | { | 278 | { |
| 272 | return NULL; | 279 | if (fscache_cookie_valid(parent)) |
| 280 | return __fscache_acquire_cookie(parent, def, netfs_data); | ||
| 281 | else | ||
| 282 | return NULL; | ||
| 273 | } | 283 | } |
| 274 | 284 | ||
| 275 | /** | 285 | /** |
| @@ -287,6 +297,8 @@ struct fscache_cookie *fscache_acquire_cookie( | |||
| 287 | static inline | 297 | static inline |
| 288 | void fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire) | 298 | void fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire) |
| 289 | { | 299 | { |
| 300 | if (fscache_cookie_valid(cookie)) | ||
| 301 | __fscache_relinquish_cookie(cookie, retire); | ||
| 290 | } | 302 | } |
| 291 | 303 | ||
| 292 | /** | 304 | /** |
| @@ -302,6 +314,8 @@ void fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire) | |||
| 302 | static inline | 314 | static inline |
| 303 | void fscache_update_cookie(struct fscache_cookie *cookie) | 315 | void fscache_update_cookie(struct fscache_cookie *cookie) |
| 304 | { | 316 | { |
| 317 | if (fscache_cookie_valid(cookie)) | ||
| 318 | __fscache_update_cookie(cookie); | ||
| 305 | } | 319 | } |
| 306 | 320 | ||
| 307 | /** | 321 | /** |
