Skip to content

Commit 8347972

Browse files
committed
ioctl: Rearrange members in nvme_resv_acquire_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_acquire_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_racqa racqa; /* 28 4 */ __u64 crkey; /* 32 8 */ __u64 nrkey; /* 40 8 */ _Bool iekey; /* 48 1 */ /* size: 56, cachelines: 1, members: 10 */ /* padding: 7 */ /* last cacheline: 56 bytes */ } __attribute__((__aligned__(8))); Signed-off-by: Daniel Wagner <[email protected]>
1 parent 3b3d57a commit 8347972

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/nvme/ioctl.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3796,28 +3796,28 @@ int nvme_copy(struct nvme_copy_args *args);
37963796
/**
37973797
* nvme_resv_acquire_args - Arguments for the NVMe Reservation Acquire Comand
37983798
* @fd: File descriptor of nvme device
3799+
* @result: The command completion result from CQE dword0
3800+
* @timeout: Timeout in ms
37993801
* @nsid: Namespace identifier
38003802
* @rtype: The type of reservation to be create, see &enum nvme_resv_rtype
38013803
* @racqa: The action that is performed by the command, see &enum nvme_resv_racqa
3802-
* @iekey: Set to ignore the existing key
38033804
* @crkey: The current reservation key associated with the host
38043805
* @nrkey: The reservation key to be unregistered from the namespace if
3805-
* the action is preempt
3806-
* @timeout: Timeout in ms
3807-
* @result: The command completion result from CQE dword0
3806+
* the action is preempt
3807+
* @iekey: Set to ignore the existing key
38083808
*/
38093809
struct nvme_resv_acquire_args {
38103810
int args_size;
38113811
int fd;
3812+
__u32 *result;
3813+
__u32 timeout;
38123814
__u32 nsid;
38133815
enum nvme_resv_rtype rtype;
38143816
enum nvme_resv_racqa racqa;
3815-
bool iekey;
38163817
__u64 crkey;
38173818
__u64 nrkey;
3818-
__u32 timeout;
3819-
__u32 *result;
3820-
};
3819+
bool iekey;
3820+
} __attribute__((packed, aligned(__alignof__(__u64))));
38213821

38223822
/**
38233823
* nvme_resv_acquire() - Send an nvme reservation acquire

0 commit comments

Comments
 (0)