diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-04-03 07:38:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-04-03 07:38:49 +0000 |
commit | a10a53dd934a67693d068bba16e635ddabcdabe2 (patch) | |
tree | 262c2fe9621c7903046080bc3fe9812b423c0dda /src/nvme/util.c | |
parent | Adding upstream version 1.3. (diff) | |
download | libnvme-a9fbe62d400e1522fde6e0e8bb08569f55184021.tar.xz libnvme-a9fbe62d400e1522fde6e0e8bb08569f55184021.zip |
Adding upstream version 1.4.upstream/1.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/nvme/util.c')
-rw-r--r-- | src/nvme/util.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvme/util.c b/src/nvme/util.c index 0354afe..e7cbc8a 100644 --- a/src/nvme/util.c +++ b/src/nvme/util.c @@ -403,14 +403,17 @@ void nvme_init_copy_range_f1(struct nvme_copy_range_f1 *copy, __u16 *nlbs, __u64 *slbas, __u64 *eilbrts, __u32 *elbatms, __u32 *elbats, __u16 nr) { - int i; + int i, j; for (i = 0; i < nr; i++) { copy[i].nlb = cpu_to_le16(nlbs[i]); copy[i].slba = cpu_to_le64(slbas[i]); - copy[i].elbt[2] = cpu_to_le64(eilbrts[i]); copy[i].elbatm = cpu_to_le16(elbatms[i]); copy[i].elbat = cpu_to_le16(elbats[i]); + for (j = 0; j < 8; j++) + copy[i].elbt[9 - j] = (eilbrts[i] >> (8 * j)) & 0xff; + copy[i].elbt[1] = 0; + copy[i].elbt[0] = 0; } } |