]> www.infradead.org Git - users/sagi/libnvme.git/commit
ioctl: Rearrange members in nvme_copy_args
authorDaniel Wagner <dwagner@suse.de>
Thu, 13 Jan 2022 17:50:31 +0000 (18:50 +0100)
committerDaniel Wagner <dwagner@suse.de>
Thu, 13 Jan 2022 17:52:24 +0000 (18:52 +0100)
commit3b3d57a25ae6ec9b9fda18bce731644abb7d39bb
tree9d4c03c0efab48df80ef285553280649e69a678f
parente78db5adb93df72adbe6b118dd24e9facfa9c1bd
ioctl: Rearrange members in nvme_copy_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_copy_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        struct nvme_copy_range *   copy;                 /*    24     8 */
        __u64                      sdlba;                /*    32     8 */
        __u16                      nr;                   /*    40     2 */
        __u16                      dspec;                /*    42     2 */
        __u8                       prinfor;              /*    44     1 */
        __u8                       prinfow;              /*    45     1 */
        __u8                       dtype;                /*    46     1 */
        __u8                       format;               /*    47     1 */
        int                        lr;                   /*    48     4 */
        int                        fua;                  /*    52     4 */
        __u32                      ilbrt;                /*    56     4 */
        __u16                      lbatm;                /*    60     2 */
        __u16                      lbat;                 /*    62     2 */

        /* size: 64, cachelines: 1, members: 18 */
} __attribute__((__aligned__(8)));

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