Skip to content

Commit 9f6b2bd

Browse files
committed
ioctl: Rearrange members in nvme_resv_release_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_resv_release_args { int args_size; /* 0 4 */ int fd; /* 4 4 */ __u32 * result; /* 8 8 */ __u32 timeout; /* 16 4 */ __u32 nsid; /* 20 4 */ enum nvme_resv_rtype rtype; /* 24 4 */ enum nvme_resv_rrela rrela; /* 28 4 */ __u64 crkey; /* 32 8 */ _Bool iekey; /* 40 1 */ /* size: 48, cachelines: 1, members: 9 */ /* padding: 7 */ /* last cacheline: 48 bytes */ } __attribute__((__aligned__(8))); Signed-off-by: Daniel Wagner <[email protected]>
1 parent a4304bc commit 9f6b2bd

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/nvme/ioctl.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3872,25 +3872,25 @@ int nvme_resv_register(struct nvme_resv_register_args *args);
38723872
/**
38733873
* nvme_resv_release_args - Arguments for the NVMe Reservation Release Command
38743874
* @fd: File descriptor of nvme device
3875+
* @result: The command completion result from CQE dword0
3876+
* @timeout: Timeout in ms
38753877
* @nsid: Namespace identifier
38763878
* @rtype: The type of reservation to be create, see &enum nvme_resv_rtype
38773879
* @rrela: Reservation releast action, see &enum nvme_resv_rrela
3878-
* @iekey: Set to ignore the existing key
38793880
* @crkey: The current reservation key to release
3880-
* @timeout: Timeout in ms
3881-
* @result: The command completion result from CQE dword0
3881+
* @iekey: Set to ignore the existing key
38823882
*/
38833883
struct nvme_resv_release_args {
38843884
int args_size;
38853885
int fd;
3886+
__u32 *result;
3887+
__u32 timeout;
38863888
__u32 nsid;
38873889
enum nvme_resv_rtype rtype;
38883890
enum nvme_resv_rrela rrela;
3889-
bool iekey;
38903891
__u64 crkey;
3891-
__u32 timeout;
3892-
__u32 *result;
3893-
};
3892+
bool iekey;
3893+
} __attribute__((packed, aligned(__alignof__(__u64))));
38943894

38953895
/**
38963896
* nvme_resv_release() - Send an nvme reservation release

0 commit comments

Comments
 (0)