Skip to content

Commit

Permalink
f2fs: drop obsolete node page when it is truncated
Browse files Browse the repository at this point in the history
If a node page is trucated, we'd better drop the page in the node_inode's page
cache for better memory footprint.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
  • Loading branch information
Jaegeuk Kim committed Jan 22, 2014
1 parent 4ef51a8 commit bf39c00
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/f2fs/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,10 @@ static void truncate_node(struct dnode_of_data *dn)
F2FS_SET_SB_DIRT(sbi);

f2fs_put_page(dn->node_page, 1);

invalidate_mapping_pages(NODE_MAPPING(sbi),
dn->node_page->index, dn->node_page->index);

dn->node_page = NULL;
trace_f2fs_truncate_node(dn->inode, dn->nid, ni.blk_addr);
}
Expand Down

0 comments on commit bf39c00

Please sign in to comment.