@@ -984,7 +984,7 @@ static int __cgroup_bpf_replace(struct cgroup *cgrp,
984
984
struct hlist_head * progs ;
985
985
bool found = false;
986
986
987
- atype = bpf_cgroup_atype_find (link -> type , new_prog -> aux -> attach_btf_id );
987
+ atype = bpf_cgroup_atype_find (link -> link . attach_type , new_prog -> aux -> attach_btf_id );
988
988
if (atype < 0 )
989
989
return - EINVAL ;
990
990
@@ -1396,8 +1396,8 @@ static void bpf_cgroup_link_release(struct bpf_link *link)
1396
1396
}
1397
1397
1398
1398
WARN_ON (__cgroup_bpf_detach (cg_link -> cgroup , NULL , cg_link ,
1399
- cg_link -> type , 0 ));
1400
- if (cg_link -> type == BPF_LSM_CGROUP )
1399
+ link -> attach_type , 0 ));
1400
+ if (link -> attach_type == BPF_LSM_CGROUP )
1401
1401
bpf_trampoline_unlink_cgroup_shim (cg_link -> link .prog );
1402
1402
1403
1403
cg = cg_link -> cgroup ;
@@ -1439,7 +1439,7 @@ static void bpf_cgroup_link_show_fdinfo(const struct bpf_link *link,
1439
1439
"cgroup_id:\t%llu\n"
1440
1440
"attach_type:\t%d\n" ,
1441
1441
cg_id ,
1442
- cg_link -> type );
1442
+ link -> attach_type );
1443
1443
}
1444
1444
1445
1445
static int bpf_cgroup_link_fill_link_info (const struct bpf_link * link ,
@@ -1455,7 +1455,7 @@ static int bpf_cgroup_link_fill_link_info(const struct bpf_link *link,
1455
1455
cgroup_unlock ();
1456
1456
1457
1457
info -> cgroup .cgroup_id = cg_id ;
1458
- info -> cgroup .attach_type = cg_link -> type ;
1458
+ info -> cgroup .attach_type = link -> attach_type ;
1459
1459
return 0 ;
1460
1460
}
1461
1461
@@ -1497,7 +1497,6 @@ int cgroup_bpf_link_attach(const union bpf_attr *attr, struct bpf_prog *prog)
1497
1497
bpf_link_init (& link -> link , BPF_LINK_TYPE_CGROUP , & bpf_cgroup_link_lops ,
1498
1498
prog , attr -> link_create .attach_type );
1499
1499
link -> cgroup = cgrp ;
1500
- link -> type = attr -> link_create .attach_type ;
1501
1500
1502
1501
err = bpf_link_prime (& link -> link , & link_primer );
1503
1502
if (err ) {
@@ -1506,7 +1505,7 @@ int cgroup_bpf_link_attach(const union bpf_attr *attr, struct bpf_prog *prog)
1506
1505
}
1507
1506
1508
1507
err = cgroup_bpf_attach (cgrp , NULL , NULL , link ,
1509
- link -> type , BPF_F_ALLOW_MULTI | attr -> link_create .flags ,
1508
+ link -> link . attach_type , BPF_F_ALLOW_MULTI | attr -> link_create .flags ,
1510
1509
attr -> link_create .cgroup .relative_fd ,
1511
1510
attr -> link_create .cgroup .expected_revision );
1512
1511
if (err ) {
0 commit comments