Date: Sun, 23 Dec 2007 22:35:39 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 131493 for review Message-ID: <200712232235.lBNMZdPd018108@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=131493 Change 131493 by rwatson@rwatson_cinnamon on 2007/12/23 22:34:50 Rename bpf_buffree() and associated functions to bpf_canfreebuf() -- this is a check rather than an operation implementing freeing. Affected files ... .. //depot/projects/zcopybpf/src/sys/net/bpf.c#29 edit .. //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.c#23 edit .. //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.h#10 edit Differences ... ==== //depot/projects/zcopybpf/src/sys/net/bpf.c#29 (text+ko) ==== @@ -210,11 +210,11 @@ /* * If the buffer mechanism has a way to decide that a held buffer can be made - * free, then it is exposed via the bpf_buffree() interface. (1) is returned - * if the buffer can be discarded, (0) is returned if it cannot. + * free, then it is exposed via the bpf_canfreebuf() interface. (1) is + * returned if the buffer can be discarded, (0) is returned if it cannot. */ static int -bpf_buffree(struct bpf_d *d) +bpf_canfreebuf(struct bpf_d *d) { BPFD_LOCK_ASSERT(d); @@ -222,7 +222,7 @@ switch (d->bd_bufmode) { #ifdef BPF_ZEROCOPY case BPF_BUFMODE_ZBUF: - return (bpf_zerocopy_buffree(d)); + return (bpf_zerocopy_canfreebuf(d)); #endif } return (0); @@ -827,7 +827,7 @@ // printf("bpf_ready: hlen: %d, immediate %d, state %d, slen %d\n", // d->bd_hlen, d->bd_immediate, d->bd_state, d->bd_slen); - if (!bpf_buffree(d) && d->bd_hlen != 0) + if (!bpf_canfreebuf(d) && d->bd_hlen != 0) return (1); if ((d->bd_immediate || d->bd_state == BPF_TIMED_OUT) && d->bd_slen != 0) @@ -1763,7 +1763,7 @@ * run this check if we need the space), but for now it's a reliable * spot to do it. */ - if (bpf_buffree(d)) { + if (bpf_canfreebuf(d)) { d->bd_fbuf = d->bd_hbuf; d->bd_hbuf = NULL; d->bd_hlen = 0; ==== //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.c#23 (text+ko) ==== @@ -365,12 +365,12 @@ * XXXRW: Memory ordering also an issue here? */ int -bpf_zerocopy_buffree(struct bpf_d *d) +bpf_zerocopy_canfreebuf(struct bpf_d *d) { struct zbuf *zb; KASSERT(d->bd_bufmode == BPF_BUFMODE_ZBUF, - ("bpf_zerocopy_buffree: not in zbuf mode")); + ("bpf_zerocopy_canfreebuf: not in zbuf mode")); zb = (struct zbuf *)d->bd_hbuf; if (zb == NULL) ==== //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.h#10 (text+ko) ==== @@ -41,7 +41,7 @@ void bpf_zerocopy_append_mbuf(struct bpf_d *d, caddr_t buf, u_int offset, void *src, u_int len); void bpf_zerocopy_bufheld(struct bpf_d *); -int bpf_zerocopy_buffree(struct bpf_d *); +int bpf_zerocopy_canfreebuf(struct bpf_d *); void bpf_zerocopy_free(struct bpf_d *d); int bpf_zerocopy_ioctl_ackzbuf(struct thread *td, struct bpf_d *d, struct bpf_zbuf *bz);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712232235.lBNMZdPd018108>