summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLukas Czerner <lczerner@redhat.com>2013-05-21 23:58:51 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-05-21 23:58:51 -0400
commitbad54831968a8429b08e34faf33178c21ac6bba0 (patch)
tree5bfb2930e095e9f050029489677bc2646866d9ea /fs
parent5c0bb97ce082732cd279883a231f908c1d39ae21 (diff)
downloadlinux-bad54831968a8429b08e34faf33178c21ac6bba0.tar.bz2
reiserfs: use ->invalidatepage() length argument
->invalidatepage() aop now accepts range to invalidate so we can make use of it in reiserfs_invalidatepage() Signed-off-by: Lukas Czerner <lczerner@redhat.com> Cc: reiserfs-devel@vger.kernel.org
Diffstat (limited to 'fs')
-rw-r--r--fs/reiserfs/inode.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 278c86e3e6c4..76c8faddf137 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -2976,11 +2976,13 @@ static void reiserfs_invalidatepage(struct page *page, unsigned int offset,
struct buffer_head *head, *bh, *next;
struct inode *inode = page->mapping->host;
unsigned int curr_off = 0;
+ unsigned int stop = offset + length;
+ int partial_page = (offset || length < PAGE_CACHE_SIZE);
int ret = 1;
BUG_ON(!PageLocked(page));
- if (offset == 0)
+ if (!partial_page)
ClearPageChecked(page);
if (!page_has_buffers(page))
@@ -2992,6 +2994,9 @@ static void reiserfs_invalidatepage(struct page *page, unsigned int offset,
unsigned int next_off = curr_off + bh->b_size;
next = bh->b_this_page;
+ if (next_off > stop)
+ goto out;
+
/*
* is this block fully invalidated?
*/
@@ -3010,7 +3015,7 @@ static void reiserfs_invalidatepage(struct page *page, unsigned int offset,
* The get_block cached value has been unconditionally invalidated,
* so real IO is not possible anymore.
*/
- if (!offset && ret) {
+ if (!partial_page && ret) {
ret = try_to_release_page(page, 0);
/* maybe should BUG_ON(!ret); - neilb */
}