From nobody Mon Feb 9 19:26:46 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB1271C3BF7 for ; Wed, 29 Jan 2025 14:34:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738161247; cv=none; b=nwamh8Ze2somqhfj1jKzKwJ1nbgAlxQ4GPrrJ6Lgr9DXvx3pCQWXIEDHY2MUVU7a4JzeGiKLqYOemfS/OyVHKcLPhtwhO/wsDF30cDDks7SwFnCK2A91tuhJ3xmj2Olm4f69puuIAw7BxK8GjWLx8WbWhih4KxuH3OxVA8oCXoM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738161247; c=relaxed/simple; bh=4t+5unmGv52HY7nsPdUt+YPnFklMQEdDwWh34rLapjk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lniCA/kLamwUxN1+op0qIwEEmU/MsXsg7asYx78TXIqFGo1OAq8lmB0c4G8RpDB7ciPqJrGvRP3skQhNxsyZIKKT7+s2OVO6IBK3sUj8RbKdtciz2LS0HhCVKfr4Dsw1JOJxLR3hErNzKEY7yGryQQ2+Du+yF1gcwX5vuoKaYgk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=VatHdZMN; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VatHdZMN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738161244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rWQmcBfn6LxROs0Geum4JpiJkxmd4QKKpQmGmi4WG/c=; b=VatHdZMNnFqYZv9ROrkB433b127e2YlFmdY7n4wavtMN3nxmlyMH0ijihGN37rsn7oD6yl yT3riBywl8ttpaMiVZmjMtl5x6c2d6xl8YqyqZDpbekKtC/uRwx0VO6RAHSAYsysAkcnW1 UvS7BMsn6MMPbZgkaMqSOf+2CRDkdPQ= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-394-AW3pbO1ZPR224uRpqvyw6A-1; Wed, 29 Jan 2025 09:34:01 -0500 X-MC-Unique: AW3pbO1ZPR224uRpqvyw6A-1 X-Mimecast-MFC-AGG-ID: AW3pbO1ZPR224uRpqvyw6A Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 76B551800374; Wed, 29 Jan 2025 14:34:00 +0000 (UTC) Received: from pasta.fast.eng.rdu2.dc.redhat.com (unknown [10.45.224.234]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 167A51800955; Wed, 29 Jan 2025 14:33:57 +0000 (UTC) From: Andreas Gruenbacher To: Christian Brauner Cc: Andreas Gruenbacher , Christoph Hellwig , gfs2@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] gfs2: use lockref_init for gl_lockref Date: Wed, 29 Jan 2025 15:33:50 +0100 Message-ID: <20250129143353.1892423-2-agruenba@redhat.com> In-Reply-To: <20250129143353.1892423-1-agruenba@redhat.com> References: <20250129143353.1892423-1-agruenba@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Type: text/plain; charset="utf-8" Move the initialization of gl_lockref from gfs2_init_glock_once() to gfs2_glock_get(). This allows to use lockref_init() there. Signed-off-by: Andreas Gruenbacher Reviewed-by: Christoph Hellwig --- fs/gfs2/glock.c | 2 +- fs/gfs2/main.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 8c4c1f871a88..b29eb71e3e29 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -1201,8 +1201,8 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number, if (glops->go_instantiate) gl->gl_flags |=3D BIT(GLF_INSTANTIATE_NEEDED); gl->gl_name =3D name; + lockref_init(&gl->gl_lockref, 1); lockdep_set_subclass(&gl->gl_lockref.lock, glops->go_subclass); - gl->gl_lockref.count =3D 1; gl->gl_state =3D LM_ST_UNLOCKED; gl->gl_target =3D LM_ST_UNLOCKED; gl->gl_demote_state =3D LM_ST_EXCLUSIVE; diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c index 04cadc02e5a6..0727f60ad028 100644 --- a/fs/gfs2/main.c +++ b/fs/gfs2/main.c @@ -51,7 +51,6 @@ static void gfs2_init_glock_once(void *foo) { struct gfs2_glock *gl =3D foo; =20 - 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); --=20 2.48.1 From nobody Mon Feb 9 19:26:46 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AE841DDC35 for ; Wed, 29 Jan 2025 14:34:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738161251; cv=none; b=JxCA/Wok8glTpkyD/cO/yKDwRrf7UwJo4PdxwBOOXQZ/b89U43XbqhiSNeQdN+m047v+Qqg7G/pN+oTQbuez1IHNsmIg+AicYcqrmVl+HgUwg1vho98Tr6EkurVqNxDmZalv1WfbU01vGI3hurQoVp/k0n9LK9H3vR/+9TQ126s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738161251; c=relaxed/simple; bh=ygwAQBWML1tmKhXOycj3SmWBSx72h3X+STM8yQsxciw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=unqDCnLFgH3oyUFxz49V5r0lZpWwhi6L7uBvW4/G6bW+Hud/n7Hxx6wEtozUAMP/zLAFqV2M/KUUN54Bq9M/S3MOeuMU04AaGFW2hrXT/6afYKYwyPnHKhmF+SxGqkPxcKJCVJaquDSdgI8sTfnB11Q2Z3ZgMoN9RBPcWgq7Cu4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Lac7n6+i; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Lac7n6+i" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738161248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=74dydNQetms/bGYetTVmJaGxaCOgtJUS+5wTgNyYG0Y=; b=Lac7n6+i9q+NM3NR+4T0tNwc5ToQWIr1GMCuEF8/C87IsROA8xd1/uH4/HUrKSGhY0nRY/ ukpQ8rftypFseXchEVkOm43LTd6x2HG2soZI7Fp39YLVW2FU2lJMZtEuqrX95CNLJH3fp2 yceQb9qm26at8QGWg8vbqLlp09UaIEU= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-198-kgxk55RYPnGOzbegLQNvdA-1; Wed, 29 Jan 2025 09:34:04 -0500 X-MC-Unique: kgxk55RYPnGOzbegLQNvdA-1 X-Mimecast-MFC-AGG-ID: kgxk55RYPnGOzbegLQNvdA Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4D52E180034D; Wed, 29 Jan 2025 14:34:03 +0000 (UTC) Received: from pasta.fast.eng.rdu2.dc.redhat.com (unknown [10.45.224.234]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F3B611800951; Wed, 29 Jan 2025 14:34:00 +0000 (UTC) From: Andreas Gruenbacher To: Christian Brauner Cc: Andreas Gruenbacher , Christoph Hellwig , gfs2@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] gfs2: switch to lockref_init(..., 1) Date: Wed, 29 Jan 2025 15:33:51 +0100 Message-ID: <20250129143353.1892423-3-agruenba@redhat.com> In-Reply-To: <20250129143353.1892423-1-agruenba@redhat.com> References: <20250129143353.1892423-1-agruenba@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Type: text/plain; charset="utf-8" In qd_alloc(), initialize the lockref count to 1 to cover the common case. Compensate for that in gfs2_quota_init() by adjusting the count back down to 0; this only occurs when mounting the filesystem rw. Signed-off-by: Andreas Gruenbacher Reviewed-by: Christoph Hellwig --- fs/gfs2/quota.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 58bc5013ca49..6ae529a5388b 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -236,7 +236,7 @@ static struct gfs2_quota_data *qd_alloc(unsigned hash, = struct gfs2_sbd *sdp, str return NULL; =20 qd->qd_sbd =3D sdp; - lockref_init(&qd->qd_lockref, 0); + lockref_init(&qd->qd_lockref, 1); qd->qd_id =3D qid; qd->qd_slot =3D -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 =3D qd =3D gfs2_qd_search_bucket(hash, sdp, qid); if (qd =3D=3D NULL) { - new_qd->qd_lockref.count++; *qdp =3D 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 =3D=3D NULL) goto fail_brelse; =20 + qd->qd_lockref.count =3D 0; set_bit(QDF_CHANGE, &qd->qd_flags); qd->qd_change =3D qc_change; qd->qd_slot =3D slot; --=20 2.48.1 From nobody Mon Feb 9 19:26:46 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B16E1DE2C4 for ; Wed, 29 Jan 2025 14:34:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738161253; cv=none; b=dqygO+MQmKKOd4CGwCv9AcBu3ZXk8VgOXALXjffecnDd1r/HBLYP4FVwpUTBB1MLS6YlDxzFhuwekzEil8bL8mUsYspJlrHHYiU7qYKsNv2vEqtIcFExrPwwBJkTEyhwsB3MTlpF3rZHZ40jNgaDJszrYL6JycuHSxoNN3ELi8k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738161253; c=relaxed/simple; bh=sOo6x7YbfBKA3MhGRFMvMERvL+ZEBSKAsXyXGi1LNW0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UTyEOkEin1lqC2Fy+Axgko6l2FTv+rz8nOxNvPc6zwiY58vszpW0URuqwek1JBX9vEsQICJ63R9HqTuYn3IVWoQF465RiMC+qpbbQEpHLOF/FajhPeHZG1S8yA7nuUzde/WqgHxSN4GBoYcUcJD7qEJJr8rLQCu/uzDasMDpYNU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Fyrx3eZz; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Fyrx3eZz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738161251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+jemsFWFhJUh1ajdOLy+e9zf9cxIUtzcm24Z7l2CwCo=; b=Fyrx3eZz1A4ui4K12A03xl5oiTXEadMlvXFfMljh/IQ04ofKaNyDfx4rXHRGj8kWTv5C2g AC8RQmpYeVpc7wfcLRV+y8i0ODMw1af0fSTYCY3sqfVrdkzKpoYfmuNGV6j4XwhqMEDtoR DXVxwX11mscnjYTfHlYHFkkEEfKOw/4= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-677-xmmuzNfrO7qt3ymHQXy5ZQ-1; Wed, 29 Jan 2025 09:34:07 -0500 X-MC-Unique: xmmuzNfrO7qt3ymHQXy5ZQ-1 X-Mimecast-MFC-AGG-ID: xmmuzNfrO7qt3ymHQXy5ZQ Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CD0581956048; Wed, 29 Jan 2025 14:34:05 +0000 (UTC) Received: from pasta.fast.eng.rdu2.dc.redhat.com (unknown [10.45.224.234]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A460C1800951; Wed, 29 Jan 2025 14:34:03 +0000 (UTC) From: Andreas Gruenbacher To: Christian Brauner Cc: Andreas Gruenbacher , Christoph Hellwig , gfs2@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] lockref: remove count argument of lockref_init Date: Wed, 29 Jan 2025 15:33:52 +0100 Message-ID: <20250129143353.1892423-4-agruenba@redhat.com> In-Reply-To: <20250129143353.1892423-1-agruenba@redhat.com> References: <20250129143353.1892423-1-agruenba@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 Content-Type: text/plain; charset="utf-8" All users of lockref_init() now initialize the count to 1, so hardcode that and remove the count argument. Signed-off-by: Andreas Gruenbacher Reviewed-by: Christoph Hellwig --- fs/dcache.c | 2 +- fs/erofs/zdata.c | 2 +- fs/gfs2/glock.c | 2 +- fs/gfs2/quota.c | 2 +- include/linux/lockref.h | 5 ++--- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index 1a01d7a6a7a9..973a66dd3adf 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1682,7 +1682,7 @@ static struct dentry *__d_alloc(struct super_block *s= b, const struct qstr *name) smp_store_release(&dentry->d_name.name, dname); /* ^^^ */ =20 dentry->d_flags =3D 0; - lockref_init(&dentry->d_lockref, 1); + lockref_init(&dentry->d_lockref); seqcount_spinlock_init(&dentry->d_seq, &dentry->d_lock); dentry->d_inode =3D NULL; dentry->d_parent =3D dentry; diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 254f6ad2c336..85a08230d7c2 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -747,7 +747,7 @@ static int z_erofs_register_pcluster(struct z_erofs_dec= ompress_frontend *fe) if (IS_ERR(pcl)) return PTR_ERR(pcl); =20 - lockref_init(&pcl->lockref, 1); /* one ref for this request */ + lockref_init(&pcl->lockref); /* one ref for this request */ pcl->algorithmformat =3D map->m_algorithmformat; pcl->length =3D 0; pcl->partial =3D true; diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index b29eb71e3e29..65c07aa95718 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -1201,7 +1201,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number, if (glops->go_instantiate) gl->gl_flags |=3D BIT(GLF_INSTANTIATE_NEEDED); gl->gl_name =3D 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 =3D LM_ST_UNLOCKED; gl->gl_target =3D LM_ST_UNLOCKED; diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 6ae529a5388b..2298e06797ac 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -236,7 +236,7 @@ static struct gfs2_quota_data *qd_alloc(unsigned hash, = struct gfs2_sbd *sdp, str return NULL; =20 qd->qd_sbd =3D sdp; - lockref_init(&qd->qd_lockref, 1); + lockref_init(&qd->qd_lockref); qd->qd_id =3D qid; qd->qd_slot =3D -1; INIT_LIST_HEAD(&qd->qd_lru); diff --git a/include/linux/lockref.h b/include/linux/lockref.h index c39f119659ba..30c68ad1859a 100644 --- a/include/linux/lockref.h +++ b/include/linux/lockref.h @@ -37,12 +37,11 @@ struct lockref { /** * lockref_init - Initialize a lockref * @lockref: pointer to lockref structure - * @count: initial count */ -static inline void lockref_init(struct lockref *lockref, unsigned int coun= t) +static inline void lockref_init(struct lockref *lockref) { spin_lock_init(&lockref->lock); - lockref->count =3D count; + lockref->count =3D 1; } =20 void lockref_get(struct lockref *lockref); --=20 2.48.1