Commit 98e3a5d3 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

bdev: make opts structures packed



This ensures that when fields are added, that the
size of the structure will change, ensuring different
versions of the structure can be detected using
sizeof.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: If346cb6628b3a288a3ac720104b501589eba3b83
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14089


Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent b801af09
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -164,6 +164,10 @@ struct spdk_bdev_opts {
	uint32_t bdev_io_pool_size;
	uint32_t bdev_io_cache_size;
	bool bdev_auto_examine;

	/* Hole at bytes 9-15. */
	uint8_t reserved9[7];

	/**
	 * The size of spdk_bdev_opts according to the caller of this library is used for ABI
	 * compatibility.  The library uses this field to know how many fields in this
@@ -174,7 +178,7 @@ struct spdk_bdev_opts {

	uint32_t small_buf_pool_size;
	uint32_t large_buf_pool_size;
};
} __attribute__((packed));
SPDK_STATIC_ASSERT(sizeof(struct spdk_bdev_opts) == 32, "Incorrect size");

/**
@@ -193,7 +197,7 @@ struct spdk_bdev_ext_io_opts {
	void *memory_domain_ctx;
	/** Metadata buffer, optional */
	void *metadata;
};
} __attribute__((packed));
SPDK_STATIC_ASSERT(sizeof(struct spdk_bdev_ext_io_opts) == 32, "Incorrect size");

/**