|
@@ -339,7 +339,7 @@ static int bpf_obj_name_cpy(char *dst, const char *src)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-#define BPF_MAP_CREATE_LAST_FIELD numa_node
|
|
|
+#define BPF_MAP_CREATE_LAST_FIELD map_name
|
|
|
/* called via syscall */
|
|
|
static int map_create(union bpf_attr *attr)
|
|
|
{
|
|
@@ -361,6 +361,10 @@ static int map_create(union bpf_attr *attr)
|
|
|
if (IS_ERR(map))
|
|
|
return PTR_ERR(map);
|
|
|
|
|
|
+ err = bpf_obj_name_cpy(map->name, attr->map_name);
|
|
|
+ if (err)
|
|
|
+ goto free_map_nouncharge;
|
|
|
+
|
|
|
atomic_set(&map->refcnt, 1);
|
|
|
atomic_set(&map->usercnt, 1);
|
|
|
|
|
@@ -1462,6 +1466,7 @@ static int bpf_map_get_info_by_fd(struct bpf_map *map,
|
|
|
info.value_size = map->value_size;
|
|
|
info.max_entries = map->max_entries;
|
|
|
info.map_flags = map->map_flags;
|
|
|
+ memcpy(info.name, map->name, sizeof(map->name));
|
|
|
|
|
|
if (copy_to_user(uinfo, &info, info_len) ||
|
|
|
put_user(info_len, &uattr->info.info_len))
|