aboutsummaryrefslogtreecommitdiff
path: root/fs/f2fs/segment.c
diff options
context:
space:
mode:
authorJaegeuk Kim2014-12-05 10:39:49 -0800
committerJaegeuk Kim2014-12-08 10:35:05 -0800
commit9be32d72becca41d7d9b010d7d9be1d39489414f (patch)
tree7ac34f8b38e3db9411a175b4e5f0ee810c57d7ef /fs/f2fs/segment.c
parent769ec6e5b7d4a8115447736871be8bffaaba3a7d (diff)
f2fs: do retry operations with cond_resched
This patch revists retrial paths in f2fs. The basic idea is to use cond_resched instead of retrying from the very early stage. Suggested-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r--fs/f2fs/segment.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 9a33e34d26ce..c79d67e5045f 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -179,13 +179,13 @@ void register_inmem_page(struct inode *inode, struct page *page)
struct f2fs_inode_info *fi = F2FS_I(inode);
struct inmem_pages *new;
int err;
-retry:
+
new = f2fs_kmem_cache_alloc(inmem_entry_slab, GFP_NOFS);
/* add atomic page indices to the list */
new->page = page;
INIT_LIST_HEAD(&new->list);
-
+retry:
/* increase reference count with clean state */
mutex_lock(&fi->inmem_lock);
err = radix_tree_insert(&fi->inmem_root, page->index, new);
@@ -195,7 +195,6 @@ retry:
return;
} else if (err) {
mutex_unlock(&fi->inmem_lock);
- kmem_cache_free(inmem_entry_slab, new);
goto retry;
}
get_page(page);