Skip to content

Commit a4304bc

Browse files
committed
ioctl: Rearrange members in nvme_resv_register_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_register_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_rrega rrega; /* 24 4 */ enum nvme_resv_cptpl cptpl; /* 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 8347972 commit a4304bc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/nvme/ioctl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3847,15 +3847,15 @@ int nvme_resv_acquire(struct nvme_resv_acquire_args *args);
38473847
struct nvme_resv_register_args {
38483848
int args_size;
38493849
int fd;
3850+
__u32 *result;
3851+
__u32 timeout;
38503852
__u32 nsid;
38513853
enum nvme_resv_rrega rrega;
38523854
enum nvme_resv_cptpl cptpl;
3853-
bool iekey;
38543855
__u64 crkey;
38553856
__u64 nrkey;
3856-
__u32 timeout;
3857-
__u32 *result;
3858-
};
3857+
bool iekey;
3858+
} __attribute__((packed, aligned(__alignof__(__u64))));
38593859

38603860
/**
38613861
* nvme_resv_register() - Send an nvme reservation register

0 commit comments

Comments
 (0)