Skip to content

Commit 15a2a84

Browse files
committed
ioctl: Rearrange members in nvme_get_lba_status_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_get_lba_status_args { int args_size; /* 0 4 */ int fd; /* 4 4 */ __u32 * result; /* 8 8 */ __u32 timeout; /* 16 4 */ __u32 nsid; /* 20 4 */ __u32 mndw; /* 24 4 */ enum nvme_lba_status_atype atype; /* 28 4 */ __u64 slba; /* 32 8 */ struct nvme_lba_status * lbas; /* 40 8 */ __u16 rl; /* 48 2 */ /* size: 50, cachelines: 1, members: 10 */ /* last cacheline: 50 bytes */ } __attribute__((__packed__)); Signed-off-by: Daniel Wagner <[email protected]>
1 parent 355ca20 commit 15a2a84

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/nvme/ioctl.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3009,28 +3009,28 @@ int nvme_security_receive(struct nvme_security_receive_args *args);
30093009
/**
30103010
* nvme_get_lba_status_args - Arguments for the NVMe Get LBA Status command
30113011
* @fd: File descriptor of nvme device
3012+
* @result: The command completion result from CQE dword0
3013+
* @timeout: Timeout in ms
30123014
* @nsid: Namespace ID to retrieve LBA status
3013-
* @slba: Starting logical block address to check statuses
30143015
* @mndw: Maximum number of dwords to return
30153016
* @atype: Action type mechanism to determine LBA status desctriptors to
3016-
* return, see &enum nvme_lba_status_atype
3017-
* @rl: Range length from slba to perform the action
3018-
* @timeout: Timeout in ms
3017+
* return, see &enum nvme_lba_status_atype
3018+
* @slba: Starting logical block address to check statuses
30193019
* @lbas: Data payload to return status descriptors
3020-
* @result: The command completion result from CQE dword0
3020+
* @rl: Range length from slba to perform the action
30213021
*/
30223022
struct nvme_get_lba_status_args {
30233023
int args_size;
30243024
int fd;
3025+
__u32 *result;
3026+
__u32 timeout;
30253027
__u32 nsid;
3026-
__u64 slba;
30273028
__u32 mndw;
3028-
__u16 rl;
30293029
enum nvme_lba_status_atype atype;
3030-
__u32 timeout;
3030+
__u64 slba;
30313031
struct nvme_lba_status *lbas;
3032-
__u32 *result;
3033-
};
3032+
__u16 rl;
3033+
} __attribute__((__packed__));
30343034

30353035
/**
30363036
* nvme_get_lba_status() - Retrieve information on possibly unrecoverable LBAs

0 commit comments

Comments
 (0)