reduce: check strlen(SPDK_REDUCE_SIGNATURE) in buildtime

Change-Id: I4d12f2a693a4a34c840d972a4f60cbd0fc35011b
Signed-off-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/437236
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
wuzhouhui 2018-12-14 12:43:27 +08:00 committed by Jim Harris
parent 7fbc5106e4
commit 3a4185be19

View File

@ -45,8 +45,6 @@
/* Always round up the size of the PM region to the nearest cacheline. */
#define REDUCE_PM_SIZE_ALIGNMENT 64
#define SPDK_REDUCE_SIGNATURE "SPDKREDU"
/* Offset into the backing device where the persistent memory file's path is stored. */
#define REDUCE_BACKING_DEV_PATH_OFFSET 4096
@ -62,6 +60,11 @@ struct spdk_reduce_vol_superblock {
};
SPDK_STATIC_ASSERT(sizeof(struct spdk_reduce_vol_superblock) == 4096, "size incorrect");
#define SPDK_REDUCE_SIGNATURE "SPDKREDU"
/* null terminator counts one */
SPDK_STATIC_ASSERT(sizeof(SPDK_REDUCE_SIGNATURE) - 1 ==
sizeof(((struct spdk_reduce_vol_superblock *)0)->signature), "size incorrect");
#define REDUCE_PATH_MAX 4096
/**