Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drbd: Define the size of res_opts->cpu_mask in a single place

Signed-off-by: Andreas Gruenbacher <agruen@linbit.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>

authored by

Andreas Gruenbacher and committed by
Philipp Reisner
f44d0436 6bbf53ca

+4 -3
+1 -2
drivers/block/drbd/drbd_main.c
··· 2503 2503 2504 2504 /* silently ignore cpu mask on UP kernel */ 2505 2505 if (nr_cpu_ids > 1 && res_opts->cpu_mask[0] != 0) { 2506 - /* FIXME: Get rid of constant 32 here */ 2507 - err = bitmap_parse(res_opts->cpu_mask, 32, 2506 + err = bitmap_parse(res_opts->cpu_mask, DRBD_CPU_MASK_SIZE, 2508 2507 cpumask_bits(new_cpu_mask), nr_cpu_ids); 2509 2508 if (err) { 2510 2509 drbd_warn(resource, "bitmap_parse() failed with %d\n", err);
+2
include/linux/drbd.h
··· 382 382 #define DRBD_MD_INDEX_FLEX_EXT -2 383 383 #define DRBD_MD_INDEX_FLEX_INT -3 384 384 385 + #define DRBD_CPU_MASK_SIZE 32 386 + 385 387 #endif
+1 -1
include/linux/drbd_genl.h
··· 135 135 ) 136 136 137 137 GENL_struct(DRBD_NLA_RESOURCE_OPTS, 4, res_opts, 138 - __str_field_def(1, DRBD_GENLA_F_MANDATORY, cpu_mask, 32) 138 + __str_field_def(1, DRBD_GENLA_F_MANDATORY, cpu_mask, DRBD_CPU_MASK_SIZE) 139 139 __u32_field_def(2, DRBD_GENLA_F_MANDATORY, on_no_data, DRBD_ON_NO_DATA_DEF) 140 140 ) 141 141