Skip to content

Commit

Permalink
reiserfs: use ->invalidatepage() length argument
Browse files Browse the repository at this point in the history
->invalidatepage() aop now accepts range to invalidate so we can make
use of it in reiserfs_invalidatepage()

Signed-off-by: Lukas Czerner <[email protected]>
Cc: [email protected]
  • Loading branch information
Lukas Czerner authored and tytso committed May 22, 2013
1 parent 5c0bb97 commit bad5483
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fs/reiserfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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?
*/
Expand All @@ -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 */
}
Expand Down

0 comments on commit bad5483

Please sign in to comment.