bpf: rename list_head -> graph_root in field info types
[platform/kernel/linux-starfive.git] / kernel / bpf / btf.c
index f7dd8af..578cee3 100644 (file)
@@ -3228,7 +3228,7 @@ struct btf_field_info {
                struct {
                        const char *node_name;
                        u32 value_btf_id;
-               } list_head;
+               } graph_root;
        };
 };
 
@@ -3335,8 +3335,8 @@ static int btf_find_list_head(const struct btf *btf, const struct btf_type *pt,
                return -EINVAL;
        info->type = BPF_LIST_HEAD;
        info->off = off;
-       info->list_head.value_btf_id = id;
-       info->list_head.node_name = list_node;
+       info->graph_root.value_btf_id = id;
+       info->graph_root.node_name = list_node;
        return BTF_FIELD_FOUND;
 }
 
@@ -3604,13 +3604,14 @@ static int btf_parse_list_head(const struct btf *btf, struct btf_field *field,
        u32 offset;
        int i;
 
-       t = btf_type_by_id(btf, info->list_head.value_btf_id);
+       t = btf_type_by_id(btf, info->graph_root.value_btf_id);
        /* We've already checked that value_btf_id is a struct type. We
         * just need to figure out the offset of the list_node, and
         * verify its type.
         */
        for_each_member(i, t, member) {
-               if (strcmp(info->list_head.node_name, __btf_name_by_offset(btf, member->name_off)))
+               if (strcmp(info->graph_root.node_name,
+                          __btf_name_by_offset(btf, member->name_off)))
                        continue;
                /* Invalid BTF, two members with same name */
                if (n)
@@ -3627,9 +3628,9 @@ static int btf_parse_list_head(const struct btf *btf, struct btf_field *field,
                if (offset % __alignof__(struct bpf_list_node))
                        return -EINVAL;
 
-               field->list_head.btf = (struct btf *)btf;
-               field->list_head.value_btf_id = info->list_head.value_btf_id;
-               field->list_head.node_offset = offset;
+               field->graph_root.btf = (struct btf *)btf;
+               field->graph_root.value_btf_id = info->graph_root.value_btf_id;
+               field->graph_root.node_offset = offset;
        }
        if (!n)
                return -ENOENT;
@@ -3736,11 +3737,11 @@ int btf_check_and_fixup_fields(const struct btf *btf, struct btf_record *rec)
 
                if (!(rec->fields[i].type & BPF_LIST_HEAD))
                        continue;
-               btf_id = rec->fields[i].list_head.value_btf_id;
+               btf_id = rec->fields[i].graph_root.value_btf_id;
                meta = btf_find_struct_meta(btf, btf_id);
                if (!meta)
                        return -EFAULT;
-               rec->fields[i].list_head.value_rec = meta->record;
+               rec->fields[i].graph_root.value_rec = meta->record;
 
                if (!(rec->field_mask & BPF_LIST_NODE))
                        continue;