From owner-p4-projects@FreeBSD.ORG Sun Dec 23 22:35:39 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AF1B016A419; Sun, 23 Dec 2007 22:35:39 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EA1716A417 for ; Sun, 23 Dec 2007 22:35:39 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 5541913C447 for ; Sun, 23 Dec 2007 22:35:39 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lBNMZdrQ018122 for ; Sun, 23 Dec 2007 22:35:39 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBNMZdPd018108 for perforce@freebsd.org; Sun, 23 Dec 2007 22:35:39 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 23 Dec 2007 22:35:39 GMT Message-Id: <200712232235.lBNMZdPd018108@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 131493 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Dec 2007 22:35:40 -0000 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);