* [PATCH] fs: Use common code in wait_on_new_inode()
@ 2026-10-10 18:10 Markus Elfring
0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2026-10-10 18:10 UTC (permalink / raw)
To: linux-fsdevel, Alexander Viro, Christian Brauner, Jan Kara,
Mateusz Guzik
Cc: LKML, kernel-janitors, Nikolaos Karaolidis
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-10 18:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-10 18:10 [PATCH] fs: Use common code in wait_on_new_inode() Markus Elfring
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®