diff options
author | Suresh Jayaraman <sjayaraman@suse.de> | 2010-07-05 08:43:00 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-08-02 08:40:36 -0400 |
commit | 85f2d6b44d7e83bdeab87df910127c6f296866cf (patch) | |
tree | 238389c1726e212a80336551809b44b0bbedec38 /fs/cifs/file.c | |
parent | 9451a9a52f91a4c171cfaca2f6d7a2ce91867b8d (diff) |
cifs: FS-Cache page management
Takes care of invalidation and release of FS-Cache marked pages and also
invalidation of the FsCache page flag when the inode is removed.
Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index d302d941f9ac..f677ede766d1 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -2267,6 +2267,22 @@ out: | |||
2267 | return rc; | 2267 | return rc; |
2268 | } | 2268 | } |
2269 | 2269 | ||
2270 | static int cifs_release_page(struct page *page, gfp_t gfp) | ||
2271 | { | ||
2272 | if (PagePrivate(page)) | ||
2273 | return 0; | ||
2274 | |||
2275 | return cifs_fscache_release_page(page, gfp); | ||
2276 | } | ||
2277 | |||
2278 | static void cifs_invalidate_page(struct page *page, unsigned long offset) | ||
2279 | { | ||
2280 | struct cifsInodeInfo *cifsi = CIFS_I(page->mapping->host); | ||
2281 | |||
2282 | if (offset == 0) | ||
2283 | cifs_fscache_invalidate_page(page, &cifsi->vfs_inode); | ||
2284 | } | ||
2285 | |||
2270 | static void | 2286 | static void |
2271 | cifs_oplock_break(struct slow_work *work) | 2287 | cifs_oplock_break(struct slow_work *work) |
2272 | { | 2288 | { |
@@ -2340,6 +2356,8 @@ const struct address_space_operations cifs_addr_ops = { | |||
2340 | .write_begin = cifs_write_begin, | 2356 | .write_begin = cifs_write_begin, |
2341 | .write_end = cifs_write_end, | 2357 | .write_end = cifs_write_end, |
2342 | .set_page_dirty = __set_page_dirty_nobuffers, | 2358 | .set_page_dirty = __set_page_dirty_nobuffers, |
2359 | .releasepage = cifs_release_page, | ||
2360 | .invalidatepage = cifs_invalidate_page, | ||
2343 | /* .sync_page = cifs_sync_page, */ | 2361 | /* .sync_page = cifs_sync_page, */ |
2344 | /* .direct_IO = */ | 2362 | /* .direct_IO = */ |
2345 | }; | 2363 | }; |
@@ -2356,6 +2374,8 @@ const struct address_space_operations cifs_addr_ops_smallbuf = { | |||
2356 | .write_begin = cifs_write_begin, | 2374 | .write_begin = cifs_write_begin, |
2357 | .write_end = cifs_write_end, | 2375 | .write_end = cifs_write_end, |
2358 | .set_page_dirty = __set_page_dirty_nobuffers, | 2376 | .set_page_dirty = __set_page_dirty_nobuffers, |
2377 | .releasepage = cifs_release_page, | ||
2378 | .invalidatepage = cifs_invalidate_page, | ||
2359 | /* .sync_page = cifs_sync_page, */ | 2379 | /* .sync_page = cifs_sync_page, */ |
2360 | /* .direct_IO = */ | 2380 | /* .direct_IO = */ |
2361 | }; | 2381 | }; |