diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-03-14 01:24:32 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-03-20 10:30:13 +0100 |
commit | c3850aa1cb25872fddacd7abd8dfb021411e92ee (patch) | |
tree | bca15120146f17ce472eb64718579f4d7ce8eaa0 | |
parent | f2fs: scan next nat page to reuse free nids in there (diff) | |
download | linux-c3850aa1cb25872fddacd7abd8dfb021411e92ee.tar.xz linux-c3850aa1cb25872fddacd7abd8dfb021411e92ee.zip |
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: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
-rw-r--r-- | fs/f2fs/data.c | 2 | ||||
-rw-r--r-- | fs/f2fs/node.c | 11 |
2 files changed, 2 insertions, 11 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index c8e20b618913..ea8be6fc38f1 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -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) { ClearPagePrivate(page); - return 0; + return 1; } static int f2fs_set_data_page_dirty(struct page *page) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 94951d9aff4c..bf9172bbbb00 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -933,7 +933,6 @@ struct page *get_node_page_ra(struct page *parent, int start) if (!nid) return ERR_PTR(-ENOENT); -repeat: page = grab_cache_page(mapping, nid); if (!page) return ERR_PTR(-ENOMEM); @@ -961,12 +960,6 @@ page_hit: f2fs_put_page(page, 1); return ERR_PTR(-EIO); } - - /* Has the page been truncated? */ - if (page->mapping != mapping) { - f2fs_put_page(page, 1); - goto repeat; - } mark_page_accessed(page); return page; } @@ -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) { ClearPagePrivate(page); - return 0; + return 1; } /* @@ -1630,8 +1623,6 @@ flush_now: write_lock(&nm_i->nat_tree_lock); __del_from_nat_cache(nm_i, ne); write_unlock(&nm_i->nat_tree_lock); - - /* We can reuse this freed nid at this point */ add_free_nid(NM_I(sbi), nid); } else { write_lock(&nm_i->nat_tree_lock); |