Skip to content

Commit a5b8527

Browse files
Kamaljit Singhkeithbusch
authored andcommitted
nvme-core: add method to check for an I/O controller
Add nvme_is_io_ctrl() to check if the controller is of type I/O controller. Uses negative logic by excluding an administrative controller and a discovery controller. Signed-off-by: Kamaljit Singh <kamaljit.singh@opensource.wdc.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent eeaed48 commit a5b8527

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/nvme/host/core.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3163,6 +3163,11 @@ static inline bool nvme_admin_ctrl(struct nvme_ctrl *ctrl)
31633163
return ctrl->cntrltype == NVME_CTRL_ADMIN;
31643164
}
31653165

3166+
static inline bool nvme_is_io_ctrl(struct nvme_ctrl *ctrl)
3167+
{
3168+
return !nvme_discovery_ctrl(ctrl) && !nvme_admin_ctrl(ctrl);
3169+
}
3170+
31663171
static bool nvme_validate_cntlid(struct nvme_subsystem *subsys,
31673172
struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
31683173
{

0 commit comments

Comments
 (0)