ok mvs@
> On 19 Jan 2021, at 03:11, David Gwynne <da...@gwynne.id.au> wrote:
>
> vfs does it for us.
>
> ok?
>
> Index: bpf.c
> ===================================================================
> RCS file: /cvs/src/sys/net/bpf.c,v
> retrieving revision 1.202
> diff -u -p -r1.202 bpf.c
> --- bpf.c 17 Jan 2021 02:27:29 -0000 1.202
> +++ bpf.c 19 Jan 2021 00:10:22 -0000
> @@ -379,7 +379,6 @@ bpfopen(dev_t dev, int flag, int mode, s
> sigio_init(&bd->bd_sigio);
>
> bd->bd_rtout = 0; /* no timeout by default */
> - bd->bd_rnonblock = ISSET(flag, FNONBLOCK);
>
> bpf_get(bd);
> LIST_INSERT_HEAD(&bpf_d_list, bd, bd_list);
> @@ -497,7 +496,7 @@ bpfread(dev_t dev, struct uio *uio, int
> ROTATE_BUFFERS(d);
> break;
> }
> - if (d->bd_rnonblock) {
> + if (ISSET(ioflag, IO_NDELAY)) {
> /* User requested non-blocking I/O */
> error = EWOULDBLOCK;
> } else if (d->bd_rtout == 0) {
> @@ -982,10 +981,7 @@ bpfioctl(dev_t dev, u_long cmd, caddr_t
> break;
>
> case FIONBIO: /* Non-blocking I/O */
> - if (*(int *)addr)
> - d->bd_rnonblock = 1;
> - else
> - d->bd_rnonblock = 0;
> + /* let vfs to keep track of this */
> break;
>
> case FIOASYNC: /* Send signal on receive packets */
> Index: bpfdesc.h
> ===================================================================
> RCS file: /cvs/src/sys/net/bpfdesc.h,v
> retrieving revision 1.44
> diff -u -p -r1.44 bpfdesc.h
> --- bpfdesc.h 2 Jan 2021 02:46:06 -0000 1.44
> +++ bpfdesc.h 19 Jan 2021 00:10:22 -0000
> @@ -80,7 +80,6 @@ struct bpf_d {
> struct bpf_if *bd_bif; /* interface descriptor */
> uint64_t bd_rtout; /* [m] Read timeout in nanoseconds */
> u_long bd_nreaders; /* [m] # threads asleep in bpfread() */
> - int bd_rnonblock; /* true if nonblocking reads are set */
> struct bpf_program_smr
> *bd_rfilter; /* read filter code */
> struct bpf_program_smr
>