From: Markus Elfring <Markus.Elfring@web.de>
To: linux-fsdevel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
Mateusz Guzik <mjguzik@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Nikolaos Karaolidis <nick@karaolidis.com>
Subject: [PATCH] fs: Use common code in wait_on_new_inode()
Date: Sat, 10 Oct 2026 20:10:18 +0200 [thread overview]
Message-ID: <3906d06e-50cf-4230-a29e-939a1ac04e07@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 10 Oct 2026 20:00:18 +0200
Use an additional label so that a statement can be better reused
at the end of this function implementation.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
fs/inode.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/inode.c b/fs/inode.c
index 702f2d5ef459..f4699866a73b 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -529,10 +529,8 @@ void wait_on_new_inode(struct inode *inode)
struct wait_queue_head *wq_head;
spin_lock(&inode->i_lock);
- if (!(inode_state_read(inode) & I_NEW)) {
- spin_unlock(&inode->i_lock);
- return;
- }
+ if (!(inode_state_read(inode) & I_NEW))
+ goto unlock;
wq_head = inode_bit_waitqueue(&wqe, inode, __I_NEW);
for (;;) {
@@ -545,6 +543,7 @@ void wait_on_new_inode(struct inode *inode)
}
finish_wait(wq_head, &wqe.wq_entry);
WARN_ON(inode_state_read(inode) & I_NEW);
+unlock:
spin_unlock(&inode->i_lock);
}
EXPORT_SYMBOL(wait_on_new_inode);
--
2.56.0
reply other threads:[~2026-10-10 18:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=3906d06e-50cf-4230-a29e-939a1ac04e07@web.de \
--to=markus.elfring@web.de \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjguzik@gmail.com \
--cc=nick@karaolidis.com \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®