linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Zhang Zhen <zhenzhang.zhang@huawei.com>
To: jaegeuk@kernel.org, cm224.lee@samsung.com
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH] fs/f2fs: replace open coded nofail allocation in __add_ino_entry
Date: Mon, 24 Aug 2015 11:39:55 +0800	[thread overview]
Message-ID: <55DA920B.9040706@huawei.com> (raw)
In-Reply-To: <1440386638-40325-1-git-send-email-zhenzhang.zhang@huawei.com>

__add_ino_entry is looping around the allocation request and minics
__GFP_NOFAIL behavior without any allocation fallback strategy.
Here remove the open coded loop and replace it with __GFP_NOFAIL.

Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
---
 fs/f2fs/checkpoint.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index b70bbe1..d62363b 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -337,12 +337,7 @@ retry:

 	e = radix_tree_lookup(&im->ino_root, ino);
 	if (!e) {
-		e = kmem_cache_alloc(ino_entry_slab, GFP_ATOMIC);
-		if (!e) {
-			spin_unlock(&im->ino_lock);
-			radix_tree_preload_end();
-			goto retry;
-		}
+		e = kmem_cache_alloc(ino_entry_slab, GFP_ATOMIC|__GFP_NOFAIL);
 		if (radix_tree_insert(&im->ino_root, ino, e)) {
 			spin_unlock(&im->ino_lock);
 			kmem_cache_free(ino_entry_slab, e);
-- 
1.9.1


.





------------------------------------------------------------------------------

       reply	other threads:[~2015-08-24  3:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1440386638-40325-1-git-send-email-zhenzhang.zhang@huawei.com>
2015-08-24  3:39 ` Zhang Zhen [this message]
2015-08-24  4:56   ` [PATCH] fs/f2fs: replace open coded nofail allocation in __add_ino_entry Jaegeuk Kim
2015-08-24  6:10     ` Zhang Zhen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55DA920B.9040706@huawei.com \
    --to=zhenzhang.zhang@huawei.com \
    --cc=cm224.lee@samsung.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).