@@ -287,7 +287,7 @@ static void array_map_free(struct bpf_map *map)
287287 bpf_map_area_free (array );
288288}
289289
290- static const struct bpf_map_ops array_ops = {
290+ const struct bpf_map_ops array_map_ops = {
291291 .map_alloc = array_map_alloc ,
292292 .map_free = array_map_free ,
293293 .map_get_next_key = array_map_get_next_key ,
@@ -297,12 +297,7 @@ static const struct bpf_map_ops array_ops = {
297297 .map_gen_lookup = array_map_gen_lookup ,
298298};
299299
300- static struct bpf_map_type_list array_type __ro_after_init = {
301- .ops = & array_ops ,
302- .type = BPF_MAP_TYPE_ARRAY ,
303- };
304-
305- static const struct bpf_map_ops percpu_array_ops = {
300+ const struct bpf_map_ops percpu_array_map_ops = {
306301 .map_alloc = array_map_alloc ,
307302 .map_free = array_map_free ,
308303 .map_get_next_key = array_map_get_next_key ,
@@ -311,19 +306,6 @@ static const struct bpf_map_ops percpu_array_ops = {
311306 .map_delete_elem = array_map_delete_elem ,
312307};
313308
314- static struct bpf_map_type_list percpu_array_type __ro_after_init = {
315- .ops = & percpu_array_ops ,
316- .type = BPF_MAP_TYPE_PERCPU_ARRAY ,
317- };
318-
319- static int __init register_array_map (void )
320- {
321- bpf_register_map_type (& array_type );
322- bpf_register_map_type (& percpu_array_type );
323- return 0 ;
324- }
325- late_initcall (register_array_map );
326-
327309static struct bpf_map * fd_array_map_alloc (union bpf_attr * attr )
328310{
329311 /* only file descriptors can be stored in this type of map */
@@ -427,7 +409,7 @@ void bpf_fd_array_map_clear(struct bpf_map *map)
427409 fd_array_map_delete_elem (map , & i );
428410}
429411
430- static const struct bpf_map_ops prog_array_ops = {
412+ const struct bpf_map_ops prog_array_map_ops = {
431413 .map_alloc = fd_array_map_alloc ,
432414 .map_free = fd_array_map_free ,
433415 .map_get_next_key = array_map_get_next_key ,
@@ -437,18 +419,6 @@ static const struct bpf_map_ops prog_array_ops = {
437419 .map_fd_put_ptr = prog_fd_array_put_ptr ,
438420};
439421
440- static struct bpf_map_type_list prog_array_type __ro_after_init = {
441- .ops = & prog_array_ops ,
442- .type = BPF_MAP_TYPE_PROG_ARRAY ,
443- };
444-
445- static int __init register_prog_array_map (void )
446- {
447- bpf_register_map_type (& prog_array_type );
448- return 0 ;
449- }
450- late_initcall (register_prog_array_map );
451-
452422static struct bpf_event_entry * bpf_event_entry_gen (struct file * perf_file ,
453423 struct file * map_file )
454424{
@@ -539,7 +509,7 @@ static void perf_event_fd_array_release(struct bpf_map *map,
539509 rcu_read_unlock ();
540510}
541511
542- static const struct bpf_map_ops perf_event_array_ops = {
512+ const struct bpf_map_ops perf_event_array_map_ops = {
543513 .map_alloc = fd_array_map_alloc ,
544514 .map_free = fd_array_map_free ,
545515 .map_get_next_key = array_map_get_next_key ,
@@ -550,18 +520,6 @@ static const struct bpf_map_ops perf_event_array_ops = {
550520 .map_release = perf_event_fd_array_release ,
551521};
552522
553- static struct bpf_map_type_list perf_event_array_type __ro_after_init = {
554- .ops = & perf_event_array_ops ,
555- .type = BPF_MAP_TYPE_PERF_EVENT_ARRAY ,
556- };
557-
558- static int __init register_perf_event_array_map (void )
559- {
560- bpf_register_map_type (& perf_event_array_type );
561- return 0 ;
562- }
563- late_initcall (register_perf_event_array_map );
564-
565523#ifdef CONFIG_CGROUPS
566524static void * cgroup_fd_array_get_ptr (struct bpf_map * map ,
567525 struct file * map_file /* not used */ ,
@@ -582,7 +540,7 @@ static void cgroup_fd_array_free(struct bpf_map *map)
582540 fd_array_map_free (map );
583541}
584542
585- static const struct bpf_map_ops cgroup_array_ops = {
543+ const struct bpf_map_ops cgroup_array_map_ops = {
586544 .map_alloc = fd_array_map_alloc ,
587545 .map_free = cgroup_fd_array_free ,
588546 .map_get_next_key = array_map_get_next_key ,
@@ -591,18 +549,6 @@ static const struct bpf_map_ops cgroup_array_ops = {
591549 .map_fd_get_ptr = cgroup_fd_array_get_ptr ,
592550 .map_fd_put_ptr = cgroup_fd_array_put_ptr ,
593551};
594-
595- static struct bpf_map_type_list cgroup_array_type __ro_after_init = {
596- .ops = & cgroup_array_ops ,
597- .type = BPF_MAP_TYPE_CGROUP_ARRAY ,
598- };
599-
600- static int __init register_cgroup_array_map (void )
601- {
602- bpf_register_map_type (& cgroup_array_type );
603- return 0 ;
604- }
605- late_initcall (register_cgroup_array_map );
606552#endif
607553
608554static struct bpf_map * array_of_map_alloc (union bpf_attr * attr )
@@ -644,7 +590,7 @@ static void *array_of_map_lookup_elem(struct bpf_map *map, void *key)
644590 return READ_ONCE (* inner_map );
645591}
646592
647- static const struct bpf_map_ops array_of_map_ops = {
593+ const struct bpf_map_ops array_of_maps_map_ops = {
648594 .map_alloc = array_of_map_alloc ,
649595 .map_free = array_of_map_free ,
650596 .map_get_next_key = array_map_get_next_key ,
@@ -653,15 +599,3 @@ static const struct bpf_map_ops array_of_map_ops = {
653599 .map_fd_get_ptr = bpf_map_fd_get_ptr ,
654600 .map_fd_put_ptr = bpf_map_fd_put_ptr ,
655601};
656-
657- static struct bpf_map_type_list array_of_map_type __ro_after_init = {
658- .ops = & array_of_map_ops ,
659- .type = BPF_MAP_TYPE_ARRAY_OF_MAPS ,
660- };
661-
662- static int __init register_array_of_map (void )
663- {
664- bpf_register_map_type (& array_of_map_type );
665- return 0 ;
666- }
667- late_initcall (register_array_of_map );
0 commit comments