From owner-p4-projects@FreeBSD.ORG Tue Jan 8 14:40:45 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D4AD116A46C; Tue, 8 Jan 2008 14:40:44 +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 98A7416A468 for ; Tue, 8 Jan 2008 14:40:44 +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 B329D13C469 for ; Tue, 8 Jan 2008 14:40:44 +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 m08Eeifn018348 for ; Tue, 8 Jan 2008 14:40:44 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 m08EehtK018345 for perforce@freebsd.org; Tue, 8 Jan 2008 14:40:43 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 8 Jan 2008 14:40:43 GMT Message-Id: <200801081440.m08EehtK018345@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 132789 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: Tue, 08 Jan 2008 14:40:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=132789 Change 132789 by rwatson@rwatson_cinnamon on 2008/01/08 14:40:00 Integrate zcopybpf. Affected files ... .. //depot/projects/zcopybpf/src/sys/amd64/amd64/pmap.c#12 integrate .. //depot/projects/zcopybpf/src/sys/amd64/conf/GENERIC#11 integrate .. //depot/projects/zcopybpf/src/sys/arm/at91/if_ate.c#6 integrate .. //depot/projects/zcopybpf/src/sys/conf/NOTES#16 integrate .. //depot/projects/zcopybpf/src/sys/conf/options#13 integrate .. //depot/projects/zcopybpf/src/sys/dev/cxgb/sys/mvec.h#5 integrate .. //depot/projects/zcopybpf/src/sys/dev/cxgb/sys/uipc_mvec.c#5 integrate .. //depot/projects/zcopybpf/src/sys/dev/ichwd/ichwd.c#6 integrate .. //depot/projects/zcopybpf/src/sys/dev/ichwd/ichwd.h#5 integrate .. //depot/projects/zcopybpf/src/sys/dev/streams/streams.c#5 integrate .. //depot/projects/zcopybpf/src/sys/dev/usb/if_rum.c#6 integrate .. //depot/projects/zcopybpf/src/sys/dev/usb/if_zyd.c#5 integrate .. //depot/projects/zcopybpf/src/sys/dev/usb/usbdevs#13 integrate .. //depot/projects/zcopybpf/src/sys/fs/devfs/devfs_vnops.c#8 integrate .. //depot/projects/zcopybpf/src/sys/fs/fifofs/fifo_vnops.c#7 integrate .. //depot/projects/zcopybpf/src/sys/fs/hpfs/hpfs_vfsops.c#5 integrate .. //depot/projects/zcopybpf/src/sys/i386/conf/GENERIC#11 integrate .. //depot/projects/zcopybpf/src/sys/i386/i386/pmap.c#12 integrate .. //depot/projects/zcopybpf/src/sys/ia64/conf/GENERIC#7 integrate .. //depot/projects/zcopybpf/src/sys/kern/kern_descrip.c#10 integrate .. //depot/projects/zcopybpf/src/sys/kern/kern_event.c#7 integrate .. //depot/projects/zcopybpf/src/sys/kern/subr_lock.c#9 integrate .. //depot/projects/zcopybpf/src/sys/kern/sys_generic.c#8 integrate .. //depot/projects/zcopybpf/src/sys/kern/sys_pipe.c#7 integrate .. //depot/projects/zcopybpf/src/sys/kern/sys_socket.c#5 integrate .. //depot/projects/zcopybpf/src/sys/kern/tty.c#4 integrate .. //depot/projects/zcopybpf/src/sys/kern/uipc_mqueue.c#6 integrate .. //depot/projects/zcopybpf/src/sys/kern/uipc_sem.c#4 integrate .. //depot/projects/zcopybpf/src/sys/kern/vfs_syscalls.c#9 integrate .. //depot/projects/zcopybpf/src/sys/kern/vfs_vnops.c#7 integrate .. //depot/projects/zcopybpf/src/sys/opencrypto/cryptodev.c#6 integrate .. //depot/projects/zcopybpf/src/sys/pc98/conf/GENERIC#9 integrate .. //depot/projects/zcopybpf/src/sys/powerpc/conf/GENERIC#9 integrate .. //depot/projects/zcopybpf/src/sys/sparc64/conf/GENERIC#7 integrate .. //depot/projects/zcopybpf/src/sys/sys/file.h#3 integrate .. //depot/projects/zcopybpf/src/sys/sys/syscallsubr.h#3 integrate Differences ... ==== //depot/projects/zcopybpf/src/sys/amd64/amd64/pmap.c#12 (text+ko) ==== @@ -77,7 +77,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.602 2008/01/06 18:51:03 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.603 2008/01/08 08:30:30 alc Exp $"); /* * Manages physical address maps. @@ -2075,15 +2075,8 @@ pd_entry_t ptepde; vm_page_t free; -#if defined(PMAP_DIAGNOSTIC) - /* - * XXX This makes pmap_remove_all() illegal for non-managed pages! - */ - if (m->flags & PG_FICTITIOUS) { - panic("pmap_remove_all: illegal for unmanaged page, va: 0x%lx", - VM_PAGE_TO_PHYS(m)); - } -#endif + KASSERT((m->flags & PG_FICTITIOUS) == 0, + ("pmap_remove_all: page %p is fictitious", m)); mtx_assert(&vm_page_queue_mtx, MA_OWNED); while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pmap = PV_PMAP(pv); ==== //depot/projects/zcopybpf/src/sys/amd64/conf/GENERIC#11 (text+ko) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.490 2007/12/15 00:56:16 scottl Exp $ +# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.491 2008/01/07 21:40:09 jhb Exp $ cpu HAMMER ident GENERIC @@ -52,6 +52,7 @@ options COMPAT_FREEBSD4 # Compatible with FreeBSD4 options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options COMPAT_FREEBSD6 # Compatible with FreeBSD6 +options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support ==== //depot/projects/zcopybpf/src/sys/arm/at91/if_ate.c#6 (text) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/at91/if_ate.c,v 1.22 2007/12/16 12:57:12 stas Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/at91/if_ate.c,v 1.23 2008/01/07 00:36:09 cognet Exp $"); #include #include @@ -191,7 +191,7 @@ callout_init_mtx(&sc->tick_ch, &sc->sc_mtx, 0); if ((err = ate_get_mac(sc, eaddr)) != 0) { - device_printf(dev, "No MAC address set"); + device_printf(dev, "No MAC address set\n"); goto out; } ate_set_mac(sc, eaddr); ==== //depot/projects/zcopybpf/src/sys/conf/NOTES#16 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1464 2007/12/27 23:19:03 des Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1465 2008/01/07 21:40:09 jhb Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -300,6 +300,9 @@ # Enable FreeBSD6 compatibility syscalls options COMPAT_FREEBSD6 +# Enable FreeBSD7 compatibility syscalls +options COMPAT_FREEBSD7 + # # These three options provide support for System V Interface # Definition-style interprocess communication, in the form of shared ==== //depot/projects/zcopybpf/src/sys/conf/options#13 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.614 2007/12/27 16:45:39 alc Exp $ +# $FreeBSD: src/sys/conf/options,v 1.615 2008/01/07 21:40:09 jhb Exp $ # # On the handling of kernel options # @@ -67,6 +67,7 @@ COMPAT_FREEBSD4 opt_compat.h COMPAT_FREEBSD5 opt_compat.h COMPAT_FREEBSD6 opt_compat.h +COMPAT_FREEBSD7 opt_compat.h COMPILING_LINT opt_global.h CY_PCI_FASTINTR DIRECTIO ==== //depot/projects/zcopybpf/src/sys/dev/cxgb/sys/mvec.h#5 (text+ko) ==== @@ -25,7 +25,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/cxgb/sys/mvec.h,v 1.8 2007/12/17 08:17:50 kmacy Exp $ + * $FreeBSD: src/sys/dev/cxgb/sys/mvec.h,v 1.9 2008/01/07 01:18:16 kmacy Exp $ * ***************************************************************************/ @@ -84,6 +84,7 @@ * along that needs 1 byte */ uint16_t mi_pad; + struct mbuf *mi_mbuf; /* need to be able to handle the @#$@@#%$ing packet zone */ #define mi_size mi_ext.ext_size #define mi_base mi_ext.ext_buf #define mi_args mi_ext.ext_args ==== //depot/projects/zcopybpf/src/sys/dev/cxgb/sys/uipc_mvec.c#5 (text+ko) ==== @@ -29,7 +29,7 @@ ***************************************************************************/ #include -__FBSDID("$FreeBSD: src/sys/dev/cxgb/sys/uipc_mvec.c,v 1.15 2007/12/16 05:19:48 kmacy Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/cxgb/sys/uipc_mvec.c,v 1.16 2008/01/07 01:18:16 kmacy Exp $"); #include #include @@ -125,6 +125,7 @@ mi->mi_flags = m->m_flags; mi->mi_len = m->m_len; + mi->mi_mbuf = NULL; if (m->m_flags & M_PKTHDR) { mi->mi_ether_vtag = m->m_pkthdr.ether_vtag; @@ -151,6 +152,7 @@ mi->mi_type = m->m_ext.ext_type; mi->mi_size = m->m_ext.ext_size; mi->mi_refcnt = m->m_ext.ref_cnt; + mi->mi_mbuf = m; } else { mi->mi_base = (caddr_t)m; mi->mi_data = m->m_data; @@ -267,7 +269,8 @@ goto err_out; } else if (seg_count >= TX_MAX_SEGS) { if (cxgb_debug) - printf("mbuf chain too long: %d max allowed %d\n", seg_count, TX_MAX_SEGS); + printf("mbuf chain too long: %d max allowed %d\n", + seg_count, TX_MAX_SEGS); if (!defragged) { n = m_defrag(*m, M_DONTWAIT); if (n == NULL) { @@ -300,9 +303,10 @@ } n = *m; while (n) { - if (((n->m_flags & (M_EXT|M_NOFREE)) == M_EXT) && (n->m_len > 0)) + if (((n->m_flags & (M_EXT|M_NOFREE)) == M_EXT) && + (n->m_len > 0) && (n->m_ext.ext_type != EXT_PACKET) ) n->m_flags &= ~M_EXT; - else if (n->m_len > 0) { + else if ((n->m_len > 0) || (n->m_ext.ext_type == EXT_PACKET)) { n = n->m_next; continue; } @@ -380,6 +384,10 @@ */ while (dofree == 0) { cnt = *(mi->mi_refcnt); + if (mi->mi_type == EXT_PACKET) { + dofree = 1; + break; + } if (atomic_cmpset_int(mi->mi_refcnt, cnt, cnt - 1)) { if (cnt == 1) dofree = 1; @@ -419,7 +427,10 @@ ("%s: ext_free not set", __func__)); (*(mi->mi_ext.ext_free))(mi->mi_ext.ext_buf, mi->mi_ext.ext_args); - break; + break; + case EXT_PACKET: + uma_zfree(zone_pack, mi->mi_mbuf); + break; default: dump_mi(mi); panic("unknown mv type in m_free_vec type=%d idx=%d", type, idx); ==== //depot/projects/zcopybpf/src/sys/dev/ichwd/ichwd.c#6 (text+ko) ==== @@ -56,7 +56,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ichwd/ichwd.c,v 1.13 2007/12/31 11:44:01 des Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ichwd/ichwd.c,v 1.14 2008/01/07 09:46:39 des Exp $"); #include #include @@ -93,6 +93,7 @@ { DEVICEID_ICH8, "Intel ICH8 watchdog timer", 8 }, { DEVICEID_ICH8DH, "Intel ICH8DH watchdog timer", 8 }, { DEVICEID_ICH8DO, "Intel ICH8DO watchdog timer", 8 }, + { DEVICEID_ICH8M, "Intel ICH8M watchdog timer", 8 }, { DEVICEID_63XXESB, "Intel 63XXESB watchdog timer", 8 }, { DEVICEID_ICH9, "Intel ICH9 watchdog timer", 9 }, { DEVICEID_ICH9R, "Intel ICH9R watchdog timer", 9 }, ==== //depot/projects/zcopybpf/src/sys/dev/ichwd/ichwd.h#5 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ichwd/ichwd.h,v 1.7 2007/12/31 11:44:01 des Exp $ + * $FreeBSD: src/sys/dev/ichwd/ichwd.h,v 1.8 2008/01/07 09:46:39 des Exp $ */ #ifndef _ICHWD_H_ @@ -85,6 +85,7 @@ #define DEVICEID_ICH8 0x2810 #define DEVICEID_ICH8DH 0x2812 #define DEVICEID_ICH8DO 0x2814 +#define DEVICEID_ICH8M 0x2815 #define DEVICEID_ICH9 0x2918 #define DEVICEID_ICH9R 0x2916 #define DEVICEID_ICH9DH 0x2912 ==== //depot/projects/zcopybpf/src/sys/dev/streams/streams.c#5 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/streams/streams.c,v 1.57 2007/12/30 01:42:12 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/streams/streams.c,v 1.58 2008/01/07 20:05:18 jhb Exp $"); #include #include @@ -90,6 +90,7 @@ static struct fileops svr4_netops = { .fo_read = soo_read, .fo_write = soo_write, + .fo_truncate = soo_truncate, .fo_ioctl = soo_ioctl, .fo_poll = soo_poll, .fo_kqfilter = soo_kqfilter, ==== //depot/projects/zcopybpf/src/sys/dev/usb/if_rum.c#6 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/usb/if_rum.c,v 1.15 2007/11/21 05:51:43 kevlo Exp $ */ +/* $FreeBSD: src/sys/dev/usb/if_rum.c,v 1.16 2008/01/07 09:14:37 kevlo Exp $ */ /*- * Copyright (c) 2005-2007 Damien Bergamini @@ -18,7 +18,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/if_rum.c,v 1.15 2007/11/21 05:51:43 kevlo Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/if_rum.c,v 1.16 2008/01/07 09:14:37 kevlo Exp $"); /*- * Ralink Technology RT2501USB/RT2601USB chipset driver @@ -118,6 +118,7 @@ { USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2671 }, { USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_WL113R2 }, { USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_WL172 }, + { USB_VENDOR_SPARKLAN, USB_PRODUCT_SPARKLAN_RT2573 }, { USB_VENDOR_SURECOM, USB_PRODUCT_SURECOM_RT2573 } }; ==== //depot/projects/zcopybpf/src/sys/dev/usb/if_zyd.c#5 (text+ko) ==== @@ -1,6 +1,6 @@ /* $OpenBSD: if_zyd.c,v 1.52 2007/02/11 00:08:04 jsg Exp $ */ /* $NetBSD: if_zyd.c,v 1.7 2007/06/21 04:04:29 kiyohara Exp $ */ -/* $FreeBSD: src/sys/dev/usb/if_zyd.c,v 1.11 2007/12/01 08:53:03 kevlo Exp $ */ +/* $FreeBSD: src/sys/dev/usb/if_zyd.c,v 1.12 2008/01/07 11:31:55 weongyo Exp $ */ /*- * Copyright (c) 2006 by Damien Bergamini @@ -2788,6 +2788,6 @@ static devclass_t zyd_devclass; DRIVER_MODULE(zyd, uhub, zyd_driver, zyd_devclass, usbd_driver_load, 0); -MODULE_DEPEND(rum, wlan, 1, 1, 1); -MODULE_DEPEND(rum, wlan_amrr, 1, 1, 1); -MODULE_DEPEND(rum, usb, 1, 1, 1); +MODULE_DEPEND(zyd, wlan, 1, 1, 1); +MODULE_DEPEND(zyd, wlan_amrr, 1, 1, 1); +MODULE_DEPEND(zyd, usb, 1, 1, 1); ==== //depot/projects/zcopybpf/src/sys/dev/usb/usbdevs#13 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/sys/dev/usb/usbdevs,v 1.336 2007/12/11 06:41:38 davidxu Exp $ +$FreeBSD: src/sys/dev/usb/usbdevs,v 1.337 2008/01/07 09:14:37 kevlo Exp $ /* $NetBSD: usbdevs,v 1.392 2004/12/29 08:38:44 imp Exp $ */ /*- @@ -594,6 +594,7 @@ vendor OQO 0x1557 OQO vendor UMEDIA 0x157e U-MEDIA Communications vendor FIBERLINE 0x1582 Fiberline +vendor SPARKLAN 0x15a9 SparkLAN vendor SOHOWARE 0x15e8 SOHOware vendor UMAX 0x1606 UMAX Data Systems vendor INSIDEOUT 0x1608 Inside Out Networks @@ -2111,6 +2112,9 @@ product SOURCENEXT KEIKAI8 0x039f KeikaiDenwa 8 product SOURCENEXT KEIKAI8_CHG 0x012e KeikaiDenwa 8 with charger +/* SparkLAN products */ +product SPARKLAN RT2573 0x0004 RT2573 + /* Sphairon Access Systems GmbH products */ product SPHAIRON UB801R 0x0110 UB801R ==== //depot/projects/zcopybpf/src/sys/fs/devfs/devfs_vnops.c#8 (text+ko) ==== @@ -31,7 +31,7 @@ * @(#)kernfs_vnops.c 8.15 (Berkeley) 5/21/95 * From: FreeBSD: src/sys/miscfs/kernfs/kernfs_vnops.c 1.43 * - * $FreeBSD: src/sys/fs/devfs/devfs_vnops.c,v 1.151 2007/12/30 01:42:13 jeff Exp $ + * $FreeBSD: src/sys/fs/devfs/devfs_vnops.c,v 1.153 2008/01/08 04:45:24 jhb Exp $ */ /* @@ -992,17 +992,20 @@ vnode_destroy_vobject(vp); + VI_LOCK(vp); dev_lock(); dev = vp->v_rdev; vp->v_rdev = NULL; if (dev == NULL) { dev_unlock(); + VI_UNLOCK(vp); return (0); } dev->si_usecount -= vp->v_usecount; dev_unlock(); + VI_UNLOCK(vp); dev_rel(dev); return (0); } @@ -1278,6 +1281,13 @@ return (devfs_allocv(de, ap->a_dvp->v_mount, ap->a_vpp, td)); } +static int +devfs_truncate_f(struct file *fp, off_t length, struct ucred *cred, struct thread *td) +{ + + return (vnops.fo_truncate(fp, length, cred, td)); +} + /* ARGSUSED */ static int devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, struct thread *td) @@ -1322,6 +1332,7 @@ static struct fileops devfs_ops_f = { .fo_read = devfs_read_f, .fo_write = devfs_write_f, + .fo_truncate = devfs_truncate_f, .fo_ioctl = devfs_ioctl_f, .fo_poll = devfs_poll_f, .fo_kqfilter = devfs_kqfilter_f, ==== //depot/projects/zcopybpf/src/sys/fs/fifofs/fifo_vnops.c#7 (text+ko) ==== @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * @(#)fifo_vnops.c 8.10 (Berkeley) 5/27/95 - * $FreeBSD: src/sys/fs/fifofs/fifo_vnops.c,v 1.139 2007/12/30 01:42:13 jeff Exp $ + * $FreeBSD: src/sys/fs/fifofs/fifo_vnops.c,v 1.140 2008/01/07 20:05:18 jhb Exp $ */ #include @@ -61,10 +61,12 @@ static fo_kqfilter_t fifo_kqfilter_f; static fo_stat_t fifo_stat_f; static fo_close_t fifo_close_f; +static fo_truncate_t fifo_truncate_f; struct fileops fifo_ops_f = { .fo_read = fifo_read_f, .fo_write = fifo_write_f, + .fo_truncate = fifo_truncate_f, .fo_ioctl = fifo_ioctl_f, .fo_poll = fifo_poll_f, .fo_kqfilter = fifo_kqfilter_f, @@ -724,6 +726,13 @@ } static int +fifo_truncate_f(struct file *fp, off_t length, struct ucred *cred, struct thread *td) +{ + + return (vnops.fo_truncate(fp, length, cred, td)); +} + +static int fifo_write_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, struct thread *td) { struct fifoinfo *fip; ==== //depot/projects/zcopybpf/src/sys/fs/hpfs/hpfs_vfsops.c#5 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/fs/hpfs/hpfs_vfsops.c,v 1.61 2007/10/16 10:54:52 alfred Exp $ + * $FreeBSD: src/sys/fs/hpfs/hpfs_vfsops.c,v 1.62 2008/01/07 16:51:24 attilio Exp $ */ @@ -323,7 +323,11 @@ if (bp) brelse (bp); mp->mnt_data = NULL; + DROP_GIANT(); + g_topology_lock(); g_vfs_close(cp, td); + g_topology_unlock(); + PICKUP_GIANT(); return (error); } @@ -353,7 +357,11 @@ } vinvalbuf(hpmp->hpm_devvp, V_SAVE, td, 0, 0); + DROP_GIANT(); + g_topology_lock(); g_vfs_close(hpmp->hpm_cp, td); + g_topology_unlock(); + PICKUP_GIANT(); vrele(hpmp->hpm_devvp); dprintf(("hpfs_umount: freeing memory...\n")); ==== //depot/projects/zcopybpf/src/sys/i386/conf/GENERIC#11 (text+ko) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.479 2007/12/15 00:56:15 scottl Exp $ +# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.480 2008/01/07 21:40:10 jhb Exp $ cpu I486_CPU cpu I586_CPU @@ -52,6 +52,7 @@ options COMPAT_FREEBSD4 # Compatible with FreeBSD4 options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options COMPAT_FREEBSD6 # Compatible with FreeBSD6 +options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support ==== //depot/projects/zcopybpf/src/sys/i386/i386/pmap.c#12 (text+ko) ==== @@ -75,7 +75,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.605 2008/01/06 18:51:04 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.606 2008/01/08 08:30:30 alc Exp $"); /* * Manages physical address maps. @@ -2119,15 +2119,8 @@ pt_entry_t *pte, tpte; vm_page_t free; -#if defined(PMAP_DIAGNOSTIC) - /* - * XXX This makes pmap_remove_all() illegal for non-managed pages! - */ - if (m->flags & PG_FICTITIOUS) { - panic("pmap_remove_all: illegal for unmanaged page, va: 0x%x", - VM_PAGE_TO_PHYS(m)); - } -#endif + KASSERT((m->flags & PG_FICTITIOUS) == 0, + ("pmap_remove_all: page %p is fictitious", m)); mtx_assert(&vm_page_queue_mtx, MA_OWNED); sched_pin(); while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { ==== //depot/projects/zcopybpf/src/sys/ia64/conf/GENERIC#7 (text+ko) ==== @@ -18,7 +18,7 @@ # # For hardware specific information check HARDWARE.TXT # -# $FreeBSD: src/sys/ia64/conf/GENERIC,v 1.93 2007/12/02 20:40:33 rwatson Exp $ +# $FreeBSD: src/sys/ia64/conf/GENERIC,v 1.94 2008/01/07 21:40:10 jhb Exp $ cpu ITANIUM ident GENERIC @@ -29,6 +29,7 @@ options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!] options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options COMPAT_FREEBSD6 # Compatible with FreeBSD6 +options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options DDB # Support DDB options FFS # Berkeley Fast Filesystem options GDB # Support remote GDB ==== //depot/projects/zcopybpf/src/sys/kern/kern_descrip.c#10 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_descrip.c,v 1.316 2008/01/03 01:26:59 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_descrip.c,v 1.317 2008/01/07 20:05:18 jhb Exp $"); #include "opt_compat.h" #include "opt_ddb.h" @@ -2760,6 +2760,13 @@ } static int +badfo_truncate(struct file *fp, off_t length, struct ucred *active_cred, struct thread *td) +{ + + return (EINVAL); +} + +static int badfo_ioctl(struct file *fp, u_long com, void *data, struct ucred *active_cred, struct thread *td) { @@ -2797,6 +2804,7 @@ struct fileops badfileops = { .fo_read = badfo_readwrite, .fo_write = badfo_readwrite, + .fo_truncate = badfo_truncate, .fo_ioctl = badfo_ioctl, .fo_poll = badfo_poll, .fo_kqfilter = badfo_kqfilter, ==== //depot/projects/zcopybpf/src/sys/kern/kern_event.c#7 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_event.c,v 1.115 2007/12/30 01:42:13 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_event.c,v 1.116 2008/01/07 20:05:18 jhb Exp $"); #include "opt_ktrace.h" @@ -105,6 +105,7 @@ static fo_rdwr_t kqueue_read; static fo_rdwr_t kqueue_write; +static fo_truncate_t kqueue_truncate; static fo_ioctl_t kqueue_ioctl; static fo_poll_t kqueue_poll; static fo_kqfilter_t kqueue_kqfilter; @@ -114,6 +115,7 @@ static struct fileops kqueueops = { .fo_read = kqueue_read, .fo_write = kqueue_write, + .fo_truncate = kqueue_truncate, .fo_ioctl = kqueue_ioctl, .fo_poll = kqueue_poll, .fo_kqfilter = kqueue_kqfilter, @@ -1324,6 +1326,15 @@ /*ARGSUSED*/ static int +kqueue_truncate(struct file *fp, off_t length, struct ucred *active_cred, + struct thread *td) +{ + + return (EINVAL); +} + +/*ARGSUSED*/ +static int kqueue_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *active_cred, struct thread *td) { ==== //depot/projects/zcopybpf/src/sys/kern/subr_lock.c#9 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/subr_lock.c,v 1.20 2007/12/31 03:45:51 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/subr_lock.c,v 1.21 2008/01/08 01:11:40 kris Exp $"); #include "opt_ddb.h" #include "opt_mprof.h" @@ -492,7 +492,7 @@ if (!lock_prof_enable || (lo->lo_flags & LO_NOPROFILE)) return; if (lock_prof_skipcount && - (++lock_prof_count % lock_prof_skipcount) == 0) + (++lock_prof_count % lock_prof_skipcount) != 0) return; spin = LOCK_CLASS(lo) == &lock_class_mtx_spin; if (spin && lock_prof_skipspin == 1) ==== //depot/projects/zcopybpf/src/sys/kern/sys_generic.c#8 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/sys_generic.c,v 1.161 2007/12/30 01:42:13 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/sys_generic.c,v 1.162 2008/01/07 20:05:18 jhb Exp $"); #include "opt_compat.h" #include "opt_ktrace.h" @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -69,7 +70,7 @@ #include #endif -#include +#include static MALLOC_DEFINE(M_IOCTLOPS, "ioctlops", "ioctl data buffer"); static MALLOC_DEFINE(M_SELECT, "select", "select() buffer"); @@ -544,6 +545,70 @@ return (error); } +/* + * Truncate a file given a file descriptor. + * + * Can't use fget_write() here, since must return EINVAL and not EBADF if the + * descriptor isn't writable. + */ +int +kern_ftruncate(td, fd, length) + struct thread *td; + int fd; + off_t length; +{ + struct file *fp; + int error; + + AUDIT_ARG(fd, fd); + if (length < 0) + return (EINVAL); + error = fget(td, fd, &fp); + if (error) + return (error); + AUDIT_ARG(file, td->td_proc, fp); + if (!(fp->f_flag & FWRITE)) { + fdrop(fp, td); + return (EINVAL); + } + error = fo_truncate(fp, length, td->td_ucred, td); + fdrop(fp, td); + return (error); +} + +#ifndef _SYS_SYSPROTO_H_ +struct ftruncate_args { + int fd; + int pad; + off_t length; +}; +#endif +int +ftruncate(td, uap) + struct thread *td; + struct ftruncate_args *uap; +{ + + return (kern_ftruncate(td, uap->fd, uap->length)); +} + +#if defined(COMPAT_43) +#ifndef _SYS_SYSPROTO_H_ +struct oftruncate_args { + int fd; + long length; +}; +#endif +int +oftruncate(td, uap) + struct thread *td; + struct oftruncate_args *uap; +{ + + return (kern_ftruncate(td, uap->fd, uap->length)); +} +#endif /* COMPAT_43 */ + #ifndef _SYS_SYSPROTO_H_ struct ioctl_args { int fd; ==== //depot/projects/zcopybpf/src/sys/kern/sys_pipe.c#7 (text+ko) ==== @@ -89,7 +89,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/sys_pipe.c,v 1.195 2007/12/30 01:42:13 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/sys_pipe.c,v 1.196 2008/01/07 20:05:18 jhb Exp $"); #include "opt_mac.h" @@ -140,6 +140,7 @@ */ static fo_rdwr_t pipe_read; static fo_rdwr_t pipe_write; +static fo_truncate_t pipe_truncate; static fo_ioctl_t pipe_ioctl; static fo_poll_t pipe_poll; static fo_kqfilter_t pipe_kqfilter; @@ -149,6 +150,7 @@ static struct fileops pipeops = { .fo_read = pipe_read, .fo_write = pipe_write, + .fo_truncate = pipe_truncate, .fo_ioctl = pipe_ioctl, .fo_poll = pipe_poll, .fo_kqfilter = pipe_kqfilter, @@ -1230,6 +1232,18 @@ return (error); } +/* ARGSUSED */ +static int +pipe_truncate(fp, length, active_cred, td) + struct file *fp; + off_t length; + struct ucred *active_cred; + struct thread *td; +{ + + return (EINVAL); +} + /* * we implement a very minimal set of ioctls for compatibility with sockets. */ ==== //depot/projects/zcopybpf/src/sys/kern/sys_socket.c#5 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/sys_socket.c,v 1.74 2007/10/24 19:03:55 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/sys_socket.c,v 1.75 2008/01/07 20:05:18 jhb Exp $"); #include "opt_mac.h" @@ -59,6 +59,7 @@ struct fileops socketops = { .fo_read = soo_read, .fo_write = soo_write, + .fo_truncate = soo_truncate, .fo_ioctl = soo_ioctl, .fo_poll = soo_poll, .fo_kqfilter = soo_kqfilter, @@ -110,6 +111,14 @@ } int +soo_truncate(struct file *fp, off_t length, struct ucred *active_cred, + struct thread *td) +{ + + return (EINVAL); +} + +int soo_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *active_cred, struct thread *td) { ==== //depot/projects/zcopybpf/src/sys/kern/tty.c#4 (text+ko) ==== @@ -71,7 +71,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/tty.c,v 1.273 2007/07/20 09:41:54 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/tty.c,v 1.274 2008/01/08 04:53:28 jhb Exp $"); #include "opt_compat.h" #include "opt_tty.h" @@ -3040,16 +3040,19 @@ * * XXX: This shall sleep until all threads have left the driver. */ - void ttyfree(struct tty *tp) { + struct cdev *dev; u_int unit; mtx_assert(&Giant, MA_OWNED); ttygone(tp); unit = tp->t_devunit; - destroy_dev(tp->t_mdev); + dev = tp->t_mdev; + tp->t_dev = NULL; + ttyrel(tp); + destroy_dev(dev); free_unr(tty_unit, unit); } @@ -3065,7 +3068,6 @@ tp = TAILQ_FIRST(&tty_list); if (tp != NULL) ttyref(tp); - mtx_unlock(&tty_list_mutex); while (tp != NULL) { bzero(&xt, sizeof xt); xt.xt_size = sizeof xt; @@ -3074,6 +3076,18 @@ xt.xt_cancc = tp->t_canq.c_cc; xt.xt_outcc = tp->t_outq.c_cc; XT_COPY(line); + + /* + * XXX: We hold the tty list lock while doing this to + * work around a race with pty/pts tty destruction. + * They set t_dev to NULL and then call ttyrel() to + * free the structure which will block on the list + * lock before they call destroy_dev() on the cdev + * backing t_dev. + * + * XXX: ttyfree() now does the same since it has been + * fixed to not leak ttys. + */ if (tp->t_dev != NULL) xt.xt_dev = dev2udev(tp->t_dev); XT_COPY(state); @@ -3096,6 +3110,7 @@ XT_COPY(olowat); XT_COPY(ospeedwat); #undef XT_COPY + mtx_unlock(&tty_list_mutex); error = SYSCTL_OUT(req, &xt, sizeof xt); if (error != 0) { ttyrel(tp); @@ -3108,7 +3123,9 @@ mtx_unlock(&tty_list_mutex); ttyrel(tp); tp = tp2; + mtx_lock(&tty_list_mutex); } + mtx_unlock(&tty_list_mutex); return (0); } ==== //depot/projects/zcopybpf/src/sys/kern/uipc_mqueue.c#6 (text+ko) ==== @@ -43,7 +43,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/uipc_mqueue.c,v 1.26 2007/12/30 01:42:13 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/uipc_mqueue.c,v 1.27 2008/01/07 20:05:18 jhb Exp $"); #include #include @@ -2317,6 +2317,14 @@ } static int +mqf_truncate(struct file *fp, off_t length, struct ucred *active_cred, + struct thread *td) +{ + + return (EINVAL); +} + +static int mqf_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *active_cred, struct thread *td) { @@ -2433,6 +2441,7 @@ static struct fileops mqueueops = { .fo_read = mqf_read, .fo_write = mqf_write, + .fo_truncate = mqf_truncate, .fo_ioctl = mqf_ioctl, .fo_poll = mqf_poll, .fo_kqfilter = mqf_kqfilter, ==== //depot/projects/zcopybpf/src/sys/kern/uipc_sem.c#4 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/uipc_sem.c,v 1.29 2007/10/24 19:03:55 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/uipc_sem.c,v 1.30 2008/01/07 22:03:19 rwatson Exp $"); #include "opt_mac.h" #include "opt_posix.h" @@ -442,6 +442,9 @@ sem_free(struct ksem *ks) { +#ifdef MAC + mac_posixsem_destroy(ks); +#endif nsems--; if (ks->ks_onlist) LIST_REMOVE(ks, ks_entry); ==== //depot/projects/zcopybpf/src/sys/kern/vfs_syscalls.c#9 (text+ko) ==== @@ -35,7 +35,7 @@ >>> TRUNCATED FOR MAIL (1000 lines) <<<