* Free zero copy buffers at request of descriptor. */
| 466 | * Free zero copy buffers at request of descriptor. |
| 467 | */ |
| 468 | void |
| 469 | bpf_zerocopy_free(struct bpf_d *d) |
| 470 | { |
| 471 | struct zbuf *zb; |
| 472 | |
| 473 | KASSERT(d->bd_bufmode == BPF_BUFMODE_ZBUF, |
| 474 | ("bpf_zerocopy_free: not in zbuf mode")); |
| 475 | |
| 476 | zb = (struct zbuf *)d->bd_sbuf; |
| 477 | if (zb != NULL) |
| 478 | zbuf_free(zb); |
| 479 | zb = (struct zbuf *)d->bd_hbuf; |
| 480 | if (zb != NULL) |
| 481 | zbuf_free(zb); |
| 482 | zb = (struct zbuf *)d->bd_fbuf; |
| 483 | if (zb != NULL) |
| 484 | zbuf_free(zb); |
| 485 | } |
| 486 | |
| 487 | /* |
| 488 | * Ioctl to return the maximum buffer size. |