bpf: arraymap: use bpf_map_init_from_attr()
authorJakub Kicinski <jakub.kicinski@netronome.com>
Thu, 18 Jan 2018 03:13:26 +0000 (19:13 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 18 Jan 2018 21:54:25 +0000 (22:54 +0100)
Arraymap was not converted to use bpf_map_init_from_attr()
to avoid merge conflicts with emergency fixes.  Do it now.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/arraymap.c

index 68336092bfb44c10a0736ddb1a53e1d5a6cad523..b1f66480135b3d8e21fedef41e71e0dfb3ba01c1 100644 (file)
@@ -120,12 +120,7 @@ static struct bpf_map *array_map_alloc(union bpf_attr *attr)
        array->map.unpriv_array = unpriv;
 
        /* copy mandatory map attributes */
-       array->map.map_type = attr->map_type;
-       array->map.key_size = attr->key_size;
-       array->map.value_size = attr->value_size;
-       array->map.max_entries = attr->max_entries;
-       array->map.map_flags = attr->map_flags;
-       array->map.numa_node = numa_node;
+       bpf_map_init_from_attr(&array->map, attr);
        array->elem_size = elem_size;
 
        if (!percpu)