[PATCH v2 1/2] nvme: enumerate controller flags
Keith Busch
kbusch at kernel.org
Thu Sep 22 08:25:52 PDT 2022
On Thu, Sep 22, 2022 at 11:15:36AM +0300, Sagi Grimberg wrote:
> We expect to grow a few of these flags for various purposes
> so make them a proper enumeration.
>
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> ---
> drivers/nvme/host/nvme.h | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
> index bdc0ff7ed9ab..fcf891467e68 100644
> --- a/drivers/nvme/host/nvme.h
> +++ b/drivers/nvme/host/nvme.h
> @@ -233,6 +233,11 @@ struct nvme_fault_inject {
> #endif
> };
>
> +enum nvme_ctrl_flags {
> + NVME_CTRL_FAILFAST_EXPIRED = (1 << 0),
> + NVME_CTRL_ADMIN_Q_STOPPED = (1 << 1),
> +};
Don't shift these. They are used with set/clear/test_bit() APIs, which take the
bit position rather than the value.
> +
> struct nvme_ctrl {
> bool comp_seen;
> enum nvme_ctrl_state state;
> @@ -354,8 +359,6 @@ struct nvme_ctrl {
> u16 maxcmd;
> int nr_reconnects;
> unsigned long flags;
> -#define NVME_CTRL_FAILFAST_EXPIRED 0
> -#define NVME_CTRL_ADMIN_Q_STOPPED 1
> struct nvmf_ctrl_options *opts;
>
> struct page *discard_page;
More information about the Linux-nvme
mailing list