Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 348979
b: refs/heads/master
c: a7fdffb
h: refs/heads/master
i:
  348977: acde059
  348975: a11519d
v: v3
  • Loading branch information
Jaegeuk Kim committed Jan 22, 2013
1 parent 0ca452d commit 5fb8094
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c01e54b770e69c65525295eb2668be3dc0822406
refs/heads/master: a7fdffbd3ea4b3cc2993af006bde38a423b38b72
17 changes: 11 additions & 6 deletions trunk/fs/f2fs/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,24 +1124,29 @@ static int f2fs_write_node_page(struct page *page,
return 0;
}

/*
* It is very important to gather dirty pages and write at once, so that we can
* submit a big bio without interfering other data writes.
* Be default, 512 pages (2MB), a segment size, is quite reasonable.
*/
#define COLLECT_DIRTY_NODES 512
static int f2fs_write_node_pages(struct address_space *mapping,
struct writeback_control *wbc)
{
struct f2fs_sb_info *sbi = F2FS_SB(mapping->host->i_sb);
struct block_device *bdev = sbi->sb->s_bdev;
long nr_to_write = wbc->nr_to_write;

if (wbc->for_kupdate)
return 0;

if (get_pages(sbi, F2FS_DIRTY_NODES) == 0)
return 0;

/* First check balancing cached NAT entries */
if (try_to_free_nats(sbi, NAT_ENTRY_PER_BLOCK)) {
write_checkpoint(sbi, false, false);
return 0;
}

/* collect a number of dirty node pages and write together */
if (get_pages(sbi, F2FS_DIRTY_NODES) < COLLECT_DIRTY_NODES)
return 0;

/* if mounting is failed, skip writing node pages */
wbc->nr_to_write = bio_get_nr_vecs(bdev);
sync_node_pages(sbi, 0, wbc);
Expand Down

0 comments on commit 5fb8094

Please sign in to comment.