summaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2024-08-23 14:47:38 +0200
committerChristian Brauner <brauner@kernel.org>2024-08-30 08:22:39 +0200
commit0fe340a98b584a31b07c664dc5ff0c923730581e (patch)
tree1eccafad07aea5023d594ef114581953761bb226 /fs/dcache.c
parent532980cb1bff9b942c23fe94324dee560f5f57a5 (diff)
downloadlinux-0fe340a98b584a31b07c664dc5ff0c923730581e.tar.gz
linux-0fe340a98b584a31b07c664dc5ff0c923730581e.tar.bz2
linux-0fe340a98b584a31b07c664dc5ff0c923730581e.zip
inode: port __I_NEW to var event
Port the __I_NEW mechanism to use the new var event mechanism. Link: https://lore.kernel.org/r/20240823-work-i_state-v3-4-5cd5fd207a57@kernel.org Reviewed-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 1af75fa68638..894e38cdf4d0 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1908,8 +1908,13 @@ void d_instantiate_new(struct dentry *entry, struct inode *inode)
__d_instantiate(entry, inode);
WARN_ON(!(inode->i_state & I_NEW));
inode->i_state &= ~I_NEW & ~I_CREATING;
+ /*
+ * Pairs with the barrier in prepare_to_wait_event() to make sure
+ * ___wait_var_event() either sees the bit cleared or
+ * waitqueue_active() check in wake_up_var() sees the waiter.
+ */
smp_mb();
- wake_up_bit(&inode->i_state, __I_NEW);
+ inode_wake_up_bit(inode, __I_NEW);
spin_unlock(&inode->i_lock);
}
EXPORT_SYMBOL(d_instantiate_new);