Skip to content

Commit 3bca40d

Browse files
committed
ioctl: Rearrange members in nvme_set_property_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_set_property_args { int args_size; /* 0 4 */ int fd; /* 4 4 */ __u32 * result; /* 8 8 */ __u32 timeout; /* 16 4 */ int offset; /* 20 4 */ __u64 value; /* 24 8 */ /* size: 32, cachelines: 1, members: 6 */ /* last cacheline: 32 bytes */ } __attribute__((__aligned__(8))); Signed-off-by: Daniel Wagner <[email protected]>
1 parent 65d2d83 commit 3bca40d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/nvme/ioctl.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3369,19 +3369,19 @@ int nvme_lockdown(struct nvme_lockdown_args *args);
33693369
/**
33703370
* nvme_set_property_args - Arguments for NVMe Set Property command
33713371
* @fd: File descriptor of nvme device
3372+
* @result: The command completion result from CQE dword0
3373+
* @timeout: Timeout in ms
33723374
* @offset: Property offset from the base to set
33733375
* @value: The value to set the property
3374-
* @timeout: Timeout in ms
3375-
* @result: The command completion result from CQE dword0
33763376
*/
33773377
struct nvme_set_property_args {
33783378
int args_size;
33793379
int fd;
3380+
__u32 *result;
3381+
__u32 timeout;
33803382
int offset;
33813383
__u64 value;
3382-
__u32 timeout;
3383-
__u32 *result;
3384-
};
3384+
} __attribute__((packed, aligned(__alignof__(__u64))));
33853385

33863386
/**
33873387
* nvme_set_property() - Set controller property

0 commit comments

Comments
 (0)