[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250305141740.GC18065@lst.de>
Date: Wed, 5 Mar 2025 15:17:40 +0100
From: Christoph Hellwig <hch@....de>
To: Daniel Wagner <wagi@...nel.org>
Cc: James Smart <james.smart@...adcom.com>, Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>,
Chaitanya Kulkarni <kch@...dia.com>, Hannes Reinecke <hare@...e.de>,
Keith Busch <kbusch@...nel.org>, linux-nvme@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 02/11] nvmet-fcloop: add ref counting to lport
On Wed, Feb 26, 2025 at 07:45:54PM +0100, Daniel Wagner wrote:
> +static void
> +fcloop_lport_free(struct kref *ref)
> +{
> + struct fcloop_lport *lport =
> + container_of(ref, struct fcloop_lport, ref);
> + unsigned long flags;
> +
> + spin_lock_irqsave(&fcloop_lock, flags);
> + list_del(&lport->lport_list);
> + spin_unlock_irqrestore(&fcloop_lock, flags);
> +
> + kfree(lport);
Maybe it's just me, but I find the kref a really horrible pattern over
usig a simple refcount_t.
Otherwise adding proper refcounting looks fine.
Powered by blists - more mailing lists