nvme: use uint32_t consistently for NSID values

A few places were accidentally storing namespace IDs in uint16_t.

Change-Id: Iae9d709fb20bc1ac0a584ccd9683b721ce5de961
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403886
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2018-03-14 14:05:40 -07:00 committed by Jim Harris
parent 8d8f4ac304
commit c937fab3cb
6 changed files with 12 additions and 12 deletions

View File

@ -129,7 +129,7 @@ reservation_ns_completion(void *cb_arg, const struct spdk_nvme_cpl *cpl)
static int static int
reservation_ns_register(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *qpair, reservation_ns_register(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *qpair,
uint16_t ns_id) uint32_t ns_id)
{ {
int ret; int ret;
struct spdk_nvme_reservation_register_data rr_data; struct spdk_nvme_reservation_register_data rr_data;
@ -165,7 +165,7 @@ reservation_ns_register(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *q
} }
static int static int
reservation_ns_report(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *qpair, uint16_t ns_id) reservation_ns_report(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *qpair, uint32_t ns_id)
{ {
int ret, i; int ret, i;
uint8_t *payload; uint8_t *payload;
@ -222,7 +222,7 @@ reservation_ns_report(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *qpa
} }
static int static int
reservation_ns_acquire(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *qpair, uint16_t ns_id) reservation_ns_acquire(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *qpair, uint32_t ns_id)
{ {
int ret; int ret;
struct spdk_nvme_reservation_acquire_data cdata; struct spdk_nvme_reservation_acquire_data cdata;
@ -258,7 +258,7 @@ reservation_ns_acquire(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *qp
} }
static int static int
reservation_ns_release(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *qpair, uint16_t ns_id) reservation_ns_release(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_qpair *qpair, uint32_t ns_id)
{ {
int ret; int ret;
struct spdk_nvme_reservation_key_data cdata; struct spdk_nvme_reservation_key_data cdata;

View File

@ -128,7 +128,7 @@ nvme_ctrlr_cmd_identify_controller(struct spdk_nvme_ctrlr *ctrlr, void *payload,
} }
int int
nvme_ctrlr_cmd_identify_namespace(struct spdk_nvme_ctrlr *ctrlr, uint16_t nsid, nvme_ctrlr_cmd_identify_namespace(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid,
void *payload, spdk_nvme_cmd_cb cb_fn, void *cb_arg) void *payload, spdk_nvme_cmd_cb cb_fn, void *cb_arg)
{ {
struct nvme_request *req; struct nvme_request *req;

View File

@ -300,7 +300,7 @@ struct spdk_nvme_ns {
uint32_t pi_type; uint32_t pi_type;
uint32_t sectors_per_max_io; uint32_t sectors_per_max_io;
uint32_t sectors_per_stripe; uint32_t sectors_per_stripe;
uint16_t id; uint32_t id;
uint16_t flags; uint16_t flags;
}; };
@ -528,7 +528,7 @@ int nvme_ctrlr_cmd_identify_controller(struct spdk_nvme_ctrlr *ctrlr,
void *payload, void *payload,
spdk_nvme_cmd_cb cb_fn, void *cb_arg); spdk_nvme_cmd_cb cb_fn, void *cb_arg);
int nvme_ctrlr_cmd_identify_namespace(struct spdk_nvme_ctrlr *ctrlr, int nvme_ctrlr_cmd_identify_namespace(struct spdk_nvme_ctrlr *ctrlr,
uint16_t nsid, void *payload, uint32_t nsid, void *payload,
spdk_nvme_cmd_cb cb_fn, void *cb_arg); spdk_nvme_cmd_cb cb_fn, void *cb_arg);
int nvme_ctrlr_cmd_set_num_queues(struct spdk_nvme_ctrlr *ctrlr, int nvme_ctrlr_cmd_set_num_queues(struct spdk_nvme_ctrlr *ctrlr,
uint32_t num_queues, spdk_nvme_cmd_cb cb_fn, uint32_t num_queues, spdk_nvme_cmd_cb cb_fn,
@ -589,7 +589,7 @@ void nvme_qpair_disable(struct spdk_nvme_qpair *qpair);
int nvme_qpair_submit_request(struct spdk_nvme_qpair *qpair, int nvme_qpair_submit_request(struct spdk_nvme_qpair *qpair,
struct nvme_request *req); struct nvme_request *req);
int nvme_ns_construct(struct spdk_nvme_ns *ns, uint16_t id, int nvme_ns_construct(struct spdk_nvme_ns *ns, uint32_t id,
struct spdk_nvme_ctrlr *ctrlr); struct spdk_nvme_ctrlr *ctrlr);
void nvme_ns_destruct(struct spdk_nvme_ns *ns); void nvme_ns_destruct(struct spdk_nvme_ns *ns);

View File

@ -222,7 +222,7 @@ spdk_nvme_ns_get_optimal_io_boundary(struct spdk_nvme_ns *ns)
return ns->sectors_per_stripe; return ns->sectors_per_stripe;
} }
int nvme_ns_construct(struct spdk_nvme_ns *ns, uint16_t id, int nvme_ns_construct(struct spdk_nvme_ns *ns, uint32_t id,
struct spdk_nvme_ctrlr *ctrlr) struct spdk_nvme_ctrlr *ctrlr)
{ {
assert(id > 0); assert(id > 0);

View File

@ -387,7 +387,7 @@ nvme_ns_destruct(struct spdk_nvme_ns *ns)
} }
int int
nvme_ns_construct(struct spdk_nvme_ns *ns, uint16_t id, nvme_ns_construct(struct spdk_nvme_ns *ns, uint32_t id,
struct spdk_nvme_ctrlr *ctrlr) struct spdk_nvme_ctrlr *ctrlr)
{ {
return 0; return 0;

View File

@ -42,7 +42,7 @@
SPDK_LOG_REGISTER_COMPONENT("nvme", SPDK_LOG_NVME) SPDK_LOG_REGISTER_COMPONENT("nvme", SPDK_LOG_NVME)
int int
nvme_ctrlr_cmd_identify_namespace(struct spdk_nvme_ctrlr *ctrlr, uint16_t nsid, void *payload, nvme_ctrlr_cmd_identify_namespace(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid, void *payload,
spdk_nvme_cmd_cb cb_fn, void *cb_arg) spdk_nvme_cmd_cb cb_fn, void *cb_arg)
{ {
return -1; return -1;
@ -63,7 +63,7 @@ static void
test_nvme_ns_construct(void) test_nvme_ns_construct(void)
{ {
struct spdk_nvme_ns ns = {}; struct spdk_nvme_ns ns = {};
uint16_t id = 1; uint32_t id = 1;
struct spdk_nvme_ctrlr ctrlr = {}; struct spdk_nvme_ctrlr ctrlr = {};
nvme_ns_construct(&ns, id, &ctrlr); nvme_ns_construct(&ns, id, &ctrlr);