MCPcopy Create free account
hub / github.com/containerd/cgroups / DeviceFilter

Function DeviceFilter

cgroup2/devicefilter.go:45–55  ·  view source on GitHub ↗

DeviceFilter returns eBPF device filter program and its license string

(devices []specs.LinuxDeviceCgroup)

Source from the content-addressed store, hash-verified

43
44// DeviceFilter returns eBPF device filter program and its license string
45func DeviceFilter(devices []specs.LinuxDeviceCgroup) (asm.Instructions, string, error) {
46 p := &program{}
47 p.init()
48 for i := len(devices) - 1; i >= 0; i-- {
49 if err := p.appendDevice(devices[i]); err != nil {
50 return nil, "", err
51 }
52 }
53 insts, err := p.finalize()
54 return insts, license, err
55}
56
57type program struct {
58 insts asm.Instructions

Callers 2

testDeviceFilterFunction · 0.85
setDevicesFunction · 0.85

Calls 3

initMethod · 0.95
appendDeviceMethod · 0.95
finalizeMethod · 0.95

Tested by 1

testDeviceFilterFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…