diff options
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 | }; |