]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dcache: use lockref_init for d_lockref
authorChristoph Hellwig <hch@lst.de>
Wed, 15 Jan 2025 09:46:42 +0000 (10:46 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 16 Jan 2025 10:48:11 +0000 (11:48 +0100)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250115094702.504610-7-hch@lst.de
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/dcache.c

index b4d5e9e1e43da012cf24c379800feb9cde806ea8..1a01d7a6a7a92ed821a65a0a1adf3b9dc7432908 100644 (file)
@@ -1681,9 +1681,8 @@ static struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
        /* Make sure we always see the terminating NUL character */
        smp_store_release(&dentry->d_name.name, dname); /* ^^^ */
 
-       dentry->d_lockref.count = 1;
        dentry->d_flags = 0;
-       spin_lock_init(&dentry->d_lock);
+       lockref_init(&dentry->d_lockref, 1);
        seqcount_spinlock_init(&dentry->d_seq, &dentry->d_lock);
        dentry->d_inode = NULL;
        dentry->d_parent = dentry;