MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bpf_zerocopy_canwritebuf

Function bpf_zerocopy_canwritebuf

freebsd/net/bpf_zerocopy.c:449–463  ·  view source on GitHub ↗

* Query from the BPF framework as to whether or not the buffer current in * the store position can actually be written to. This may return false if * the store buffer is assigned to userspace before the hold buffer is * acknowledged. */

Source from the content-addressed store, hash-verified

447 * acknowledged.
448 */
449int
450bpf_zerocopy_canwritebuf(struct bpf_d *d)
451{
452 struct zbuf *zb;
453
454 KASSERT(d->bd_bufmode == BPF_BUFMODE_ZBUF,
455 ("bpf_zerocopy_canwritebuf: not in zbuf mode"));
456
457 zb = (struct zbuf *)d->bd_sbuf;
458 KASSERT(zb != NULL, ("bpf_zerocopy_canwritebuf: bd_sbuf NULL"));
459
460 if (zb->zb_flags & ZBUF_FLAG_ASSIGNED)
461 return (0);
462 return (1);
463}
464
465/*
466 * Free zero copy buffers at request of descriptor.

Callers 1

bpf_canwritebufFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected