提交 c3850aa1 编写于 作者: J Jaegeuk Kim

f2fs: fix return value of releasepage for node and data

If the return value of releasepage is equal to zero, the page cannot be reclaimed.
Instead, we should return 1 in order to reclaim clean pages.
Reviewed-by: NNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
上级 48cb76c7
...@@ -683,7 +683,7 @@ static void f2fs_invalidate_data_page(struct page *page, unsigned long offset) ...@@ -683,7 +683,7 @@ static void f2fs_invalidate_data_page(struct page *page, unsigned long offset)
static int f2fs_release_data_page(struct page *page, gfp_t wait) static int f2fs_release_data_page(struct page *page, gfp_t wait)
{ {
ClearPagePrivate(page); ClearPagePrivate(page);
return 0; return 1;
} }
static int f2fs_set_data_page_dirty(struct page *page) static int f2fs_set_data_page_dirty(struct page *page)
......
...@@ -933,7 +933,6 @@ struct page *get_node_page_ra(struct page *parent, int start) ...@@ -933,7 +933,6 @@ struct page *get_node_page_ra(struct page *parent, int start)
if (!nid) if (!nid)
return ERR_PTR(-ENOENT); return ERR_PTR(-ENOENT);
repeat:
page = grab_cache_page(mapping, nid); page = grab_cache_page(mapping, nid);
if (!page) if (!page)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
...@@ -961,12 +960,6 @@ struct page *get_node_page_ra(struct page *parent, int start) ...@@ -961,12 +960,6 @@ struct page *get_node_page_ra(struct page *parent, int start)
f2fs_put_page(page, 1); f2fs_put_page(page, 1);
return ERR_PTR(-EIO); return ERR_PTR(-EIO);
} }
/* Has the page been truncated? */
if (page->mapping != mapping) {
f2fs_put_page(page, 1);
goto repeat;
}
mark_page_accessed(page); mark_page_accessed(page);
return page; return page;
} }
...@@ -1189,7 +1182,7 @@ static void f2fs_invalidate_node_page(struct page *page, unsigned long offset) ...@@ -1189,7 +1182,7 @@ static void f2fs_invalidate_node_page(struct page *page, unsigned long offset)
static int f2fs_release_node_page(struct page *page, gfp_t wait) static int f2fs_release_node_page(struct page *page, gfp_t wait)
{ {
ClearPagePrivate(page); ClearPagePrivate(page);
return 0; return 1;
} }
/* /*
...@@ -1630,8 +1623,6 @@ void flush_nat_entries(struct f2fs_sb_info *sbi) ...@@ -1630,8 +1623,6 @@ void flush_nat_entries(struct f2fs_sb_info *sbi)
write_lock(&nm_i->nat_tree_lock); write_lock(&nm_i->nat_tree_lock);
__del_from_nat_cache(nm_i, ne); __del_from_nat_cache(nm_i, ne);
write_unlock(&nm_i->nat_tree_lock); write_unlock(&nm_i->nat_tree_lock);
/* We can reuse this freed nid at this point */
add_free_nid(NM_I(sbi), nid); add_free_nid(NM_I(sbi), nid);
} else { } else {
write_lock(&nm_i->nat_tree_lock); write_lock(&nm_i->nat_tree_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册