f2fs: avoid unnecessary f2fs_balance_fs calls

Only when node page is newly dirtied, it needs to check whether we need to do
f2fs_gc.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Jaegeuk Kim
2016-01-07 13:23:12 -08:00
parent 7612118ae8
commit 12719ae14e
6 changed files with 30 additions and 29 deletions
+2 -2
View File
@@ -317,7 +317,7 @@ static inline bool IS_DNODE(struct page *node_page)
return true;
}
static inline void set_nid(struct page *p, int off, nid_t nid, bool i)
static inline int set_nid(struct page *p, int off, nid_t nid, bool i)
{
struct f2fs_node *rn = F2FS_NODE(p);
@@ -327,7 +327,7 @@ static inline void set_nid(struct page *p, int off, nid_t nid, bool i)
rn->i.i_nid[off - NODE_DIR1_BLOCK] = cpu_to_le32(nid);
else
rn->in.nid[off] = cpu_to_le32(nid);
set_page_dirty(p);
return set_page_dirty(p);
}
static inline nid_t get_nid(struct page *p, int off, bool i)