arraymap.c (d0ed4c60abfb9a4ab6cd416d1dea9df6266f8fc7) arraymap.c (5dc4c4b7d4e8115e7cde96a030f98cb3ab2e458c)
1/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
2 * Copyright (c) 2016,2017 Facebook
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of version 2 of the GNU General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but

--- 40 unchanged lines hidden (view full) ---

49 array->pptrs[i] = ptr;
50 cond_resched();
51 }
52
53 return 0;
54}
55
56/* Called from syscall */
1/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
2 * Copyright (c) 2016,2017 Facebook
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of version 2 of the GNU General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but

--- 40 unchanged lines hidden (view full) ---

49 array->pptrs[i] = ptr;
50 cond_resched();
51 }
52
53 return 0;
54}
55
56/* Called from syscall */
57static int array_map_alloc_check(union bpf_attr *attr)
57int array_map_alloc_check(union bpf_attr *attr)
58{
59 bool percpu = attr->map_type == BPF_MAP_TYPE_PERCPU_ARRAY;
60 int numa_node = bpf_map_attr_numa_node(attr);
61
62 /* check sanity of attributes */
63 if (attr->max_entries == 0 || attr->key_size != 4 ||
64 attr->value_size == 0 ||
65 attr->map_flags & ~ARRAY_CREATE_FLAG_MASK ||

--- 687 unchanged lines hidden ---
58{
59 bool percpu = attr->map_type == BPF_MAP_TYPE_PERCPU_ARRAY;
60 int numa_node = bpf_map_attr_numa_node(attr);
61
62 /* check sanity of attributes */
63 if (attr->max_entries == 0 || attr->key_size != 4 ||
64 attr->value_size == 0 ||
65 attr->map_flags & ~ARRAY_CREATE_FLAG_MASK ||

--- 687 unchanged lines hidden ---