drbd: Define the size of res_opts->cpu_mask in a single place
authorAndreas Gruenbacher <agruen@linbit.com>
Fri, 22 Jul 2011 11:53:19 +0000 (13:53 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Mon, 17 Feb 2014 15:46:48 +0000 (16:46 +0100)
Signed-off-by: Andreas Gruenbacher <agruen@linbit.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
drivers/block/drbd/drbd_main.c
include/linux/drbd.h
include/linux/drbd_genl.h

index e07446e19c74564e445c5aa89282651a22490b44..59a58e896cf581efd5c411e563a8eab7ff62e7fb 100644 (file)
@@ -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);
index de7d74ab3de6df5237c5b117fa2dced482779842..6f60136da873146b80d0a9699ba79d81f567834b 100644 (file)
@@ -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
index b14a2e899fea0c9618e231d4c4f296d7a9342b9c..4193f5f2636c011686cb105c2bba428fc88be2c5 100644 (file)
@@ -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)
 )
 
This page took 0.029808 seconds and 5 git commands to generate.