diff options
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/page-io.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 74cd1f7f1f88..dcdeef169a69 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c | |||
@@ -60,6 +60,7 @@ void ext4_ioend_wait(struct inode *inode) | |||
60 | static void put_io_page(struct ext4_io_page *io_page) | 60 | static void put_io_page(struct ext4_io_page *io_page) |
61 | { | 61 | { |
62 | if (atomic_dec_and_test(&io_page->p_count)) { | 62 | if (atomic_dec_and_test(&io_page->p_count)) { |
63 | end_page_writeback(io_page->p_page); | ||
63 | put_page(io_page->p_page); | 64 | put_page(io_page->p_page); |
64 | kmem_cache_free(io_page_cachep, io_page); | 65 | kmem_cache_free(io_page_cachep, io_page); |
65 | } | 66 | } |
@@ -233,9 +234,9 @@ static void ext4_end_bio(struct bio *bio, int error) | |||
233 | } while (bh != head); | 234 | } while (bh != head); |
234 | } | 235 | } |
235 | 236 | ||
236 | if (atomic_read(&io_end->pages[i]->p_count) == 1) | 237 | put_io_page(io_end->pages[i]); |
237 | end_page_writeback(io_end->pages[i]->p_page); | ||
238 | } | 238 | } |
239 | io_end->num_io_pages = 0; | ||
239 | inode = io_end->inode; | 240 | inode = io_end->inode; |
240 | 241 | ||
241 | if (error) { | 242 | if (error) { |
@@ -427,8 +428,6 @@ int ext4_bio_write_page(struct ext4_io_submit *io, | |||
427 | * PageWriteback bit from the page to prevent the system from | 428 | * PageWriteback bit from the page to prevent the system from |
428 | * wedging later on. | 429 | * wedging later on. |
429 | */ | 430 | */ |
430 | if (atomic_read(&io_page->p_count) == 1) | ||
431 | end_page_writeback(page); | ||
432 | put_io_page(io_page); | 431 | put_io_page(io_page); |
433 | return ret; | 432 | return ret; |
434 | } | 433 | } |