diff options
author | Hannes Reinecke <hare@suse.de> | 2021-09-22 08:35:21 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2021-10-20 19:16:02 +0200 |
commit | a294711ed5123f757ed8ed2f103c851b8ee416c9 (patch) | |
tree | fcb3968a5d09620f3fc7a926f4a0c8c82ee9eeee /drivers/nvme/target/nvmet.h | |
parent | e15a8a9755659ff5972f30de4dd64867c97f242d (diff) |
nvmet: add nvmet_is_disc_subsys() helper
Add a helper function to determine if a given subsystem is a discovery
subsystem.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/target/nvmet.h')
-rw-r--r-- | drivers/nvme/target/nvmet.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h index f8e0ee131dc6..f31dcc4fb1a2 100644 --- a/drivers/nvme/target/nvmet.h +++ b/drivers/nvme/target/nvmet.h @@ -577,6 +577,11 @@ static inline struct nvmet_subsys *nvmet_req_subsys(struct nvmet_req *req) return req->sq->ctrl->subsys; } +static inline bool nvmet_is_disc_subsys(struct nvmet_subsys *subsys) +{ + return subsys->type == NVME_NQN_DISC; +} + #ifdef CONFIG_NVME_TARGET_PASSTHRU void nvmet_passthru_subsys_free(struct nvmet_subsys *subsys); int nvmet_passthru_ctrl_enable(struct nvmet_subsys *subsys); |