aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Kleikamp <shaggy@linux.vnet.ibm.com>2008-01-03 14:09:33 -0500
committerDave Kleikamp <shaggy@linux.vnet.ibm.com>2008-01-03 14:09:33 -0500
commit29a424f28390752a4ca2349633aaacc6be494db5 (patch)
tree3f9306c0dc66b049063e65cbb9e723cff6af524a
parentb8c9a18712f7b617fda66d878ce3759c9e575ba0 (diff)
JFS: clear PAGECACHE_TAG_DIRTY for no-write pages
When JFS decides to drop a dirty metapage, it simply clears the META_dirty bit and leave alone the PG_dirty and PAGECACHE_TAG_DIRTY bits. When such no-write page goes to metapage_writepage(), the `relic' PAGECACHE_TAG_DIRTY tag should be cleared, to prevent pdflush from repeatedly trying to sync them. This is done through set_page_writeback(), so call it should be called in all cases. If no I/O is initiated, end_page_writeback() should be called immediately. This is how __block_write_full_page() does things. Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com> CC: Fengguang Wu <wfg@mail.ustc.edu.cn>
-rw-r--r--fs/jfs/jfs_metapage.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index f5cd8d38af7a..b27fa117f229 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -360,6 +360,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
360 struct metapage *mp; 360 struct metapage *mp;
361 int redirty = 0; 361 int redirty = 0;
362 sector_t lblock; 362 sector_t lblock;
363 int nr_underway = 0;
363 sector_t pblock; 364 sector_t pblock;
364 sector_t next_block = 0; 365 sector_t next_block = 0;
365 sector_t page_start; 366 sector_t page_start;
@@ -371,6 +372,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
371 (PAGE_CACHE_SHIFT - inode->i_blkbits); 372 (PAGE_CACHE_SHIFT - inode->i_blkbits);
372 BUG_ON(!PageLocked(page)); 373 BUG_ON(!PageLocked(page));
373 BUG_ON(PageWriteback(page)); 374 BUG_ON(PageWriteback(page));
375 set_page_writeback(page);
374 376
375 for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) { 377 for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) {
376 mp = page_to_mp(page, offset); 378 mp = page_to_mp(page, offset);
@@ -413,11 +415,10 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
413 if (!bio->bi_size) 415 if (!bio->bi_size)
414 goto dump_bio; 416 goto dump_bio;
415 submit_bio(WRITE, bio); 417 submit_bio(WRITE, bio);
418 nr_underway++;
416 bio = NULL; 419 bio = NULL;
417 } else { 420 } else
418 set_page_writeback(page);
419 inc_io(page); 421 inc_io(page);
420 }
421 xlen = (PAGE_CACHE_SIZE - offset) >> inode->i_blkbits; 422 xlen = (PAGE_CACHE_SIZE - offset) >> inode->i_blkbits;
422 pblock = metapage_get_blocks(inode, lblock, &xlen); 423 pblock = metapage_get_blocks(inode, lblock, &xlen);
423 if (!pblock) { 424 if (!pblock) {
@@ -449,12 +450,16 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
449 goto dump_bio; 450 goto dump_bio;
450 451
451 submit_bio(WRITE, bio); 452 submit_bio(WRITE, bio);
453 nr_underway++;
452 } 454 }
453 if (redirty) 455 if (redirty)
454 redirty_page_for_writepage(wbc, page); 456 redirty_page_for_writepage(wbc, page);
455 457
456 unlock_page(page); 458 unlock_page(page);
457 459
460 if (nr_underway == 0)
461 end_page_writeback(page);
462
458 return 0; 463 return 0;
459add_failed: 464add_failed:
460 /* We should never reach here, since we're only adding one vec */ 465 /* We should never reach here, since we're only adding one vec */