mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-17 02:36:21 +00:00
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
This commit is contained in:
parent
5c0bb97ce0
commit
bad5483196
@ -2976,11 +2976,13 @@ static void reiserfs_invalidatepage(struct page *page, unsigned int offset,
|
|||||||
struct buffer_head *head, *bh, *next;
|
struct buffer_head *head, *bh, *next;
|
||||||
struct inode *inode = page->mapping->host;
|
struct inode *inode = page->mapping->host;
|
||||||
unsigned int curr_off = 0;
|
unsigned int curr_off = 0;
|
||||||
|
unsigned int stop = offset + length;
|
||||||
|
int partial_page = (offset || length < PAGE_CACHE_SIZE);
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
|
||||||
BUG_ON(!PageLocked(page));
|
BUG_ON(!PageLocked(page));
|
||||||
|
|
||||||
if (offset == 0)
|
if (!partial_page)
|
||||||
ClearPageChecked(page);
|
ClearPageChecked(page);
|
||||||
|
|
||||||
if (!page_has_buffers(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;
|
unsigned int next_off = curr_off + bh->b_size;
|
||||||
next = bh->b_this_page;
|
next = bh->b_this_page;
|
||||||
|
|
||||||
|
if (next_off > stop)
|
||||||
|
goto out;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* is this block fully invalidated?
|
* 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,
|
* The get_block cached value has been unconditionally invalidated,
|
||||||
* so real IO is not possible anymore.
|
* so real IO is not possible anymore.
|
||||||
*/
|
*/
|
||||||
if (!offset && ret) {
|
if (!partial_page && ret) {
|
||||||
ret = try_to_release_page(page, 0);
|
ret = try_to_release_page(page, 0);
|
||||||
/* maybe should BUG_ON(!ret); - neilb */
|
/* maybe should BUG_ON(!ret); - neilb */
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user