fs: Use common code in wait_on_new_inode()
Subsystems (2)
PATCH 1/1 fs: Use common code in wait_on_new_inode()
From: Markus Elfring <[email protected]>
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 <[email protected]>
--- fs/inode.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
fs/inode.c +3 -4
@@ -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);
Signature · 1 line
2.56.0