cwd10 takes the low 32-bits and cwd11 takes the upper 32-bits of the

lba. Rather than do a cast to uint64_t, which clang warns might be
unaligned, do the stores 32-bits at a time.

Sponsored by: Netflix
This commit is contained in:
imp 2017-03-07 23:02:59 +00:00
parent b432c84c13
commit 6884a6e482

View File

@ -955,7 +955,8 @@ void nvme_ns_rw_cmd(struct nvme_command *cmd, uint32_t rwcmd, uint16_t nsid,
{
cmd->opc = rwcmd;
cmd->nsid = nsid;
*(uint64_t *)&cmd->cdw10 = lba;
cmd->cdw10 = lba & 0xffffffffu;
cmd->cdw11 = lba >> 32;
cmd->cdw12 = count-1;
cmd->cdw13 = 0;
cmd->cdw14 = 0;