]> www.infradead.org Git - users/sagi/libnvme.git/commit
ioctl: Rearrange members in nvme_io_args
authorDaniel Wagner <dwagner@suse.de>
Thu, 13 Jan 2022 16:59:20 +0000 (17:59 +0100)
committerDaniel Wagner <dwagner@suse.de>
Thu, 13 Jan 2022 17:51:05 +0000 (18:51 +0100)
commitfc93fb68725d6bff59e99e735220f8d7d646c88f
tree8e60183b40e8fe91ad4d27b40a86b020c6c390f6
parent57af2be56e3158251460e5177a67b19c2d0e5875
ioctl: Rearrange members in nvme_io_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_io_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        void *                     data;                 /*    24     8 */
        void *                     metadata;             /*    32     8 */
        __u64                      slba;                 /*    40     8 */
        __u16                      nlb;                  /*    48     2 */
        __u16                      control;              /*    50     2 */
        __u16                      apptag;               /*    52     2 */
        __u16                      appmask;              /*    54     2 */
        __u32                      reftag;               /*    56     4 */
        __u32                      data_len;             /*    60     4 */
        /* --- cacheline 1 boundary (64 bytes) --- */
        __u64                      storage_tag;          /*    64     8 */
        __u32                      metadata_len;         /*    72     4 */
        __u8                       dsm;                  /*    76     1 */
        __u8                       dspec;                /*    77     1 */

        /* size: 80, cachelines: 2, members: 18 */
        /* padding: 2 */
        /* last cacheline: 16 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
src/nvme/ioctl.h