From: Andreas Gruenbacher Date: Fri, 22 Jul 2011 11:53:19 +0000 (+0200) Subject: drbd: Define the size of res_opts->cpu_mask in a single place X-Git-Tag: firefly_0821_release~176^2~4188^2~38 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f44d0436db1ea02f2a08bec40a854550a93e90a8;p=firefly-linux-kernel-4.4.55.git drbd: Define the size of res_opts->cpu_mask in a single place Signed-off-by: Andreas Gruenbacher Signed-off-by: Philipp Reisner --- diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index e07446e19c74..59a58e896cf5 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -2503,8 +2503,7 @@ int set_resource_options(struct drbd_resource *resource, struct res_opts *res_op /* silently ignore cpu mask on UP kernel */ if (nr_cpu_ids > 1 && res_opts->cpu_mask[0] != 0) { - /* FIXME: Get rid of constant 32 here */ - err = bitmap_parse(res_opts->cpu_mask, 32, + err = bitmap_parse(res_opts->cpu_mask, DRBD_CPU_MASK_SIZE, cpumask_bits(new_cpu_mask), nr_cpu_ids); if (err) { drbd_warn(resource, "bitmap_parse() failed with %d\n", err); diff --git a/include/linux/drbd.h b/include/linux/drbd.h index de7d74ab3de6..6f60136da873 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h @@ -382,4 +382,6 @@ enum drbd_timeout_flag { #define DRBD_MD_INDEX_FLEX_EXT -2 #define DRBD_MD_INDEX_FLEX_INT -3 +#define DRBD_CPU_MASK_SIZE 32 + #endif diff --git a/include/linux/drbd_genl.h b/include/linux/drbd_genl.h index b14a2e899fea..4193f5f2636c 100644 --- a/include/linux/drbd_genl.h +++ b/include/linux/drbd_genl.h @@ -135,7 +135,7 @@ GENL_struct(DRBD_NLA_DISK_CONF, 3, disk_conf, ) GENL_struct(DRBD_NLA_RESOURCE_OPTS, 4, res_opts, - __str_field_def(1, DRBD_GENLA_F_MANDATORY, cpu_mask, 32) + __str_field_def(1, DRBD_GENLA_F_MANDATORY, cpu_mask, DRBD_CPU_MASK_SIZE) __u32_field_def(2, DRBD_GENLA_F_MANDATORY, on_no_data, DRBD_ON_NO_DATA_DEF) )