use macros for directive type and max ruhs.
Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
struct nvme_fdp_ruh_status *ruhs;
int bytes, ret, i;
struct nvme_fdp_ruh_status *ruhs;
int bytes, ret, i;
- bytes = sizeof(*ruhs) + 128 * sizeof(struct nvme_fdp_ruh_status_desc);
+ bytes = sizeof(*ruhs) + FDP_MAX_RUHS * sizeof(struct nvme_fdp_ruh_status_desc);
ruhs = scalloc(1, bytes);
if (!ruhs)
return -ENOMEM;
ruhs = scalloc(1, bytes);
if (!ruhs)
return -ENOMEM;
struct fio_ruhs_info *ruhs, *tmp;
int i, ret;
struct fio_ruhs_info *ruhs, *tmp;
int i, ret;
- ruhs = scalloc(1, sizeof(*ruhs) + 128 * sizeof(*ruhs->plis));
+ ruhs = scalloc(1, sizeof(*ruhs) + FDP_MAX_RUHS * sizeof(*ruhs->plis));
if (!ruhs)
return -ENOMEM;
if (!ruhs)
return -ENOMEM;
- if (ruhs->nr_ruhs > 128)
- ruhs->nr_ruhs = 128;
+ if (ruhs->nr_ruhs > FDP_MAX_RUHS)
+ ruhs->nr_ruhs = FDP_MAX_RUHS;
if (td->o.fdp_nrpli == 0) {
f->ruhs_info = ruhs;
if (td->o.fdp_nrpli == 0) {
f->ruhs_info = ruhs;
ruhs->pli_loc = 0;
dspec = ruhs->plis[ruhs->pli_loc++];
ruhs->pli_loc = 0;
dspec = ruhs->plis[ruhs->pli_loc++];
+ io_u->dtype = FDP_DIR_DTYPE;
+#define FDP_DIR_DTYPE 2
+#define FDP_MAX_RUHS 128
+
struct fio_ruhs_info {
uint32_t nr_ruhs;
uint32_t pli_loc;
struct fio_ruhs_info {
uint32_t nr_ruhs;
uint32_t pli_loc;