erofs: use lockref_init for pcl->lockref
authorChristoph Hellwig <hch@lst.de>
Wed, 15 Jan 2025 09:46:43 +0000 (10:46 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 16 Jan 2025 10:48:12 +0000 (11:48 +0100)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250115094702.504610-8-hch@lst.de
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/erofs/zdata.c

index 01f14750548745803e7357c765ea9e1ee18ebae1..59f143d9744f91c59e8e81e6c24605ebdd761cc9 100644 (file)
@@ -747,8 +747,7 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe)
        if (IS_ERR(pcl))
                return PTR_ERR(pcl);
 
-       spin_lock_init(&pcl->lockref.lock);
-       pcl->lockref.count = 1;         /* one ref for this request */
+       lockref_init(&pcl->lockref, 1); /* one ref for this request */
        pcl->algorithmformat = map->m_algorithmformat;
        pcl->length = 0;
        pcl->partial = true;