[PATCH V3 03/10] nvme: centralize queue action nvme_kill_queues()
Matthew Wilcox
willy at infradead.org
Tue Jul 14 21:39:29 EDT 2020
On Tue, Jul 14, 2020 at 06:36:07PM -0700, Keith Busch wrote:
> On Tue, Jul 14, 2020 at 04:30:50PM -0700, Chaitanya Kulkarni wrote:
> > There is no point in having 7 different functions which are differing
> > with just one line.
> >
> > The helper functions for ctrl queue management can be centralized with
> > the help of the descriptive enums for action. This avoids code
> > duplication which spans across the 7 functions as compare to one
> > function and exporting 7 symbols as compare to one symbol.
> >
> > This patch merges nvme_kill_queue() into newly introduced
> > nvme_queue_act() which handles the queue management.
>
> This should be separate from the xarray conversion part of this series.
>
> And if we're going to collapse these, I would prefer to create a generic
> API to iterate namespaces, something like "nvme_ns_iter()" that takes a
> callback function parameter.
The XArray iteration API deliberately doesn't do this. It's not
type-safe, and in this age of spectre/meltdown/l1tf/... indirect
function calls are Bad and Slow. I'd leave the code the way it is.
More information about the Linux-nvme
mailing list