diff options
| author | James Morris <jmorris@macbook.(none)> | 2009-12-03 12:03:40 +0530 |
|---|---|---|
| committer | James Morris <jmorris@macbook.(none)> | 2009-12-03 12:03:40 +0530 |
| commit | c84d6efd363a3948eb32ec40d46bab6338580454 (patch) | |
| tree | 3ba7ac46e6626fe8ac843834588609eb6ccee5c6 /include/linux/fscache.h | |
| parent | 7539cf4b92be4aecc573ea962135f246a7a33401 (diff) | |
| parent | 22763c5cf3690a681551162c15d34d935308c8d7 (diff) | |
| download | linux-next-c84d6efd363a3948eb32ec40d46bab6338580454.tar.gz linux-next-c84d6efd363a3948eb32ec40d46bab6338580454.zip | |
Merge branch 'master' into next
Diffstat (limited to 'include/linux/fscache.h')
| -rw-r--r-- | include/linux/fscache.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/fscache.h b/include/linux/fscache.h index 6d8ee466e0a0..595ce49288b7 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h @@ -202,6 +202,8 @@ extern int __fscache_write_page(struct fscache_cookie *, struct page *, gfp_t); extern void __fscache_uncache_page(struct fscache_cookie *, struct page *); extern bool __fscache_check_page_write(struct fscache_cookie *, struct page *); extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *); +extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *, + gfp_t); /** * fscache_register_netfs - Register a filesystem as desiring caching services @@ -615,4 +617,29 @@ void fscache_wait_on_page_write(struct fscache_cookie *cookie, __fscache_wait_on_page_write(cookie, page); } +/** + * fscache_maybe_release_page - Consider releasing a page, cancelling a store + * @cookie: The cookie representing the cache object + * @page: The netfs page that is being cached. + * @gfp: The gfp flags passed to releasepage() + * + * Consider releasing a page for the vmscan algorithm, on behalf of the netfs's + * releasepage() call. A storage request on the page may cancelled if it is + * not currently being processed. + * + * The function returns true if the page no longer has a storage request on it, + * and false if a storage request is left in place. If true is returned, the + * page will have been passed to fscache_uncache_page(). If false is returned + * the page cannot be freed yet. + */ +static inline +bool fscache_maybe_release_page(struct fscache_cookie *cookie, + struct page *page, + gfp_t gfp) +{ + if (fscache_cookie_valid(cookie) && PageFsCache(page)) + return __fscache_maybe_release_page(cookie, page, gfp); + return false; +} + #endif /* _LINUX_FSCACHE_H */ |
