[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHc6FU58eBO0i8er5+gK--eAMVHULCzHPnJ9H5oN12fr=AAnbg@mail.gmail.com>
Date: Wed, 15 Jan 2025 14:35:03 +0100
From: Andreas Gruenbacher <agruenba@...hat.com>
To: Christoph Hellwig <hch@....de>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Al Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Gao Xiang <xiang@...nel.org>, Chao Yu <chao@...nel.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-erofs@...ts.ozlabs.org, gfs2@...ts.linux.dev
Subject: Re: [PATCH 8/8] gfs2: use lockref_init for qd_lockref
On Wed, Jan 15, 2025 at 10:56 AM Christoph Hellwig <hch@....de> wrote:
> Signed-off-by: Christoph Hellwig <hch@....de>
> ---
> fs/gfs2/quota.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
> index 72b48f6f5561..58bc5013ca49 100644
> --- a/fs/gfs2/quota.c
> +++ b/fs/gfs2/quota.c
> @@ -236,8 +236,7 @@ static struct gfs2_quota_data *qd_alloc(unsigned hash, struct gfs2_sbd *sdp, str
> return NULL;
>
> qd->qd_sbd = sdp;
> - qd->qd_lockref.count = 0;
> - spin_lock_init(&qd->qd_lockref.lock);
> + lockref_init(&qd->qd_lockref, 0);
Hmm, initializing count to 0 seems to be the odd case and it's fairly
simple to change gfs2 to work with an initial value of 1. I wonder if
lockref_init() should really have a count argument.
> qd->qd_id = qid;
> qd->qd_slot = -1;
> INIT_LIST_HEAD(&qd->qd_lru);
> --
> 2.45.2
Thanks,
Andreas
Powered by blists - more mailing lists