]> www.infradead.org Git - users/hch/xfs.git/commitdiff
lockref: remove count argument of lockref_init
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 30 Jan 2025 13:56:23 +0000 (14:56 +0100)
committerChristian Brauner <brauner@kernel.org>
Fri, 7 Feb 2025 09:27:25 +0000 (10:27 +0100)
All users of lockref_init() now initialize the count to 1, so hardcode
that and remove the count argument.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Link: https://lore.kernel.org/r/20250130135624.1899988-4-agruenba@redhat.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/dcache.c
fs/erofs/zdata.c
fs/gfs2/glock.c
fs/gfs2/quota.c
include/linux/lockref.h

index 9cc0d47da321c52669e05f0e97a6ccfa2451d025..7dee242b4195a747a1a73456644c550de5d11759 100644 (file)
@@ -1700,7 +1700,7 @@ static struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
        smp_store_release(&dentry->d_name.name, dname); /* ^^^ */
 
        dentry->d_flags = 0;
-       lockref_init(&dentry->d_lockref, 1);
+       lockref_init(&dentry->d_lockref);
        seqcount_spinlock_init(&dentry->d_seq, &dentry->d_lock);
        dentry->d_inode = NULL;
        dentry->d_parent = dentry;
index 29f8963bb523205dbe8a83b459a4acf28c690d70..d771e06db738682501abb5f9a94cf5d764ec5572 100644 (file)
@@ -726,7 +726,7 @@ static int z_erofs_register_pcluster(struct z_erofs_frontend *fe)
        if (IS_ERR(pcl))
                return PTR_ERR(pcl);
 
-       lockref_init(&pcl->lockref, 1); /* one ref for this request */
+       lockref_init(&pcl->lockref); /* one ref for this request */
        pcl->algorithmformat = map->m_algorithmformat;
        pcl->length = 0;
        pcl->partial = true;
index b29eb71e3e29ef20ea2027872832f7736b4caffc..65c07aa95718419cc3d2daecac841763d0d32b92 100644 (file)
@@ -1201,7 +1201,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
        if (glops->go_instantiate)
                gl->gl_flags |= BIT(GLF_INSTANTIATE_NEEDED);
        gl->gl_name = name;
-       lockref_init(&gl->gl_lockref, 1);
+       lockref_init(&gl->gl_lockref);
        lockdep_set_subclass(&gl->gl_lockref.lock, glops->go_subclass);
        gl->gl_state = LM_ST_UNLOCKED;
        gl->gl_target = LM_ST_UNLOCKED;
index 6ae529a5388bc8ee271cad23ee85a00595ff87e5..2298e06797ac38967d91d95389cba5f9f2fceb7e 100644 (file)
@@ -236,7 +236,7 @@ static struct gfs2_quota_data *qd_alloc(unsigned hash, struct gfs2_sbd *sdp, str
                return NULL;
 
        qd->qd_sbd = sdp;
-       lockref_init(&qd->qd_lockref, 1);
+       lockref_init(&qd->qd_lockref);
        qd->qd_id = qid;
        qd->qd_slot = -1;
        INIT_LIST_HEAD(&qd->qd_lru);
index c39f119659ba4684906fea9adb4a6ec89ca537e3..676721ee878d766fa4bdc02baef890f4f795e99d 100644 (file)
@@ -37,12 +37,13 @@ struct lockref {
 /**
  * lockref_init - Initialize a lockref
  * @lockref: pointer to lockref structure
- * @count: initial count
+ *
+ * Initializes @lockref->count to 1.
  */
-static inline void lockref_init(struct lockref *lockref, unsigned int count)
+static inline void lockref_init(struct lockref *lockref)
 {
        spin_lock_init(&lockref->lock);
-       lockref->count = count;
+       lockref->count = 1;
 }
 
 void lockref_get(struct lockref *lockref);