@@ -14,9 +14,9 @@ const structOpsValuePrefix = "bpf_struct_ops_"
14
14
// TODO: Doc
15
15
type structOpsProgMetaKey struct {}
16
16
type structOpsProgMeta struct {
17
- AttachBtfId btf.TypeID
18
- AttachType sys.AttachType
19
- ModBtfObjID uint32
17
+ attachBtfId btf.TypeID
18
+ attachType sys.AttachType
19
+ modBtfObjID uint32
20
20
}
21
21
22
22
// structOpsKernTypes holds information about kernel types related to struct_ops
@@ -28,8 +28,6 @@ type structOpsKernTypes struct {
28
28
typeID btf.TypeID
29
29
// The wrapper struct type that contains the target struct
30
30
valueType * btf.Struct
31
- // The BTF type ID of the wrapper struct
32
- valueTypeID btf.TypeID
33
31
// The member within ValueType that holds the target struct
34
32
dataMember * btf.Member
35
33
// mod_btf
@@ -69,8 +67,7 @@ type structOpsMeta struct {
69
67
funcs []structOpsFunc
70
68
// used for represent a data for the user struct
71
69
// e.g. struct tcp_congestion_ops in bpf_prog's btf format */
72
- data []byte
73
- modBtfObjId btf.ID
70
+ data []byte
74
71
}
75
72
76
73
// extractStructOpsMeta returns the *structops.Meta embedded in a MapSpec’s Contents
@@ -221,18 +218,11 @@ func findStructOpsKernTypes(userStructType *btf.Struct) (*structOpsKernTypes, er
221
218
return nil , fmt .Errorf ("type ID of %s: %w" , kType .TypeName (), err )
222
219
}
223
220
224
- // 5. type-ID of wrapper
225
- wID , err := s .TypeID (wType )
226
- if err != nil {
227
- return nil , fmt .Errorf ("type ID of %s: %w" , wType .TypeName (), err )
228
- }
229
-
230
221
return & structOpsKernTypes {
231
222
spec : s ,
232
223
typ : kType ,
233
224
typeID : kID ,
234
225
valueType : wType ,
235
- valueTypeID : wID ,
236
226
dataMember : dataMem ,
237
227
modBtfObjId : uint32 (modID ),
238
228
}, nil
@@ -416,9 +406,9 @@ func (sl *structOpsLoader) copyDataMember(
416
406
sl .stOpsProgsToMap [ps .Name ] = ms .Name
417
407
418
408
ps .Instructions [0 ].Metadata .Set (structOpsProgMetaKey {}, & structOpsProgMeta {
419
- AttachBtfId : kern .typeID ,
420
- AttachType : attachType ,
421
- ModBtfObjID : kern .modBtfObjId ,
409
+ attachBtfId : kern .typeID ,
410
+ attachType : attachType ,
411
+ modBtfObjID : kern .modBtfObjId ,
422
412
})
423
413
}
424
414
0 commit comments