Unverified Commit b06ddfee authored by Christian Brauner's avatar Christian Brauner
Browse files

Merge patch series "further lockref cleanups"

Andreas Gruenbacher <agruenba@redhat.com> says:

Here's an updated version with an additional comment saying that
lockref_init() initializes count to 1.

* patches from https://lore.kernel.org/r/20250130135624.1899988-1-agruenba@redhat.com:
  lockref: remove count argument of lockref_init
  gfs2: switch to lockref_init(..., 1)
  gfs2: use lockref_init for gl_lockref

Link: https://lore.kernel.org/r/20250130135624.1899988-1-agruenba@redhat.com


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parents e52e97f0 bb504b4d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -1201,8 +1201,8 @@ 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);
	lockdep_set_subclass(&gl->gl_lockref.lock, glops->go_subclass);
	gl->gl_lockref.count = 1;
	gl->gl_state = LM_ST_UNLOCKED;
	gl->gl_target = LM_ST_UNLOCKED;
	gl->gl_demote_state = LM_ST_EXCLUSIVE;
+0 −1
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ static void gfs2_init_glock_once(void *foo)
{
	struct gfs2_glock *gl = foo;

	spin_lock_init(&gl->gl_lockref.lock);
	INIT_LIST_HEAD(&gl->gl_holders);
	INIT_LIST_HEAD(&gl->gl_lru);
	INIT_LIST_HEAD(&gl->gl_ail_list);
+2 −2
Original line number Diff line number Diff line
@@ -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, 0);
	lockref_init(&qd->qd_lockref);
	qd->qd_id = qid;
	qd->qd_slot = -1;
	INIT_LIST_HEAD(&qd->qd_lru);
@@ -297,7 +297,6 @@ static int qd_get(struct gfs2_sbd *sdp, struct kqid qid,
	spin_lock_bucket(hash);
	*qdp = qd = gfs2_qd_search_bucket(hash, sdp, qid);
	if (qd == NULL) {
		new_qd->qd_lockref.count++;
		*qdp = new_qd;
		list_add(&new_qd->qd_list, &sdp->sd_quota_list);
		hlist_bl_add_head_rcu(&new_qd->qd_hlist, &qd_hash_table[hash]);
@@ -1450,6 +1449,7 @@ int gfs2_quota_init(struct gfs2_sbd *sdp)
			if (qd == NULL)
				goto fail_brelse;

			qd->qd_lockref.count = 0;
			set_bit(QDF_CHANGE, &qd->qd_flags);
			qd->qd_change = qc_change;
			qd->qd_slot = slot;
Loading