Skip to content

Commit f5fa119

Browse files
committed
ioctl: Rearrange members in nvme_resv_report_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_report_args { int args_size; /* 0 4 */ int fd; /* 4 4 */ __u32 * result; /* 8 8 */ __u32 timeout; /* 16 4 */ __u32 nsid; /* 20 4 */ struct nvme_resv_status * report; /* 24 8 */ __u32 len; /* 32 4 */ _Bool eds; /* 36 1 */ /* size: 40, cachelines: 1, members: 8 */ /* padding: 3 */ /* last cacheline: 40 bytes */ } __attribute__((__aligned__(8))); Signed-off-by: Daniel Wagner <[email protected]>
1 parent 9f6b2bd commit f5fa119

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
@@ -3904,24 +3904,24 @@ int nvme_resv_release(struct nvme_resv_release_args *args);
39043904
/**
39053905
* nvme_resv_report_args - Arguments for the NVMe Reservation Report command
39063906
* @fd: File descriptor of nvme device
3907+
* @result: The command completion result from CQE dword0
3908+
* @timeout: Timeout in ms
39073909
* @nsid: Namespace identifier
3908-
* @eds: Request extended Data Structure
3909-
* @len: Number of bytes to request transfered with this command
39103910
* @report: The user space destination address to store the reservation
39113911
* report
3912-
* @timeout: Timeout in ms
3913-
* @result: The command completion result from CQE dword0
3912+
* @len: Number of bytes to request transfered with this command
3913+
* @eds: Request extended Data Structure
39143914
*/
39153915
struct nvme_resv_report_args {
39163916
int args_size;
39173917
int fd;
3918+
__u32 *result;
3919+
__u32 timeout;
39183920
__u32 nsid;
3919-
bool eds;
3920-
__u32 len;
39213921
struct nvme_resv_status *report;
3922-
__u32 timeout;
3923-
__u32 *result;
3924-
};
3922+
__u32 len;
3923+
bool eds;
3924+
} __attribute__((packed, aligned(__alignof__(__u32*))));
39253925

39263926
/**
39273927
* nvme_resv_report() - Send an nvme reservation report

0 commit comments

Comments
 (0)