Skip to content

Commit a335603

Browse files
committed
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 <[email protected]>
1 parent f5fa119 commit a335603

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/nvme/ioctl.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3939,29 +3939,29 @@ int nvme_resv_report(struct nvme_resv_report_args *args);
39393939
/**
39403940
* nvme_zns_mgmt_send_args - Arguments for the NVMe ZNS Management Send command
39413941
* @fd: File descriptor of nvme device
3942+
* @result: The command completion result from CQE dword0
3943+
* @timeout: timeout in ms
39423944
* @nsid: Namespace ID
39433945
* @slba: Starting logical block address
39443946
* @zsa: Zone send action
3945-
* @select_all: Select all flag
3946-
* @zsaso: Zone Send Action Specific Option
39473947
* @data_len: Length of @data
39483948
* @data: Userspace address of the data
3949-
* @timeout: timeout in ms
3950-
* @result: The command completion result from CQE dword0
3949+
* @select_all: Select all flag
3950+
* @zsaso: Zone Send Action Specific Option
39513951
*/
39523952
struct nvme_zns_mgmt_send_args {
39533953
int args_size;
39543954
int fd;
3955+
__u32 *result;
3956+
__u32 timeout;
39553957
__u32 nsid;
39563958
__u64 slba;
39573959
enum nvme_zns_send_action zsa;
3958-
bool select_all;
3959-
__u8 zsaso;
39603960
__u32 data_len;
39613961
void *data;
3962-
__u32 timeout;
3963-
__u32 *result;
3964-
};
3962+
bool select_all;
3963+
__u8 zsaso;
3964+
} __attribute__((packed, aligned(__alignof__(__u64))));
39653965

39663966
/**
39673967
* nvme_zns_mgmt_send() -

0 commit comments

Comments
 (0)