diff options
Diffstat (limited to 'fs/reiserfs/inode.c')
-rw-r--r-- | fs/reiserfs/inode.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index f844533792ee..0048cc16a6a8 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -2975,16 +2975,19 @@ static int invalidatepage_can_drop(struct inode *inode, struct buffer_head *bh) | |||
2975 | } | 2975 | } |
2976 | 2976 | ||
2977 | /* clm -- taken from fs/buffer.c:block_invalidate_page */ | 2977 | /* clm -- taken from fs/buffer.c:block_invalidate_page */ |
2978 | static void reiserfs_invalidatepage(struct page *page, unsigned long offset) | 2978 | static void reiserfs_invalidatepage(struct page *page, unsigned int offset, |
2979 | unsigned int length) | ||
2979 | { | 2980 | { |
2980 | struct buffer_head *head, *bh, *next; | 2981 | struct buffer_head *head, *bh, *next; |
2981 | struct inode *inode = page->mapping->host; | 2982 | struct inode *inode = page->mapping->host; |
2982 | unsigned int curr_off = 0; | 2983 | unsigned int curr_off = 0; |
2984 | unsigned int stop = offset + length; | ||
2985 | int partial_page = (offset || length < PAGE_CACHE_SIZE); | ||
2983 | int ret = 1; | 2986 | int ret = 1; |
2984 | 2987 | ||
2985 | BUG_ON(!PageLocked(page)); | 2988 | BUG_ON(!PageLocked(page)); |
2986 | 2989 | ||
2987 | if (offset == 0) | 2990 | if (!partial_page) |
2988 | ClearPageChecked(page); | 2991 | ClearPageChecked(page); |
2989 | 2992 | ||
2990 | if (!page_has_buffers(page)) | 2993 | if (!page_has_buffers(page)) |
@@ -2996,6 +2999,9 @@ static void reiserfs_invalidatepage(struct page *page, unsigned long offset) | |||
2996 | unsigned int next_off = curr_off + bh->b_size; | 2999 | unsigned int next_off = curr_off + bh->b_size; |
2997 | next = bh->b_this_page; | 3000 | next = bh->b_this_page; |
2998 | 3001 | ||
3002 | if (next_off > stop) | ||
3003 | goto out; | ||
3004 | |||
2999 | /* | 3005 | /* |
3000 | * is this block fully invalidated? | 3006 | * is this block fully invalidated? |
3001 | */ | 3007 | */ |
@@ -3014,7 +3020,7 @@ static void reiserfs_invalidatepage(struct page *page, unsigned long offset) | |||
3014 | * The get_block cached value has been unconditionally invalidated, | 3020 | * The get_block cached value has been unconditionally invalidated, |
3015 | * so real IO is not possible anymore. | 3021 | * so real IO is not possible anymore. |
3016 | */ | 3022 | */ |
3017 | if (!offset && ret) { | 3023 | if (!partial_page && ret) { |
3018 | ret = try_to_release_page(page, 0); | 3024 | ret = try_to_release_page(page, 0); |
3019 | /* maybe should BUG_ON(!ret); - neilb */ | 3025 | /* maybe should BUG_ON(!ret); - neilb */ |
3020 | } | 3026 | } |