From: Namjae Jeon <linkinjeon@gmail.com>
To: jaegeuk.kim@samsung.com
Cc: linux-f2fs-devel@lists.sourceforge.net,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Namjae Jeon <linkinjeon@gmail.com>,
Namjae Jeon <namjae.jeon@samsung.com>,
Amit Sahrawat <a.sahrawat@samsung.com>
Subject: [PATCH 4/5] f2fs: remove nid_free from f2fs_new_inode
Date: Sun, 17 Mar 2013 17:27:07 +0900 [thread overview]
Message-ID: <1363508828-2920-1-git-send-email-linkinjeon@gmail.com> (raw)
From: Namjae Jeon <namjae.jeon@samsung.com>
we can remove nid_free from new inode allocation part.
Since, nid_free is used to check if we need to free alloced nid
in case of failure.
Instead we can directly call alloc_nid_failed from that point, as
there is no dependency in that path.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
---
fs/f2fs/namei.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index d4a171b..261d821 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -24,7 +24,6 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
struct f2fs_sb_info *sbi = F2FS_SB(sb);
nid_t ino;
struct inode *inode;
- bool nid_free = false;
int err;
inode = new_inode(sb);
@@ -58,7 +57,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
err = insert_inode_locked(inode);
if (err) {
err = -EINVAL;
- nid_free = true;
+ alloc_nid_failed(sbi, ino);
goto out;
}
@@ -70,8 +69,6 @@ out:
unlock_new_inode(inode);
fail:
iput(inode);
- if (nid_free)
- alloc_nid_failed(sbi, ino);
return ERR_PTR(err);
}
--
1.7.9.5
next reply other threads:[~2013-03-17 8:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-17 8:27 Namjae Jeon [this message]
2013-03-18 2:11 ` [PATCH 4/5] f2fs: remove nid_free from f2fs_new_inode Jaegeuk Kim
2013-03-18 12:00 ` Namjae Jeon
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=1363508828-2920-1-git-send-email-linkinjeon@gmail.com \
--to=linkinjeon@gmail.com \
--cc=a.sahrawat@samsung.com \
--cc=jaegeuk.kim@samsung.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namjae.jeon@samsung.com \
/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).