From a335603816389e64c60f00a62d55b8cc88bcda22 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 13 Jan 2022 19:04:09 +0100 Subject: [PATCH] ioctl: Rearrange members in nvme_zns_mgmt_send_args Avoid any holes in the struct by rearranging the members. Also add the attribute packed to struct definition to reduce ABI breakage. struct nvme_zns_mgmt_send_args { int args_size; /* 0 4 */ int fd; /* 4 4 */ __u32 * result; /* 8 8 */ __u32 timeout; /* 16 4 */ __u32 nsid; /* 20 4 */ __u64 slba; /* 24 8 */ enum nvme_zns_send_action zsa; /* 32 4 */ __u32 data_len; /* 36 4 */ void * data; /* 40 8 */ _Bool select_all; /* 48 1 */ __u8 zsaso; /* 49 1 */ /* size: 56, cachelines: 1, members: 11 */ /* padding: 6 */ /* last cacheline: 56 bytes */ } __attribute__((__aligned__(8))); Signed-off-by: Daniel Wagner --- src/nvme/ioctl.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/nvme/ioctl.h b/src/nvme/ioctl.h index 86ef600c..91fc3c4f 100644 --- a/src/nvme/ioctl.h +++ b/src/nvme/ioctl.h @@ -3939,29 +3939,29 @@ int nvme_resv_report(struct nvme_resv_report_args *args); /** * nvme_zns_mgmt_send_args - Arguments for the NVMe ZNS Management Send command * @fd: File descriptor of nvme device + * @result: The command completion result from CQE dword0 + * @timeout: timeout in ms * @nsid: Namespace ID * @slba: Starting logical block address * @zsa: Zone send action - * @select_all: Select all flag - * @zsaso: Zone Send Action Specific Option * @data_len: Length of @data * @data: Userspace address of the data - * @timeout: timeout in ms - * @result: The command completion result from CQE dword0 + * @select_all: Select all flag + * @zsaso: Zone Send Action Specific Option */ struct nvme_zns_mgmt_send_args { int args_size; int fd; + __u32 *result; + __u32 timeout; __u32 nsid; __u64 slba; enum nvme_zns_send_action zsa; - bool select_all; - __u8 zsaso; __u32 data_len; void *data; - __u32 timeout; - __u32 *result; -}; + bool select_all; + __u8 zsaso; +} __attribute__((packed, aligned(__alignof__(__u64)))); /** * nvme_zns_mgmt_send() - -- 2.50.1