From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 02:59:35 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE984106566B; Sun, 12 Apr 2009 02:59:35 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 895D38FC12; Sun, 12 Apr 2009 02:59:35 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id n3C30skW054388; Sat, 11 Apr 2009 23:00:54 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id n3C30sVL054387; Sat, 11 Apr 2009 23:00:54 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Sat, 11 Apr 2009 23:00:54 -0400 From: David Schultz To: Norikatsu Shigemura Message-ID: <20090412030054.GA54299@zim.MIT.EDU> Mail-Followup-To: Norikatsu Shigemura , Stanislav Sedov , svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG References: <200904111657.n3BGvpsC092703@svn.freebsd.org> <20090411210702.ce5325b9.stas@FreeBSD.org> <20090412021841.673a200b.nork@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090412021841.673a200b.nork@FreeBSD.org> Cc: Stanislav Sedov , svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r190943 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 02:59:36 -0000 On Sun, Apr 12, 2009, Norikatsu Shigemura wrote: > On Sat, 11 Apr 2009 21:07:02 +0400 > Stanislav Sedov wrote: > > > Log: > > > GNU Pth has some fragile kludges that were broken by r189828. > > > I've discussed this with the Pth maintainer and no clear solution > > > has emerged on the ports side of things, so for now, hack around > > > the issue in signal.h. > > Can't we just put a patch in ports tree itself? What meant under 'no > > clean solution emerged'? I can prepare a patch, if needed. > > I think so, too. I have a quick hack patch. As I mentioned to vd@ on 3/20, I'd prefer something like that. Does your proposed patch also work for the ports that depend on GNU Pth, some of which may depend on signal.h? From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 03:03:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 961421065675; Sun, 12 Apr 2009 03:03:55 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 829478FC1E; Sun, 12 Apr 2009 03:03:55 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3C33t1W008786; Sun, 12 Apr 2009 03:03:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3C33txo008783; Sun, 12 Apr 2009 03:03:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200904120303.n3C33txo008783@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 12 Apr 2009 03:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190953 - in head/sys/powerpc: aim include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 03:03:56 -0000 Author: nwhitehorn Date: Sun Apr 12 03:03:55 2009 New Revision: 190953 URL: http://svn.freebsd.org/changeset/base/190953 Log: Rework the way we get the cacheline size. Instead of having a table of CPUs known to use 128 byte cache lines and defaulting to 32, use the dcbz instruction to measure it. Also make dcbz behave the way you would expect on PPC 970. Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/include/hid.h head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sun Apr 12 03:02:42 2009 (r190952) +++ head/sys/powerpc/aim/machdep.c Sun Apr 12 03:03:55 2009 (r190953) @@ -117,6 +117,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -254,8 +255,8 @@ powerpc_init(u_int startkernel, u_int en size_t trap_offset; void *kmdp; char *env; - int vers; uint32_t msr, scratch; + uint8_t *cache_check; end = 0; kmdp = NULL; @@ -326,37 +327,61 @@ powerpc_init(u_int startkernel, u_int en } /* - * Set cacheline_size based on the CPU model. + * Init KDB */ - vers = mfpvr() >> 16; - switch (vers) { + kdb_init(); + + /* + * PowerPC 970 CPUs have a misfeature requested by Apple that makes + * them pretend they have a 32-byte cacheline. Turn this off + * before we measure the cacheline size. + */ + + switch (mfpvr() >> 16) { case IBM970: case IBM970FX: case IBM970MP: case IBM970GX: - cacheline_size = 128; + scratch = mfspr64upper(SPR_HID5,msr); + scratch &= ~HID5_970_DCBZ_SIZE_HI; + mtspr64(SPR_HID5, scratch, mfspr(SPR_HID5), msr); break; - default: - cacheline_size = 32; } /* - * Init KDB + * Initialize the interrupt tables and figure out our cache line + * size and whether or not we need the 64-bit bridge code. */ - kdb_init(); - /* - * XXX: Initialize the interrupt tables. - * Disable translation in case the vector area - * hasn't been mapped (G5) + * Disable translation in case the vector area hasn't been + * mapped (G5). */ + msr = mfmsr(); mtmsr(msr & ~(PSL_IR | PSL_DR)); isync(); /* + * Measure the cacheline size using dcbz + * + * Use EXC_PGM as a playground. We are about to overwrite it + * anyway, we know it exists, and we know it is cache-aligned. + */ + + cache_check = (void *)EXC_PGM; + + for (cacheline_size = 0; cacheline_size < 0x100; cacheline_size++) + cache_check[cacheline_size] = 0xff; + + __asm __volatile("dcbz %0,0":: "r" (cache_check) : "memory"); + + /* Find the first byte dcbz did not zero to get the cache line size */ + for (cacheline_size = 0; cacheline_size < 0x100 && + cache_check[cacheline_size] == 0; cacheline_size++); + + /* * Figure out whether we need to use the 64 bit PMAP. This works by * executing an instruction that is only legal on 64-bit PPC (mtmsrd), * and setting ppc64 = 0 if that causes a trap. Modified: head/sys/powerpc/include/hid.h ============================================================================== --- head/sys/powerpc/include/hid.h Sun Apr 12 03:02:42 2009 (r190952) +++ head/sys/powerpc/include/hid.h Sun Apr 12 03:03:55 2009 (r190953) @@ -147,4 +147,6 @@ * 7457: XBSEN = Extended BAT Block Size Enable */ +#define HID5_970_DCBZ_SIZE_HI 0x01000000 /* dcbz does a 32-byte store */ + #endif /* _POWERPC_HID_H_ */ Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sun Apr 12 03:02:42 2009 (r190952) +++ head/sys/powerpc/include/spr.h Sun Apr 12 03:03:55 2009 (r190953) @@ -391,6 +391,8 @@ #define SPR_SRR3 0x3df /* 4.. Save/Restore Register 3 */ #define SPR_HID0 0x3f0 /* ..8 Hardware Implementation Register 0 */ #define SPR_HID1 0x3f1 /* ..8 Hardware Implementation Register 1 */ +#define SPR_HID4 0x3f4 /* ..8 Hardware Implementation Register 4 */ +#define SPR_HID5 0x3f6 /* ..8 Hardware Implementation Register 5 */ #if defined(AIM) #define SPR_DBSR 0x3f0 /* 4.. Debug Status Register */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 03:50:55 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 833931065674; Sun, 12 Apr 2009 03:50:55 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from sakura.ninth-nine.com (ns1.ninth-nine.com [219.127.74.121]) by mx1.freebsd.org (Postfix) with ESMTP id 2572D8FC1B; Sun, 12 Apr 2009 03:50:54 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from nadesico.ninth-nine.com (ns1.ninth-nine.com [219.127.74.121] (may be forged)) (authenticated bits=0) by sakura.ninth-nine.com (8.14.3/8.14.3/NinthNine) with ESMTP id n3C3omin005238; Sun, 12 Apr 2009 12:50:53 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Sun, 12 Apr 2009 12:50:47 +0900 From: Norikatsu Shigemura To: David Schultz Message-Id: <20090412125047.fb6adf5a.nork@FreeBSD.org> In-Reply-To: <20090412030054.GA54299@zim.MIT.EDU> References: <200904111657.n3BGvpsC092703@svn.freebsd.org> <20090411210702.ce5325b9.stas@FreeBSD.org> <20090412021841.673a200b.nork@FreeBSD.org> <20090412030054.GA54299@zim.MIT.EDU> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.14.7; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Stanislav Sedov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Norikatsu Shigemura Subject: Re: svn commit: r190943 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 03:50:56 -0000 On Sat, 11 Apr 2009 23:00:54 -0400 > > > Can't we just put a patch in ports tree itself? What meant under 'no > > > clean solution emerged'? I can prepare a patch, if needed. > > I think so, too. I have a quick hack patch. > As I mentioned to vd@ on 3/20, I'd prefer something like > that. Does your proposed patch also work for the ports that depend > on GNU Pth, some of which may depend on signal.h? Yes, no problem! Pth required singal.h's definision(SIGINT, SIGQUIT, ...), and it was already token care in pthread.h.in like following: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* * Protect namespace, because possibly existing vendor Pthread stuff * would certainly conflict with our defintions of pthread*_t. */ #define pthread_t __vendor_pthread_t : #include /* for sigset_t */ : /* * Unprotect namespace, so we can define our own variants now */ #undef pthread_t : - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 04:02:24 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 572491065670; Sun, 12 Apr 2009 04:02:24 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 0E2648FC1C; Sun, 12 Apr 2009 04:02:23 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id n3C43hmk054883; Sun, 12 Apr 2009 00:03:43 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id n3C43h6O054882; Sun, 12 Apr 2009 00:03:43 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Sun, 12 Apr 2009 00:03:43 -0400 From: David Schultz To: Norikatsu Shigemura Message-ID: <20090412040343.GA54862@zim.MIT.EDU> Mail-Followup-To: Norikatsu Shigemura , Stanislav Sedov , svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG References: <200904111657.n3BGvpsC092703@svn.freebsd.org> <20090411210702.ce5325b9.stas@FreeBSD.org> <20090412021841.673a200b.nork@FreeBSD.org> <20090412030054.GA54299@zim.MIT.EDU> <20090412125047.fb6adf5a.nork@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090412125047.fb6adf5a.nork@FreeBSD.org> Cc: Stanislav Sedov , svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r190943 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 04:02:25 -0000 On Sun, Apr 12, 2009, Norikatsu Shigemura wrote: > On Sat, 11 Apr 2009 23:00:54 -0400 > > > > Can't we just put a patch in ports tree itself? What meant under 'no > > > > clean solution emerged'? I can prepare a patch, if needed. > > > I think so, too. I have a quick hack patch. > > As I mentioned to vd@ on 3/20, I'd prefer something like > > that. Does your proposed patch also work for the ports that depend > > on GNU Pth, some of which may depend on signal.h? > > Yes, no problem! Pth required singal.h's definision(SIGINT, > SIGQUIT, ...), and it was already token care in pthread.h.in > like following: > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > /* > * Protect namespace, because possibly existing vendor Pthread stuff > * would certainly conflict with our defintions of pthread*_t. > */ > #define pthread_t __vendor_pthread_t > : > #include /* for sigset_t */ > : > /* > * Unprotect namespace, so we can define our own variants now > */ > #undef pthread_t > : > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - I don't understand how this is related to the problem; signal.h and sys/signal.h are not the same header, nor does one include the other. From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 04:33:47 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3341A106564A; Sun, 12 Apr 2009 04:33:47 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from sakura.ninth-nine.com (ns1.ninth-nine.com [219.127.74.121]) by mx1.freebsd.org (Postfix) with ESMTP id CA60C8FC0A; Sun, 12 Apr 2009 04:33:46 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from nadesico.ninth-nine.com ([192.168.36.249]) (authenticated bits=0) by sakura.ninth-nine.com (8.14.3/8.14.3/NinthNine) with ESMTP id n3C4XeiE005512; Sun, 12 Apr 2009 13:33:45 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Sun, 12 Apr 2009 13:32:33 +0900 From: Norikatsu Shigemura To: David Schultz Message-Id: <20090412133233.1dc58fcb.nork@FreeBSD.org> In-Reply-To: <20090412040343.GA54862@zim.MIT.EDU> References: <200904111657.n3BGvpsC092703@svn.freebsd.org> <20090411210702.ce5325b9.stas@FreeBSD.org> <20090412021841.673a200b.nork@FreeBSD.org> <20090412030054.GA54299@zim.MIT.EDU> <20090412125047.fb6adf5a.nork@FreeBSD.org> <20090412040343.GA54862@zim.MIT.EDU> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.16.0; amd64-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Stanislav Sedov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Norikatsu Shigemura Subject: Re: svn commit: r190943 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 04:33:47 -0000 On Sun, 12 Apr 2009 00:03:43 -0400 David Schultz wrote: > > Yes, no problem! Pth required singal.h's definision(SIGINT, > > SIGQUIT, ...), and it was already token care in pthread.h.in > > like following: > I don't understand how this is related to the problem; signal.h > and sys/signal.h are not the same header, nor does one include the > other. Simple-fully, no required signal.h. -- Norikatsu Shigemura From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 04:45:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B17F9106566B; Sun, 12 Apr 2009 04:45:40 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A01A98FC12; Sun, 12 Apr 2009 04:45:40 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3C4jeBF010899; Sun, 12 Apr 2009 04:45:40 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3C4jevv010898; Sun, 12 Apr 2009 04:45:40 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200904120445.n3C4jevv010898@svn.freebsd.org> From: Tim Kientzle Date: Sun, 12 Apr 2009 04:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190955 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 04:45:41 -0000 Author: kientzle Date: Sun Apr 12 04:45:40 2009 New Revision: 190955 URL: http://svn.freebsd.org/changeset/base/190955 Log: Merge r881 from libarchive.googlecode.com: The "empty" format should not be recognized if there is a read error. Modified: head/lib/libarchive/archive_read_support_format_empty.c Modified: head/lib/libarchive/archive_read_support_format_empty.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_empty.c Sun Apr 12 03:45:03 2009 (r190954) +++ head/lib/libarchive/archive_read_support_format_empty.c Sun Apr 12 04:45:40 2009 (r190955) @@ -60,9 +60,10 @@ static int archive_read_format_empty_bid(struct archive_read *a) { const void *h; + ssize_t avail; - h = __archive_read_ahead(a, 1, NULL); - if (h != NULL) + h = __archive_read_ahead(a, 1, &avail); + if (avail != 0) return (-1); return (1); } From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 04:59:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05C9A106568A; Sun, 12 Apr 2009 04:59:12 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E80958FC19; Sun, 12 Apr 2009 04:59:11 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3C4xBbF011184; Sun, 12 Apr 2009 04:59:11 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3C4xB6D011182; Sun, 12 Apr 2009 04:59:11 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200904120459.n3C4xB6D011182@svn.freebsd.org> From: Tim Kientzle Date: Sun, 12 Apr 2009 04:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190956 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 04:59:12 -0000 Author: kientzle Date: Sun Apr 12 04:59:11 2009 New Revision: 190956 URL: http://svn.freebsd.org/changeset/base/190956 Log: Merge from libarchive.googlecode.com: r751: Change __archive_strncat() to use a void * source, which reduces the amount of casting needed to use this with "char", "signed char" and "unsigned char". r752: Use additions instead of multiplications when growing buffer; faster and less chance of overflow. Modified: head/lib/libarchive/archive_string.c head/lib/libarchive/archive_string.h Modified: head/lib/libarchive/archive_string.c ============================================================================== --- head/lib/libarchive/archive_string.c Sun Apr 12 04:45:40 2009 (r190955) +++ head/lib/libarchive/archive_string.c Sun Apr 12 04:59:11 2009 (r190956) @@ -115,11 +115,11 @@ __archive_string_ensure(struct archive_s as->buffer_length = 32; else if (as->buffer_length < 8192) /* Buffers under 8k are doubled for speed. */ - as->buffer_length *= 2; + as->buffer_length += as->buffer_length; else { /* Buffers 8k and over grow by at least 25% each time. */ size_t old_length = as->buffer_length; - as->buffer_length = (as->buffer_length * 5) / 4; + as->buffer_length += as->buffer_length / 4; /* Be safe: If size wraps, release buffer and return NULL. */ if (as->buffer_length < old_length) { free(as->s); @@ -142,10 +142,12 @@ __archive_string_ensure(struct archive_s } struct archive_string * -__archive_strncat(struct archive_string *as, const char *p, size_t n) +__archive_strncat(struct archive_string *as, const void *_p, size_t n) { size_t s; - const char *pp; + const char *p, *pp; + + p = (const char *)_p; /* Like strlen(p), except won't examine positions beyond p[n]. */ s = 0; Modified: head/lib/libarchive/archive_string.h ============================================================================== --- head/lib/libarchive/archive_string.h Sun Apr 12 04:45:40 2009 (r190955) +++ head/lib/libarchive/archive_string.h Sun Apr 12 04:59:11 2009 (r190956) @@ -99,8 +99,12 @@ __archive_string_ensure(struct archive_s #define archive_string_ensure __archive_string_ensure /* Append C string, which may lack trailing \0. */ +/* The source is declared void * here because this gets used with + * "signed char *", "unsigned char *" and "char *" arguments. + * Declaring it "char *" as with some of the other functions just + * leads to a lot of extra casts. */ struct archive_string * -__archive_strncat(struct archive_string *, const char *, size_t); +__archive_strncat(struct archive_string *, const void *, size_t); #define archive_strncat __archive_strncat /* Append a C string to an archive_string, resizing as necessary. */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 05:04:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C46161065672; Sun, 12 Apr 2009 05:04:02 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B116C8FC08; Sun, 12 Apr 2009 05:04:02 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3C542f5011355; Sun, 12 Apr 2009 05:04:02 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3C542cg011353; Sun, 12 Apr 2009 05:04:02 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200904120504.n3C542cg011353@svn.freebsd.org> From: Tim Kientzle Date: Sun, 12 Apr 2009 05:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190957 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 05:04:03 -0000 Author: kientzle Date: Sun Apr 12 05:04:02 2009 New Revision: 190957 URL: http://svn.freebsd.org/changeset/base/190957 Log: Merge from libarchive.googlecode.com r756,r761: Document the new archive_read_disk API. Added: head/lib/libarchive/archive_read_disk.3 (contents, props changed) Modified: head/lib/libarchive/Makefile Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Sun Apr 12 04:59:11 2009 (r190956) +++ head/lib/libarchive/Makefile Sun Apr 12 05:04:02 2009 (r190957) @@ -77,6 +77,7 @@ SRCS= archive_check_magic.c \ # Man pages to be installed. MAN= archive_entry.3 \ archive_read.3 \ + archive_read_disk.3 \ archive_util.3 \ archive_write.3 \ archive_write_disk.3 \ @@ -186,6 +187,16 @@ MLINKS+= archive_read.3 archive_read_sup MLINKS+= archive_read.3 archive_read_support_format_iso9660.3 MLINKS+= archive_read.3 archive_read_support_format_tar.3 MLINKS+= archive_read.3 archive_read_support_format_zip.3 +MLINKS+= archive_read_disk.3 archive_read_disk_entry_from_file.3 +MLINKS+= archive_read_disk.3 archive_read_disk_gname.3 +MLINKS+= archive_read_disk.3 archive_read_disk_new.3 +MLINKS+= archive_read_disk.3 archive_read_disk_set_gname_lookup.3 +MLINKS+= archive_read_disk.3 archive_read_disk_set_standard_lookup.3 +MLINKS+= archive_read_disk.3 archive_read_disk_set_symlink_hybrid.3 +MLINKS+= archive_read_disk.3 archive_read_disk_set_symlink_logical.3 +MLINKS+= archive_read_disk.3 archive_read_disk_set_symlink_physical.3 +MLINKS+= archive_read_disk.3 archive_read_disk_set_uname_lookup.3 +MLINKS+= archive_read_disk.3 archive_read_disk_uname.3 MLINKS+= archive_util.3 archive_clear_error.3 MLINKS+= archive_util.3 archive_compression.3 MLINKS+= archive_util.3 archive_compression_name.3 Added: head/lib/libarchive/archive_read_disk.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/archive_read_disk.3 Sun Apr 12 05:04:02 2009 (r190957) @@ -0,0 +1,308 @@ +.\" Copyright (c) 2003-2009 Tim Kientzle +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 10, 2009 +.Dt archive_read_disk 3 +.Os +.Sh NAME +.Nm archive_read_disk_new , +.Nm archive_read_disk_set_symlink_logical , +.Nm archive_read_disk_set_symlink_physical , +.Nm archive_read_disk_set_symlink_hybrid , +.Nm archive_read_disk_entry_from_file , +.Nm archive_read_disk_gname , +.Nm archive_read_disk_uname , +.Nm archive_read_disk_set_uname_lookup , +.Nm archive_read_disk_set_gname_lookup , +.Nm archive_read_disk_set_standard_lookup , +.Nm archive_read_close , +.Nm archive_read_finish +.Nd functions for reading objects from disk +.Sh SYNOPSIS +.In archive.h +.Ft struct archive * +.Fn archive_read_disk_new "void" +.Ft int +.Fn archive_read_disk_set_symlink_logical "struct archive *" +.Ft int +.Fn archive_read_disk_set_symlink_physical "struct archive *" +.Ft int +.Fn archive_read_disk_set_symlink_hybrid "struct archive *" +.Ft int +.Fn archive_read_disk_gname "struct archive *" "gid_t" +.Ft int +.Fn archive_read_disk_uname "struct archive *" "uid_t" +.Ft int +.Fo archive_read_disk_set_gname_lookup +.Fa "struct archive *" +.Fa "void *" +.Fa "const char *(*lookup)(void *, gid_t)" +.Fa "void (*cleanup)(void *)" +.Fc +.Ft int +.Fo archive_read_disk_set_uname_lookup +.Fa "struct archive *" +.Fa "void *" +.Fa "const char *(*lookup)(void *, uid_t)" +.Fa "void (*cleanup)(void *)" +.Fc +.Ft int +.Fn archive_read_disk_set_standard_lookup "struct archive *" +.Ft int +.Fo archive_read_disk_entry_from_file +.Fa "struct archive *" +.Fa "struct archive_entry *" +.Fa "int fd" +.Fa "const struct stat *" +.Fc +.Ft int +.Fn archive_read_close "struct archive *" +.Ft int +.Fn archive_read_finish "struct archive *" +.Sh DESCRIPTION +These functions provide an API for reading information about +objects on disk. +In particular, they provide an interface for populating +.Tn struct archive_entry +objects. +.Bl -tag -width indent +.It Fn archive_read_disk_new +Allocates and initializes a +.Tn struct archive +object suitable for reading object information from disk. +.It Xo +.Fn archive_read_disk_set_symlink_logical , +.Fn archive_read_disk_set_symlink_physical , +.Fn archive_read_disk_set_symlink_hybrid +.Xc +This sets the mode used for handling symbolic links. +The +.Dq logical +mode follows all symbolic links. +The +.Dq physical +mode does not follow any symbolic links. +The +.Dq hybrid +mode currently behaves identically to the +.Dq logical +mode. +.It Xo +.Fn archive_read_disk_gname , +.Fn archive_read_disk_uname +.Xc +Returns a user or group name given a gid or uid value. +By default, these always return a NULL string. +.It Xo +.Fn archive_read_disk_set_gname_lookup , +.Fn archive_read_disk_set_uname_lookup +.Xc +These allow you to override the functions used for +user and group name lookups. +You may also provide a +.Tn void * +pointer to a private data structure and a cleanup function for +that data. +The cleanup function will be invoked when the +.Tn struct archive +object is destroyed or when new lookup functions are registered. +.It Fn archive_read_disk_set_standard_lookup +This convenience function installs a standard set of user +and group name lookup functions. +These functions use +.Xr getpwid 3 +and +.Xr getgrid 3 +to convert ids to names, defaulting to NULL if the names cannot +be looked up. +These functions also implement a simple memory cache to reduce +the number of calls to +.Xr getpwid 3 +and +.Xr getgrid 3 . +.It Fn archive_read_disk_entry_from_file +Populates a +.Tn struct archive_entry +object with information about a particular file. +The +.Tn archive_entry +object must have already been created with +.Xr archive_entry_new 3 +and at least one of the source path or path fields must already be set. +(If both are set, the source path will be used.) +.Pp +Information is read from disk using the path name from the +.Tn struct archive_entry +object. +If a file descriptor is provided, some information will be obtained using +that file descriptor, on platforms that support the appropriate +system calls. +.Pp +If a pointer to a +.Tn struct stat +is provided, information from that structure will be used instead +of reading from the disk where appropriate. +This can provide performance benefits in scenarios where +.Tn struct stat +information has already been read from the disk as a side effect +of some other operation. +(For example, directory traversal libraries often provide this information.) +.Pp +Where necessary, user and group ids are converted to user and group names +using the currently registered lookup functions above. +This affects the file ownership fields and ACL values in the +.Tn struct archive_entry +object. +.It Fn archive_read_close +This currently does nothing. +.It Fn archive_write_finish +Invokes +.Fn archive_write_close +if it was not invoked manually, then releases all resources. +.El +More information about the +.Va struct archive +object and the overall design of the library can be found in the +.Xr libarchive 3 +overview. +.Sh EXAMPLE +The following illustrates basic usage of the library by +showing how to use it to copy an item on disk into an archive. +.Bd -literal -offset indent +void +file_to_archive(struct archive *a, const char *name) +{ + char buff[8192]; + size_t bytes_read; + struct archive *ard; + struct archive_entry *entry; + int fd; + + ard = archive_read_disk_new(); + archive_read_disk_set_standard_lookup(ard); + entry = archive_entry_new(); + fd = open(name, O_RDONLY); + if (fd < 0) + return; + archive_entry_copy_sourcepath(entry, name); + archive_read_disk_entry_from_file(ard, entry, fd, NULL); + archive_write_header(a, entry); + while ((bytes_read = read(fd, buff, sizeof(buff))) > 0) + archive_write_data(a, buff, bytes_read); + archive_write_finish_entry(a); + archive_read_finish(ard); + archive_entry_free(entry); +} +.Ed +.Sh RETURN VALUES +Most functions return +.Cm ARCHIVE_OK +(zero) on success, or one of several negative +error codes for errors. +Specific error codes include: +.Cm ARCHIVE_RETRY +for operations that might succeed if retried, +.Cm ARCHIVE_WARN +for unusual conditions that do not prevent further operations, and +.Cm ARCHIVE_FATAL +for serious errors that make remaining operations impossible. +The +.Xr archive_errno 3 +and +.Xr archive_error_string 3 +functions can be used to retrieve an appropriate error code and a +textual error message. +(See +.Xr archive_util 3 +for details.) +.Pp +.Fn archive_read_disk_new +returns a pointer to a newly-allocated +.Tn struct archive +object or NULL if the allocation failed for any reason. +.Pp +.Fn archive_read_disk_gname +and +.Fn archive_read_disk_uname +return +.Tn const char * +pointers to the textual name or NULL if the lookup failed for any reason. +The returned pointer points to internal storage that +may be reused on the next call to either of these functions; +callers should copy the string if they need to continue accessing it. +.Pp +.Sh SEE ALSO +.Xr archive_read 3 , +.Xr archive_write 3 , +.Xr archive_write_disk 3 , +.Xr tar 1 , +.Xr libarchive 3 +.Sh HISTORY +The +.Nm libarchive +library first appeared in +.Fx 5.3 . +The +.Nm archive_read_disk +interface was added to +.Nm libarchive 2.6 +and first appeared in +.Fx 8.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm libarchive +library was written by +.An Tim Kientzle Aq kientzle@freebsd.org . +.Sh BUGS +The +.Dq standard +user name and group name lookup functions are not the defaults because +.Xr getgrid 3 +and +.Xr getpwid 3 +are sometimes too large for particular applications. +The current design allows the application author to use a more +compact implementation when appropriate. +.Pp +The full list of metadata read from disk by +.Fn archive_read_disk_entry_from_file +is necessarily system-dependent. +.Pp +The +.Fn archive_read_disk_entry_from_file +function reads as much information as it can from disk. +Some method should be provided to limit this so that clients who +do not need ACLs, for instance, can avoid the extra work needed +to look up such information. +.Pp +This API should provide a set of methods for walking a directory tree. +That would make it a direct parallel of the +.Xr archive_read 3 +API. +When such methods are implemented, the +.Dq hybrid +symbolic link mode will make sense. From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 05:19:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D052106566C; Sun, 12 Apr 2009 05:19:36 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C4078FC0C; Sun, 12 Apr 2009 05:19:36 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3C5JZs1011695; Sun, 12 Apr 2009 05:19:35 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3C5JZ7H011694; Sun, 12 Apr 2009 05:19:35 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200904120519.n3C5JZ7H011694@svn.freebsd.org> From: Kip Macy Date: Sun, 12 Apr 2009 05:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190958 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 05:19:36 -0000 Author: kmacy Date: Sun Apr 12 05:19:35 2009 New Revision: 190958 URL: http://svn.freebsd.org/changeset/base/190958 Log: sendfile doesn't modify the vnode - acquire vnode lock shared Reviewed by: ups, jeffr Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Sun Apr 12 05:04:02 2009 (r190957) +++ head/sys/kern/uipc_syscalls.c Sun Apr 12 05:19:35 2009 (r190958) @@ -1811,7 +1811,7 @@ kern_sendfile(struct thread *td, struct if ((error = fgetvp_read(td, uap->fd, &vp)) != 0) goto out; vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); if (vp->v_type == VREG) { obj = vp->v_object; if (obj != NULL) { From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 05:25:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C88011065672 for ; Sun, 12 Apr 2009 05:25:43 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 1C1ED8FC12 for ; Sun, 12 Apr 2009 05:25:42 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 12 Apr 2009 05:25:41 -0000 Received: from p54A3DCEC.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.220.236] by mail.gmx.net (mp071) with SMTP; 12 Apr 2009 07:25:41 +0200 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1+DSj0V+MaDMo1FQIKgXBBcvd31qM5vGtOz2wekEL pt7elTfzVRRlpQ Message-ID: <49E17B54.70903@gmx.de> Date: Sun, 12 Apr 2009 07:25:40 +0200 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Tim Kientzle References: <200904120445.n3C4jevv010898@svn.freebsd.org> In-Reply-To: <200904120445.n3C4jevv010898@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.54 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190955 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 05:25:44 -0000 Tim Kientzle schrieb: > Author: kientzle > Date: Sun Apr 12 04:45:40 2009 > New Revision: 190955 > URL: http://svn.freebsd.org/changeset/base/190955 > > Log: > Merge r881 from libarchive.googlecode.com: The "empty" format > should not be recognized if there is a read error. > > Modified: > head/lib/libarchive/archive_read_support_format_empty.c > > Modified: head/lib/libarchive/archive_read_support_format_empty.c > ============================================================================== > --- head/lib/libarchive/archive_read_support_format_empty.c Sun Apr 12 03:45:03 2009 (r190954) > +++ head/lib/libarchive/archive_read_support_format_empty.c Sun Apr 12 04:45:40 2009 (r190955) > @@ -60,9 +60,10 @@ static int > archive_read_format_empty_bid(struct archive_read *a) > { > const void *h; > + ssize_t avail; > > - h = __archive_read_ahead(a, 1, NULL); > - if (h != NULL) > + h = __archive_read_ahead(a, 1, &avail); > + if (avail != 0) > return (-1); > return (1); > } "h" now is write-only - is this intended or should the variable be removed? From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 05:33:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B23C106564A; Sun, 12 Apr 2009 05:33:36 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 281E68FC0C; Sun, 12 Apr 2009 05:33:36 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3C5XZtM012033; Sun, 12 Apr 2009 05:33:35 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3C5XZdK012013; Sun, 12 Apr 2009 05:33:35 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200904120533.n3C5XZdK012013@svn.freebsd.org> From: Tim Kientzle Date: Sun, 12 Apr 2009 05:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190959 - in head/lib/libarchive: . test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 05:33:36 -0000 Author: kientzle Date: Sun Apr 12 05:33:34 2009 New Revision: 190959 URL: http://svn.freebsd.org/changeset/base/190959 Log: Merge from libarchive.googlecode.com: Mostly a bunch of corrections to the Windows support to reconcile differences between Visual Studio and Cygwin. Includes parts of revisions 757, 774, 787, 815, 817, 819, 820, 844, and 886. Of particular note, r886 overhauled the UTF-8/Unicode conversions to work correctly regardless of whether the local system uses 16-bit or 32-bit wchar_t. (I assume that systems with 16-bit wchar_t use UTF-16 and those with 32-bit wchar_t use UCS-4.) This revision also added a preference for wcrtomb() (which is thread-safe) on platforms that support it. Modified: head/lib/libarchive/archive.h head/lib/libarchive/archive_check_magic.c head/lib/libarchive/archive_entry.c head/lib/libarchive/archive_entry.h head/lib/libarchive/archive_read_disk_set_standard_lookup.c head/lib/libarchive/archive_read_support_compression_program.c head/lib/libarchive/archive_string.c head/lib/libarchive/archive_write_disk.c head/lib/libarchive/archive_write_disk_set_standard_lookup.c head/lib/libarchive/archive_write_set_compression_program.c head/lib/libarchive/archive_write_set_format_mtree.c head/lib/libarchive/test/main.c head/lib/libarchive/test/test.h head/lib/libarchive/test/test_read_disk.c head/lib/libarchive/test/test_read_extract.c head/lib/libarchive/test/test_tar_large.c head/lib/libarchive/test/test_write_disk.c head/lib/libarchive/test/test_write_disk_failures.c head/lib/libarchive/test/test_write_disk_hardlink.c head/lib/libarchive/test/test_write_disk_perms.c head/lib/libarchive/test/test_write_disk_secure.c Modified: head/lib/libarchive/archive.h ============================================================================== --- head/lib/libarchive/archive.h Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/archive.h Sun Apr 12 05:33:34 2009 (r190959) @@ -46,7 +46,7 @@ /* Get appropriate definitions of standard POSIX-style types. */ /* These should match the types used in 'struct stat' */ -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) #define __LA_INT64_T __int64 # if defined(_WIN64) # define __LA_SSIZE_T __int64 @@ -68,7 +68,7 @@ * .lib. The default here assumes you're building a DLL. Only * libarchive source should ever define __LIBARCHIVE_BUILD. */ -#if ((defined __WIN32__) || (defined _WIN32)) && (!defined LIBARCHIVE_STATIC) +#if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC) # ifdef __LIBARCHIVE_BUILD # ifdef __GNUC__ # define __LA_DECL __attribute__((dllexport)) extern Modified: head/lib/libarchive/archive_check_magic.c ============================================================================== --- head/lib/libarchive/archive_check_magic.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/archive_check_magic.c Sun Apr 12 05:33:34 2009 (r190959) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_UNISTD_H #include #endif -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) #include #include #endif @@ -56,7 +56,7 @@ errmsg(const char *m) static void diediedie(void) { -#if defined(_WIN32) && defined(_DEBUG) +#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG) /* Cause a breakpoint exception */ DebugBreak(); #endif Modified: head/lib/libarchive/archive_entry.c ============================================================================== --- head/lib/libarchive/archive_entry.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/archive_entry.c Sun Apr 12 05:33:34 2009 (r190959) @@ -83,7 +83,7 @@ __FBSDID("$FreeBSD$"); #elif defined makedev /* There's a "makedev" macro. */ #define ae_makedev(maj, min) makedev((maj), (min)) -#elif defined mkdev || defined _WIN32 || defined __WIN32__ +#elif defined mkdev || ((defined _WIN32 || defined __WIN32__) && !defined(__CYGWIN__)) /* Windows. */ #define ae_makedev(maj, min) mkdev((maj), (min)) #else Modified: head/lib/libarchive/archive_entry.h ============================================================================== --- head/lib/libarchive/archive_entry.h Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/archive_entry.h Sun Apr 12 05:33:34 2009 (r190959) @@ -42,7 +42,7 @@ /* Get appropriate definitions of standard POSIX-style types. */ /* These should match the types used in 'struct stat' */ -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) #define __LA_INT64_T __int64 #define __LA_UID_T unsigned int #define __LA_GID_T unsigned int @@ -71,7 +71,7 @@ * .lib. The default here assumes you're building a DLL. Only * libarchive source should ever define __LIBARCHIVE_BUILD. */ -#if ((defined __WIN32__) || (defined _WIN32)) && (!defined LIBARCHIVE_STATIC) +#if ((defined __WIN32__) || (defined _WIN32) || defined(__CYGWIN__)) && (!defined LIBARCHIVE_STATIC) # ifdef __LIBARCHIVE_BUILD # ifdef __GNUC__ # define __LA_DECL __attribute__((dllexport)) extern Modified: head/lib/libarchive/archive_read_disk_set_standard_lookup.c ============================================================================== --- head/lib/libarchive/archive_read_disk_set_standard_lookup.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/archive_read_disk_set_standard_lookup.c Sun Apr 12 05:33:34 2009 (r190959) @@ -47,14 +47,14 @@ __FBSDID("$FreeBSD$"); #include "archive.h" -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) int archive_read_disk_set_standard_lookup(struct archive *a) { archive_set_error(a, -1, "Standard lookups not available on Windows"); return (ARCHIVE_FATAL); } -#else +#else /* ! (_WIN32 && !__CYGWIN__) */ #define name_cache_size 127 static const char * const NO_NAME = "(noname)"; @@ -226,4 +226,4 @@ lookup_gname_helper(struct archive *a, i return strdup(grent.gr_name); } -#endif /* _WIN32 */ +#endif /* ! (_WIN32 && !__CYGWIN__) */ Modified: head/lib/libarchive/archive_read_support_compression_program.c ============================================================================== --- head/lib/libarchive/archive_read_support_compression_program.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/archive_read_support_compression_program.c Sun Apr 12 05:33:34 2009 (r190959) @@ -61,7 +61,7 @@ archive_read_support_compression_program /* This capability is only available on POSIX systems. */ #if (!defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \ - !(defined(HAVE_FORK) || defined(HAVE_VFORK))) && !defined(_WIN32) + !(defined(HAVE_FORK) || defined(HAVE_VFORK))) && (!defined(_WIN32) || defined(__CYGWIN__)) /* * On non-Posix systems, allow the program to build, but choke if Modified: head/lib/libarchive/archive_string.c ============================================================================== --- head/lib/libarchive/archive_string.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/archive_string.c Sun Apr 12 05:33:34 2009 (r190959) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_WCHAR_H #include #endif -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) #include #endif @@ -165,56 +165,18 @@ __archive_strappend_char(struct archive_ return (__archive_string_append(as, &c, 1)); } -#ifndef _WIN32 /* - * Home-grown wctomb for UTF-8. + * Translates a wide character string into UTF-8 and appends + * to the archive_string. Note: returns NULL if conversion fails, + * but still leaves a best-effort conversion in the argument as. */ -static int -my_wctomb_utf8(char *p, wchar_t wc) -{ - if (p == NULL) - /* UTF-8 doesn't use shift states. */ - return (0); - if (wc <= 0x7f) { - p[0] = (char)wc; - return (1); - } - if (wc <= 0x7ff) { - p[0] = 0xc0 | ((wc >> 6) & 0x1f); - p[1] = 0x80 | (wc & 0x3f); - return (2); - } - if (wc <= 0xffff) { - p[0] = 0xe0 | ((wc >> 12) & 0x0f); - p[1] = 0x80 | ((wc >> 6) & 0x3f); - p[2] = 0x80 | (wc & 0x3f); - return (3); - } - if (wc <= 0x1fffff) { - p[0] = 0xf0 | ((wc >> 18) & 0x07); - p[1] = 0x80 | ((wc >> 12) & 0x3f); - p[2] = 0x80 | ((wc >> 6) & 0x3f); - p[3] = 0x80 | (wc & 0x3f); - return (4); - } - /* Unicode has no codes larger than 0x1fffff. */ - /* - * Awkward point: UTF-8 <-> wchar_t conversions - * can actually fail. - */ - return (-1); -} - -static int -my_wcstombs(struct archive_string *as, const wchar_t *w, - int (*func)(char *, wchar_t)) +struct archive_string * +__archive_strappend_w_utf8(struct archive_string *as, const wchar_t *w) { - int n; char *p; + unsigned wc; char buff[256]; - - /* Clear the shift state before starting. */ - (*func)(NULL, L'\0'); + struct archive_string *return_val = as; /* * Convert one wide char at a time into 'buff', whenever that @@ -229,67 +191,50 @@ my_wcstombs(struct archive_string *as, c archive_strcat(as, buff); p = buff; } - n = (*func)(p, *w++); - if (n == -1) - return (-1); - p += n; + wc = *w++; + /* If this is a surrogate pair, assemble the full code point.*/ + /* Note: wc must not be wchar_t here, because the full code + * point can be more than 16 bits! */ + if (wc >= 0xD800 && wc <= 0xDBff + && *w >= 0xDC00 && *w <= 0xDFFF) { + wc -= 0xD800; + wc *= 0x400; + wc += (*w - 0xDC00); + wc += 0x10000; + ++w; + } + /* Translate code point to UTF8 */ + if (wc <= 0x7f) { + *p++ = (char)wc; + } else if (wc <= 0x7ff) { + *p++ = 0xc0 | ((wc >> 6) & 0x1f); + *p++ = 0x80 | (wc & 0x3f); + } else if (wc <= 0xffff) { + *p++ = 0xe0 | ((wc >> 12) & 0x0f); + *p++ = 0x80 | ((wc >> 6) & 0x3f); + *p++ = 0x80 | (wc & 0x3f); + } else if (wc <= 0x1fffff) { + *p++ = 0xf0 | ((wc >> 18) & 0x07); + *p++ = 0x80 | ((wc >> 12) & 0x3f); + *p++ = 0x80 | ((wc >> 6) & 0x3f); + *p++ = 0x80 | (wc & 0x3f); + } else { + /* Unicode has no codes larger than 0x1fffff. */ + /* TODO: use \uXXXX escape here instead of ? */ + *p++ = '?'; + return_val = NULL; + } } *p = '\0'; archive_strcat(as, buff); - return (0); -} - -/* - * Translates a wide character string into UTF-8 and appends - * to the archive_string. Note: returns NULL if conversion fails. - */ -struct archive_string * -__archive_strappend_w_utf8(struct archive_string *as, const wchar_t *w) -{ - if (my_wcstombs(as, w, my_wctomb_utf8)) - return (NULL); - return (as); + return (return_val); } -/* - * Translates a wide character string into current locale character set - * and appends to the archive_string. Note: returns NULL if conversion - * fails. - */ -struct archive_string * -__archive_strappend_w_mbs(struct archive_string *as, const wchar_t *w) -{ -#if HAVE_WCTOMB - if (my_wcstombs(as, w, wctomb)) - return (NULL); -#else - /* TODO: Can we do better than this? Are there platforms - * that have locale support but don't have wctomb()? */ - if (my_wcstombs(as, w, my_wctomb_utf8)) - return (NULL); -#endif - return (as); -} - - -/* - * Home-grown mbtowc for UTF-8. Some systems lack UTF-8 - * (or even lack mbtowc()) and we need UTF-8 support for pax - * format. So please don't replace this with a call to the - * standard mbtowc() function! - */ static int -my_mbtowc_utf8(wchar_t *pwc, const char *s, size_t n) +utf8_to_unicode(int *pwc, const char *s, size_t n) { int ch; - /* Standard behavior: a NULL value for 's' just resets shift state. */ - if (s == NULL) - return (0); - /* If length argument is zero, don't look at the first character. */ - if (n <= 0) - return (-1); - /* * Decode 1-4 bytes depending on the value of the first byte. */ @@ -335,13 +280,15 @@ my_mbtowc_utf8(wchar_t *pwc, const char } /* - * Return a wide-character string by converting this archive_string - * from UTF-8. + * Return a wide-character Unicode string by converting this archive_string + * from UTF-8. We assume that systems with 16-bit wchar_t always use + * UTF16 and systems with 32-bit wchar_t can accept UCS4. */ wchar_t * __archive_string_utf8_w(struct archive_string *as) { wchar_t *ws, *dest; + int wc, wc2;/* Must be large enough for a 21-bit Unicode code point. */ const char *src; int n; int err; @@ -353,25 +300,68 @@ __archive_string_utf8_w(struct archive_s dest = ws; src = as->s; while (*src != '\0') { - n = my_mbtowc_utf8(dest, src, 8); + n = utf8_to_unicode(&wc, src, 8); if (n == 0) break; if (n < 0) { free(ws); return (NULL); } - dest++; src += n; + if (wc >= 0xDC00 && wc <= 0xDBFF) { + /* This is a leading surrogate; some idiot + * has translated UTF16 to UTF8 without combining + * surrogates; rebuild the full code point before + * continuing. */ + n = utf8_to_unicode(&wc2, src, 8); + if (n < 0) { + free(ws); + return (NULL); + } + if (n == 0) /* Ignore the leading surrogate */ + break; + if (wc2 < 0xDC00 || wc2 > 0xDFFF) { + /* If the second character isn't a + * trailing surrogate, then someone + * has really screwed up and this is + * invalid. */ + free(ws); + return (NULL); + } else { + src += n; + wc -= 0xD800; + wc *= 0x400; + wc += wc2 - 0xDC00; + wc += 0x10000; + } + } + if ((sizeof(wchar_t) < 4) && (wc > 0xffff)) { + /* We have a code point that won't fit into a + * wchar_t; convert it to a surrogate pair. */ + wc -= 0x10000; + *dest++ = ((wc >> 10) & 0x3ff) + 0xD800; + *dest++ = (wc & 0x3ff) + 0xDC00; + } else + *dest++ = wc; } *dest++ = L'\0'; return (ws); } -#else +#if defined(_WIN32) && !defined(__CYGWIN__) -static struct archive_string * -my_archive_strappend_w(struct archive_string *as, - unsigned int codepage, const wchar_t *w) +/* + * Translates a wide character string into current locale character set + * and appends to the archive_string. Note: returns NULL if conversion + * fails. + * + * Win32 builds use WideCharToMultiByte from the Windows API. + * (Maybe Cygwin should too? WideCharToMultiByte will know a + * lot more about local character encodings than the wcrtomb() + * wrapper is going to know.) + */ +struct archive_string * +__archive_strappend_w_mbs(struct archive_string *as, const wchar_t *w) { char *p; int l, wl; @@ -388,9 +378,8 @@ my_archive_strappend_w(struct archive_st * And to set NULL for last argument is necessary when a codepage * is not CP_ACP(current locale). */ - l = WideCharToMultiByte(codepage, 0, w, wl, p, l, NULL, - (codepage == CP_ACP) ? &useDefaultChar : NULL); - if (l == 0 || useDefaultChar) { + l = WideCharToMultiByte(CP_ACP, 0, w, wl, p, l, NULL, &useDefaultChar); + if (l == 0) { free(p); return (NULL); } @@ -399,50 +388,68 @@ my_archive_strappend_w(struct archive_st return (as); } -/* - * Translates a wide character string into UTF-8 and appends - * to the archive_string. Note: returns NULL if conversion fails. - */ -struct archive_string * -__archive_strappend_w_utf8(struct archive_string *as, const wchar_t *w) -{ - - return (my_archive_strappend_w(as, CP_UTF8, w)); -} +#else /* * Translates a wide character string into current locale character set * and appends to the archive_string. Note: returns NULL if conversion * fails. + * + * Non-Windows uses ISO C wcrtomb() or wctomb() to perform the conversion + * one character at a time. If a non-Windows platform doesn't have + * either of these, fall back to the built-in UTF8 conversion. */ struct archive_string * __archive_strappend_w_mbs(struct archive_string *as, const wchar_t *w) { - - return (my_archive_strappend_w(as, CP_ACP, w)); -} - -/* - * Return a wide-character string by converting this archive_string - * from UTF-8. - */ -wchar_t * -__archive_string_utf8_w(struct archive_string *as) -{ - wchar_t *ws; +#if !defined(HAVE_WCTOMB) && !defined(HAVE_WCRTOMB) + /* If there's no built-in locale support, fall back to UTF8 always. */ + return __archive_strappend_w_utf8(as, w); +#else + /* We cannot use the standard wcstombs() here because it + * cannot tell us how big the output buffer should be. So + * I've built a loop around wcrtomb() or wctomb() that + * converts a character at a time and resizes the string as + * needed. We prefer wcrtomb() when it's available because + * it's thread-safe. */ int n; + char *p; + char buff[256]; +#if HAVE_WCRTOMB + mbstate_t shift_state; - ws = (wchar_t *)malloc((as->length + 1) * sizeof(wchar_t)); - if (ws == NULL) - __archive_errx(1, "Out of memory"); - n = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, - as->s, (int)as->length, ws, (int)as->length); - if (n == 0) { - free(ws); - return (NULL); + memset(&shift_state, 0, sizeof(shift_state)); +#else + /* Clear the shift state before starting. */ + wctomb(NULL, L'\0'); +#endif + + /* + * Convert one wide char at a time into 'buff', whenever that + * fills, append it to the string. + */ + p = buff; + while (*w != L'\0') { + /* Flush the buffer when we have <=16 bytes free. */ + /* (No encoding has a single character >16 bytes.) */ + if ((size_t)(p - buff) >= (size_t)(sizeof(buff) - MB_CUR_MAX)) { + *p = '\0'; + archive_strcat(as, buff); + p = buff; + } +#if HAVE_WCRTOMB + n = wcrtomb(p, *w++, &shift_state); +#else + n = wctomb(p, *w++); +#endif + if (n == -1) + return (NULL); + p += n; } - ws[n] = L'\0'; - return (ws); + *p = '\0'; + archive_strcat(as, buff); + return (as); +#endif } -#endif /* !_WIN32 */ +#endif /* _WIN32 && ! __CYGWIN__ */ Modified: head/lib/libarchive/archive_write_disk.c ============================================================================== --- head/lib/libarchive/archive_write_disk.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/archive_write_disk.c Sun Apr 12 05:33:34 2009 (r190959) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_SYS_EXTATTR_H #include #endif +#ifdef HAVE_SYS_XATTR_H +#include +#endif #ifdef HAVE_ATTR_XATTR_H #include #endif @@ -414,7 +417,7 @@ _archive_write_header(struct archive *_a a->mode &= ~S_ISVTX; a->mode &= ~a->user_umask; } -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) if (a->flags & ARCHIVE_EXTRACT_OWNER) a->todo |= TODO_OWNER; #endif @@ -1217,7 +1220,7 @@ _archive_write_close(struct archive *_a) if (p->fixup & TODO_TIMES) { #ifdef HAVE_UTIMES /* {f,l,}utimes() are preferred, when available. */ -#ifdef __timeval +#if defined(_WIN32) && !defined(__CYGWIN__) struct __timeval times[2]; #else struct timeval times[2]; @@ -1474,7 +1477,7 @@ check_symlinks(struct archive_write_disk return (ARCHIVE_OK); } -#ifdef _WIN32 +#if defined(_WIN32) || defined(__CYGWIN__) /* * 1. Convert a path separator from '\' to '/' . * We shouldn't check multi-byte character directly because some @@ -1544,7 +1547,7 @@ cleanup_pathname(struct archive_write_di return (ARCHIVE_FAILED); } -#ifdef _WIN32 +#if defined(_WIN32) || defined(__CYGWIN__) cleanup_pathname_win(a); #endif /* Skip leading '/'. */ @@ -1758,12 +1761,17 @@ create_dir(struct archive_write_disk *a, static int set_ownership(struct archive_write_disk *a) { +#ifndef __CYGWIN__ +/* unfortunately, on win32 there is no 'root' user with uid 0, + so we just have to try the chown and see if it works */ + /* If we know we can't change it, don't bother trying. */ if (a->user_uid != 0 && a->user_uid != a->uid) { archive_set_error(&a->archive, errno, "Can't set UID=%d", a->uid); return (ARCHIVE_WARN); } +#endif #ifdef HAVE_FCHOWN /* If we have an fd, we can avoid a race. */ @@ -1807,7 +1815,7 @@ set_time(int fd, int mode, const char *n time_t atime, long atime_nsec, time_t mtime, long mtime_nsec) { -#ifdef __timeval +#if defined(_WIN32) && !defined(__CYGWIN__) struct __timeval times[2]; #else struct timeval times[2]; @@ -1944,7 +1952,7 @@ set_mode(struct archive_write_disk *a, i return (r); if (a->pst->st_gid != a->gid) { mode &= ~ S_ISGID; -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) if (a->flags & ARCHIVE_EXTRACT_OWNER) { /* * This is only an error if you @@ -1963,7 +1971,7 @@ set_mode(struct archive_write_disk *a, i if (a->pst->st_uid != a->uid && (a->todo & TODO_SUID)) { mode &= ~ S_ISUID; -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) if (a->flags & ARCHIVE_EXTRACT_OWNER) { archive_set_error(&a->archive, -1, "Can't restore SUID bit"); @@ -1981,7 +1989,7 @@ set_mode(struct archive_write_disk *a, i */ if (a->user_uid != a->uid) { mode &= ~ S_ISUID; -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) if (a->flags & ARCHIVE_EXTRACT_OWNER) { archive_set_error(&a->archive, -1, "Can't make file SUID"); Modified: head/lib/libarchive/archive_write_disk_set_standard_lookup.c ============================================================================== --- head/lib/libarchive/archive_write_disk_set_standard_lookup.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/archive_write_disk_set_standard_lookup.c Sun Apr 12 05:33:34 2009 (r190959) @@ -122,7 +122,7 @@ lookup_gid(void *private_data, const cha if (grent != NULL) gid = grent->gr_gid; } -#elif _WIN32 +#elif defined(_WIN32) && !defined(__CYGWIN__) /* TODO: do a gname->gid lookup for Windows. */ #endif b->id = gid; @@ -159,7 +159,7 @@ lookup_uid(void *private_data, const cha if (pwent != NULL) uid = pwent->pw_uid; } -#elif _WIN32 +#elif defined(_WIN32) && !defined(__CYGWIN__) /* TODO: do a uname->uid lookup for Windows. */ #endif b->id = uid; Modified: head/lib/libarchive/archive_write_set_compression_program.c ============================================================================== --- head/lib/libarchive/archive_write_set_compression_program.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/archive_write_set_compression_program.c Sun Apr 12 05:33:34 2009 (r190959) @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD$"); /* This capability is only available on POSIX systems. */ #if (!defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \ - !(defined(HAVE_FORK) || defined(HAVE_VFORK))) && !defined(_WIN32) + !(defined(HAVE_FORK) || defined(HAVE_VFORK))) && (!defined(_WIN32) || defined(__CYGWIN__)) #include "archive.h" /* Modified: head/lib/libarchive/archive_write_set_format_mtree.c ============================================================================== --- head/lib/libarchive/archive_write_set_format_mtree.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/archive_write_set_format_mtree.c Sun Apr 12 05:33:34 2009 (r190959) @@ -320,7 +320,7 @@ mtree_indent(struct mtree_writer *mtree) archive_string_empty(&mtree->ebuf); } -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) static size_t dir_len(struct archive_entry *entry) { @@ -334,7 +334,7 @@ dir_len(struct archive_entry *entry) return (r - path + 1); } -#else +#else /* _WIN32 && !__CYGWIN__ */ /* * Note: We should use wide-character for findng '\' character, * a directory separator on Windows, because some character-set have @@ -376,7 +376,7 @@ alen: return (0); return (al + 1); } -#endif /* _WIN32 */ +#endif /* _WIN32 && !__CYGWIN__ */ static int parent_dir_changed(struct archive_string *dir, struct archive_entry *entry) Modified: head/lib/libarchive/test/main.c ============================================================================== --- head/lib/libarchive/test/main.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/test/main.c Sun Apr 12 05:33:34 2009 (r190959) @@ -33,7 +33,7 @@ #include #include #include -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) #include #include #include @@ -93,7 +93,7 @@ static int assertions = 0; static const char *refdir; -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) static void invalid_parameter_handler(const wchar_t * expression, @@ -798,7 +798,7 @@ static int test_run(int i, const char *t /* If there were no failures, we can remove the work dir. */ if (failures == failures_before) { if (!keep_temp_files && chdir(tmpdir) == 0) { -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) systemf("rm -rf %s", tests[i].name); #else systemf("rmdir /S /Q %s", tests[i].name); @@ -894,7 +894,7 @@ extract_reference_file(const char *name) fclose(in); } -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) #define DEV_NULL "NUL" #else #define DEV_NULL "/dev/null" @@ -966,7 +966,7 @@ get_refdir(void) strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); } -#if defined(_WIN32) && defined(_DEBUG) +#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG) DebugBreak(); #endif printf("Unable to locate known reference file %s\n", KNOWNREF); @@ -992,7 +992,7 @@ int main(int argc, char **argv) (void)argc; /* UNUSED */ -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) /* To stop to run the default invalid parameter handler. */ _set_invalid_parameter_handler(invalid_parameter_handler); /* for open() to a binary mode. */ Modified: head/lib/libarchive/test/test.h ============================================================================== --- head/lib/libarchive/test/test.h Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/test/test.h Sun Apr 12 05:33:34 2009 (r190959) @@ -37,7 +37,7 @@ #elif defined(__FreeBSD__) /* Building as part of FreeBSD system requires a pre-built config.h. */ #include "config_freebsd.h" -#elif defined(_WIN32) +#elif defined(_WIN32) && !defined(__CYGWIN__) /* Win32 can't run the 'configure' script. */ #include "config_windows.h" #else @@ -45,7 +45,7 @@ #error Oops: No config.h and no pre-built configuration in test.h. #endif -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) #include #else #include @@ -56,7 +56,7 @@ #include #include #include -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) #include #endif #include @@ -69,10 +69,15 @@ #ifdef __FreeBSD__ #include /* For __FBSDID */ #else +/* Some non-FreeBSD platforms such as newlib-derived ones like + * cygwin, have __FBSDID, so this definition must be guarded. + */ +#ifndef __FBSDID #define __FBSDID(a) /* null */ #endif +#endif -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) #define snprintf sprintf_s #define LOCALE_DE "deu" #else Modified: head/lib/libarchive/test/test_read_disk.c ============================================================================== --- head/lib/libarchive/test/test_read_disk.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/test/test_read_disk.c Sun Apr 12 05:33:34 2009 (r190959) @@ -111,6 +111,11 @@ DEFINE_TEST(test_read_disk) if (archive_read_disk_set_standard_lookup(a) != ARCHIVE_OK) { skipping("standard uname/gname lookup"); } else { +#if defined(__CYGWIN__) + skipping("standard uname/gname lookup; typically no user with uid=0 on cygwin platform"); + i = 0; + p = zero_groups[0]; /* avoid unused warnings */ +#else /* XXX Someday, we may need to generalize this the * same way we generalized the group name check below. * That's needed only if we encounter a system where @@ -135,6 +140,7 @@ DEFINE_TEST(test_read_disk) failure("group 0 didn't have any of the expected names"); assertEqualString(p, zero_groups[0]); } +#endif } /* Deregister again and verify the default lookups again. */ Modified: head/lib/libarchive/test/test_read_extract.c ============================================================================== --- head/lib/libarchive/test/test_read_extract.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/test/test_read_extract.c Sun Apr 12 05:33:34 2009 (r190959) @@ -32,13 +32,13 @@ DEFINE_TEST(test_read_extract) { struct archive_entry *ae; struct archive *a; -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) struct stat st; #endif size_t used; int i; char *buff, *file_buff; -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) int fd; ssize_t bytes_read; #endif @@ -138,7 +138,7 @@ DEFINE_TEST(test_read_extract) assert(0 == archive_read_finish(a)); #endif -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) /* Test the entries on disk. */ /* This first entry was extracted with ARCHIVE_EXTRACT_PERM, * so the permissions should have been restored exactly, Modified: head/lib/libarchive/test/test_tar_large.c ============================================================================== --- head/lib/libarchive/test/test_tar_large.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/test/test_tar_large.c Sun Apr 12 05:33:34 2009 (r190959) @@ -53,7 +53,7 @@ struct memblock { struct memblock *next; size_t size; void *buff; - off_t filebytes; + int64_t filebytes; }; /* @@ -61,17 +61,17 @@ struct memblock { * some accounting overhead. */ struct memdata { - off_t filebytes; + int64_t filebytes; void *buff; struct memblock *first; struct memblock *last; }; /* The following size definitions simplify things below. */ -#define KB ((off_t)1024) -#define MB ((off_t)1024 * KB) -#define GB ((off_t)1024 * MB) -#define TB ((off_t)1024 * GB) +#define KB ((int64_t)1024) +#define MB ((int64_t)1024 * KB) +#define GB ((int64_t)1024 * MB) +#define TB ((int64_t)1024 * GB) #if ARCHIVE_VERSION_NUMBER < 2000000 static ssize_t memory_read_skip(struct archive *, void *, size_t request); @@ -100,7 +100,7 @@ memory_write(struct archive *a, void *_p if ((const char *)filedata <= (const char *)buff && (const char *)buff < (const char *)filedata + filedatasize) { /* We don't need to store a block of file data. */ - private->last->filebytes += (off_t)size; + private->last->filebytes += (int64_t)size; } else { /* Yes, we're assuming the very first write is metadata. */ /* It's header or metadata, copy and save it. */ @@ -140,7 +140,7 @@ memory_read(struct archive *a, void *_pr * We're returning file bytes, simulate it by * passing blocks from the template data. */ - if (private->filebytes > (off_t)filedatasize) + if (private->filebytes > (int64_t)filedatasize) size = (ssize_t)filedatasize; else size = (ssize_t)private->filebytes; @@ -202,7 +202,7 @@ memory_read_skip(struct archive *a, void DEFINE_TEST(test_tar_large) { /* The sizes of the entries we're going to generate. */ - static off_t tests[] = { + static int64_t tests[] = { /* Test for 32-bit signed overflow. */ 2 * GB - 1, 2 * GB, 2 * GB + 1, /* Test for 32-bit unsigned overflow. */ @@ -218,7 +218,8 @@ DEFINE_TEST(test_tar_large) struct memdata memdata; struct archive_entry *ae; struct archive *a; - off_t filesize, writesize; + int64_t filesize; + size_t writesize; filedatasize = (size_t)(1 * MB); filedata = malloc(filedatasize); @@ -243,11 +244,6 @@ DEFINE_TEST(test_tar_large) archive_entry_set_mode(ae, S_IFREG | 0755); filesize = tests[i]; - if (filesize < 0) { - archive_entry_free(ae); - skipping("32-bit off_t doesn't permit testing of very large files."); - return; - } archive_entry_set_size(ae, filesize); assertA(0 == archive_write_header(a, ae)); @@ -257,10 +253,11 @@ DEFINE_TEST(test_tar_large) * Write the actual data to the archive. */ while (filesize > 0) { - writesize = (off_t)filedatasize; - if (writesize > filesize) - writesize = filesize; - assertA(writesize == archive_write_data(a, filedata, writesize)); + writesize = filedatasize; + if ((int64_t)writesize > filesize) + writesize = (size_t)filesize; + assertA((int)writesize + == archive_write_data(a, filedata, writesize)); filesize -= writesize; } } Modified: head/lib/libarchive/test/test_write_disk.c ============================================================================== --- head/lib/libarchive/test/test_write_disk.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/test/test_write_disk.c Sun Apr 12 05:33:34 2009 (r190959) @@ -52,7 +52,7 @@ static void create(struct archive_entry * that automatically. */ if (archive_entry_filetype(ae) == AE_IFDIR) st.st_mode &= ~S_ISGID; -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) assertEqualInt(st.st_mode, archive_entry_mode(ae) & ~UMASK); #endif } @@ -99,7 +99,7 @@ static void create_reg_file(struct archi assert(0 == stat(archive_entry_pathname(ae), &st)); failure("st.st_mode=%o archive_entry_mode(ae)=%o", st.st_mode, archive_entry_mode(ae)); -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) assertEqualInt(st.st_mode, (archive_entry_mode(ae) & ~UMASK)); #endif assertEqualInt(st.st_size, sizeof(data)); @@ -146,7 +146,7 @@ static void create_reg_file2(struct arch assert(0 == stat(archive_entry_pathname(ae), &st)); failure("st.st_mode=%o archive_entry_mode(ae)=%o", st.st_mode, archive_entry_mode(ae)); -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) assertEqualInt(st.st_mode, (archive_entry_mode(ae) & ~UMASK)); #endif assertEqualInt(st.st_size, i); @@ -183,7 +183,7 @@ static void create_reg_file3(struct arch assert(0 == stat(archive_entry_pathname(ae), &st)); failure("st.st_mode=%o archive_entry_mode(ae)=%o", st.st_mode, archive_entry_mode(ae)); -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) assertEqualInt(st.st_mode, (archive_entry_mode(ae) & ~UMASK)); #endif assertEqualInt(st.st_size, 5); @@ -212,14 +212,14 @@ static void create_reg_file4(struct arch assert(0 == stat(archive_entry_pathname(ae), &st)); failure("st.st_mode=%o archive_entry_mode(ae)=%o", st.st_mode, archive_entry_mode(ae)); -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__CYGWIN__) assertEqualInt(st.st_mode, (archive_entry_mode(ae) & ~UMASK)); #endif failure(msg); assertEqualInt(st.st_size, sizeof(data)); } -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) static void create_reg_file_win(struct archive_entry *ae, const char *msg) { static const char data[]="abcdefghijklmnopqrstuvwxyz"; @@ -257,7 +257,7 @@ static void create_reg_file_win(struct a st.st_mode, archive_entry_mode(ae)); assertEqualInt(st.st_size, sizeof(data)); } -#endif /* _WIN32 */ +#endif /* _WIN32 && !__CYGWIN__ */ #endif DEFINE_TEST(test_write_disk) @@ -326,7 +326,7 @@ DEFINE_TEST(test_write_disk) create(ae, "Test creating a file over an existing dir."); archive_entry_free(ae); -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) /* A file with unusable characters in its file name. */ assert((ae = archive_entry_new()) != NULL); archive_entry_copy_pathname(ae, "f:i*l?e\"fl|e"); @@ -342,6 +342,6 @@ DEFINE_TEST(test_write_disk) create_reg_file_win(ae, "Test creating a regular file" " with unusable characters in its file name"); archive_entry_free(ae); -#endif /* _WIN32 */ +#endif /* _WIN32 && !__CYGWIN__ */ #endif } Modified: head/lib/libarchive/test/test_write_disk_failures.c ============================================================================== --- head/lib/libarchive/test/test_write_disk_failures.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/test/test_write_disk_failures.c Sun Apr 12 05:33:34 2009 (r190959) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); DEFINE_TEST(test_write_disk_failures) { -#if ARCHIVE_VERSION_NUMBER < 1009000 || defined(_WIN32) +#if ARCHIVE_VERSION_NUMBER < 1009000 || (defined(_WIN32) && !defined(__CYGWIN__)) skipping("archive_write_disk interface"); #else struct archive_entry *ae; Modified: head/lib/libarchive/test/test_write_disk_hardlink.c ============================================================================== --- head/lib/libarchive/test/test_write_disk_hardlink.c Sun Apr 12 05:19:35 2009 (r190958) +++ head/lib/libarchive/test/test_write_disk_hardlink.c Sun Apr 12 05:33:34 2009 (r190959) @@ -25,7 +25,14 @@ #include "test.h" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 05:38:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E64CB106564A; Sun, 12 Apr 2009 05:38:35 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D508F8FC08; Sun, 12 Apr 2009 05:38:35 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3C5cZbq012154; Sun, 12 Apr 2009 05:38:35 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3C5cZoC012153; Sun, 12 Apr 2009 05:38:35 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200904120538.n3C5cZoC012153@svn.freebsd.org> From: Tim Kientzle Date: Sun, 12 Apr 2009 05:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190960 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 05:38:36 -0000 Author: kientzle Date: Sun Apr 12 05:38:35 2009 New Revision: 190960 URL: http://svn.freebsd.org/changeset/base/190960 Log: Thanks to Christoph Mallon for pointing out the dead variable here. Also, rework this a little to make the logic excruciatingly clear. Modified: head/lib/libarchive/archive_read_support_format_empty.c Modified: head/lib/libarchive/archive_read_support_format_empty.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_empty.c Sun Apr 12 05:33:34 2009 (r190959) +++ head/lib/libarchive/archive_read_support_format_empty.c Sun Apr 12 05:38:35 2009 (r190960) @@ -59,13 +59,14 @@ archive_read_support_format_empty(struct static int archive_read_format_empty_bid(struct archive_read *a) { - const void *h; ssize_t avail; - h = __archive_read_ahead(a, 1, &avail); - if (avail != 0) - return (-1); - return (1); + (void)__archive_read_ahead(a, 1, &avail); + /* Bid 1 if we successfully read exactly zero bytes. */ + if (avail == 0) + return (1); + /* Otherwise, we don't bid on this. */ + return (-1); } static int From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 05:47:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC2931065702; Sun, 12 Apr 2009 05:47:23 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A98558FC0A; Sun, 12 Apr 2009 05:47:23 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3C5lNeM012365; Sun, 12 Apr 2009 05:47:23 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3C5lNVm012363; Sun, 12 Apr 2009 05:47:23 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200904120547.n3C5lNVm012363@svn.freebsd.org> From: Tim Kientzle Date: Sun, 12 Apr 2009 05:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190961 - in head/lib/libarchive: . test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 05:47:24 -0000 Author: kientzle Date: Sun Apr 12 05:47:23 2009 New Revision: 190961 URL: http://svn.freebsd.org/changeset/base/190961 Log: Merge from libarchive.googlecode.com r791, r879, r884, r948: Various fixes to read_support_compression_program. In particular, failure of the external program is detected a lot earlier, which gives much more reasonable error handling. Modified: head/lib/libarchive/archive_read_support_compression_program.c head/lib/libarchive/test/test_read_compress_program.c Modified: head/lib/libarchive/archive_read_support_compression_program.c ============================================================================== --- head/lib/libarchive/archive_read_support_compression_program.c Sun Apr 12 05:38:35 2009 (r190960) +++ head/lib/libarchive/archive_read_support_compression_program.c Sun Apr 12 05:47:23 2009 (r190961) @@ -38,6 +38,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_LIMITS_H # include #endif +#ifdef HAVE_SIGNAL_H +# include +#endif #ifdef HAVE_STDLIB_H # include #endif @@ -119,6 +122,8 @@ static int program_bidder_free(struct ar struct program_filter { char *description; pid_t child; + int exit_status; + int waitpid_return; int child_stdin, child_stdout; char *out_buf; @@ -211,6 +216,73 @@ program_bidder_bid(struct archive_read_f } /* + * Shut down the child, return ARCHIVE_OK if it exited normally. + * + * Note that the return value is sticky; if we're called again, + * we won't reap the child again, but we will return the same status + * (including error message if the child came to a bad end). + */ +static int +child_stop(struct archive_read_filter *self, struct program_filter *state) +{ + /* Close our side of the I/O with the child. */ + if (state->child_stdin != -1) { + close(state->child_stdin); + state->child_stdin = -1; + } + if (state->child_stdout != -1) { + close(state->child_stdout); + state->child_stdout = -1; + } + + if (state->child != 0) { + /* Reap the child. */ + do { + state->waitpid_return + = waitpid(state->child, &state->exit_status, 0); + } while (state->waitpid_return == -1 && errno == EINTR); + state->child = 0; + } + + if (state->waitpid_return < 0) { + /* waitpid() failed? This is ugly. */ + archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC, + "Child process exited badly"); + return (ARCHIVE_WARN); + } + + if (WIFSIGNALED(state->exit_status)) { +#ifdef SIGPIPE + /* If the child died because we stopped reading before + * it was done, that's okay. Some archive formats + * have padding at the end that we routinely ignore. */ + /* The alternative to this would be to add a step + * before close(child_stdout) above to read from the + * child until the child has no more to write. */ + if (WTERMSIG(state->exit_status) == SIGPIPE) + return (ARCHIVE_OK); +#endif + archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC, + "Child process exited with signal %d", + WTERMSIG(state->exit_status)); + return (ARCHIVE_WARN); + } + + if (WIFEXITED(state->exit_status)) { + if (WEXITSTATUS(state->exit_status) == 0) + return (ARCHIVE_OK); + + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, + "Child process exited with status %d", + WEXITSTATUS(state->exit_status)); + return (ARCHIVE_WARN); + } + + return (ARCHIVE_WARN); +} + +/* * Use select() to decide whether the child is ready for read or write. */ static ssize_t @@ -229,11 +301,10 @@ child_read(struct archive_read_filter *s if (ret > 0) return (ret); - if (ret == 0 || (ret == -1 && errno == EPIPE)) { - close(state->child_stdout); - state->child_stdout = -1; - return (0); - } + if (ret == 0 || (ret == -1 && errno == EPIPE)) + /* Child has closed its output; reap the child + * and return the status. */ + return (child_stop(self, state)); if (ret == -1 && errno != EAGAIN) return (-1); @@ -352,8 +423,11 @@ program_filter_read(struct archive_read_ while (state->child_stdout != -1 && total < state->out_buf_len) { bytes = child_read(self, p, state->out_buf_len - total); if (bytes < 0) - return (bytes); + /* No recovery is possible if we can no longer + * read from the child. */ + return (ARCHIVE_FATAL); if (bytes == 0) + /* We got EOF from the child. */ break; total += bytes; p += bytes; @@ -367,24 +441,17 @@ static int program_filter_close(struct archive_read_filter *self) { struct program_filter *state; - int status; + int e; state = (struct program_filter *)self->data; - - /* Shut down the child. */ - if (state->child_stdin != -1) - close(state->child_stdin); - if (state->child_stdout != -1) - close(state->child_stdout); - while (waitpid(state->child, &status, 0) == -1 && errno == EINTR) - continue; + e = child_stop(self, state); /* Release our private data. */ free(state->out_buf); free(state->description); free(state); - return (ARCHIVE_OK); + return (e); } #endif /* !defined(HAVE_PIPE) || !defined(HAVE_VFORK) || !defined(HAVE_FCNTL) */ Modified: head/lib/libarchive/test/test_read_compress_program.c ============================================================================== --- head/lib/libarchive/test/test_read_compress_program.c Sun Apr 12 05:38:35 2009 (r190960) +++ head/lib/libarchive/test/test_read_compress_program.c Sun Apr 12 05:47:23 2009 (r190961) @@ -35,14 +35,34 @@ static unsigned char archive[] = { DEFINE_TEST(test_read_compress_program) { int r; - -#if ARCHIVE_VERSION_NUMBER < 1009000 - skipping("archive_read_support_compression_program()"); -#else struct archive_entry *ae; struct archive *a; const char *extprog; + /* + * First, test handling when a non-existent compression + * program is requested. + */ + assert((a = archive_read_new()) != NULL); + r = archive_read_support_compression_program(a, "nonexistent"); + if (r == ARCHIVE_FATAL) { + skipping("archive_read_support_compression_program() " + "unsupported on this platform"); + return; + } + assertEqualIntA(a, ARCHIVE_OK, r); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_memory(a, archive, sizeof(archive))); + assertEqualIntA(a, ARCHIVE_FATAL, + archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_WARN, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + + /* + * If we have "gunzip", try using that. + */ if ((extprog = external_gzip_program(1)) == NULL) { skipping("There is no gzip uncompression " "program in this platform"); @@ -51,28 +71,18 @@ DEFINE_TEST(test_read_compress_program) assert((a = archive_read_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_none(a)); - r = archive_read_support_compression_program(a, extprog); - if (r == ARCHIVE_FATAL) { - skipping("archive_read_support_compression_program() " - "unsupported on this platform"); - return; - } - assertEqualIntA(a, ARCHIVE_OK, r); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_compression_program(a, extprog)); assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, archive, sizeof(archive))); assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); - assert(archive_compression(a) == ARCHIVE_COMPRESSION_PROGRAM); - assert(archive_format(a) == ARCHIVE_FORMAT_TAR_USTAR); - assert(0 == archive_read_close(a)); -#if ARCHIVE_VERSION_NUMBER < 2000000 - archive_read_finish(a); -#else - assert(0 == archive_read_finish(a)); -#endif -#endif + assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_PROGRAM); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); } From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 07:43:20 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 351031065670 for ; Sun, 12 Apr 2009 07:43:20 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id D97078FC12 for ; Sun, 12 Apr 2009 07:43:19 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 1B6638FC53 for ; Sun, 12 Apr 2009 11:43:19 +0400 (MSD) Received: from orion.SpringDaemons.com (unknown [77.232.3.143]) by mx0.deglitch.com (Postfix) with ESMTPA id E98588FC1D; Sun, 12 Apr 2009 11:43:14 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id A4E9D39832; Sun, 12 Apr 2009 11:43:22 +0400 (MSD) Date: Sun, 12 Apr 2009 11:43:18 +0400 From: Stanislav Sedov To: David Schultz Message-Id: <20090412114318.fd0d213d.stas@FreeBSD.org> In-Reply-To: <20090412030054.GA54299@zim.MIT.EDU> References: <200904111657.n3BGvpsC092703@svn.freebsd.org> <20090411210702.ce5325b9.stas@FreeBSD.org> <20090412021841.673a200b.nork@FreeBSD.org> <20090412030054.GA54299@zim.MIT.EDU> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Sun Apr 12 11:43:18 2009 X-DSPAM-Confidence: 1.0000 X-DSPAM-Improbability: 1 in 98689409 chance of being spam X-DSPAM-Probability: 0.0023 X-DSPAM-Signature: 49e19b96967001471294326 Cc: Stanislav Sedov , svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Norikatsu Shigemura Subject: Re: svn commit: r190943 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 07:43:20 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, 11 Apr 2009 23:00:54 -0400 David Schultz mentioned: > On Sun, Apr 12, 2009, Norikatsu Shigemura wrote: > > On Sat, 11 Apr 2009 21:07:02 +0400 > > Stanislav Sedov wrote: > > > > Log: > > > > GNU Pth has some fragile kludges that were broken by r189828. > > > > I've discussed this with the Pth maintainer and no clear solution > > > > has emerged on the ports side of things, so for now, hack around > > > > the issue in signal.h. > > > Can't we just put a patch in ports tree itself? What meant under 'no > > > clean solution emerged'? I can prepare a patch, if needed. > > > > I think so, too. I have a quick hack patch. > > As I mentioned to vd@ on 3/20, I'd prefer something like > that. Does your proposed patch also work for the ports that depend > on GNU Pth, some of which may depend on signal.h? Will the following do the trick? #if !(defined(__FreeBSD__) && __FreeBSD_version >= %%PTHREAD_CHANGE_VERSION%%) # define pthread_kill(a, b) # define pthread_sigmask(a, b, c) # include # undef pthread_kill # undef pthread_sigmask #endif - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAknhm5oACgkQK/VZk+smlYGD6wCdEMSpTqCEMLpS+PTyGFjrUjGR wOQAoISd2Y2mqAgKAxVYMR9oKQelyZQq =L9Ct -----END PGP SIGNATURE----- !DSPAM:49e19b96967001471294326! From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 11:42:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B6BE106566B; Sun, 12 Apr 2009 11:42:42 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27C978FC13; Sun, 12 Apr 2009 11:42:42 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CBgefE023812; Sun, 12 Apr 2009 11:42:40 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CBgeAL023809; Sun, 12 Apr 2009 11:42:40 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904121142.n3CBgeAL023809@svn.freebsd.org> From: Robert Watson Date: Sun, 12 Apr 2009 11:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190962 - in head/sys: contrib/pf/net netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 11:42:42 -0000 Author: rwatson Date: Sun Apr 12 11:42:40 2009 New Revision: 190962 URL: http://svn.freebsd.org/changeset/base/190962 Log: Update stats in struct udpstat using two new macros, UDPSTAT_ADD() and UDPSTAT_INC(), rather than directly manipulating the fields across the kernel. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structures. MFC after: 3 days Modified: head/sys/contrib/pf/net/pf.c head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h Modified: head/sys/contrib/pf/net/pf.c ============================================================================== --- head/sys/contrib/pf/net/pf.c Sun Apr 12 05:47:23 2009 (r190961) +++ head/sys/contrib/pf/net/pf.c Sun Apr 12 11:42:40 2009 (r190962) @@ -6293,7 +6293,7 @@ pf_route(struct mbuf **m, struct pf_rule if (m0->m_pkthdr.csum_flags & M_TCPV4_CSUM_OUT) TCPSTAT_INC(tcpstat.tcps_outhwcsum); else if (m0->m_pkthdr.csum_flags & M_UDPV4_CSUM_OUT) - V_udpstat.udps_outhwcsum++; + UDPSTAT_INC(udps_outhwcsum); error = (*ifp->if_output)(ifp, m0, sintosa(dst), NULL); goto done; } @@ -6641,7 +6641,7 @@ pf_check_proto_cksum(struct mbuf *m, int case IPPROTO_UDP: { INIT_VNET_INET(curvnet); - V_udpstat.udps_badsum++; + UDPSTAT_INC(udps_badsum); break; } case IPPROTO_ICMP: @@ -6744,7 +6744,7 @@ pf_check_proto_cksum(struct mbuf *m, int TCPSTAT_INC(tcps_rcvbadsum); break; case IPPROTO_UDP: - V_udpstat.udps_badsum++; + UDPSTAT_INC(udps_badsum); break; case IPPROTO_ICMP: V_icmpstat.icps_checksum++; Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Sun Apr 12 05:47:23 2009 (r190961) +++ head/sys/netinet/udp_usrreq.c Sun Apr 12 11:42:40 2009 (r190962) @@ -254,7 +254,7 @@ udp_append(struct inpcb *inp, struct ip m_freem(n); if (opts) m_freem(opts); - V_udpstat.udps_fullsock++; + UDPSTAT_INC(udps_fullsock); } else sorwakeup_locked(so); } @@ -276,7 +276,7 @@ udp_input(struct mbuf *m, int off) #endif ifp = m->m_pkthdr.rcvif; - V_udpstat.udps_ipackets++; + UDPSTAT_INC(udps_ipackets); /* * Strip IP options, if any; should skip this, make available to @@ -294,7 +294,7 @@ udp_input(struct mbuf *m, int off) ip = mtod(m, struct ip *); if (m->m_len < iphlen + sizeof(struct udphdr)) { if ((m = m_pullup(m, iphlen + sizeof(struct udphdr))) == 0) { - V_udpstat.udps_hdrops++; + UDPSTAT_INC(udps_hdrops); return; } ip = mtod(m, struct ip *); @@ -324,7 +324,7 @@ udp_input(struct mbuf *m, int off) len = ntohs((u_short)uh->uh_ulen); if (ip->ip_len != len) { if (len > ip->ip_len || len < sizeof(struct udphdr)) { - V_udpstat.udps_badlen++; + UDPSTAT_INC(udps_badlen); goto badunlocked; } m_adj(m, len - ip->ip_len); @@ -364,12 +364,12 @@ udp_input(struct mbuf *m, int off) bcopy(b, ((struct ipovly *)ip)->ih_x1, 9); } if (uh_sum) { - V_udpstat.udps_badsum++; + UDPSTAT_INC(udps_badsum); m_freem(m); return; } } else - V_udpstat.udps_nosum++; + UDPSTAT_INC(udps_nosum); #ifdef IPFIREWALL_FORWARD /* @@ -442,7 +442,7 @@ udp_input(struct mbuf *m, int off) IPSTAT_INC(ips_notmember); if (blocked == MCAST_NOTSMEMBER || blocked == MCAST_MUTED) - V_udpstat.udps_filtermcast++; + UDPSTAT_INC(udps_filtermcast); INP_RUNLOCK(inp); continue; } @@ -494,7 +494,7 @@ udp_input(struct mbuf *m, int off) * to send an ICMP Port Unreachable for a broadcast * or multicast datgram.) */ - V_udpstat.udps_noportbcast++; + UDPSTAT_INC(udps_noportbcast); goto badheadlocked; } if (last->inp_ppcb == NULL) { @@ -531,9 +531,9 @@ udp_input(struct mbuf *m, int off) buf, ntohs(uh->uh_dport), inet_ntoa(ip->ip_src), ntohs(uh->uh_sport)); } - V_udpstat.udps_noport++; + UDPSTAT_INC(udps_noport); if (m->m_flags & (M_BCAST | M_MCAST)) { - V_udpstat.udps_noportbcast++; + UDPSTAT_INC(udps_noportbcast); goto badheadlocked; } if (V_udp_blackhole) @@ -1072,7 +1072,7 @@ udp_output(struct inpcb *inp, struct mbu ((struct ip *)ui)->ip_len = sizeof (struct udpiphdr) + len; ((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; /* XXX */ ((struct ip *)ui)->ip_tos = inp->inp_ip_tos; /* XXX */ - V_udpstat.udps_opackets++; + UDPSTAT_INC(udps_opackets); if (unlock_udbinfo == 2) INP_INFO_WUNLOCK(&V_udbinfo); Modified: head/sys/netinet/udp_var.h ============================================================================== --- head/sys/netinet/udp_var.h Sun Apr 12 05:47:23 2009 (r190961) +++ head/sys/netinet/udp_var.h Sun Apr 12 11:42:40 2009 (r190962) @@ -71,6 +71,11 @@ struct udpstat { u_long udps_filtermcast; /* blocked by multicast filter */ }; +#ifdef _KERNEL +#define UDPSTAT_ADD(name, val) V_udpstat.name += (val) +#define UDPSTAT_INC(name) UDPSTAT_ADD(name, 1) +#endif + /* * Names for UDP sysctl objects. */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 11:46:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E9B3106564A; Sun, 12 Apr 2009 11:46:57 +0000 (UTC) (envelope-from rse@engelschall.com) Received: from visp1.engelschall.com (visp1.engelschall.com [194.97.152.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1D5548FC12; Sun, 12 Apr 2009 11:46:57 +0000 (UTC) (envelope-from rse@engelschall.com) Received: by visp1.engelschall.com (Postfix, from userid 21100) id B253F19818; Sun, 12 Apr 2009 13:30:07 +0200 (CEST) Received: by en1.engelschall.com (Postfix, from userid 10000) id 11CC66DC0C; Sun, 12 Apr 2009 13:22:07 +0200 (CEST) Date: Sun, 12 Apr 2009 13:22:07 +0200 From: "Ralf S. Engelschall" To: David Schultz Message-ID: <20090412112207.GA45902@engelschall.com> References: <200904111657.n3BGvpsC092703@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200904111657.n3BGvpsC092703@svn.freebsd.org> Organization: FreeBSD User-Agent: Mutt/1.5.19 OpenPKG/CURRENT (2009-01-05) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190943 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Ralf S. Engelschall" List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 11:46:57 -0000 On Sat, Apr 11, 2009, David Schultz wrote: > [...] > GNU Pth has some fragile kludges that were broken by r189828. > I've discussed this with the Pth maintainer and no clear solution > has emerged on the ports side of things, so for now, hack around > the issue in signal.h. > [...] We really should not apply any special workarounds in our FreeBSD code base for third-party libraries like GNU Pth. I've personally still not investigated on this issue of the GNU Pth port, but I'm sure the problem _can_ be solved from within the ports tree or even in my own upstream GNU Pth code base. We at least certainly don't need any hacks in the FreeBSD . I recommend to backout this change. I will check the GNU Pth ports issue we have here and perhaps even apply a workaround upstream... -- rse@FreeBSD.org Ralf S. Engelschall FreeBSD.org/~rse rse@engelschall.com FreeBSD committer www.engelschall.com From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 11:53:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4FD61065670; Sun, 12 Apr 2009 11:53:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7DCF8FC0A; Sun, 12 Apr 2009 11:53:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CBrCPk024179; Sun, 12 Apr 2009 11:53:12 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CBrC5i024178; Sun, 12 Apr 2009 11:53:12 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904121153.n3CBrC5i024178@svn.freebsd.org> From: Robert Watson Date: Sun, 12 Apr 2009 11:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190963 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 11:53:13 -0000 Author: rwatson Date: Sun Apr 12 11:53:12 2009 New Revision: 190963 URL: http://svn.freebsd.org/changeset/base/190963 Log: Commit file omitted in r190962: Update stats in struct udpstat using two new macros, UDPSTAT_ADD() and UDPSTAT_INC(), rather than directly manipulating the fields across the kernel. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structures. MFC after: 3 days Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Sun Apr 12 11:42:40 2009 (r190962) +++ head/sys/netinet6/udp6_usrreq.c Sun Apr 12 11:53:12 2009 (r190963) @@ -166,7 +166,7 @@ udp6_append(struct inpcb *inp, struct mb m_freem(n); if (opts) m_freem(opts); - V_udpstat.udps_fullsock++; + UDPSTAT_INC(udps_fullsock); } else sorwakeup_locked(so); } @@ -202,7 +202,7 @@ udp6_input(struct mbuf **mp, int *offp, return (IPPROTO_DONE); #endif - V_udpstat.udps_ipackets++; + UDPSTAT_INC(udps_ipackets); /* * Destination port of 0 is illegal, based on RFC768. @@ -214,7 +214,7 @@ udp6_input(struct mbuf **mp, int *offp, ulen = ntohs((u_short)uh->uh_ulen); if (plen != ulen) { - V_udpstat.udps_badlen++; + UDPSTAT_INC(udps_badlen); goto badunlocked; } @@ -222,11 +222,11 @@ udp6_input(struct mbuf **mp, int *offp, * Checksum extended UDP header and data. */ if (uh->uh_sum == 0) { - V_udpstat.udps_nosum++; + UDPSTAT_INC(udps_nosum); goto badunlocked; } if (in6_cksum(m, IPPROTO_UDP, off, ulen) != 0) { - V_udpstat.udps_badsum++; + UDPSTAT_INC(udps_badsum); goto badunlocked; } @@ -327,8 +327,8 @@ udp6_input(struct mbuf **mp, int *offp, * to send an ICMP Port Unreachable for a broadcast * or multicast datgram.) */ - V_udpstat.udps_noport++; - V_udpstat.udps_noportmcast++; + UDPSTAT_INC(udps_noport); + UDPSTAT_INC(udps_noportmcast); goto badheadlocked; } INP_RLOCK(last); @@ -365,10 +365,10 @@ udp6_input(struct mbuf **mp, int *offp, ip6_sprintf(ip6bufs, &ip6->ip6_src), ntohs(uh->uh_sport)); } - V_udpstat.udps_noport++; + UDPSTAT_INC(udps_noport); if (m->m_flags & M_MCAST) { printf("UDP6: M_MCAST is set in a unicast packet.\n"); - V_udpstat.udps_noportmcast++; + UDPSTAT_INC(udps_noportmcast); goto badheadlocked; } INP_INFO_RUNLOCK(&V_udbinfo); @@ -719,7 +719,7 @@ udp6_output(struct inpcb *inp, struct mb flags = 0; - V_udpstat.udps_opackets++; + UDPSTAT_INC(udps_opackets); error = ip6_output(m, optp, NULL, flags, inp->in6p_moptions, NULL, inp); break; From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 12:35:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7ABA1065673 for ; Sun, 12 Apr 2009 12:35:48 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id E5C3F8FC1A for ; Sun, 12 Apr 2009 12:35:47 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 12 Apr 2009 12:35:43 -0000 Received: from p54A3F1BC.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.241.188] by mail.gmx.net (mp044) with SMTP; 12 Apr 2009 14:35:43 +0200 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX19xxw9nymFxs8Gs6DtQVMqA2eX8SsQ7S+9PEkwygZ QHHXHaY9E2NFjC Message-ID: <49E1E01C.90704@gmx.de> Date: Sun, 12 Apr 2009 14:35:40 +0200 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Alexander Kabaev References: <200904111401.n3BE1108088009@svn.freebsd.org> <20090411163528.GC46526@troutmask.apl.washington.edu> <20090411124335.0600a72f@kan.dnsalias.net> In-Reply-To: <20090411124335.0600a72f@kan.dnsalias.net> Content-Type: multipart/mixed; boundary="------------060603020107020709020402" X-Y-GMX-Trusted: 0 X-FuHaFi: 0.52,0.47 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten , Steve Kargl Subject: Re: svn commit: r190919 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 12:35:49 -0000 This is a multi-part message in MIME format. --------------060603020107020709020402 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Alexander Kabaev schrieb: > On Sat, 11 Apr 2009 09:35:28 -0700 > Steve Kargl wrote: > >> On Sat, Apr 11, 2009 at 02:01:01PM +0000, Ed Schouten wrote: >>> Author: ed >>> Date: Sat Apr 11 14:01:01 2009 >>> New Revision: 190919 >>> URL: http://svn.freebsd.org/changeset/base/190919 >>> >>> Log: >>> Simplify in/out functions (for i386 and AMD64). >>> >>> Remove a hack to generate more efficient code for port numbers >>> below 0x100, which has been obsolete for at least ten years, >>> because GCC has an asm constraint to specify that. >>> >>> Submitted by: Christoph Mallon >>> >> I thought Christoph and bde were still hashing out the correctness >> of this patch. >> >> http://lists.freebsd.org/pipermail/freebsd-amd64/2009-April/012064.html >> >> -- >> Steve > > The patch is inconsistent in regards to usage of volatile vs. > __volatile even within itself. I think the code is sloppy and was not > ready to be committed yet. Please fix or back out. Backing it out because of two underscores (!) would be counterproductive: It removes about 150 lines of hard to read hacks, which are unnecessary for at least a decade. GCC 2.95, which was released in 1999 supports the "N" constraint for inline asm. Perhaps olders do, too, but you cannot get older GCCs from the official site. Attached is a patch, which replaces all __inline and __volatile in the touched headers by thir ISO equivalents - again there hasn't been a reason to use the alternate GCC keywords for at least a decade. Also "inline" and "volatile" are already used hundreds of times in sys/. The patch is simply the result of %s/\<__\(inline\|volatile\)\>/\1/. Christoph --------------060603020107020709020402 Content-Type: text/plain; name="ISO.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ISO.diff" Index: i386/include/cpufunc.h =================================================================== --- i386/include/cpufunc.h (Revision 190919) +++ i386/include/cpufunc.h (Arbeitskopie) @@ -65,84 +65,84 @@ #if defined(__GNUCLIKE_ASM) && defined(__CC_SUPPORTS___INLINE) -static __inline void +static inline void breakpoint(void) { - __asm __volatile("int $3"); + __asm volatile("int $3"); } -static __inline u_int +static inline u_int bsfl(u_int mask) { u_int result; - __asm __volatile("bsfl %1,%0" : "=r" (result) : "rm" (mask)); + __asm volatile("bsfl %1,%0" : "=r" (result) : "rm" (mask)); return (result); } -static __inline u_int +static inline u_int bsrl(u_int mask) { u_int result; - __asm __volatile("bsrl %1,%0" : "=r" (result) : "rm" (mask)); + __asm volatile("bsrl %1,%0" : "=r" (result) : "rm" (mask)); return (result); } -static __inline void +static inline void disable_intr(void) { #ifdef XEN xen_cli(); #else - __asm __volatile("cli" : : : "memory"); + __asm volatile("cli" : : : "memory"); #endif } -static __inline void +static inline void do_cpuid(u_int ax, u_int *p) { - __asm __volatile("cpuid" + __asm volatile("cpuid" : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) : "0" (ax)); } -static __inline void +static inline void cpuid_count(u_int ax, u_int cx, u_int *p) { - __asm __volatile("cpuid" + __asm volatile("cpuid" : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) : "0" (ax), "c" (cx)); } -static __inline void +static inline void enable_intr(void) { #ifdef XEN xen_sti(); #else - __asm __volatile("sti"); + __asm volatile("sti"); #endif } static inline void cpu_monitor(const void *addr, int extensions, int hints) { - __asm __volatile("monitor;" + __asm volatile("monitor;" : :"a" (addr), "c" (extensions), "d"(hints)); } static inline void cpu_mwait(int extensions, int hints) { - __asm __volatile("mwait;" : :"a" (hints), "c" (extensions)); + __asm volatile("mwait;" : :"a" (hints), "c" (extensions)); } #ifdef _KERNEL #define HAVE_INLINE_FFS -static __inline int +static inline int ffs(int mask) { /* @@ -156,7 +156,7 @@ #define HAVE_INLINE_FLS -static __inline int +static inline int fls(int mask) { return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1); @@ -164,13 +164,13 @@ #endif /* _KERNEL */ -static __inline void +static inline void halt(void) { - __asm __volatile("hlt"); + __asm volatile("hlt"); } -static __inline u_char +static inline u_char inb(u_int port) { u_char data; @@ -179,7 +179,7 @@ return (data); } -static __inline u_int +static inline u_int inl(u_int port) { u_int data; @@ -188,40 +188,40 @@ return (data); } -static __inline void +static inline void insb(u_int port, void *addr, size_t cnt) { - __asm __volatile("cld; rep; insb" + __asm volatile("cld; rep; insb" : "+D" (addr), "+c" (cnt) : "d" (port) : "memory"); } -static __inline void +static inline void insw(u_int port, void *addr, size_t cnt) { - __asm __volatile("cld; rep; insw" + __asm volatile("cld; rep; insw" : "+D" (addr), "+c" (cnt) : "d" (port) : "memory"); } -static __inline void +static inline void insl(u_int port, void *addr, size_t cnt) { - __asm __volatile("cld; rep; insl" + __asm volatile("cld; rep; insl" : "+D" (addr), "+c" (cnt) : "d" (port) : "memory"); } -static __inline void +static inline void invd(void) { - __asm __volatile("invd"); + __asm volatile("invd"); } -static __inline u_short +static inline u_short inw(u_int port) { u_short data; @@ -230,125 +230,125 @@ return (data); } -static __inline void +static inline void outb(u_int port, u_char data) { - __asm __volatile("outb %0, %w1" : : "a" (data), "Nd" (port)); + __asm volatile("outb %0, %w1" : : "a" (data), "Nd" (port)); } -static __inline void +static inline void outl(u_int port, u_int data) { __asm volatile("outl %0, %w1" : : "a" (data), "Nd" (port)); } -static __inline void +static inline void outsb(u_int port, const void *addr, size_t cnt) { - __asm __volatile("cld; rep; outsb" + __asm volatile("cld; rep; outsb" : "+S" (addr), "+c" (cnt) : "d" (port)); } -static __inline void +static inline void outsw(u_int port, const void *addr, size_t cnt) { - __asm __volatile("cld; rep; outsw" + __asm volatile("cld; rep; outsw" : "+S" (addr), "+c" (cnt) : "d" (port)); } -static __inline void +static inline void outsl(u_int port, const void *addr, size_t cnt) { - __asm __volatile("cld; rep; outsl" + __asm volatile("cld; rep; outsl" : "+S" (addr), "+c" (cnt) : "d" (port)); } -static __inline void +static inline void outw(u_int port, u_short data) { __asm volatile("outw %0, %w1" : : "a" (data), "Nd" (port)); } -static __inline void +static inline void ia32_pause(void) { - __asm __volatile("pause"); + __asm volatile("pause"); } -static __inline u_int +static inline u_int read_eflags(void) { u_int ef; - __asm __volatile("pushfl; popl %0" : "=r" (ef)); + __asm volatile("pushfl; popl %0" : "=r" (ef)); return (ef); } -static __inline uint64_t +static inline uint64_t rdmsr(u_int msr) { uint64_t rv; - __asm __volatile("rdmsr" : "=A" (rv) : "c" (msr)); + __asm volatile("rdmsr" : "=A" (rv) : "c" (msr)); return (rv); } -static __inline uint64_t +static inline uint64_t rdpmc(u_int pmc) { uint64_t rv; - __asm __volatile("rdpmc" : "=A" (rv) : "c" (pmc)); + __asm volatile("rdpmc" : "=A" (rv) : "c" (pmc)); return (rv); } -static __inline uint64_t +static inline uint64_t rdtsc(void) { uint64_t rv; - __asm __volatile("rdtsc" : "=A" (rv)); + __asm volatile("rdtsc" : "=A" (rv)); return (rv); } -static __inline void +static inline void wbinvd(void) { - __asm __volatile("wbinvd"); + __asm volatile("wbinvd"); } -static __inline void +static inline void write_eflags(u_int ef) { - __asm __volatile("pushl %0; popfl" : : "r" (ef)); + __asm volatile("pushl %0; popfl" : : "r" (ef)); } -static __inline void +static inline void wrmsr(u_int msr, uint64_t newval) { - __asm __volatile("wrmsr" : : "A" (newval), "c" (msr)); + __asm volatile("wrmsr" : : "A" (newval), "c" (msr)); } -static __inline void +static inline void load_cr0(u_int data) { - __asm __volatile("movl %0,%%cr0" : : "r" (data)); + __asm volatile("movl %0,%%cr0" : : "r" (data)); } -static __inline u_int +static inline u_int rcr0(void) { u_int data; - __asm __volatile("movl %%cr0,%0" : "=r" (data)); + __asm volatile("movl %%cr0,%0" : "=r" (data)); return (data); } -static __inline u_int +static inline u_int rcr2(void) { u_int data; @@ -356,48 +356,48 @@ #ifdef XEN return (xen_rcr2()); #endif - __asm __volatile("movl %%cr2,%0" : "=r" (data)); + __asm volatile("movl %%cr2,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_cr3(u_int data) { #ifdef XEN xen_load_cr3(data); #else - __asm __volatile("movl %0,%%cr3" : : "r" (data) : "memory"); + __asm volatile("movl %0,%%cr3" : : "r" (data) : "memory"); #endif } -static __inline u_int +static inline u_int rcr3(void) { u_int data; - __asm __volatile("movl %%cr3,%0" : "=r" (data)); + __asm volatile("movl %%cr3,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_cr4(u_int data) { - __asm __volatile("movl %0,%%cr4" : : "r" (data)); + __asm volatile("movl %0,%%cr4" : : "r" (data)); } -static __inline u_int +static inline u_int rcr4(void) { u_int data; - __asm __volatile("movl %%cr4,%0" : "=r" (data)); + __asm volatile("movl %%cr4,%0" : "=r" (data)); return (data); } /* * Global TLB flush (except for thise for pages marked PG_G) */ -static __inline void +static inline void invltlb(void) { #ifdef XEN @@ -411,216 +411,216 @@ * TLB flush for an individual page (even if it has PG_G). * Only works on 486+ CPUs (i386 does not have PG_G). */ -static __inline void +static inline void invlpg(u_int addr) { #ifdef XEN xen_invlpg(addr); #else - __asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory"); + __asm volatile("invlpg %0" : : "m" (*(char *)addr) : "memory"); #endif } -static __inline u_int +static inline u_int rfs(void) { u_int sel; - __asm __volatile("mov %%fs,%0" : "=rm" (sel)); + __asm volatile("mov %%fs,%0" : "=rm" (sel)); return (sel); } -static __inline uint64_t +static inline uint64_t rgdt(void) { uint64_t gdtr; - __asm __volatile("sgdt %0" : "=m" (gdtr)); + __asm volatile("sgdt %0" : "=m" (gdtr)); return (gdtr); } -static __inline u_int +static inline u_int rgs(void) { u_int sel; - __asm __volatile("mov %%gs,%0" : "=rm" (sel)); + __asm volatile("mov %%gs,%0" : "=rm" (sel)); return (sel); } -static __inline uint64_t +static inline uint64_t ridt(void) { uint64_t idtr; - __asm __volatile("sidt %0" : "=m" (idtr)); + __asm volatile("sidt %0" : "=m" (idtr)); return (idtr); } -static __inline u_short +static inline u_short rldt(void) { u_short ldtr; - __asm __volatile("sldt %0" : "=g" (ldtr)); + __asm volatile("sldt %0" : "=g" (ldtr)); return (ldtr); } -static __inline u_int +static inline u_int rss(void) { u_int sel; - __asm __volatile("mov %%ss,%0" : "=rm" (sel)); + __asm volatile("mov %%ss,%0" : "=rm" (sel)); return (sel); } -static __inline u_short +static inline u_short rtr(void) { u_short tr; - __asm __volatile("str %0" : "=g" (tr)); + __asm volatile("str %0" : "=g" (tr)); return (tr); } -static __inline void +static inline void load_fs(u_int sel) { - __asm __volatile("mov %0,%%fs" : : "rm" (sel)); + __asm volatile("mov %0,%%fs" : : "rm" (sel)); } -static __inline void +static inline void load_gs(u_int sel) { - __asm __volatile("mov %0,%%gs" : : "rm" (sel)); + __asm volatile("mov %0,%%gs" : : "rm" (sel)); } -static __inline void +static inline void lidt(struct region_descriptor *addr) { - __asm __volatile("lidt (%0)" : : "r" (addr)); + __asm volatile("lidt (%0)" : : "r" (addr)); } -static __inline void +static inline void lldt(u_short sel) { - __asm __volatile("lldt %0" : : "r" (sel)); + __asm volatile("lldt %0" : : "r" (sel)); } -static __inline void +static inline void ltr(u_short sel) { - __asm __volatile("ltr %0" : : "r" (sel)); + __asm volatile("ltr %0" : : "r" (sel)); } -static __inline u_int +static inline u_int rdr0(void) { u_int data; - __asm __volatile("movl %%dr0,%0" : "=r" (data)); + __asm volatile("movl %%dr0,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr0(u_int dr0) { - __asm __volatile("movl %0,%%dr0" : : "r" (dr0)); + __asm volatile("movl %0,%%dr0" : : "r" (dr0)); } -static __inline u_int +static inline u_int rdr1(void) { u_int data; - __asm __volatile("movl %%dr1,%0" : "=r" (data)); + __asm volatile("movl %%dr1,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr1(u_int dr1) { - __asm __volatile("movl %0,%%dr1" : : "r" (dr1)); + __asm volatile("movl %0,%%dr1" : : "r" (dr1)); } -static __inline u_int +static inline u_int rdr2(void) { u_int data; - __asm __volatile("movl %%dr2,%0" : "=r" (data)); + __asm volatile("movl %%dr2,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr2(u_int dr2) { - __asm __volatile("movl %0,%%dr2" : : "r" (dr2)); + __asm volatile("movl %0,%%dr2" : : "r" (dr2)); } -static __inline u_int +static inline u_int rdr3(void) { u_int data; - __asm __volatile("movl %%dr3,%0" : "=r" (data)); + __asm volatile("movl %%dr3,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr3(u_int dr3) { - __asm __volatile("movl %0,%%dr3" : : "r" (dr3)); + __asm volatile("movl %0,%%dr3" : : "r" (dr3)); } -static __inline u_int +static inline u_int rdr4(void) { u_int data; - __asm __volatile("movl %%dr4,%0" : "=r" (data)); + __asm volatile("movl %%dr4,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr4(u_int dr4) { - __asm __volatile("movl %0,%%dr4" : : "r" (dr4)); + __asm volatile("movl %0,%%dr4" : : "r" (dr4)); } -static __inline u_int +static inline u_int rdr5(void) { u_int data; - __asm __volatile("movl %%dr5,%0" : "=r" (data)); + __asm volatile("movl %%dr5,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr5(u_int dr5) { - __asm __volatile("movl %0,%%dr5" : : "r" (dr5)); + __asm volatile("movl %0,%%dr5" : : "r" (dr5)); } -static __inline u_int +static inline u_int rdr6(void) { u_int data; - __asm __volatile("movl %%dr6,%0" : "=r" (data)); + __asm volatile("movl %%dr6,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr6(u_int dr6) { - __asm __volatile("movl %0,%%dr6" : : "r" (dr6)); + __asm volatile("movl %0,%%dr6" : : "r" (dr6)); } -static __inline u_int +static inline u_int rdr7(void) { u_int data; - __asm __volatile("movl %%dr7,%0" : "=r" (data)); + __asm volatile("movl %%dr7,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr7(u_int dr7) { - __asm __volatile("movl %0,%%dr7" : : "r" (dr7)); + __asm volatile("movl %0,%%dr7" : : "r" (dr7)); } -static __inline register_t +static inline register_t intr_disable(void) { register_t eflags; @@ -634,7 +634,7 @@ return (eflags); } -static __inline void +static inline void intr_restore(register_t eflags) { #ifdef XEN Index: amd64/include/cpufunc.h =================================================================== --- amd64/include/cpufunc.h (Revision 190919) +++ amd64/include/cpufunc.h (Arbeitskopie) @@ -57,74 +57,74 @@ #if defined(__GNUCLIKE_ASM) && defined(__CC_SUPPORTS___INLINE) -static __inline void +static inline void breakpoint(void) { - __asm __volatile("int $3"); + __asm volatile("int $3"); } -static __inline u_int +static inline u_int bsfl(u_int mask) { u_int result; - __asm __volatile("bsfl %1,%0" : "=r" (result) : "rm" (mask)); + __asm volatile("bsfl %1,%0" : "=r" (result) : "rm" (mask)); return (result); } -static __inline u_long +static inline u_long bsfq(u_long mask) { u_long result; - __asm __volatile("bsfq %1,%0" : "=r" (result) : "rm" (mask)); + __asm volatile("bsfq %1,%0" : "=r" (result) : "rm" (mask)); return (result); } -static __inline u_int +static inline u_int bsrl(u_int mask) { u_int result; - __asm __volatile("bsrl %1,%0" : "=r" (result) : "rm" (mask)); + __asm volatile("bsrl %1,%0" : "=r" (result) : "rm" (mask)); return (result); } -static __inline u_long +static inline u_long bsrq(u_long mask) { u_long result; - __asm __volatile("bsrq %1,%0" : "=r" (result) : "rm" (mask)); + __asm volatile("bsrq %1,%0" : "=r" (result) : "rm" (mask)); return (result); } -static __inline void +static inline void disable_intr(void) { - __asm __volatile("cli" : : : "memory"); + __asm volatile("cli" : : : "memory"); } -static __inline void +static inline void do_cpuid(u_int ax, u_int *p) { - __asm __volatile("cpuid" + __asm volatile("cpuid" : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) : "0" (ax)); } -static __inline void +static inline void cpuid_count(u_int ax, u_int cx, u_int *p) { - __asm __volatile("cpuid" + __asm volatile("cpuid" : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) : "0" (ax), "c" (cx)); } -static __inline void +static inline void enable_intr(void) { - __asm __volatile("sti"); + __asm volatile("sti"); } #ifdef _KERNEL @@ -134,7 +134,7 @@ #define HAVE_INLINE_FFSL -static __inline int +static inline int ffsl(long mask) { return (mask == 0 ? mask : (int)bsfq((u_long)mask) + 1); @@ -142,7 +142,7 @@ #define HAVE_INLINE_FLS -static __inline int +static inline int fls(int mask) { return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1); @@ -150,7 +150,7 @@ #define HAVE_INLINE_FLSL -static __inline int +static inline int flsl(long mask) { return (mask == 0 ? mask : (int)bsrq((u_long)mask) + 1); @@ -158,13 +158,13 @@ #endif /* _KERNEL */ -static __inline void +static inline void halt(void) { - __asm __volatile("hlt"); + __asm volatile("hlt"); } -static __inline u_char +static inline u_char inb(u_int port) { u_char data; @@ -173,7 +173,7 @@ return (data); } -static __inline u_int +static inline u_int inl(u_int port) { u_int data; @@ -182,40 +182,40 @@ return (data); } -static __inline void +static inline void insb(u_int port, void *addr, size_t cnt) { - __asm __volatile("cld; rep; insb" + __asm volatile("cld; rep; insb" : "+D" (addr), "+c" (cnt) : "d" (port) : "memory"); } -static __inline void +static inline void insw(u_int port, void *addr, size_t cnt) { - __asm __volatile("cld; rep; insw" + __asm volatile("cld; rep; insw" : "+D" (addr), "+c" (cnt) : "d" (port) : "memory"); } -static __inline void +static inline void insl(u_int port, void *addr, size_t cnt) { - __asm __volatile("cld; rep; insl" + __asm volatile("cld; rep; insl" : "+D" (addr), "+c" (cnt) : "d" (port) : "memory"); } -static __inline void +static inline void invd(void) { - __asm __volatile("invd"); + __asm volatile("invd"); } -static __inline u_short +static inline u_short inw(u_int port) { u_short data; @@ -224,172 +224,172 @@ return (data); } -static __inline void +static inline void outb(u_int port, u_char data) { __asm volatile("outb %0, %w1" : : "a" (data), "Nd" (port)); } -static __inline void +static inline void outl(u_int port, u_int data) { __asm volatile("outl %0, %w1" : : "a" (data), "Nd" (port)); } -static __inline void +static inline void outsb(u_int port, const void *addr, size_t cnt) { - __asm __volatile("cld; rep; outsb" + __asm volatile("cld; rep; outsb" : "+S" (addr), "+c" (cnt) : "d" (port)); } -static __inline void +static inline void outsw(u_int port, const void *addr, size_t cnt) { - __asm __volatile("cld; rep; outsw" + __asm volatile("cld; rep; outsw" : "+S" (addr), "+c" (cnt) : "d" (port)); } -static __inline void +static inline void outsl(u_int port, const void *addr, size_t cnt) { - __asm __volatile("cld; rep; outsl" + __asm volatile("cld; rep; outsl" : "+S" (addr), "+c" (cnt) : "d" (port)); } -static __inline void +static inline void outw(u_int port, u_short data) { __asm volatile("outw %0, %w1" : : "a" (data), "Nd" (port)); } -static __inline void +static inline void ia32_pause(void) { - __asm __volatile("pause"); + __asm volatile("pause"); } -static __inline u_long +static inline u_long read_rflags(void) { u_long rf; - __asm __volatile("pushfq; popq %0" : "=r" (rf)); + __asm volatile("pushfq; popq %0" : "=r" (rf)); return (rf); } -static __inline u_int64_t +static inline u_int64_t rdmsr(u_int msr) { u_int32_t low, high; - __asm __volatile("rdmsr" : "=a" (low), "=d" (high) : "c" (msr)); + __asm volatile("rdmsr" : "=a" (low), "=d" (high) : "c" (msr)); return (low | ((u_int64_t)high << 32)); } -static __inline u_int64_t +static inline u_int64_t rdpmc(u_int pmc) { u_int32_t low, high; - __asm __volatile("rdpmc" : "=a" (low), "=d" (high) : "c" (pmc)); + __asm volatile("rdpmc" : "=a" (low), "=d" (high) : "c" (pmc)); return (low | ((u_int64_t)high << 32)); } -static __inline u_int64_t +static inline u_int64_t rdtsc(void) { u_int32_t low, high; - __asm __volatile("rdtsc" : "=a" (low), "=d" (high)); + __asm volatile("rdtsc" : "=a" (low), "=d" (high)); return (low | ((u_int64_t)high << 32)); } -static __inline void +static inline void wbinvd(void) { - __asm __volatile("wbinvd"); + __asm volatile("wbinvd"); } -static __inline void +static inline void write_rflags(u_long rf) { - __asm __volatile("pushq %0; popfq" : : "r" (rf)); + __asm volatile("pushq %0; popfq" : : "r" (rf)); } -static __inline void +static inline void wrmsr(u_int msr, u_int64_t newval) { u_int32_t low, high; low = newval; high = newval >> 32; - __asm __volatile("wrmsr" : : "a" (low), "d" (high), "c" (msr)); + __asm volatile("wrmsr" : : "a" (low), "d" (high), "c" (msr)); } -static __inline void +static inline void load_cr0(u_long data) { - __asm __volatile("movq %0,%%cr0" : : "r" (data)); + __asm volatile("movq %0,%%cr0" : : "r" (data)); } -static __inline u_long +static inline u_long rcr0(void) { u_long data; - __asm __volatile("movq %%cr0,%0" : "=r" (data)); + __asm volatile("movq %%cr0,%0" : "=r" (data)); return (data); } -static __inline u_long +static inline u_long rcr2(void) { u_long data; - __asm __volatile("movq %%cr2,%0" : "=r" (data)); + __asm volatile("movq %%cr2,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_cr3(u_long data) { - __asm __volatile("movq %0,%%cr3" : : "r" (data) : "memory"); + __asm volatile("movq %0,%%cr3" : : "r" (data) : "memory"); } -static __inline u_long +static inline u_long rcr3(void) { u_long data; - __asm __volatile("movq %%cr3,%0" : "=r" (data)); + __asm volatile("movq %%cr3,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_cr4(u_long data) { - __asm __volatile("movq %0,%%cr4" : : "r" (data)); + __asm volatile("movq %0,%%cr4" : : "r" (data)); } -static __inline u_long +static inline u_long rcr4(void) { u_long data; - __asm __volatile("movq %%cr4,%0" : "=r" (data)); + __asm volatile("movq %%cr4,%0" : "=r" (data)); return (data); } /* * Global TLB flush (except for thise for pages marked PG_G) */ -static __inline void +static inline void invltlb(void) { @@ -400,60 +400,60 @@ * TLB flush for an individual page (even if it has PG_G). * Only works on 486+ CPUs (i386 does not have PG_G). */ -static __inline void +static inline void invlpg(u_long addr) { - __asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory"); + __asm volatile("invlpg %0" : : "m" (*(char *)addr) : "memory"); } -static __inline u_int +static inline u_int rfs(void) { u_int sel; - __asm __volatile("mov %%fs,%0" : "=rm" (sel)); + __asm volatile("mov %%fs,%0" : "=rm" (sel)); return (sel); } -static __inline u_int +static inline u_int rgs(void) { u_int sel; - __asm __volatile("mov %%gs,%0" : "=rm" (sel)); + __asm volatile("mov %%gs,%0" : "=rm" (sel)); return (sel); } -static __inline u_int +static inline u_int rss(void) { u_int sel; - __asm __volatile("mov %%ss,%0" : "=rm" (sel)); + __asm volatile("mov %%ss,%0" : "=rm" (sel)); return (sel); } -static __inline void +static inline void load_ds(u_int sel) { - __asm __volatile("mov %0,%%ds" : : "rm" (sel)); + __asm volatile("mov %0,%%ds" : : "rm" (sel)); } -static __inline void +static inline void load_es(u_int sel) { - __asm __volatile("mov %0,%%es" : : "rm" (sel)); + __asm volatile("mov %0,%%es" : : "rm" (sel)); } static inline void cpu_monitor(const void *addr, int extensions, int hints) { - __asm __volatile("monitor;" + __asm volatile("monitor;" : :"a" (addr), "c" (extensions), "d"(hints)); } static inline void cpu_mwait(int extensions, int hints) { - __asm __volatile("mwait;" : :"a" (hints), "c" (extensions)); + __asm volatile("mwait;" : :"a" (hints), "c" (extensions)); } #ifdef _KERNEL @@ -461,18 +461,18 @@ #ifndef MSR_FSBASE #define MSR_FSBASE 0xc0000100 #endif -static __inline void +static inline void load_fs(u_int sel) { /* Preserve the fsbase value across the selector load */ - __asm __volatile("rdmsr; mov %0,%%fs; wrmsr" + __asm volatile("rdmsr; mov %0,%%fs; wrmsr" : : "rm" (sel), "c" (MSR_FSBASE) : "eax", "edx"); } #ifndef MSR_GSBASE #define MSR_GSBASE 0xc0000101 #endif -static __inline void +static inline void load_gs(u_int sel) { /* @@ -480,155 +480,155 @@ * Note that we have to disable interrupts because the gsbase * being trashed happens to be the kernel gsbase at the time. */ - __asm __volatile("pushfq; cli; rdmsr; mov %0,%%gs; wrmsr; popfq" + __asm volatile("pushfq; cli; rdmsr; mov %0,%%gs; wrmsr; popfq" : : "rm" (sel), "c" (MSR_GSBASE) : "eax", "edx"); } #else /* Usable by userland */ -static __inline void +static inline void load_fs(u_int sel) { - __asm __volatile("mov %0,%%fs" : : "rm" (sel)); + __asm volatile("mov %0,%%fs" : : "rm" (sel)); } -static __inline void +static inline void load_gs(u_int sel) { - __asm __volatile("mov %0,%%gs" : : "rm" (sel)); + __asm volatile("mov %0,%%gs" : : "rm" (sel)); } #endif -static __inline void +static inline void lidt(struct region_descriptor *addr) { - __asm __volatile("lidt (%0)" : : "r" (addr)); + __asm volatile("lidt (%0)" : : "r" (addr)); } -static __inline void +static inline void lldt(u_short sel) { - __asm __volatile("lldt %0" : : "r" (sel)); + __asm volatile("lldt %0" : : "r" (sel)); } -static __inline void +static inline void ltr(u_short sel) { - __asm __volatile("ltr %0" : : "r" (sel)); + __asm volatile("ltr %0" : : "r" (sel)); } -static __inline u_int64_t +static inline u_int64_t rdr0(void) { u_int64_t data; - __asm __volatile("movq %%dr0,%0" : "=r" (data)); + __asm volatile("movq %%dr0,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr0(u_int64_t dr0) { - __asm __volatile("movq %0,%%dr0" : : "r" (dr0)); + __asm volatile("movq %0,%%dr0" : : "r" (dr0)); } -static __inline u_int64_t +static inline u_int64_t rdr1(void) { u_int64_t data; - __asm __volatile("movq %%dr1,%0" : "=r" (data)); + __asm volatile("movq %%dr1,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr1(u_int64_t dr1) { - __asm __volatile("movq %0,%%dr1" : : "r" (dr1)); + __asm volatile("movq %0,%%dr1" : : "r" (dr1)); } -static __inline u_int64_t +static inline u_int64_t rdr2(void) { u_int64_t data; - __asm __volatile("movq %%dr2,%0" : "=r" (data)); + __asm volatile("movq %%dr2,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr2(u_int64_t dr2) { - __asm __volatile("movq %0,%%dr2" : : "r" (dr2)); + __asm volatile("movq %0,%%dr2" : : "r" (dr2)); } -static __inline u_int64_t +static inline u_int64_t rdr3(void) { u_int64_t data; - __asm __volatile("movq %%dr3,%0" : "=r" (data)); + __asm volatile("movq %%dr3,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr3(u_int64_t dr3) { - __asm __volatile("movq %0,%%dr3" : : "r" (dr3)); + __asm volatile("movq %0,%%dr3" : : "r" (dr3)); } -static __inline u_int64_t +static inline u_int64_t rdr4(void) { u_int64_t data; - __asm __volatile("movq %%dr4,%0" : "=r" (data)); + __asm volatile("movq %%dr4,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr4(u_int64_t dr4) { - __asm __volatile("movq %0,%%dr4" : : "r" (dr4)); + __asm volatile("movq %0,%%dr4" : : "r" (dr4)); } -static __inline u_int64_t +static inline u_int64_t rdr5(void) { u_int64_t data; - __asm __volatile("movq %%dr5,%0" : "=r" (data)); + __asm volatile("movq %%dr5,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr5(u_int64_t dr5) { - __asm __volatile("movq %0,%%dr5" : : "r" (dr5)); + __asm volatile("movq %0,%%dr5" : : "r" (dr5)); } -static __inline u_int64_t +static inline u_int64_t rdr6(void) { u_int64_t data; - __asm __volatile("movq %%dr6,%0" : "=r" (data)); + __asm volatile("movq %%dr6,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr6(u_int64_t dr6) { - __asm __volatile("movq %0,%%dr6" : : "r" (dr6)); + __asm volatile("movq %0,%%dr6" : : "r" (dr6)); } -static __inline u_int64_t +static inline u_int64_t rdr7(void) { u_int64_t data; - __asm __volatile("movq %%dr7,%0" : "=r" (data)); + __asm volatile("movq %%dr7,%0" : "=r" (data)); return (data); } -static __inline void +static inline void load_dr7(u_int64_t dr7) { - __asm __volatile("movq %0,%%dr7" : : "r" (dr7)); + __asm volatile("movq %0,%%dr7" : : "r" (dr7)); } -static __inline register_t +static inline register_t intr_disable(void) { register_t rflags; @@ -638,7 +638,7 @@ return (rflags); } -static __inline void +static inline void intr_restore(register_t rflags) { write_rflags(rflags); --------------060603020107020709020402-- From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 13:06:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24EDB106564A; Sun, 12 Apr 2009 13:06:00 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qy0-f132.google.com (mail-qy0-f132.google.com [209.85.221.132]) by mx1.freebsd.org (Postfix) with ESMTP id 75ADA8FC18; Sun, 12 Apr 2009 13:05:59 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by qyk38 with SMTP id 38so227845qyk.3 for ; Sun, 12 Apr 2009 06:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=1IzA/mCHO5mB51EVB8++CRdU6Ye7VtK/oN5IHP7R3uQ=; b=QeZLQtscTIB7suFoMGNNR5cV5jOzcdWr6stHOdcRQOs8bRix7SdCntJM3jksRk3Hjk 8konMmW2y9xgMb47yxBIIOP/uPyOcuN444diyVB60swN8oQcXViZVLtk4vSf64MUSA8c SKuYO2TB3O6XY+dHeN7FjqfxDoBUKKQbGxU3w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=KEdJk4dYatMyER3QeHCxAbgwe4kr9le+jQerM7ZLmV+gBQcbMEmm7wABTdh0/P/U3a 8lmR3DL1hjTPAf2wiHJoBqXh0xBaG04Ez5aKHBLJoxdWx6F+sUlPNi17pEK+kJ/9zf0k 8QrxPfgP3nLBVwMoI8O4W+7T2z/nz5g0D9OUo= Received: by 10.224.11.136 with SMTP id t8mr5313629qat.228.1239541558740; Sun, 12 Apr 2009 06:05:58 -0700 (PDT) Received: from kan.dnsalias.net (c-98-217-224-113.hsd1.ma.comcast.net [98.217.224.113]) by mx.google.com with ESMTPS id 7sm6258171qwb.31.2009.04.12.06.05.57 (version=SSLv3 cipher=RC4-MD5); Sun, 12 Apr 2009 06:05:58 -0700 (PDT) Date: Sun, 12 Apr 2009 09:05:51 -0400 From: Alexander Kabaev To: Christoph Mallon Message-ID: <20090412090551.176f327c@kan.dnsalias.net> In-Reply-To: <49E1E01C.90704@gmx.de> References: <200904111401.n3BE1108088009@svn.freebsd.org> <20090411163528.GC46526@troutmask.apl.washington.edu> <20090411124335.0600a72f@kan.dnsalias.net> <49E1E01C.90704@gmx.de> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.14.7; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/sq08_vM1+Gby3ShgmOFNVC+"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r190919 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 13:06:01 -0000 --Sig_/sq08_vM1+Gby3ShgmOFNVC+ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sun, 12 Apr 2009 14:35:40 +0200 Christoph Mallon wrote: > Alexander Kabaev schrieb: > > On Sat, 11 Apr 2009 09:35:28 -0700 > > Steve Kargl wrote: > >=20 > >> On Sat, Apr 11, 2009 at 02:01:01PM +0000, Ed Schouten wrote: > >>> Author: ed > >>> Date: Sat Apr 11 14:01:01 2009 > >>> New Revision: 190919 > >>> URL: http://svn.freebsd.org/changeset/base/190919 > >>> > >>> Log: > >>> Simplify in/out functions (for i386 and AMD64). > >>> =20 > >>> Remove a hack to generate more efficient code for port numbers > >>> below 0x100, which has been obsolete for at least ten years, > >>> because GCC has an asm constraint to specify that. > >>> =20 > >>> Submitted by: Christoph Mallon > >>> > >> I thought Christoph and bde were still hashing out the correctness > >> of this patch. > >> > >> http://lists.freebsd.org/pipermail/freebsd-amd64/2009-April/012064.html > >> > >> --=20 > >> Steve > >=20 > > The patch is inconsistent in regards to usage of volatile vs. > > __volatile even within itself. I think the code is sloppy and was > > not ready to be committed yet. Please fix or back out. >=20 > Backing it out because of two underscores (!) would be=20 > counterproductive: It removes about 150 lines of hard to read hacks,=20 > which are unnecessary for at least a decade. GCC 2.95, which was=20 > released in 1999 supports the "N" constraint for inline asm. Perhaps=20 > olders do, too, but you cannot get older GCCs from the official site. > Attached is a patch, which replaces all __inline and __volatile in > the touched headers by thir ISO equivalents - again there hasn't been > a reason to use the alternate GCC keywords for at least a decade. > Also "inline" and "volatile" are already used hundreds of times in > sys/. The patch is simply the result of > %s/\<__\(inline\|volatile\)\>/\1/. >=20 > Christoph Underscores as the sole reason for backing out might as well be counterproductive. The real objection was not about underscored though, but about consistency. Your patch was not consistent itself and it left files it touched with unholy mixture of plain and underscored versions sprinkled all over with no apparent system. The way to handle this change was: 1. Prepare functional patch, commit. 2. Prepare underscore removal patch, commit. Both steps require proper review and all reviewer concerns should have been addressed or reviewer should be persuaded to withdraw his objections if any. -- Alexander Kabaev --Sig_/sq08_vM1+Gby3ShgmOFNVC+ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iD8DBQFJ4ec0Q6z1jMm+XZYRApaVAKCcArQ01hWBe530HLrB8DXm0JERkQCfZxRY I9Bidwp3p54apZrxnw78K5A= =KAS/ -----END PGP SIGNATURE----- --Sig_/sq08_vM1+Gby3ShgmOFNVC+-- From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 13:22:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE7911065672; Sun, 12 Apr 2009 13:22:33 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9A558FC19; Sun, 12 Apr 2009 13:22:33 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CDMXYu026385; Sun, 12 Apr 2009 13:22:33 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CDMXwB026375; Sun, 12 Apr 2009 13:22:33 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904121322.n3CDMXwB026375@svn.freebsd.org> From: Robert Watson Date: Sun, 12 Apr 2009 13:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190964 - in head/sys: contrib/pf/net netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 13:22:35 -0000 Author: rwatson Date: Sun Apr 12 13:22:33 2009 New Revision: 190964 URL: http://svn.freebsd.org/changeset/base/190964 Log: Update stats in struct icmpstat and icmp6stat using four new macros: ICMPSTAT_ADD(), ICMPSTAT_INC(), ICMP6STAT_ADD(), and ICMP6STAT_INC(), rather than directly manipulating the fields of these structures across the kernel. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structures. In on case, icmp6stat members are manipulated indirectly, by icmp6_errcount(), and this will require further work to fix for per-CPU stats. MFC after: 3 days Modified: head/sys/contrib/pf/net/pf.c head/sys/netinet/icmp6.h head/sys/netinet/icmp_var.h head/sys/netinet/ip_icmp.c head/sys/netinet6/icmp6.c head/sys/netinet6/mld6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c head/sys/netinet6/raw_ip6.c Modified: head/sys/contrib/pf/net/pf.c ============================================================================== --- head/sys/contrib/pf/net/pf.c Sun Apr 12 11:53:12 2009 (r190963) +++ head/sys/contrib/pf/net/pf.c Sun Apr 12 13:22:33 2009 (r190964) @@ -6647,14 +6647,14 @@ pf_check_proto_cksum(struct mbuf *m, int case IPPROTO_ICMP: { INIT_VNET_INET(curvnet); - V_icmpstat.icps_checksum++; + ICMPSTAT_INC(icps_checksum); break; } #ifdef INET6 case IPPROTO_ICMPV6: { INIT_VNET_INET6(curvnet); - V_icmp6stat.icp6s_checksum++; + ICMP6STAT_INC(icp6s_checksum); break; } #endif /* INET6 */ @@ -6747,11 +6747,11 @@ pf_check_proto_cksum(struct mbuf *m, int UDPSTAT_INC(udps_badsum); break; case IPPROTO_ICMP: - V_icmpstat.icps_checksum++; + ICMPSTAT_INC(icps_checksum); break; #ifdef INET6 case IPPROTO_ICMPV6: - V_icmp6stat.icp6s_checksum++; + ICMP6STAT_INC(icp6s_checksum); break; #endif /* INET6 */ } Modified: head/sys/netinet/icmp6.h ============================================================================== --- head/sys/netinet/icmp6.h Sun Apr 12 11:53:12 2009 (r190963) +++ head/sys/netinet/icmp6.h Sun Apr 12 13:22:33 2009 (r190964) @@ -596,6 +596,11 @@ struct icmp6stat { u_quad_t icp6s_badredirect; /* bad redirect message */ }; +#ifdef _KERNEL +#define ICMP6STAT_ADD(name, val) V_icmp6stat.name += (val) +#define ICMP6STAT_INC(name) ICMP6STAT_ADD(name, 1) +#endif + /* * Names for ICMP sysctl objects */ Modified: head/sys/netinet/icmp_var.h ============================================================================== --- head/sys/netinet/icmp_var.h Sun Apr 12 11:53:12 2009 (r190963) +++ head/sys/netinet/icmp_var.h Sun Apr 12 13:22:33 2009 (r190964) @@ -57,6 +57,11 @@ struct icmpstat { u_long icps_noroute; /* no route back */ }; +#ifdef _KERNEL +#define ICMPSTAT_ADD(name, val) V_icmpstat.name += (val) +#define ICMPSTAT_INC(name) ICMPSTAT_ADD(name, 1) +#endif + /* * Names for ICMP sysctl objects */ Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Sun Apr 12 11:53:12 2009 (r190963) +++ head/sys/netinet/ip_icmp.c Sun Apr 12 13:22:33 2009 (r190964) @@ -180,7 +180,7 @@ icmp_error(struct mbuf *n, int type, int printf("icmp_error(%p, %x, %d)\n", oip, type, code); #endif if (type != ICMP_REDIRECT) - V_icmpstat.icps_error++; + ICMPSTAT_INC(icps_error); /* * Don't send error: * if the original packet was encrypted. @@ -197,7 +197,7 @@ icmp_error(struct mbuf *n, int type, int if (oip->ip_p == IPPROTO_ICMP && type != ICMP_REDIRECT && n->m_len >= oiphlen + ICMP_MINLEN && !ICMP_INFOTYPE(((struct icmp *)((caddr_t)oip + oiphlen))->icmp_type)) { - V_icmpstat.icps_oldicmp++; + ICMPSTAT_INC(icps_oldicmp); goto freeit; } /* Drop if IP header plus 8 bytes is not contignous in first mbuf. */ @@ -257,7 +257,7 @@ stdreply: icmpelen = max(8, min(V_icmp_q */ M_SETFIB(m, M_GETFIB(n)); icp = mtod(m, struct icmp *); - V_icmpstat.icps_outhist[type]++; + ICMPSTAT_INC(icps_outhist[type]); icp->icmp_type = type; if (type == ICMP_REDIRECT) icp->icmp_gwaddr.s_addr = dest; @@ -340,12 +340,12 @@ icmp_input(struct mbuf *m, int off) } #endif if (icmplen < ICMP_MINLEN) { - V_icmpstat.icps_tooshort++; + ICMPSTAT_INC(icps_tooshort); goto freeit; } i = hlen + min(icmplen, ICMP_ADVLENMIN); if (m->m_len < i && (m = m_pullup(m, i)) == 0) { - V_icmpstat.icps_tooshort++; + ICMPSTAT_INC(icps_tooshort); return; } ip = mtod(m, struct ip *); @@ -353,7 +353,7 @@ icmp_input(struct mbuf *m, int off) m->m_data += hlen; icp = mtod(m, struct icmp *); if (in_cksum(m, icmplen)) { - V_icmpstat.icps_checksum++; + ICMPSTAT_INC(icps_checksum); goto freeit; } m->m_len += hlen; @@ -395,7 +395,7 @@ icmp_input(struct mbuf *m, int off) icmpgw.sin_len = sizeof(struct sockaddr_in); icmpgw.sin_family = AF_INET; - V_icmpstat.icps_inhist[icp->icmp_type]++; + ICMPSTAT_INC(icps_inhist[icp->icmp_type]); code = icp->icmp_code; switch (icp->icmp_type) { @@ -460,7 +460,7 @@ icmp_input(struct mbuf *m, int off) */ if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) || icp->icmp_ip.ip_hl < (sizeof(struct ip) >> 2)) { - V_icmpstat.icps_badlen++; + ICMPSTAT_INC(icps_badlen); goto freeit; } icp->icmp_ip.ip_len = ntohs(icp->icmp_ip.ip_len); @@ -483,13 +483,13 @@ icmp_input(struct mbuf *m, int off) break; badcode: - V_icmpstat.icps_badcode++; + ICMPSTAT_INC(icps_badcode); break; case ICMP_ECHO: if (!V_icmpbmcastecho && (m->m_flags & (M_MCAST | M_BCAST)) != 0) { - V_icmpstat.icps_bmcastecho++; + ICMPSTAT_INC(icps_bmcastecho); break; } icp->icmp_type = ICMP_ECHOREPLY; @@ -501,11 +501,11 @@ icmp_input(struct mbuf *m, int off) case ICMP_TSTAMP: if (!V_icmpbmcastecho && (m->m_flags & (M_MCAST | M_BCAST)) != 0) { - V_icmpstat.icps_bmcasttstamp++; + ICMPSTAT_INC(icps_bmcasttstamp); break; } if (icmplen < ICMP_TSLEN) { - V_icmpstat.icps_badlen++; + ICMPSTAT_INC(icps_badlen); break; } icp->icmp_type = ICMP_TSTAMPREPLY; @@ -554,8 +554,8 @@ icmp_input(struct mbuf *m, int off) } reflect: ip->ip_len += hlen; /* since ip_input deducts this */ - V_icmpstat.icps_reflect++; - V_icmpstat.icps_outhist[icp->icmp_type]++; + ICMPSTAT_INC(icps_reflect); + ICMPSTAT_INC(icps_outhist[icp->icmp_type]); icmp_reflect(m); return; @@ -585,7 +585,7 @@ reflect: goto badcode; if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) || icp->icmp_ip.ip_hl < (sizeof(struct ip) >> 2)) { - V_icmpstat.icps_badlen++; + ICMPSTAT_INC(icps_badlen); break; } /* @@ -660,7 +660,7 @@ icmp_reflect(struct mbuf *m) IN_EXPERIMENTAL(ntohl(ip->ip_src.s_addr)) || IN_ZERONET(ntohl(ip->ip_src.s_addr)) ) { m_freem(m); /* Bad return address */ - V_icmpstat.icps_badaddr++; + ICMPSTAT_INC(icps_badaddr); goto done; /* Ip_output() will check for broadcast */ } @@ -729,7 +729,7 @@ icmp_reflect(struct mbuf *m) ia = ip_rtaddr(ip->ip_dst, M_GETFIB(m)); if (ia == NULL) { m_freem(m); - V_icmpstat.icps_noroute++; + ICMPSTAT_INC(icps_noroute); goto done; } match: Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Sun Apr 12 11:53:12 2009 (r190963) +++ head/sys/netinet6/icmp6.c Sun Apr 12 13:22:33 2009 (r190964) @@ -254,14 +254,14 @@ icmp6_error(struct mbuf *m, int type, in int off; int nxt; - V_icmp6stat.icp6s_error++; + ICMP6STAT_INC(icp6s_error); /* count per-type-code statistics */ icmp6_errcount(&V_icmp6stat.icp6s_outerrhist, type, code); #ifdef M_DECRYPTED /*not openbsd*/ if (m->m_flags & M_DECRYPTED) { - V_icmp6stat.icp6s_canterror++; + ICMP6STAT_INC(icp6s_canterror); goto freeit; } #endif @@ -319,7 +319,7 @@ icmp6_error(struct mbuf *m, int type, in IP6_EXTHDR_GET(icp, struct icmp6_hdr *, m, off, sizeof(*icp)); if (icp == NULL) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); return; } #endif @@ -330,7 +330,7 @@ icmp6_error(struct mbuf *m, int type, in * Special case: for redirect (which is * informational) we must not send icmp6 error. */ - V_icmp6stat.icp6s_canterror++; + ICMP6STAT_INC(icp6s_canterror); goto freeit; } else { /* ICMPv6 informational - send the error */ @@ -343,7 +343,7 @@ icmp6_error(struct mbuf *m, int type, in /* Finally, do rate limitation check. */ if (icmp6_ratelimit(&oip6->ip6_src, type, code)) { - V_icmp6stat.icp6s_toofreq++; + ICMP6STAT_INC(icp6s_toofreq); goto freeit; } @@ -384,7 +384,7 @@ icmp6_error(struct mbuf *m, int type, in */ m->m_pkthdr.rcvif = NULL; - V_icmp6stat.icp6s_outhist[type]++; + ICMP6STAT_INC(icp6s_outhist[type]); icmp6_reflect(m, sizeof(struct ip6_hdr)); /* header order: IPv6 - ICMPv6 */ return; @@ -424,7 +424,7 @@ icmp6_input(struct mbuf **mp, int *offp, ip6 = mtod(m, struct ip6_hdr *); if (icmp6len < sizeof(struct icmp6_hdr)) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); goto freeit; } @@ -436,7 +436,7 @@ icmp6_input(struct mbuf **mp, int *offp, #else IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off, sizeof(*icmp6)); if (icmp6 == NULL) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); return IPPROTO_DONE; } #endif @@ -447,7 +447,7 @@ icmp6_input(struct mbuf **mp, int *offp, "ICMP6 checksum error(%d|%x) %s\n", icmp6->icmp6_type, sum, ip6_sprintf(ip6bufs, &ip6->ip6_src))); - V_icmp6stat.icp6s_checksum++; + ICMP6STAT_INC(icp6s_checksum); goto freeit; } @@ -467,7 +467,7 @@ icmp6_input(struct mbuf **mp, int *offp, } } - V_icmp6stat.icp6s_inhist[icmp6->icmp6_type]++; + ICMP6STAT_INC(icp6s_inhist[icmp6->icmp6_type]); icmp6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_msg); if (icmp6->icmp6_type < ICMP6_INFOMSG_MASK) icmp6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_error); @@ -601,8 +601,8 @@ icmp6_input(struct mbuf **mp, int *offp, nicmp6->icmp6_type = ICMP6_ECHO_REPLY; nicmp6->icmp6_code = 0; if (n) { - V_icmp6stat.icp6s_reflect++; - V_icmp6stat.icp6s_outhist[ICMP6_ECHO_REPLY]++; + ICMP6STAT_INC(icp6s_reflect); + ICMP6STAT_INC(icp6s_outhist[ICMP6_ECHO_REPLY]); icmp6_reflect(n, noff); } break; @@ -734,8 +734,8 @@ icmp6_input(struct mbuf **mp, int *offp, } #undef hostnamelen if (n) { - V_icmp6stat.icp6s_reflect++; - V_icmp6stat.icp6s_outhist[ICMP6_WRUREPLY]++; + ICMP6STAT_INC(icp6s_reflect); + ICMP6STAT_INC(icp6s_outhist[ICMP6_WRUREPLY]); icmp6_reflect(n, noff); } break; @@ -856,11 +856,11 @@ icmp6_input(struct mbuf **mp, int *offp, break; badcode: - V_icmp6stat.icp6s_badcode++; + ICMP6STAT_INC(icp6s_badcode); break; badlen: - V_icmp6stat.icp6s_badlen++; + ICMP6STAT_INC(icp6s_badlen); break; } @@ -885,7 +885,7 @@ icmp6_notify_error(struct mbuf **mp, int struct sockaddr_in6 icmp6src, icmp6dst; if (icmp6len < sizeof(struct icmp6_hdr) + sizeof(struct ip6_hdr)) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); goto freeit; } #ifndef PULLDOWN_TEST @@ -896,7 +896,7 @@ icmp6_notify_error(struct mbuf **mp, int IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off, sizeof(*icmp6) + sizeof(struct ip6_hdr)); if (icmp6 == NULL) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); return (-1); } #endif @@ -931,7 +931,7 @@ icmp6_notify_error(struct mbuf **mp, int IP6_EXTHDR_GET(eh, struct ip6_ext *, m, eoff, sizeof(*eh)); if (eh == NULL) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); return (-1); } #endif @@ -959,7 +959,7 @@ icmp6_notify_error(struct mbuf **mp, int IP6_EXTHDR_GET(rth, struct ip6_rthdr *, m, eoff, sizeof(*rth)); if (rth == NULL) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); return (-1); } #endif @@ -985,7 +985,7 @@ icmp6_notify_error(struct mbuf **mp, int struct ip6_rthdr0 *, m, eoff, rthlen); if (rth0 == NULL) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); return (-1); } #endif @@ -1007,7 +1007,7 @@ icmp6_notify_error(struct mbuf **mp, int IP6_EXTHDR_GET(fh, struct ip6_frag *, m, eoff, sizeof(*fh)); if (fh == NULL) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); return (-1); } #endif @@ -1042,7 +1042,7 @@ icmp6_notify_error(struct mbuf **mp, int IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off, sizeof(*icmp6) + sizeof(struct ip6_hdr)); if (icmp6 == NULL) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); return (-1); } #endif @@ -1156,7 +1156,7 @@ icmp6_mtudisc_update(struct ip6ctlparam if (mtu < tcp_maxmtu6(&inc, NULL)) { tcp_hc_updatemtu(&inc, mtu); - V_icmp6stat.icp6s_pmtuchg++; + ICMP6STAT_INC(icp6s_pmtuchg); } } @@ -2276,7 +2276,7 @@ icmp6_redirect_input(struct mbuf *m, int #else IP6_EXTHDR_GET(nd_rd, struct nd_redirect *, m, off, icmp6len); if (nd_rd == NULL) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); return; } #endif @@ -2439,7 +2439,7 @@ icmp6_redirect_input(struct mbuf *m, int return; bad: - V_icmp6stat.icp6s_badredirect++; + ICMP6STAT_INC(icp6s_badredirect); m_freem(m); } @@ -2715,7 +2715,7 @@ noredhdropt:; icmp6_ifstat_inc(outif, ifs6_out_msg); icmp6_ifstat_inc(outif, ifs6_out_redirect); } - V_icmp6stat.icp6s_outhist[ND_REDIRECT]++; + ICMP6STAT_INC(icp6s_outhist[ND_REDIRECT]); return; Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Sun Apr 12 11:53:12 2009 (r190963) +++ head/sys/netinet6/mld6.c Sun Apr 12 13:22:33 2009 (r190964) @@ -288,7 +288,7 @@ mld6_input(struct mbuf *m, int off) #else IP6_EXTHDR_GET(mldh, struct mld_hdr *, m, off, sizeof(*mldh)); if (mldh == NULL) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); return; } #endif @@ -517,7 +517,7 @@ mld6_sendpkt(struct in6_multi *in6m, int im6o.im6o_multicast_loop = (ip6_mrouter != NULL); /* increment output statictics */ - V_icmp6stat.icp6s_outhist[type]++; + ICMP6STAT_INC(icp6s_outhist[type]); ip6_output(mh, &V_ip6_opts, NULL, 0, &im6o, &outif, NULL); if (outif) { Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sun Apr 12 11:53:12 2009 (r190963) +++ head/sys/netinet6/nd6.c Sun Apr 12 13:22:33 2009 (r190964) @@ -374,7 +374,7 @@ nd6_options(union nd_opts *ndopts) * Message validation requires that all included * options have a length that is greater than zero. */ - V_icmp6stat.icp6s_nd_badopt++; + ICMP6STAT_INC(icp6s_nd_badopt); bzero(ndopts, sizeof(*ndopts)); return -1; } @@ -418,7 +418,7 @@ nd6_options(union nd_opts *ndopts) skip1: i++; if (i > V_nd6_maxndopt) { - V_icmp6stat.icp6s_nd_toomanyopt++; + ICMP6STAT_INC(icp6s_nd_toomanyopt); nd6log((LOG_INFO, "too many loop in nd opt\n")); break; } Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Sun Apr 12 11:53:12 2009 (r190963) +++ head/sys/netinet6/nd6_nbr.c Sun Apr 12 13:22:33 2009 (r190964) @@ -128,7 +128,7 @@ nd6_ns_input(struct mbuf *m, int off, in #else IP6_EXTHDR_GET(nd_ns, struct nd_neighbor_solicit *, m, off, icmp6len); if (nd_ns == NULL) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); return; } #endif @@ -365,7 +365,7 @@ nd6_ns_input(struct mbuf *m, int off, in ip6_sprintf(ip6bufs, &daddr6))); nd6log((LOG_ERR, "nd6_ns_input: tgt=%s\n", ip6_sprintf(ip6bufs, &taddr6))); - V_icmp6stat.icp6s_badns++; + ICMP6STAT_INC(icp6s_badns); m_freem(m); } @@ -563,7 +563,7 @@ nd6_ns_output(struct ifnet *ifp, const s ip6_output(m, NULL, &ro, dad ? IPV6_UNSPECSRC : 0, &im6o, NULL, NULL); icmp6_ifstat_inc(ifp, ifs6_out_msg); icmp6_ifstat_inc(ifp, ifs6_out_neighborsolicit); - V_icmp6stat.icp6s_outhist[ND_NEIGHBOR_SOLICIT]++; + ICMP6STAT_INC(icp6s_outhist[ND_NEIGHBOR_SOLICIT]); if (ro.ro_rt) { /* we don't cache this route. */ RTFREE(ro.ro_rt); @@ -625,7 +625,7 @@ nd6_na_input(struct mbuf *m, int off, in #else IP6_EXTHDR_GET(nd_na, struct nd_neighbor_advert *, m, off, icmp6len); if (nd_na == NULL) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); return; } #endif @@ -897,7 +897,7 @@ nd6_na_input(struct mbuf *m, int off, in if (ln != NULL) LLE_WUNLOCK(ln); - V_icmp6stat.icp6s_badna++; + ICMP6STAT_INC(icp6s_badna); m_freem(m); } @@ -1065,7 +1065,7 @@ nd6_na_output(struct ifnet *ifp, const s ip6_output(m, NULL, &ro, 0, &im6o, NULL, NULL); icmp6_ifstat_inc(ifp, ifs6_out_msg); icmp6_ifstat_inc(ifp, ifs6_out_neighboradvert); - V_icmp6stat.icp6s_outhist[ND_NEIGHBOR_ADVERT]++; + ICMP6STAT_INC(icp6s_outhist[ND_NEIGHBOR_ADVERT]); if (ro.ro_rt) { /* we don't cache this route. */ RTFREE(ro.ro_rt); Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Sun Apr 12 11:53:12 2009 (r190963) +++ head/sys/netinet6/nd6_rtr.c Sun Apr 12 13:22:33 2009 (r190964) @@ -155,7 +155,7 @@ nd6_rs_input(struct mbuf *m, int off, in #else IP6_EXTHDR_GET(nd_rs, struct nd_router_solicit *, m, off, icmp6len); if (nd_rs == NULL) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); return; } #endif @@ -190,7 +190,7 @@ nd6_rs_input(struct mbuf *m, int off, in return; bad: - V_icmp6stat.icp6s_badrs++; + ICMP6STAT_INC(icp6s_badrs); m_freem(m); } @@ -246,7 +246,7 @@ nd6_ra_input(struct mbuf *m, int off, in #else IP6_EXTHDR_GET(nd_ra, struct nd_router_advert *, m, off, icmp6len); if (nd_ra == NULL) { - V_icmp6stat.icp6s_tooshort++; + ICMP6STAT_INC(icp6s_tooshort); return; } #endif @@ -422,7 +422,7 @@ nd6_ra_input(struct mbuf *m, int off, in return; bad: - V_icmp6stat.icp6s_badra++; + ICMP6STAT_INC(icp6s_badra); m_freem(m); } Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Sun Apr 12 11:53:12 2009 (r190963) +++ head/sys/netinet6/raw_ip6.c Sun Apr 12 13:22:33 2009 (r190964) @@ -477,7 +477,7 @@ rip6_output(m, va_alist) if (so->so_proto->pr_protocol == IPPROTO_ICMPV6) { if (oifp) icmp6_ifoutstat_inc(oifp, type, code); - V_icmp6stat.icp6s_outhist[type]++; + ICMP6STAT_INC(icp6s_outhist[type]); } else V_rip6stat.rip6s_opackets++; From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 13:23:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53ADF106566B for ; Sun, 12 Apr 2009 13:23:42 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id C80228FC19 for ; Sun, 12 Apr 2009 13:23:41 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 12 Apr 2009 13:23:40 -0000 Received: from p54A3F1BC.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.241.188] by mail.gmx.net (mp005) with SMTP; 12 Apr 2009 15:23:40 +0200 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1+DSPUA6x+DuELKXzp+w/gFNvfZw7pIA61pY/uyQf KPoCGdY12JY+Mw Message-ID: <49E1EB5A.9010303@gmx.de> Date: Sun, 12 Apr 2009 15:23:38 +0200 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Alexander Kabaev References: <200904111401.n3BE1108088009@svn.freebsd.org> <20090411163528.GC46526@troutmask.apl.washington.edu> <20090411124335.0600a72f@kan.dnsalias.net> <49E1E01C.90704@gmx.de> <20090412090551.176f327c@kan.dnsalias.net> In-Reply-To: <20090412090551.176f327c@kan.dnsalias.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.48 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r190919 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 13:23:42 -0000 Alexander Kabaev schrieb: > On Sun, 12 Apr 2009 14:35:40 +0200 > Christoph Mallon wrote: > >> Alexander Kabaev schrieb: >>> On Sat, 11 Apr 2009 09:35:28 -0700 >>> Steve Kargl wrote: >>> >>>> On Sat, Apr 11, 2009 at 02:01:01PM +0000, Ed Schouten wrote: >>>>> Author: ed >>>>> Date: Sat Apr 11 14:01:01 2009 >>>>> New Revision: 190919 >>>>> URL: http://svn.freebsd.org/changeset/base/190919 >>>>> >>>>> Log: >>>>> Simplify in/out functions (for i386 and AMD64). >>>>> >>>>> Remove a hack to generate more efficient code for port numbers >>>>> below 0x100, which has been obsolete for at least ten years, >>>>> because GCC has an asm constraint to specify that. >>>>> >>>>> Submitted by: Christoph Mallon >>>>> >>>> I thought Christoph and bde were still hashing out the correctness >>>> of this patch. >>>> >>>> http://lists.freebsd.org/pipermail/freebsd-amd64/2009-April/012064.html >>>> >>>> -- >>>> Steve >>> The patch is inconsistent in regards to usage of volatile vs. >>> __volatile even within itself. I think the code is sloppy and was >>> not ready to be committed yet. Please fix or back out. >> Backing it out because of two underscores (!) would be >> counterproductive: It removes about 150 lines of hard to read hacks, >> which are unnecessary for at least a decade. GCC 2.95, which was >> released in 1999 supports the "N" constraint for inline asm. Perhaps >> olders do, too, but you cannot get older GCCs from the official site. >> Attached is a patch, which replaces all __inline and __volatile in ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> the touched headers by thir ISO equivalents - again there hasn't been ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> a reason to use the alternate GCC keywords for at least a decade. >> Also "inline" and "volatile" are already used hundreds of times in >> sys/. The patch is simply the result of >> %s/\<__\(inline\|volatile\)\>/\1/. >> >> Christoph > > Underscores as the sole reason for backing out might as well be > counterproductive. The real objection was not about underscored > though, but about consistency. Your patch was not consistent itself > and it left files it touched with unholy mixture of plain and We are all doomed! I can almost see the horsemen of apocalypse appearing at the edge of the horizon! You're a /tad/ histrionic. > underscored versions sprinkled all over with no apparent system. > > The way to handle this change was: > 1. Prepare functional patch, commit. > 2. Prepare underscore removal patch, commit. Did you stop reading at the colon of the first sentence? I marked the relevant part above with "^". Christoph From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 13:39:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB8941065677; Sun, 12 Apr 2009 13:39:28 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by mx1.freebsd.org (Postfix) with ESMTP id 344AD8FC13; Sun, 12 Apr 2009 13:39:28 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by qw-out-2122.google.com with SMTP id 9so1132427qwb.7 for ; Sun, 12 Apr 2009 06:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=WJ6s2xddIXj70uWR1s9Iq8MglkmIdvllXAa3SYu5wps=; b=DV2K7i2pexJ/TOjQTxgaghc7i5CUxWUFYdDazvhWwqpWq2cllG8OuuSlyN73oYybon 3cNvQ9WzPs2Pjx0pa6ZvE7l9ujNQRZ8bM9Dmj2brlKlPflA43WLS130dRzKWJWWuU0qm mrZ7vGqbAQ9QRmE95ccLYXdXQiI/D0o4jJPQs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=Tiyebrz4+hQMS7zZKU9jGlCRRmp1FNz+ZpY2aSdpBlS8VE4t7i9vRI+GkA3cl3C7nY zmk9uWNIz7BWmtPFglm4X6MCyhZNOiOBnMD3XEGbxCTw8LvnFynnTsjf9GGpOF1IohiC i3p+n9wbvQKcK3su8biMGB5zS9CtcGKEzTRMQ= Received: by 10.224.45.134 with SMTP id e6mr5342302qaf.41.1239543567640; Sun, 12 Apr 2009 06:39:27 -0700 (PDT) Received: from kan.dnsalias.net (c-98-217-224-113.hsd1.ma.comcast.net [98.217.224.113]) by mx.google.com with ESMTPS id 7sm2923896qwf.29.2009.04.12.06.39.26 (version=SSLv3 cipher=RC4-MD5); Sun, 12 Apr 2009 06:39:27 -0700 (PDT) Date: Sun, 12 Apr 2009 09:39:21 -0400 From: Alexander Kabaev To: Christoph Mallon Message-ID: <20090412093921.37dbbdbe@kan.dnsalias.net> In-Reply-To: <49E1EB5A.9010303@gmx.de> References: <200904111401.n3BE1108088009@svn.freebsd.org> <20090411163528.GC46526@troutmask.apl.washington.edu> <20090411124335.0600a72f@kan.dnsalias.net> <49E1E01C.90704@gmx.de> <20090412090551.176f327c@kan.dnsalias.net> <49E1EB5A.9010303@gmx.de> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.14.7; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/Dgmu+VP4gev7qlJ+PwrU5Hw"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r190919 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 13:39:29 -0000 --Sig_/Dgmu+VP4gev7qlJ+PwrU5Hw Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sun, 12 Apr 2009 15:23:38 +0200 Christoph Mallon wrote: > Alexander Kabaev schrieb: > > On Sun, 12 Apr 2009 14:35:40 +0200 > > Christoph Mallon wrote: > >=20 > >> Alexander Kabaev schrieb: > >>> On Sat, 11 Apr 2009 09:35:28 -0700 > >>> Steve Kargl wrote: > >>> > >>>> On Sat, Apr 11, 2009 at 02:01:01PM +0000, Ed Schouten wrote: > >>>>> Author: ed > >>>>> Date: Sat Apr 11 14:01:01 2009 > >>>>> New Revision: 190919 > >>>>> URL: http://svn.freebsd.org/changeset/base/190919 > >>>>> > >>>>> Log: > >>>>> Simplify in/out functions (for i386 and AMD64). > >>>>> =20 > >>>>> Remove a hack to generate more efficient code for port numbers > >>>>> below 0x100, which has been obsolete for at least ten years, > >>>>> because GCC has an asm constraint to specify that. > >>>>> =20 > >>>>> Submitted by: Christoph Mallon >>>>> de> > >>>>> > >>>> I thought Christoph and bde were still hashing out the > >>>> correctness of this patch. > >>>> > >>>> http://lists.freebsd.org/pipermail/freebsd-amd64/2009-April/012064.h= tml > >>>> > >>>> --=20 > >>>> Steve > >>> The patch is inconsistent in regards to usage of volatile vs. > >>> __volatile even within itself. I think the code is sloppy and was > >>> not ready to be committed yet. Please fix or back out. > >> Backing it out because of two underscores (!) would be=20 > >> counterproductive: It removes about 150 lines of hard to read > >> hacks, which are unnecessary for at least a decade. GCC 2.95, > >> which was released in 1999 supports the "N" constraint for inline > >> asm. Perhaps olders do, too, but you cannot get older GCCs from > >> the official site. Attached is a patch, which replaces all > >> __inline and __volatile in > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >> the touched headers by thir ISO equivalents - again there hasn't > >> been > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >> a reason to use the alternate GCC keywords for at least a decade. > >> Also "inline" and "volatile" are already used hundreds of times in > >> sys/. The patch is simply the result of > >> %s/\<__\(inline\|volatile\)\>/\1/. > >> > >> Christoph > >=20 > > Underscores as the sole reason for backing out might as well be > > counterproductive. The real objection was not about underscored > > though, but about consistency. Your patch was not consistent itself > > and it left files it touched with unholy mixture of plain and >=20 > We are all doomed! I can almost see the horsemen of apocalypse > appearing at the edge of the horizon! > You're a /tad/ histrionic. > Thank you for being so constructive. If little things like maintaining file consistency and adhering to established style are too strict and limit your creativity too much, maybe you should reconsider working on projects with > 1 person involved. =20 > > underscored versions sprinkled all over with no apparent system. > >=20 > > The way to handle this change was: > > 1. Prepare functional patch, commit. > > 2. Prepare underscore removal patch, commit. >=20 > Did you stop reading at the colon of the first sentence? I marked the=20 > relevant part above with "^". >=20 Should your patch today have stopped me from posting objection yesterday? I do appreciate your lecture on GCC versions and features that made code hacks obsolete. I would appreciate it even more it it was at lest tiny bit relevant to what I objected initially. --=20 Alexander Kabaev --Sig_/Dgmu+VP4gev7qlJ+PwrU5Hw Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iD8DBQFJ4e8NQ6z1jMm+XZYRAgb2AKDo5nOCLo4j96BmU6aDuK/feTvc5wCfYwaI BPZyqPO7J1ONy9zoFQOIk1g= =GvRz -----END PGP SIGNATURE----- --Sig_/Dgmu+VP4gev7qlJ+PwrU5Hw-- From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 13:41:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5AE2106566C; Sun, 12 Apr 2009 13:41:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B324F8FC18; Sun, 12 Apr 2009 13:41:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CDfDQB026856; Sun, 12 Apr 2009 13:41:13 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CDfDhR026854; Sun, 12 Apr 2009 13:41:13 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904121341.n3CDfDhR026854@svn.freebsd.org> From: Robert Watson Date: Sun, 12 Apr 2009 13:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190965 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 13:41:14 -0000 Author: rwatson Date: Sun Apr 12 13:41:13 2009 New Revision: 190965 URL: http://svn.freebsd.org/changeset/base/190965 Log: Update stats in struct igmpstat using two new macros: IGMPSTAT_ADD() and IGMPSTAT_INC(), rather than directly manipulating the fields of the structure. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structures. MFC after: 3 days Modified: head/sys/netinet/igmp.c head/sys/netinet/igmp_var.h Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Sun Apr 12 13:22:33 2009 (r190964) +++ head/sys/netinet/igmp.c Sun Apr 12 13:41:13 2009 (r190965) @@ -762,11 +762,11 @@ igmp_input_v1_query(struct ifnet *ifp, c * daemon may wish to see it. */ if (!in_allhosts(ip->ip_dst)) { - ++V_igmpstat.igps_rcv_badqueries; + IGMPSTAT_INC(igps_rcv_badqueries); return (0); } - ++V_igmpstat.igps_rcv_gen_queries; + IGMPSTAT_INC(igps_rcv_gen_queries); /* * Switch to IGMPv1 host compatibility mode. @@ -875,7 +875,7 @@ igmp_input_v2_query(struct ifnet *ifp, c inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); igmp_v2_update_group(inm, timer); } - ++V_igmpstat.igps_rcv_group_queries; + IGMPSTAT_INC(igps_rcv_group_queries); } else { /* * IGMPv2 General Query. @@ -900,7 +900,7 @@ igmp_input_v2_query(struct ifnet *ifp, c } IF_ADDR_UNLOCK(ifp); } - ++V_igmpstat.igps_rcv_gen_queries; + IGMPSTAT_INC(igps_rcv_gen_queries); } out_locked: @@ -1041,7 +1041,7 @@ igmp_input_v3_query(struct ifnet *ifp, c * Schedule a current-state report on this ifp for * all groups, possibly containing source lists. */ - ++V_igmpstat.igps_rcv_gen_queries; + IGMPSTAT_INC(igps_rcv_gen_queries); if (!in_allhosts(ip->ip_dst) || nsrc > 0) { /* @@ -1049,7 +1049,7 @@ igmp_input_v3_query(struct ifnet *ifp, c * A general query with a source list has undefined * behaviour; discard it. */ - ++V_igmpstat.igps_rcv_badqueries; + IGMPSTAT_INC(igps_rcv_badqueries); goto out_locked; } @@ -1079,16 +1079,16 @@ igmp_input_v3_query(struct ifnet *ifp, c if (inm == NULL) goto out_locked; if (nsrc > 0) { - ++V_igmpstat.igps_rcv_gsr_queries; + IGMPSTAT_INC(igps_rcv_gsr_queries); if (!ratecheck(&inm->inm_lastgsrtv, &V_igmp_gsrdelay)) { CTR1(KTR_IGMPV3, "%s: GS query throttled.", __func__); - ++V_igmpstat.igps_drop_gsr_queries; + IGMPSTAT_INC(igps_drop_gsr_queries); goto out_locked; } } else { - ++V_igmpstat.igps_rcv_group_queries; + IGMPSTAT_INC(igps_rcv_group_queries); } CTR3(KTR_IGMPV3, "process v3 %s query on ifp %p(%s)", inet_ntoa(igmpv3->igmp_group), ifp, ifp->if_xname); @@ -1224,14 +1224,14 @@ igmp_input_v1_report(struct ifnet *ifp, struct in_ifaddr *ia; struct in_multi *inm; - ++V_igmpstat.igps_rcv_reports; + IGMPSTAT_INC(igps_rcv_reports); if (ifp->if_flags & IFF_LOOPBACK) return (0); if (!IN_MULTICAST(ntohl(igmp->igmp_group.s_addr) || !in_hosteq(igmp->igmp_group, ip->ip_dst))) { - ++V_igmpstat.igps_rcv_badreports; + IGMPSTAT_INC(igps_rcv_badreports); return (EINVAL); } @@ -1268,7 +1268,7 @@ igmp_input_v1_report(struct ifnet *ifp, goto out_locked; } - ++V_igmpstat.igps_rcv_ourreports; + IGMPSTAT_INC(igps_rcv_ourreports); /* * If we are in IGMPv3 host mode, do not allow the @@ -1339,14 +1339,14 @@ igmp_input_v2_report(struct ifnet *ifp, if (ia != NULL && in_hosteq(ip->ip_src, IA_SIN(ia)->sin_addr)) return (0); - ++V_igmpstat.igps_rcv_reports; + IGMPSTAT_INC(igps_rcv_reports); if (ifp->if_flags & IFF_LOOPBACK) return (0); if (!IN_MULTICAST(ntohl(igmp->igmp_group.s_addr)) || !in_hosteq(igmp->igmp_group, ip->ip_dst)) { - ++V_igmpstat.igps_rcv_badreports; + IGMPSTAT_INC(igps_rcv_badreports); return (EINVAL); } @@ -1379,7 +1379,7 @@ igmp_input_v2_report(struct ifnet *ifp, igi = inm->inm_igi; KASSERT(igi != NULL, ("%s: no igi for ifp %p", __func__, ifp)); - ++V_igmpstat.igps_rcv_ourreports; + IGMPSTAT_INC(igps_rcv_ourreports); /* * If we are in IGMPv3 host mode, do not allow the @@ -1437,7 +1437,7 @@ igmp_input(struct mbuf *m, int off) ifp = m->m_pkthdr.rcvif; INIT_VNET_INET(ifp->if_vnet); - ++V_igmpstat.igps_rcv_total; + IGMPSTAT_INC(igps_rcv_total); ip = mtod(m, struct ip *); iphlen = off; @@ -1447,7 +1447,7 @@ igmp_input(struct mbuf *m, int off) * Validate lengths. */ if (igmplen < IGMP_MINLEN) { - ++V_igmpstat.igps_rcv_tooshort; + IGMPSTAT_INC(igps_rcv_tooshort); m_freem(m); return; } @@ -1463,13 +1463,13 @@ igmp_input(struct mbuf *m, int off) minlen += IGMP_MINLEN; if ((m->m_flags & M_EXT || m->m_len < minlen) && (m = m_pullup(m, minlen)) == 0) { - ++V_igmpstat.igps_rcv_tooshort; + IGMPSTAT_INC(igps_rcv_tooshort); return; } ip = mtod(m, struct ip *); if (ip->ip_ttl != 1) { - ++V_igmpstat.igps_rcv_badttl; + IGMPSTAT_INC(igps_rcv_badttl); m_freem(m); return; } @@ -1481,7 +1481,7 @@ igmp_input(struct mbuf *m, int off) m->m_len -= iphlen; igmp = mtod(m, struct igmp *); if (in_cksum(m, igmplen)) { - ++V_igmpstat.igps_rcv_badsum; + IGMPSTAT_INC(igps_rcv_badsum); m_freem(m); return; } @@ -1498,14 +1498,14 @@ igmp_input(struct mbuf *m, int off) } else if (igmplen >= IGMP_V3_QUERY_MINLEN) { queryver = IGMP_VERSION_3; } else { - ++V_igmpstat.igps_rcv_tooshort; + IGMPSTAT_INC(igps_rcv_tooshort); m_freem(m); return; } switch (queryver) { case IGMP_VERSION_1: - ++V_igmpstat.igps_rcv_v1v2_queries; + IGMPSTAT_INC(igps_rcv_v1v2_queries); if (!V_igmp_v1enable) break; if (igmp_input_v1_query(ifp, ip) != 0) { @@ -1515,7 +1515,7 @@ igmp_input(struct mbuf *m, int off) break; case IGMP_VERSION_2: - ++V_igmpstat.igps_rcv_v1v2_queries; + IGMPSTAT_INC(igps_rcv_v1v2_queries); if (!V_igmp_v2enable) break; if (igmp_input_v2_query(ifp, ip, igmp) != 0) { @@ -1530,7 +1530,7 @@ igmp_input(struct mbuf *m, int off) uint16_t srclen; int nsrc; - ++V_igmpstat.igps_rcv_v3_queries; + IGMPSTAT_INC(igps_rcv_v3_queries); igmpv3 = (struct igmpv3 *)igmp; /* * Validate length based on source count. @@ -1538,7 +1538,7 @@ igmp_input(struct mbuf *m, int off) nsrc = ntohs(igmpv3->igmp_numsrc); srclen = sizeof(struct in_addr) * nsrc; if (nsrc * sizeof(in_addr_t) > srclen) { - ++V_igmpstat.igps_rcv_tooshort; + IGMPSTAT_INC(igps_rcv_tooshort); return; } /* @@ -1550,7 +1550,7 @@ igmp_input(struct mbuf *m, int off) if ((m->m_flags & M_EXT || m->m_len < igmpv3len) && (m = m_pullup(m, igmpv3len)) == NULL) { - ++V_igmpstat.igps_rcv_tooshort; + IGMPSTAT_INC(igps_rcv_tooshort); return; } igmpv3 = (struct igmpv3 *)(mtod(m, uint8_t *) @@ -1577,7 +1577,7 @@ igmp_input(struct mbuf *m, int off) if (!V_igmp_v2enable) break; if (!ip_checkrouteralert(m)) - ++V_igmpstat.igps_rcv_nora; + IGMPSTAT_INC(igps_rcv_nora); if (igmp_input_v2_report(ifp, ip, igmp) != 0) { m_freem(m); return; @@ -1590,7 +1590,7 @@ igmp_input(struct mbuf *m, int off) * as report suppression is no longer required. */ if (!ip_checkrouteralert(m)) - ++V_igmpstat.igps_rcv_nora; + IGMPSTAT_INC(igps_rcv_nora); break; default: @@ -3458,7 +3458,7 @@ igmp_intr(struct mbuf *m) goto out; } - ++V_igmpstat.igps_snd_reports; + IGMPSTAT_INC(igps_snd_reports); out: /* Modified: head/sys/netinet/igmp_var.h ============================================================================== --- head/sys/netinet/igmp_var.h Sun Apr 12 13:22:33 2009 (r190964) +++ head/sys/netinet/igmp_var.h Sun Apr 12 13:41:13 2009 (r190965) @@ -106,6 +106,11 @@ struct igmpstat { #define IGPS_VERSION_3 3 /* as of FreeBSD 8.x */ #define IGPS_VERSION3_LEN 168 +#ifdef _KERNEL +#define IGMPSTAT_ADD(name, val) V_igmpstat.name += (val) +#define IGMPSTAT_INC(name) IGMPSTAT_ADD(name, 1) +#endif + #ifdef CTASSERT CTASSERT(sizeof(struct igmpstat) == 168); #endif From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 14:00:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 646D31065674; Sun, 12 Apr 2009 14:00:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 521A78FC1F; Sun, 12 Apr 2009 14:00:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CE0aBl027346; Sun, 12 Apr 2009 14:00:36 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CE0aiO027344; Sun, 12 Apr 2009 14:00:36 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904121400.n3CE0aiO027344@svn.freebsd.org> From: Robert Watson Date: Sun, 12 Apr 2009 14:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190966 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 14:00:37 -0000 Author: rwatson Date: Sun Apr 12 14:00:36 2009 New Revision: 190966 URL: http://svn.freebsd.org/changeset/base/190966 Log: Update stats in struct mrtstat using two new macros: MRTSTAT_ADD() and MRTSTAT_INC(), rather than directly manipulating the fields of the structure. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structure. MFC after: 3 days Modified: head/sys/netinet/ip_mroute.c head/sys/netinet/ip_mroute.h Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Sun Apr 12 13:41:13 2009 (r190965) +++ head/sys/netinet/ip_mroute.c Sun Apr 12 14:00:36 2009 (r190966) @@ -1266,7 +1266,7 @@ X_ip_mforward(struct ip *ip, struct ifne /* * Determine forwarding vifs from the forwarding cache table */ - ++mrtstat.mrts_mfc_lookups; + MRTSTAT_INC(mrts_mfc_lookups); rt = mfc_find(&ip->ip_src, &ip->ip_dst); /* Entry exists, so forward if necessary */ @@ -1286,9 +1286,8 @@ X_ip_mforward(struct ip *ip, struct ifne u_long hash; int hlen = ip->ip_hl << 2; - ++mrtstat.mrts_mfc_misses; - - mrtstat.mrts_no_route++; + MRTSTAT_INC(mrts_mfc_misses); + MRTSTAT_INC(mrts_no_route); CTR2(KTR_IPMF, "ip_mforward: no mfc for (%s,%lx)", inet_ntoa(ip->ip_src), (u_long)ntohl(ip->ip_dst.s_addr)); @@ -1360,12 +1359,12 @@ X_ip_mforward(struct ip *ip, struct ifne im->im_mbz = 0; im->im_vif = vifi; - mrtstat.mrts_upcalls++; + MRTSTAT_INC(mrts_upcalls); k_igmpsrc.sin_addr = ip->ip_src; if (socket_send(V_ip_mrouter, mm, &k_igmpsrc) < 0) { CTR0(KTR_IPMF, "ip_mforward: socket queue full"); - ++mrtstat.mrts_upq_sockfull; + MRTSTAT_INC(mrts_upq_sockfull); fail1: free(rt, M_MRTABLE); fail: @@ -1399,7 +1398,7 @@ fail: } else { /* determine if queue has overflowed */ if (rt->mfc_nstall > MAX_UPQ) { - mrtstat.mrts_upq_ovflw++; + MRTSTAT_INC(mrts_upq_ovflw); non_fatal: free(rte, M_MRTABLE); m_freem(mb0); @@ -1456,7 +1455,7 @@ expire_upcalls(void *unused) free(x, M_BWMETER); } - ++mrtstat.mrts_cache_cleanups; + MRTSTAT_INC(mrts_cache_cleanups); CTR3(KTR_IPMF, "%s: expire (%lx, %lx)", __func__, (u_long)ntohl(rt->mfc_origin.s_addr), (u_long)ntohl(rt->mfc_mcastgrp.s_addr)); @@ -1503,7 +1502,7 @@ ip_mdq(struct mbuf *m, struct ifnet *ifp if ((vifi >= numvifs) || (viftable[vifi].v_ifp != ifp)) { CTR4(KTR_IPMF, "%s: rx on wrong ifp %p (vifi %d, v_ifp %p)", __func__, ifp, (int)vifi, viftable[vifi].v_ifp); - ++mrtstat.mrts_wrong_if; + MRTSTAT_INC(mrts_wrong_if); ++rt->mfc_wrong_if; /* * If we are doing PIM assert processing, send a message @@ -1543,12 +1542,12 @@ ip_mdq(struct mbuf *m, struct ifnet *ifp im->im_mbz = 0; im->im_vif = vifi; - mrtstat.mrts_upcalls++; + MRTSTAT_INC(mrts_upcalls); k_igmpsrc.sin_addr = im->im_src; if (socket_send(V_ip_mrouter, mm, &k_igmpsrc) < 0) { CTR1(KTR_IPMF, "%s: socket queue full", __func__); - ++mrtstat.mrts_upq_sockfull; + MRTSTAT_INC(mrts_upq_sockfull); return ENOBUFS; } } @@ -2082,10 +2081,10 @@ bw_upcalls_send(void) * Send the upcalls * XXX do we need to set the address in k_igmpsrc ? */ - mrtstat.mrts_upcalls++; + MRTSTAT_INC(mrts_upcalls); if (socket_send(V_ip_mrouter, m, &k_igmpsrc) < 0) { log(LOG_WARNING, "bw_upcalls_send: ip_mrouter socket queue full\n"); - ++mrtstat.mrts_upq_sockfull; + MRTSTAT_INC(mrts_upq_sockfull); } } @@ -2432,11 +2431,11 @@ pim_register_send_upcall(struct ip *ip, k_igmpsrc.sin_addr = ip->ip_src; - mrtstat.mrts_upcalls++; + MRTSTAT_INC(mrts_upcalls); if (socket_send(V_ip_mrouter, mb_first, &k_igmpsrc) < 0) { CTR1(KTR_IPMF, "%s: socket queue full", __func__); - ++mrtstat.mrts_upq_sockfull; + MRTSTAT_INC(mrts_upq_sockfull); return ENOBUFS; } Modified: head/sys/netinet/ip_mroute.h ============================================================================== --- head/sys/netinet/ip_mroute.h Sun Apr 12 13:41:13 2009 (r190965) +++ head/sys/netinet/ip_mroute.h Sun Apr 12 14:00:36 2009 (r190966) @@ -221,6 +221,11 @@ struct mrtstat { u_long mrts_upq_sockfull; /* upcalls dropped - socket full */ }; +#ifdef _KERNEL +#define MRTSTAT_ADD(name, val) mrtstat.name += (val) +#define MRTSTAT_INC(name) MRTSTAT_ADD(name, 1) +#endif + /* * Argument structure used by mrouted to get src-grp pkt counts */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 14:06:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08F1D106564A; Sun, 12 Apr 2009 14:06:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB1C28FC18; Sun, 12 Apr 2009 14:06:26 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CE6QHI027499; Sun, 12 Apr 2009 14:06:26 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CE6QSH027497; Sun, 12 Apr 2009 14:06:26 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904121406.n3CE6QSH027497@svn.freebsd.org> From: Robert Watson Date: Sun, 12 Apr 2009 14:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190967 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 14:06:27 -0000 Author: rwatson Date: Sun Apr 12 14:06:26 2009 New Revision: 190967 URL: http://svn.freebsd.org/changeset/base/190967 Log: Update stats in struct pimstat using two new macros: PIMSTAT_ADD() and PIMSTAT_INC(), rather than directly manipulating the fields of the structure. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structure. MFC after: 3 days Modified: head/sys/netinet/ip_mroute.c head/sys/netinet/pim_var.h Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Sun Apr 12 14:00:36 2009 (r190966) +++ head/sys/netinet/ip_mroute.c Sun Apr 12 14:06:26 2009 (r190967) @@ -1515,7 +1515,7 @@ ip_mdq(struct mbuf *m, struct ifnet *ifp if (pim_assert_enabled && (vifi < numvifs) && viftable[vifi].v_ifp) { if (ifp == &multicast_register_if) - pimstat.pims_rcv_registers_wrongiif++; + PIMSTAT_INC(pims_rcv_registers_wrongiif); /* Get vifi for the incoming packet */ for (vifi=0; vifi < numvifs && viftable[vifi].v_ifp != ifp; vifi++) @@ -2440,8 +2440,8 @@ pim_register_send_upcall(struct ip *ip, } /* Keep statistics */ - pimstat.pims_snd_registers_msgs++; - pimstat.pims_snd_registers_bytes += len; + PIMSTAT_INC(pims_snd_registers_msgs); + PIMSTAT_ADD(pims_snd_registers_bytes, len); return 0; } @@ -2511,8 +2511,8 @@ pim_register_send_rp(struct ip *ip, stru send_packet(vifp, mb_first); /* Keep statistics */ - pimstat.pims_snd_registers_msgs++; - pimstat.pims_snd_registers_bytes += len; + PIMSTAT_INC(pims_snd_registers_msgs); + PIMSTAT_ADD(pims_snd_registers_bytes, len); return 0; } @@ -2554,14 +2554,14 @@ pim_input(struct mbuf *m, int off) int iphlen = off; /* Keep statistics */ - pimstat.pims_rcv_total_msgs++; - pimstat.pims_rcv_total_bytes += datalen; + PIMSTAT_INC(pims_rcv_total_msgs); + PIMSTAT_ADD(pims_rcv_total_bytes, datalen); /* * Validate lengths */ if (datalen < PIM_MINLEN) { - pimstat.pims_rcv_tooshort++; + PIMSTAT_INC(pims_rcv_tooshort); CTR3(KTR_IPMF, "%s: short packet (%d) from %s", __func__, datalen, inet_ntoa(ip->ip_src)); m_freem(m); @@ -2606,7 +2606,7 @@ pim_input(struct mbuf *m, int off) if (PIM_VT_T(pim->pim_vt) == PIM_REGISTER && in_cksum(m, PIM_MINLEN) == 0) { /* do nothing, checksum okay */ } else if (in_cksum(m, datalen)) { - pimstat.pims_rcv_badsum++; + PIMSTAT_INC(pims_rcv_badsum); CTR1(KTR_IPMF, "%s: invalid checksum", __func__); m_freem(m); return; @@ -2614,7 +2614,7 @@ pim_input(struct mbuf *m, int off) /* PIM version check */ if (PIM_VT_V(pim->pim_vt) < PIM_VERSION) { - pimstat.pims_rcv_badversion++; + PIMSTAT_INC(pims_rcv_badversion); CTR3(KTR_IPMF, "%s: bad version %d expect %d", __func__, (int)PIM_VT_V(pim->pim_vt), PIM_VERSION); m_freem(m); @@ -2653,8 +2653,8 @@ pim_input(struct mbuf *m, int off) * Validate length */ if (datalen < PIM_REG_MINLEN) { - pimstat.pims_rcv_tooshort++; - pimstat.pims_rcv_badregisters++; + PIMSTAT_INC(pims_rcv_tooshort); + PIMSTAT_INC(pims_rcv_badregisters); CTR1(KTR_IPMF, "%s: register packet size too small", __func__); m_freem(m); return; @@ -2668,7 +2668,7 @@ pim_input(struct mbuf *m, int off) /* verify the version number of the inner packet */ if (encap_ip->ip_v != IPVERSION) { - pimstat.pims_rcv_badregisters++; + PIMSTAT_INC(pims_rcv_badregisters); CTR1(KTR_IPMF, "%s: bad encap ip version", __func__); m_freem(m); return; @@ -2676,7 +2676,7 @@ pim_input(struct mbuf *m, int off) /* verify the inner packet is destined to a mcast group */ if (!IN_MULTICAST(ntohl(encap_ip->ip_dst.s_addr))) { - pimstat.pims_rcv_badregisters++; + PIMSTAT_INC(pims_rcv_badregisters); CTR2(KTR_IPMF, "%s: bad encap ip dest %s", __func__, inet_ntoa(encap_ip->ip_dst)); m_freem(m); @@ -2724,8 +2724,8 @@ pim_input(struct mbuf *m, int off) /* Keep statistics */ /* XXX: registers_bytes include only the encap. mcast pkt */ - pimstat.pims_rcv_registers_msgs++; - pimstat.pims_rcv_registers_bytes += ntohs(encap_ip->ip_len); + PIMSTAT_INC(pims_rcv_registers_msgs); + PIMSTAT_ADD(pims_rcv_registers_bytes, ntohs(encap_ip->ip_len)); /* * forward the inner ip packet; point m_data at the inner ip. Modified: head/sys/netinet/pim_var.h ============================================================================== --- head/sys/netinet/pim_var.h Sun Apr 12 14:00:36 2009 (r190966) +++ head/sys/netinet/pim_var.h Sun Apr 12 14:06:26 2009 (r190967) @@ -59,6 +59,11 @@ struct pimstat { u_quad_t pims_snd_registers_bytes; /* sent regs. bytes (data only) */ }; +#ifdef _KERNEL +#define PIMSTAT_ADD(name, val) pimstat.name += (val) +#define PIMSTAT_INC(name) PIMSTAT_ADD(name, 1) +#endif + /* * Names for PIM sysctl objects */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 14:19:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C0B0106566B; Sun, 12 Apr 2009 14:19:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FBCB8FC12; Sun, 12 Apr 2009 14:19:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CEJcAV027827; Sun, 12 Apr 2009 14:19:38 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CEJcCL027824; Sun, 12 Apr 2009 14:19:38 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904121419.n3CEJcCL027824@svn.freebsd.org> From: Robert Watson Date: Sun, 12 Apr 2009 14:19:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190968 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 14:19:38 -0000 Author: rwatson Date: Sun Apr 12 14:19:37 2009 New Revision: 190968 URL: http://svn.freebsd.org/changeset/base/190968 Log: Update stats in struct carpstats using two new macros: CARPSTATS_ADD() and CARPSTATS_INC(), rather than directly manipulating the fields of the structure. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structure. MFC after: 3 days Modified: head/sys/netinet/ip_carp.c head/sys/netinet/ip_carp.h Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Sun Apr 12 14:06:26 2009 (r190967) +++ head/sys/netinet/ip_carp.c Sun Apr 12 14:19:37 2009 (r190968) @@ -530,7 +530,7 @@ carp_input(struct mbuf *m, int hlen) struct carp_header *ch; int iplen, len; - carpstats.carps_ipackets++; + CARPSTATS_INC(carps_ipackets); if (!carp_opts[CARPCTL_ALLOW]) { m_freem(m); @@ -539,7 +539,7 @@ carp_input(struct mbuf *m, int hlen) /* check if received on a valid carp interface */ if (m->m_pkthdr.rcvif->if_carp == NULL) { - carpstats.carps_badif++; + CARPSTATS_INC(carps_badif); CARP_LOG("carp_input: packet received on non-carp " "interface: %s\n", m->m_pkthdr.rcvif->if_xname); @@ -549,7 +549,7 @@ carp_input(struct mbuf *m, int hlen) /* verify that the IP TTL is 255. */ if (ip->ip_ttl != CARP_DFLTTL) { - carpstats.carps_badttl++; + CARPSTATS_INC(carps_badttl); CARP_LOG("carp_input: received ttl %d != 255i on %s\n", ip->ip_ttl, m->m_pkthdr.rcvif->if_xname); @@ -560,7 +560,7 @@ carp_input(struct mbuf *m, int hlen) iplen = ip->ip_hl << 2; if (m->m_pkthdr.len < iplen + sizeof(*ch)) { - carpstats.carps_badlen++; + CARPSTATS_INC(carps_badlen); CARP_LOG("carp_input: received len %zd < " "sizeof(struct carp_header)\n", m->m_len - sizeof(struct ip)); @@ -570,7 +570,7 @@ carp_input(struct mbuf *m, int hlen) if (iplen + sizeof(*ch) < m->m_len) { if ((m = m_pullup(m, iplen + sizeof(*ch))) == NULL) { - carpstats.carps_hdrops++; + CARPSTATS_INC(carps_hdrops); CARP_LOG("carp_input: pullup failed\n"); return; } @@ -584,7 +584,7 @@ carp_input(struct mbuf *m, int hlen) */ len = iplen + sizeof(*ch); if (len > m->m_pkthdr.len) { - carpstats.carps_badlen++; + CARPSTATS_INC(carps_badlen); CARP_LOG("carp_input: packet too short %d on %s\n", m->m_pkthdr.len, m->m_pkthdr.rcvif->if_xname); @@ -593,7 +593,7 @@ carp_input(struct mbuf *m, int hlen) } if ((m = m_pullup(m, len)) == NULL) { - carpstats.carps_hdrops++; + CARPSTATS_INC(carps_hdrops); return; } ip = mtod(m, struct ip *); @@ -602,7 +602,7 @@ carp_input(struct mbuf *m, int hlen) /* verify the CARP checksum */ m->m_data += iplen; if (carp_cksum(m, len - iplen)) { - carpstats.carps_badsum++; + CARPSTATS_INC(carps_badsum); CARP_LOG("carp_input: checksum failed on %s\n", m->m_pkthdr.rcvif->if_xname); m_freem(m); @@ -622,7 +622,7 @@ carp6_input(struct mbuf **mp, int *offp, struct carp_header *ch; u_int len; - carpstats.carps_ipackets6++; + CARPSTATS_INC(carps_ipackets6); if (!carp_opts[CARPCTL_ALLOW]) { m_freem(m); @@ -631,7 +631,7 @@ carp6_input(struct mbuf **mp, int *offp, /* check if received on a valid carp interface */ if (m->m_pkthdr.rcvif->if_carp == NULL) { - carpstats.carps_badif++; + CARPSTATS_INC(carps_badif); CARP_LOG("carp6_input: packet received on non-carp " "interface: %s\n", m->m_pkthdr.rcvif->if_xname); @@ -641,7 +641,7 @@ carp6_input(struct mbuf **mp, int *offp, /* verify that the IP TTL is 255 */ if (ip6->ip6_hlim != CARP_DFLTTL) { - carpstats.carps_badttl++; + CARPSTATS_INC(carps_badttl); CARP_LOG("carp6_input: received ttl %d != 255 on %s\n", ip6->ip6_hlim, m->m_pkthdr.rcvif->if_xname); @@ -653,7 +653,7 @@ carp6_input(struct mbuf **mp, int *offp, len = m->m_len; IP6_EXTHDR_GET(ch, struct carp_header *, m, *offp, sizeof(*ch)); if (ch == NULL) { - carpstats.carps_badlen++; + CARPSTATS_INC(carps_badlen); CARP_LOG("carp6_input: packet size %u too small\n", len); return (IPPROTO_DONE); } @@ -662,7 +662,7 @@ carp6_input(struct mbuf **mp, int *offp, /* verify the CARP checksum */ m->m_data += *offp; if (carp_cksum(m, sizeof(*ch))) { - carpstats.carps_badsum++; + CARPSTATS_INC(carps_badsum); CARP_LOG("carp6_input: checksum failed, on %s\n", m->m_pkthdr.rcvif->if_xname); m_freem(m); @@ -691,7 +691,7 @@ carp_input_c(struct mbuf *m, struct carp if (!sc || !((SC2IFP(sc)->if_flags & IFF_UP) && (SC2IFP(sc)->if_drv_flags & IFF_DRV_RUNNING))) { - carpstats.carps_badvhid++; + CARPSTATS_INC(carps_badvhid); CARP_UNLOCK(ifp->if_carp); m_freem(m); return; @@ -713,7 +713,7 @@ carp_input_c(struct mbuf *m, struct carp /* verify the CARP version. */ if (ch->carp_version != CARP_VERSION) { - carpstats.carps_badver++; + CARPSTATS_INC(carps_badver); SC2IFP(sc)->if_ierrors++; CARP_UNLOCK(ifp->if_carp); CARP_LOG("%s; invalid version %d\n", @@ -725,7 +725,7 @@ carp_input_c(struct mbuf *m, struct carp /* verify the hash */ if (carp_hmac_verify(sc, ch->carp_counter, ch->carp_md)) { - carpstats.carps_badauth++; + CARPSTATS_INC(carps_badauth); SC2IFP(sc)->if_ierrors++; CARP_UNLOCK(ifp->if_carp); CARP_LOG("%s: incorrect hash\n", SC2IFP(sc)->if_xname); @@ -915,7 +915,7 @@ carp_send_ad_locked(struct carp_softc *s MGETHDR(m, M_DONTWAIT, MT_HEADER); if (m == NULL) { SC2IFP(sc)->if_oerrors++; - carpstats.carps_onomem++; + CARPSTATS_INC(carps_onomem); /* XXX maybe less ? */ if (advbase != 255 || advskew != 255) callout_reset(&sc->sc_ad_tmo, tvtohz(&tv), @@ -953,7 +953,7 @@ carp_send_ad_locked(struct carp_softc *s getmicrotime(&SC2IFP(sc)->if_lastchange); SC2IFP(sc)->if_opackets++; SC2IFP(sc)->if_obytes += len; - carpstats.carps_opackets++; + CARPSTATS_INC(carps_opackets); if (ip_output(m, NULL, NULL, IP_RAWOUTPUT, &sc->sc_imo, NULL)) { SC2IFP(sc)->if_oerrors++; @@ -987,7 +987,7 @@ carp_send_ad_locked(struct carp_softc *s MGETHDR(m, M_DONTWAIT, MT_HEADER); if (m == NULL) { SC2IFP(sc)->if_oerrors++; - carpstats.carps_onomem++; + CARPSTATS_INC(carps_onomem); /* XXX maybe less ? */ if (advbase != 255 || advskew != 255) callout_reset(&sc->sc_ad_tmo, tvtohz(&tv), @@ -1030,7 +1030,7 @@ carp_send_ad_locked(struct carp_softc *s getmicrotime(&SC2IFP(sc)->if_lastchange); SC2IFP(sc)->if_opackets++; SC2IFP(sc)->if_obytes += len; - carpstats.carps_opackets6++; + CARPSTATS_INC(carps_opackets6); if (ip6_output(m, NULL, NULL, 0, &sc->sc_im6o, NULL, NULL)) { SC2IFP(sc)->if_oerrors++; Modified: head/sys/netinet/ip_carp.h ============================================================================== --- head/sys/netinet/ip_carp.h Sun Apr 12 14:06:26 2009 (r190967) +++ head/sys/netinet/ip_carp.h Sun Apr 12 14:19:37 2009 (r190968) @@ -117,6 +117,11 @@ struct carpstats { uint64_t carps_preempt; /* if enabled, preemptions */ }; +#ifdef _KERNEL +#define CARPSTATS_ADD(name, val) carpstats.name += (val) +#define CARPSTATS_INC(name) CARPSTATS_ADD(name, 1) +#endif + /* * Configuration structure for SIOCSVH SIOCGVH */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 14:24:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14401106564A; Sun, 12 Apr 2009 14:24:50 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id CA9BB8FC1A; Sun, 12 Apr 2009 14:24:49 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id F1A4073098; Sun, 12 Apr 2009 16:30:00 +0200 (CEST) Date: Sun, 12 Apr 2009 16:30:00 +0200 From: Luigi Rizzo To: Robert Watson Message-ID: <20090412143000.GB96365@onelab2.iet.unipi.it> References: <200904121406.n3CE6QSH027497@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200904121406.n3CE6QSH027497@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: per-cpu counters (Re: svn commit: r190967 - head/sys/netinet) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 14:24:50 -0000 On Sun, Apr 12, 2009 at 02:06:26PM +0000, Robert Watson wrote: > Author: rwatson > Date: Sun Apr 12 14:06:26 2009 > New Revision: 190967 > URL: http://svn.freebsd.org/changeset/base/190967 > > Log: > Update stats in struct pimstat using two new macros: PIMSTAT_ADD() > and PIMSTAT_INC(), rather than directly manipulating the fields of > the structure. This will make it easier to change the > implementation of these statistics, such as using per-CPU versions > of the data structure. > > MFC after: 3 days i understand that the change is only a cosmetic one, but do we really want to MFC all these counter changes now ? The problem of per-cpu counters exist all over the kernel, so rather than ad-hoc macros for each subsystem, it might be more interesting to first design and discuss a global solution (using HEAD as a test platform, if you like), and only at that stage start MFCing. As an example, an approach i was considering is replace the existing counters with an index in a global_counters[MAXCPU][] array so the counter update will become something like this: - pimstat.pims_rcv_registers_wrongiif++; + global_counters[PCPU_GET(cpuid)] + [pimstat.pims_rcv_registers_wrongiif]++; When you allocate an entry you also need to allocate an entry in the global_counters, but entries have fixed size, and the modules that you build will not depend on the MAXCPU value. All of this is still compatible with the macros you are adding, but I wonder why we should have many PIMSTAT_INC, IPFW_INC, NATD_INC and so on instead of more generic COUNTER64_INC() or COUNTER32_INC() cheers luigi From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 14:28:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AB4C106566B; Sun, 12 Apr 2009 14:28:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 23ACE8FC08; Sun, 12 Apr 2009 14:28:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id C9FBD46B1A; Sun, 12 Apr 2009 10:28:48 -0400 (EDT) Date: Sun, 12 Apr 2009 15:28:48 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Luigi Rizzo In-Reply-To: <20090412143000.GB96365@onelab2.iet.unipi.it> Message-ID: References: <200904121406.n3CE6QSH027497@svn.freebsd.org> <20090412143000.GB96365@onelab2.iet.unipi.it> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: per-cpu counters (Re: svn commit: r190967 - head/sys/netinet) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 14:28:49 -0000 On Sun, 12 Apr 2009, Luigi Rizzo wrote: > On Sun, Apr 12, 2009 at 02:06:26PM +0000, Robert Watson wrote: > >> Update stats in struct pimstat using two new macros: PIMSTAT_ADD() >> and PIMSTAT_INC(), rather than directly manipulating the fields of >> the structure. This will make it easier to change the >> implementation of these statistics, such as using per-CPU versions >> of the data structure. >> >> MFC after: 3 days > > i understand that the change is only a cosmetic one, but do we really want > to MFC all these counter changes now ? Consider 3 days the minimum, rather than expected, MFC time. > The problem of per-cpu counters exist all over the kernel, so rather than > ad-hoc macros for each subsystem, it might be more interesting to first > design and discuss a global solution (using HEAD as a test platform, if you > like), and only at that stage start MFCing. > > As an example, an approach i was considering is replace the existing > counters with an index in a global_counters[MAXCPU][] array so the counter > update will become something like this: > > - pimstat.pims_rcv_registers_wrongiif++; > + global_counters[PCPU_GET(cpuid)] > + [pimstat.pims_rcv_registers_wrongiif]++; > > When you allocate an entry you also need to allocate an entry in the > global_counters, but entries have fixed size, and the modules that you build > will not depend on the MAXCPU value. > > All of this is still compatible with the macros you are adding, but I wonder > why we should have many PIMSTAT_INC, IPFW_INC, NATD_INC and so on instead of > more generic COUNTER64_INC() or COUNTER32_INC() I have a project along these lines in progress, and will post the proposal to arch@ once I've finished prototyping it. In particular, it provides common implementations of "reset" and "report" in order to expose a single userspace version of the structure via sysctl. The reason to use per-subsystem macros is that there's another dimmension here: virtualization. Some counters are per-CPU, others are per-VIMAGE, and many are per-CPU-per-VIMAGE. Since virtualization is a work-in-progress, and they haven't yet virtualized all the counter blocks, I figured it was best to push all the counter updates behind subsystem-specific macros, and then virtualization would touch only the macro definitions, not the implementation in every place. In the sample implementation you show above, changes have to be made to every instance of the counter when virtualization is added/removed/changed for PIM, making per-CPU changes hard to MFC. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 14:29:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0ABC1065674; Sun, 12 Apr 2009 14:29:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A9D9F8FC18; Sun, 12 Apr 2009 14:29:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 6355A46B1A; Sun, 12 Apr 2009 10:29:38 -0400 (EDT) Date: Sun, 12 Apr 2009 15:29:38 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Luigi Rizzo In-Reply-To: Message-ID: References: <200904121406.n3CE6QSH027497@svn.freebsd.org> <20090412143000.GB96365@onelab2.iet.unipi.it> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: per-cpu counters (Re: svn commit: r190967 - head/sys/netinet) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 14:29:39 -0000 On Sun, 12 Apr 2009, Robert Watson wrote: >> As an example, an approach i was considering is replace the existing >> counters with an index in a global_counters[MAXCPU][] array so the counter >> update will become something like this: FYI, one other reason to put it all behind per-subsystem macros is that it allows us to easily prototype another statistics implementation, the no-op, on a per-subsystem basis. Robert N M Watson Computer Laboratory University of Cambridge >> >> - pimstat.pims_rcv_registers_wrongiif++; >> + global_counters[PCPU_GET(cpuid)] >> + [pimstat.pims_rcv_registers_wrongiif]++; >> >> When you allocate an entry you also need to allocate an entry in the >> global_counters, but entries have fixed size, and the modules that you >> build will not depend on the MAXCPU value. >> >> All of this is still compatible with the macros you are adding, but I >> wonder why we should have many PIMSTAT_INC, IPFW_INC, NATD_INC and so on >> instead of more generic COUNTER64_INC() or COUNTER32_INC() > > I have a project along these lines in progress, and will post the proposal to > arch@ once I've finished prototyping it. In particular, it provides common > implementations of "reset" and "report" in order to expose a single userspace > version of the structure via sysctl. > > The reason to use per-subsystem macros is that there's another dimmension > here: virtualization. Some counters are per-CPU, others are per-VIMAGE, and > many are per-CPU-per-VIMAGE. Since virtualization is a work-in-progress, and > they haven't yet virtualized all the counter blocks, I figured it was best to > push all the counter updates behind subsystem-specific macros, and then > virtualization would touch only the macro definitions, not the implementation > in every place. In the sample implementation you show above, changes have to > be made to every instance of the counter when virtualization is > added/removed/changed for PIM, making per-CPU changes hard to MFC. > > Robert N M Watson > Computer Laboratory > University of Cambridge > From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 14:36:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A92CE10656F0; Sun, 12 Apr 2009 14:36:25 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id 6449F8FC2A; Sun, 12 Apr 2009 14:36:25 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 6CF8673098; Sun, 12 Apr 2009 16:41:37 +0200 (CEST) Date: Sun, 12 Apr 2009 16:41:37 +0200 From: Luigi Rizzo To: Robert Watson Message-ID: <20090412144137.GD96365@onelab2.iet.unipi.it> References: <200904121406.n3CE6QSH027497@svn.freebsd.org> <20090412143000.GB96365@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: per-cpu counters (Re: svn commit: r190967 - head/sys/netinet) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 14:36:27 -0000 On Sun, Apr 12, 2009 at 03:29:38PM +0100, Robert Watson wrote: > > On Sun, 12 Apr 2009, Robert Watson wrote: > > >>As an example, an approach i was considering is replace the existing > >>counters with an index in a global_counters[MAXCPU][] array so the > >>counter update will become something like this: > > FYI, one other reason to put it all behind per-subsystem macros is that it > allows us to easily prototype another statistics implementation, the no-op, > on a per-subsystem basis. good point, i didn't consider this. From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 15:27:04 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D31D9106566C; Sun, 12 Apr 2009 15:27:04 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 943C18FC18; Sun, 12 Apr 2009 15:27:04 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.64.3]) by phk.freebsd.dk (Postfix) with ESMTP id B9A4178CCA; Sun, 12 Apr 2009 15:11:55 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.3/8.14.3) with ESMTP id n3CFBsCT030874; Sun, 12 Apr 2009 15:11:54 GMT (envelope-from phk@critter.freebsd.dk) To: Robert Watson From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 12 Apr 2009 15:28:48 +0100." Date: Sun, 12 Apr 2009 15:11:54 +0000 Message-ID: <30873.1239549114@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Luigi Rizzo Subject: Re: per-cpu counters (Re: svn commit: r190967 - head/sys/netinet) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 15:27:05 -0000 In message , Robert Wats on writes: >I have a project along these lines in progress, and will post the proposal to >arch@ once I've finished prototyping it. In particular, it provides common >implementations of "reset" and "report" in order to expose a single userspace >version of the structure via sysctl. Please don't export them via sysctl. Export them via mmap(2) like we already do with the disk I/O statistics. That way monitoring the counters becomes a no-syscall operation. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 15:33:24 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6B061065673; Sun, 12 Apr 2009 15:33:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C1F918FC1A; Sun, 12 Apr 2009 15:33:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 65CB846B2D; Sun, 12 Apr 2009 11:33:24 -0400 (EDT) Date: Sun, 12 Apr 2009 16:33:24 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Poul-Henning Kamp In-Reply-To: <30873.1239549114@critter.freebsd.dk> Message-ID: References: <30873.1239549114@critter.freebsd.dk> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Luigi Rizzo Subject: Re: per-cpu counters (Re: svn commit: r190967 - head/sys/netinet) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 15:33:25 -0000 On Sun, 12 Apr 2009, Poul-Henning Kamp wrote: > In message , Robert > Wats on writes: > >> I have a project along these lines in progress, and will post the proposal >> to arch@ once I've finished prototyping it. In particular, it provides >> common implementations of "reset" and "report" in order to expose a single >> userspace version of the structure via sysctl. > > Please don't export them via sysctl. > > Export them via mmap(2) like we already do with the disk I/O statistics. > > That way monitoring the counters becomes a no-syscall operation. The sysctls already exist, and are used by both built-in and third-party monitoring tools. Given the 8.0 timeline and the list of other things to get done before 8.0, I'm happy to solve the per-CPU counter problem as it is necessary to do so, but I don't have time to solve the mmap'd per-CPU counter problem, as it's not necessary to do so. In the current design the per-CPU counter framework allocates the storage for the counters, so it should be easy to add that feature later. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 18:58:06 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E7651065670; Sun, 12 Apr 2009 18:58:06 +0000 (UTC) (envelope-from vd@v5d.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4169F8FC17; Sun, 12 Apr 2009 18:58:06 +0000 (UTC) (envelope-from vd@v5d.org) Received: from mail.v5d.org (root@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CIw5U6028962; Sun, 12 Apr 2009 18:58:06 GMT (envelope-from vd@v5d.org) Received: by mail.v5d.org (Postfix, from userid 1002) id E7E6C410D; Sun, 12 Apr 2009 21:58:04 +0300 (EEST) Date: Sun, 12 Apr 2009 21:58:04 +0300 From: Vasil Dimov To: Stanislav Sedov Message-ID: <20090412185804.GA53117@polejan.hw.v5d.org> References: <200904111657.n3BGvpsC092703@svn.freebsd.org> <20090411210702.ce5325b9.stas@FreeBSD.org> <20090412021841.673a200b.nork@FreeBSD.org> <20090411214410.c53d0fb1.stas@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vkogqOf2sHV7VnPd" Content-Disposition: inline In-Reply-To: <20090411214410.c53d0fb1.stas@FreeBSD.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@FreeBSD.org, David Schultz , src-committers@FreeBSD.org, Norikatsu Shigemura , svn-src-all@FreeBSD.org Subject: Re: svn commit: r190943 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vd@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 18:58:06 -0000 --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 11, 2009 at 21:44:10 +0400, Stanislav Sedov wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > On Sun, 12 Apr 2009 02:18:41 +0900 > Norikatsu Shigemura mentioned: >=20 > > On Sat, 11 Apr 2009 21:07:02 +0400 > > Stanislav Sedov wrote: > > > > Log: > > > > GNU Pth has some fragile kludges that were broken by r189828. > > > > I've discussed this with the Pth maintainer and no clear solution > > > > has emerged on the ports side of things, so for now, hack around > > > > the issue in signal.h. > > > Can't we just put a patch in ports tree itself? What meant under 'no > > > clean solution emerged'? I can prepare a patch, if needed. > >=20 > > I think so, too. I have a quick hack patch. > >=20 > > ports/devel/pth/files/patch-pth_p.h.in > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -= - - - - - > > --- pth_p.h.in.orig 2006-06-09 02:54:03.000000000 +0900 > > +++ pth_p.h.in 2009-04-08 15:05:12.911807009 +0900 > > @@ -32,7 +32,7 @@ > > #include > > #include > > #include > > -#include > > +//#include > > #include > > #include > > #include > >=20 > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -= - - - - - > >=20 >=20 > Or just drop the line. Vasil, what do you think about the possibility to > commit this patch into the tree? I think we should have a workaround in p= orts > tree (it is one of the things what it was designed for) than in the src t= ree. > Better would be to implement a workaround upstream, though. I think somet= hing > like > #if !(defined(__FreeBSD__) && __FreeBSD_version >=3D %%PTHREAD_CHANGE_VE= RSION%%) > #include > #endif > where %%PTHREAD_CHANGE_VERSION%% would correspond to the __FreeBSD_versio= n where > the change was introduced, could be safely submitted upstream. [...] All, thank you! I have now committed this patch to devel/pth. Lets hope it works :) PS I still do not have access to an 8.0 machine... --=20 Vasil Dimov moc.elcaro@vomid.lisav Software Developer @ Oracle/Innobase Oy gro.DSBeerF@dv Committer @ FreeBSD.org gro.d5v@dv Home @ Sofia, Bulgaria --vkogqOf2sHV7VnPd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAkniObwACgkQFw6SP/bBpCDK0gCg1RJUuiChjljbRTEgfDx1XNby reQAoJAaJJTdM55dhwksq6SqnXcndjzW =oGCt -----END PGP SIGNATURE----- --vkogqOf2sHV7VnPd-- From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 19:04:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DFB7106564A; Sun, 12 Apr 2009 19:04:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0938FC1A; Sun, 12 Apr 2009 19:04:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CJ4SZX035527; Sun, 12 Apr 2009 19:04:28 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CJ4RTa035520; Sun, 12 Apr 2009 19:04:27 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200904121904.n3CJ4RTa035520@svn.freebsd.org> From: Rick Macklem Date: Sun, 12 Apr 2009 19:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190971 - in head/sys: conf modules modules/nfssvc nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 19:04:28 -0000 Author: rmacklem Date: Sun Apr 12 19:04:27 2009 New Revision: 190971 URL: http://svn.freebsd.org/changeset/base/190971 Log: Change nfsserver so that it uses the nfssvc() system call provided in sys/nfs/nfs_nfssvc.c by registering with it using the nfsd_call_nfsserver function pointer. Also, add the build glue for nfs_nfssvc.c optionally based on "nfsserver" and also as a loadable module. Submitted by: rmacklem Reviewed by: kib Approved by: kib (mentor) Added: head/sys/modules/nfssvc/ head/sys/modules/nfssvc/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/modules/Makefile head/sys/nfsserver/nfs.h head/sys/nfsserver/nfs_srvkrpc.c head/sys/nfsserver/nfs_srvsubs.c head/sys/nfsserver/nfs_syscalls.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Apr 12 17:43:41 2009 (r190970) +++ head/sys/conf/files Sun Apr 12 19:04:27 2009 (r190971) @@ -2469,6 +2469,7 @@ nfsserver/nfs_srvsock.c optional nfsser nfsserver/nfs_srvcache.c optional nfsserver nfsserver/nfs_srvsubs.c optional nfsserver nfsserver/nfs_syscalls.c optional nfsserver +nfs/nfs_nfssvc.c optional nfsserver nlm/nlm_advlock.c optional nfslockd nfsclient nlm/nlm_prot_clnt.c optional nfslockd nlm/nlm_prot_impl.c optional nfslockd Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Apr 12 17:43:41 2009 (r190970) +++ head/sys/modules/Makefile Sun Apr 12 19:04:27 2009 (r190971) @@ -187,6 +187,7 @@ SUBDIR= ${_3dfx} \ nfsclient \ nfslockd \ nfsserver \ + nfssvc \ nge \ nmdm \ ${_nsp} \ Added: head/sys/modules/nfssvc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/nfssvc/Makefile Sun Apr 12 19:04:27 2009 (r190971) @@ -0,0 +1,9 @@ + +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../nfs +KMOD= nfssvc +SRCS= nfs_nfssvc.c \ + opt_nfs.h + +.include Modified: head/sys/nfsserver/nfs.h ============================================================================== --- head/sys/nfsserver/nfs.h Sun Apr 12 17:43:41 2009 (r190970) +++ head/sys/nfsserver/nfs.h Sun Apr 12 19:04:27 2009 (r190971) @@ -40,6 +40,8 @@ #include "opt_nfs.h" #endif +#include + /* * Tunable constants for nfs */ @@ -116,13 +118,6 @@ struct nfsd_nfsd_args { #endif /* - * Flags for nfssvc() system call. - */ -#define NFSSVC_OLDNFSD 0x004 -#define NFSSVC_ADDSOCK 0x008 -#define NFSSVC_NFSD 0x010 - -/* * vfs.nfsrv sysctl(3) identifiers */ #define NFS_NFSRVSTATS 1 /* struct: struct nfsrvstats */ @@ -447,6 +442,13 @@ int nfsrv_symlink(struct nfsrv_descript struct mbuf **mrq); int nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct mbuf **mrq); +/* + * #ifdef _SYS_SYSPROTO_H_ so that it is only defined when sysproto.h + * has been included, so that "struct nfssvc_args" is defined. + */ +#ifdef _SYS_SYSPROTO_H_ +int nfssvc_nfsserver(struct thread *, struct nfssvc_args *); +#endif #endif /* _KERNEL */ #endif Modified: head/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- head/sys/nfsserver/nfs_srvkrpc.c Sun Apr 12 17:43:41 2009 (r190970) +++ head/sys/nfsserver/nfs_srvkrpc.c Sun Apr 12 19:04:27 2009 (r190971) @@ -151,6 +151,9 @@ int32_t (*nfsrv3_procs[NFS_NPROCS])(stru /* * NFS server system calls */ +/* + * This is now called from nfssvc() in nfs/nfs_nfssvc.c. + */ /* * Nfs server psuedo system call for the nfsd's @@ -163,25 +166,14 @@ int32_t (*nfsrv3_procs[NFS_NPROCS])(stru * - sockaddr with no IPv4-mapped addresses * - mask for both INET and INET6 families if there is IPv4-mapped overlap */ -#ifndef _SYS_SYSPROTO_H_ -struct nfssvc_args { - int flag; - caddr_t argp; -}; -#endif int -nfssvc(struct thread *td, struct nfssvc_args *uap) +nfssvc_nfsserver(struct thread *td, struct nfssvc_args *uap) { struct file *fp; struct nfsd_addsock_args addsockarg; struct nfsd_nfsd_args nfsdarg; int error; - KASSERT(!mtx_owned(&Giant), ("nfssvc(): called with Giant")); - - error = priv_check(td, PRIV_NFS_DAEMON); - if (error) - return (error); if (uap->flag & NFSSVC_ADDSOCK) { error = copyin(uap->argp, (caddr_t)&addsockarg, sizeof(addsockarg)); @@ -208,8 +200,6 @@ nfssvc(struct thread *td, struct nfssvc_ } else { error = ENXIO; } - if (error == EINTR || error == ERESTART) - error = 0; return (error); } Modified: head/sys/nfsserver/nfs_srvsubs.c ============================================================================== --- head/sys/nfsserver/nfs_srvsubs.c Sun Apr 12 17:43:41 2009 (r190970) +++ head/sys/nfsserver/nfs_srvsubs.c Sun Apr 12 19:04:27 2009 (r190971) @@ -100,10 +100,6 @@ struct nfsd_head nfsd_head; int nfsd_head_flag; #endif -static int nfssvc_offset = SYS_nfssvc; -static struct sysent nfssvc_prev_sysent; -MAKE_SYSENT(nfssvc); - struct mtx nfsd_mtx; /* @@ -519,13 +515,14 @@ static const short *nfsrv_v3errmap[] = { nfsv3err_commit, }; +extern int (*nfsd_call_nfsserver)(struct thread *, struct nfssvc_args *); + /* * Called once to initialize data structures... */ static int nfsrv_modevent(module_t mod, int type, void *data) { - static int registered; int error = 0; switch (type) { @@ -560,11 +557,7 @@ nfsrv_modevent(module_t mod, int type, v NFSD_UNLOCK(); #endif - error = syscall_register(&nfssvc_offset, &nfssvc_sysent, - &nfssvc_prev_sysent); - if (error) - break; - registered = 1; + nfsd_call_nfsserver = nfssvc_nfsserver; break; case MOD_UNLOAD: @@ -573,8 +566,7 @@ nfsrv_modevent(module_t mod, int type, v break; } - if (registered) - syscall_deregister(&nfssvc_offset, &nfssvc_prev_sysent); + nfsd_call_nfsserver = NULL; callout_drain(&nfsrv_callout); #ifdef NFS_LEGACYRPC nfsrv_destroycache(); /* Free the server request cache */ @@ -596,6 +588,7 @@ DECLARE_MODULE(nfsserver, nfsserver_mod, /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(nfsserver, 1); +MODULE_DEPEND(nfsserver, nfssvc, 1, 1, 1); #ifndef NFS_LEGACYRPC MODULE_DEPEND(nfsserver, krpc, 1, 1, 1); #endif Modified: head/sys/nfsserver/nfs_syscalls.c ============================================================================== --- head/sys/nfsserver/nfs_syscalls.c Sun Apr 12 17:43:41 2009 (r190970) +++ head/sys/nfsserver/nfs_syscalls.c Sun Apr 12 19:04:27 2009 (r190971) @@ -113,6 +113,9 @@ extern u_long sb_max_adj; */ /* + * This is now called from nfssvc() in nfs/nfs_nfssvc.c. + */ +/* * Nfs server psuedo system call for the nfsd's * Based on the flag value it either: * - adds a socket to the selection list @@ -123,27 +126,14 @@ extern u_long sb_max_adj; * - sockaddr with no IPv4-mapped addresses * - mask for both INET and INET6 families if there is IPv4-mapped overlap */ -#ifndef _SYS_SYSPROTO_H_ -struct nfssvc_args { - int flag; - caddr_t argp; -}; -#endif int -nfssvc(struct thread *td, struct nfssvc_args *uap) +nfssvc_nfsserver(struct thread *td, struct nfssvc_args *uap) { struct file *fp; struct sockaddr *nam; struct nfsd_addsock_args nfsdarg; int error; - KASSERT(!mtx_owned(&Giant), ("nfssvc(): called with Giant")); - - AUDIT_ARG(cmd, uap->flag); - - error = priv_check(td, PRIV_NFS_DAEMON); - if (error) - return (error); NFSD_LOCK(); while (nfssvc_sockhead_flag & SLP_INIT) { nfssvc_sockhead_flag |= SLP_WANTINIT; @@ -181,8 +171,6 @@ nfssvc(struct thread *td, struct nfssvc_ } else { error = ENXIO; } - if (error == EINTR || error == ERESTART) - error = 0; return (error); } From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 19:21:44 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE6871065688 for ; Sun, 12 Apr 2009 19:21:44 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 5CE0B8FC25 for ; Sun, 12 Apr 2009 19:21:44 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id C14398FC4F for ; Sun, 12 Apr 2009 23:21:43 +0400 (MSD) Received: from orion.SpringDaemons.com (unknown [77.232.3.143]) by mx0.deglitch.com (Postfix) with ESMTPA id 5A7F08FC1D; Sun, 12 Apr 2009 23:21:39 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 9D7453981A; Sun, 12 Apr 2009 23:21:46 +0400 (MSD) Date: Sun, 12 Apr 2009 23:21:42 +0400 From: Stanislav Sedov To: Stanislav Sedov Message-Id: <20090412232142.1289985d.stas@FreeBSD.org> In-Reply-To: <20090412114318.fd0d213d.stas@FreeBSD.org> References: <200904111657.n3BGvpsC092703@svn.freebsd.org> <20090411210702.ce5325b9.stas@FreeBSD.org> <20090412021841.673a200b.nork@FreeBSD.org> <20090412030054.GA54299@zim.MIT.EDU> <20090412114318.fd0d213d.stas@FreeBSD.org> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Sun Apr 12 23:21:43 2009 X-DSPAM-Confidence: 1.0000 X-DSPAM-Improbability: 1 in 98689409 chance of being spam X-DSPAM-Probability: 0.0023 X-DSPAM-Signature: 49e23f47967001128590757 Cc: src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Norikatsu Shigemura , Stanislav Sedov , svn-src-head@FreeBSD.ORG, David Schultz Subject: Re: svn commit: r190943 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 19:21:45 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sun, 12 Apr 2009 11:43:18 +0400 Stanislav Sedov mentioned: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Sat, 11 Apr 2009 23:00:54 -0400 > David Schultz mentioned: > > > On Sun, Apr 12, 2009, Norikatsu Shigemura wrote: > > > On Sat, 11 Apr 2009 21:07:02 +0400 > > > Stanislav Sedov wrote: > > > > > Log: > > > > > GNU Pth has some fragile kludges that were broken by r189828. > > > > > I've discussed this with the Pth maintainer and no clear solution > > > > > has emerged on the ports side of things, so for now, hack around > > > > > the issue in signal.h. > > > > Can't we just put a patch in ports tree itself? What meant under 'no > > > > clean solution emerged'? I can prepare a patch, if needed. > > > > > > I think so, too. I have a quick hack patch. > > > > As I mentioned to vd@ on 3/20, I'd prefer something like > > that. Does your proposed patch also work for the ports that depend > > on GNU Pth, some of which may depend on signal.h? > > Will the following do the trick? > > #if !(defined(__FreeBSD__) && __FreeBSD_version >= %%PTHREAD_CHANGE_VERSION%%) > # define pthread_kill(a, b) > # define pthread_sigmask(a, b, c) > # include > # undef pthread_kill > # undef pthread_sigmask > #endif > Of course, I meant #if !(defined(__FreeBSD__) && __FreeBSD_version >= %%PTHREAD_CHANGE_VERSION%%) # define pthread_kill(a, b) # define pthread_sigmask(a, b, c) #endif #include #if !(defined(__FreeBSD__) && __FreeBSD_version >= %%PTHREAD_CHANGE_VERSION%%) # undef pthread_kill # undef pthread_sigmask #endif - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAkniP0oACgkQK/VZk+smlYGnLwCfTXaiKQcHUYtqF7ObGCLl4yqb XMMAniNOBZznv4MvldusQtsNG96eZmBK =HO6m -----END PGP SIGNATURE----- !DSPAM:49e23f47967001128590757! From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 19:42:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25059106566C; Sun, 12 Apr 2009 19:42:26 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13F738FC26; Sun, 12 Apr 2009 19:42:26 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CJgPFZ037009; Sun, 12 Apr 2009 19:42:25 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CJgP9w037008; Sun, 12 Apr 2009 19:42:25 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200904121942.n3CJgP9w037008@svn.freebsd.org> From: Maksim Yevmenkin Date: Sun, 12 Apr 2009 19:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190974 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 19:42:26 -0000 Author: emax Date: Sun Apr 12 19:42:25 2009 New Revision: 190974 URL: http://svn.freebsd.org/changeset/base/190974 Log: Add entry about kbdmux(4) un-locking. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Apr 12 19:41:16 2009 (r190973) +++ head/UPDATING Sun Apr 12 19:42:25 2009 (r190974) @@ -22,6 +22,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090408: + Do not use Giant for kbdmux(4) locking. This is wrong and + apparently causing more problems than it solves. This will + re-open the issue where interrupt handlers may race with + kbdmux(4) in polling mode. Typical symptoms include (but + not limited to) duplicated and/or missing characters when + low level console functions (such as gets) are used while + interrupts are enabled (for example geli password prompt, + mountroot prompt etc.). Disabling kbdmux(4) may help. + 20090407: The size of structs vnet_net, vnet_inet and vnet_ipfw has changed; kernel modules referencing any of the above need to be recompiled. From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 21:06:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A304106566C; Sun, 12 Apr 2009 21:06:12 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 292768FC1A; Sun, 12 Apr 2009 21:06:12 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CL6Bp3039907; Sun, 12 Apr 2009 21:06:11 GMT (envelope-from pgj@svn.freebsd.org) Received: (from pgj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CL6BWb039906; Sun, 12 Apr 2009 21:06:11 GMT (envelope-from pgj@svn.freebsd.org) Message-Id: <200904122106.n3CL6BWb039906@svn.freebsd.org> From: Gabor Pali Date: Sun, 12 Apr 2009 21:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190977 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 21:06:12 -0000 Author: pgj (doc,ports committer) Date: Sun Apr 12 21:06:11 2009 New Revision: 190977 URL: http://svn.freebsd.org/changeset/base/190977 Log: - Add myself to the ports committers' graph Approved by: gabor (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sun Apr 12 20:24:28 2009 (r190976) +++ head/share/misc/committers-ports.dot Sun Apr 12 21:06:11 2009 (r190977) @@ -127,6 +127,7 @@ mharo [label="Michael Haro\nmharo@FreeBS osa [label="Sergey A. Osokin\nosa@FreeBSD.org\n2003/06/04"] pat [label="Patrick Li\npat@FreeBSD.org\n2001/11/14"] pav [label="Pav Lucistnik\npav@FreeBSD.org\n2003/11/12"] +pgj [label="Gabor Pali\npgj@FreeBSD.org\n2009/04/12"] philip [label="Philip Paeps\nphilip@FreeBSD.org\n2005/10/19"] pgollucci [label="Philip M. Gollucci\npgollucci@FreeBSD.org\n2008/07/21"] rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2006/06/23"] @@ -216,6 +217,7 @@ flz -> johans flz -> laszlof gabor -> lippe +gabor -> pgj garga -> acm garga -> alepulver @@ -317,6 +319,7 @@ stas -> araujo steve -> netchild tabthorpe -> jadawin +tabthorpe -> pgj thierry -> jadawin From owner-svn-src-head@FreeBSD.ORG Sun Apr 12 21:28:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08CE8106564A; Sun, 12 Apr 2009 21:28:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB7848FC17; Sun, 12 Apr 2009 21:28:35 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CLSZeY040667; Sun, 12 Apr 2009 21:28:35 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CLSZ9j040666; Sun, 12 Apr 2009 21:28:35 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200904122128.n3CLSZ9j040666@svn.freebsd.org> From: Robert Watson Date: Sun, 12 Apr 2009 21:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190978 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 21:28:36 -0000 Author: rwatson Date: Sun Apr 12 21:28:35 2009 New Revision: 190978 URL: http://svn.freebsd.org/changeset/base/190978 Log: Put TCPSTAT_ADD() and TCPSTAT_INC() behind _KERNEL. MFC after: 3 days Modified: head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sun Apr 12 21:06:11 2009 (r190977) +++ head/sys/netinet/tcp_var.h Sun Apr 12 21:28:35 2009 (r190978) @@ -458,8 +458,10 @@ struct tcpstat { u_long tcps_ecn_rcwnd; /* # times ECN reduced the cwnd */ }; +#ifdef _KERNEL #define TCPSTAT_ADD(name, val) V_tcpstat.name += (val) #define TCPSTAT_INC(name) TCPSTAT_ADD(name, 1) +#endif /* * TCB structure exported to user-land via sysctl(3). From owner-svn-src-head@FreeBSD.ORG Mon Apr 13 00:32:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2999106564A; Mon, 13 Apr 2009 00:32:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E07268FC08; Mon, 13 Apr 2009 00:32:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3D0WYTs046568; Mon, 13 Apr 2009 00:32:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3D0WYrc046567; Mon, 13 Apr 2009 00:32:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200904130032.n3D0WYrc046567@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 13 Apr 2009 00:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190982 - head/sys/dev/fxp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2009 00:32:35 -0000 Author: yongari Date: Mon Apr 13 00:32:34 2009 New Revision: 190982 URL: http://svn.freebsd.org/changeset/base/190982 Log: Don't blindly set IP packet length from interface MTU in TSO case. Remote host can advertise smaller MSS than that of sender so upper stack might have adjusted the MSS which in turn generates IP packets that are less size than that of interface MTU. Reported by: Bjoern Koenig ( bkoenig <> alpha-tierchen dot de ) Tested by: Bjoern Koenig ( bkoenig <> alpha-tierchen dot de ) MFC after: 3 days Modified: head/sys/dev/fxp/if_fxp.c Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Sun Apr 12 23:10:01 2009 (r190981) +++ head/sys/dev/fxp/if_fxp.c Mon Apr 13 00:32:34 2009 (r190982) @@ -1485,7 +1485,8 @@ fxp_encap(struct fxp_softc *sc, struct m * checksum in the first frame driver should compute it. */ ip->ip_sum = 0; - ip->ip_len = htons(ifp->if_mtu); + ip->ip_len = htons(m->m_pkthdr.tso_segsz + (ip->ip_hl << 2) + + (tcp->th_off << 2)); tcp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP + (tcp->th_off << 2) + m->m_pkthdr.tso_segsz)); From owner-svn-src-head@FreeBSD.ORG Mon Apr 13 03:20:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E65D01065675; Mon, 13 Apr 2009 03:20:21 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4B678FC08; Mon, 13 Apr 2009 03:20:21 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3D3KLL2050920; Mon, 13 Apr 2009 03:20:21 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3D3KL1r050918; Mon, 13 Apr 2009 03:20:21 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200904130320.n3D3KL1r050918@svn.freebsd.org> From: Sam Leffler Date: Mon, 13 Apr 2009 03:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190986 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2009 03:20:22 -0000 Author: sam Date: Mon Apr 13 03:20:21 2009 New Revision: 190986 URL: http://svn.freebsd.org/changeset/base/190986 Log: remove reference to sc_tdmabintcnt; it was removed in r190848 Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Apr 13 03:13:16 2009 (r190985) +++ head/sys/dev/ath/if_ath.c Mon Apr 13 03:20:21 2009 (r190986) @@ -6987,7 +6987,6 @@ ath_tdma_bintvalsetup(struct ath_softc * { /* copy from vap state (XXX check all vaps have same value?) */ sc->sc_tdmaslotlen = tdma->tdma_slotlen; - sc->sc_tdmabintcnt = tdma->tdma_bintval; sc->sc_tdmabintval = roundup((sc->sc_tdmaslotlen+sc->sc_tdmaguard) * tdma->tdma_slotcnt, 1024); From owner-svn-src-head@FreeBSD.ORG Mon Apr 13 05:21:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11C4E1065673; Mon, 13 Apr 2009 05:21:18 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00C078FC0C; Mon, 13 Apr 2009 05:21:18 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3D5LHKr053393; Mon, 13 Apr 2009 05:21:17 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3D5LHpi053392; Mon, 13 Apr 2009 05:21:17 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <200904130521.n3D5LHpi053392@svn.freebsd.org> From: David Xu Date: Mon, 13 Apr 2009 05:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190987 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2009 05:21:18 -0000 Author: davidxu Date: Mon Apr 13 05:21:17 2009 New Revision: 190987 URL: http://svn.freebsd.org/changeset/base/190987 Log: Make UMTX_OP_WAIT_UINT actually wait for an unsigned integer on 64-bits machine. MFC after: 1 week Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Apr 13 03:20:21 2009 (r190986) +++ head/sys/kern/kern_umtx.c Mon Apr 13 05:21:17 2009 (r190987) @@ -975,7 +975,7 @@ do_wait(struct thread *td, void *addr, u if (compat32 == 0) tmp = fuword(addr); else - tmp = fuword32(addr); + tmp = (unsigned int)fuword32(addr); if (tmp != id) { umtxq_lock(&uq->uq_key); umtxq_remove(uq); From owner-svn-src-head@FreeBSD.ORG Mon Apr 13 05:34:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F94A106566C for ; Mon, 13 Apr 2009 05:34:54 +0000 (UTC) (envelope-from silby@silby.com) Received: from relay03.pair.com (relay03.pair.com [209.68.5.17]) by mx1.freebsd.org (Postfix) with SMTP id 972AC8FC16 for ; Mon, 13 Apr 2009 05:34:53 +0000 (UTC) (envelope-from silby@silby.com) Received: (qmail 72685 invoked from network); 13 Apr 2009 05:08:11 -0000 Received: from 209.68.2.70 (HELO localhost) (209.68.2.70) by relay03.pair.com with SMTP; 13 Apr 2009 05:08:11 -0000 X-pair-Authenticated: 209.68.2.70 Date: Mon, 13 Apr 2009 00:08:10 -0500 (CDT) From: Mike Silbersack To: Jack F Vogel In-Reply-To: <200904100005.n3A05lIu025175@svn.freebsd.org> Message-ID: References: <200904100005.n3A05lIu025175@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190872 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2009 05:34:54 -0000 Jack, either this or some other recent change to the em driver caused it to stop working correctly on the e1000 virtual device inside VMware ESX. Unfortunately, I have not updated my 8.x VMs recently, so I don't know when this broke. I got the message about an invalid MAC address. I modified em_is_valid_ether_addr to always return True, but it looks like the effect of that was to cause the driver to load, but give the NIC a MAC of 00:00:00:00:00:00. However, if I manually set a MAC after that, the virtual NIC IS functional. So I think the sole problem may just be that the code which reads the MAC is incompatible with the ESX emulation. Do you want me to try a kernel from immediately before this change to confirm that this was the cause of the problem? Mike "Silby" Silbersack On Fri, 10 Apr 2009, Jack F Vogel wrote: > Author: jfv > Date: Fri Apr 10 00:05:46 2009 > New Revision: 190872 > URL: http://svn.freebsd.org/changeset/base/190872 > > Log: > This delta syncs the em and igb drivers with Intel, > adds header split and SCTP support into the igb driver. > Various small improvements and fixes. > From owner-svn-src-head@FreeBSD.ORG Mon Apr 13 05:52:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C375D1065675 for ; Mon, 13 Apr 2009 05:52:11 +0000 (UTC) (envelope-from silby@silby.com) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) by mx1.freebsd.org (Postfix) with SMTP id 65EC38FC17 for ; Mon, 13 Apr 2009 05:52:11 +0000 (UTC) (envelope-from silby@silby.com) Received: (qmail 96417 invoked from network); 13 Apr 2009 05:52:10 -0000 Received: from 209.68.2.70 (HELO localhost) (209.68.2.70) by relay01.pair.com with SMTP; 13 Apr 2009 05:52:10 -0000 X-pair-Authenticated: 209.68.2.70 Date: Mon, 13 Apr 2009 00:52:09 -0500 (CDT) From: Mike Silbersack To: Jack F Vogel In-Reply-To: Message-ID: References: <200904100005.n3A05lIu025175@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190872 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2009 05:52:12 -0000 To followup, I csup'd to this date: date=2009.04.08.00.00.00 and the resulting kernel works perfectly with the ESX virtual e1000. What can I do to help debug this problem? Mike "Silby" Silbersack On Mon, 13 Apr 2009, Mike Silbersack wrote: > > Jack, either this or some other recent change to the em driver caused it to > stop working correctly on the e1000 virtual device inside VMware ESX. > Unfortunately, I have not updated my 8.x VMs recently, so I don't know when > this broke. > > I got the message about an invalid MAC address. I modified > em_is_valid_ether_addr to always return True, but it looks like the effect of > that was to cause the driver to load, but give the NIC a MAC of > 00:00:00:00:00:00. However, if I manually set a MAC after that, the virtual > NIC IS functional. So I think the sole problem may just be that the code > which reads the MAC is incompatible with the ESX emulation. > > Do you want me to try a kernel from immediately before this change to confirm > that this was the cause of the problem? > > Mike "Silby" Silbersack > > On Fri, 10 Apr 2009, Jack F Vogel wrote: > >> Author: jfv >> Date: Fri Apr 10 00:05:46 2009 >> New Revision: 190872 >> URL: http://svn.freebsd.org/changeset/base/190872 >> >> Log: >> This delta syncs the em and igb drivers with Intel, >> adds header split and SCTP support into the igb driver. >> Various small improvements and fixes. >> > From owner-svn-src-head@FreeBSD.ORG Mon Apr 13 06:07:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3535A106572F; Mon, 13 Apr 2009 06:07:22 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.182]) by mx1.freebsd.org (Postfix) with ESMTP id AAFBB8FC15; Mon, 13 Apr 2009 06:07:21 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: by wa-out-1112.google.com with SMTP id m38so1062171waf.27 for ; Sun, 12 Apr 2009 23:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=YVFKth9X9D2BQc9ivkYa07QrtfQzh6vuuenj0werlCM=; b=DjCvQOPHGllu/e4KqCtPq6fWDMaVRiqtWzHo1hLN83Cd2h0+nDbUZdfpF0VvBanM+h 4NdYqhsMUyBwCx20SxvRFTMUyxr8qYe+ez2rOowJf1uIP5Org8BL5yUih8NhckhyJQjJ Vsn/qVARFlvyLBjqUWbG5NyzXrK5kISi2Oy40= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=IgQ6ZHNh4wedzsGaRoFMCYetup3IQxoIBViwt7nGq3IcHeXGQx2AUBz3A69irkZd5U S8LfbLyM+1VL7l5g5xiPrO0EUNfBOnlFNgoIdKaR3HPdVGacte//oGteY7XgPLbg5YoN GI0d8q/8SF88ATHs++jR5Lna7Kd0zn6eGggVE= MIME-Version: 1.0 Received: by 10.115.94.1 with SMTP id w1mr392989wal.177.1239601090626; Sun, 12 Apr 2009 22:38:10 -0700 (PDT) In-Reply-To: References: <200904100005.n3A05lIu025175@svn.freebsd.org> Date: Sun, 12 Apr 2009 22:38:10 -0700 Message-ID: <2a41acea0904122238g86295c5v24a1ab96b37136bd@mail.gmail.com> From: Jack Vogel To: Mike Silbersack Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190872 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2009 06:07:23 -0000 There is quite a bit of shared code changes to support alternate mac addressing, if you look at the diffs you'll notice in attach I inserted a reset, and then also moved where hardware init is called, this is because the shared code now requires RAR(0) to have a valid address in it when it does setup, reset causes that, but init_hardware will zero the RAR array out. I have no idea what your environment is, but it sounds like it may be related. If you have a driver that works, you could try taking the new if_em.* and drop them in, see if that solves it. But right now my guess is this issue is in the shared code and not the core. Let me know what you find, Jack On Sun, Apr 12, 2009 at 10:08 PM, Mike Silbersack wrote: > > Jack, either this or some other recent change to the em driver caused it to > stop working correctly on the e1000 virtual device inside VMware ESX. > Unfortunately, I have not updated my 8.x VMs recently, so I don't know when > this broke. > > I got the message about an invalid MAC address. I modified > em_is_valid_ether_addr to always return True, but it looks like the effect > of that was to cause the driver to load, but give the NIC a MAC of > 00:00:00:00:00:00. However, if I manually set a MAC after that, the virtual > NIC IS functional. So I think the sole problem may just be that the code > which reads the MAC is incompatible with the ESX emulation. > > Do you want me to try a kernel from immediately before this change to > confirm that this was the cause of the problem? > > Mike "Silby" Silbersack > > > On Fri, 10 Apr 2009, Jack F Vogel wrote: > > Author: jfv >> Date: Fri Apr 10 00:05:46 2009 >> New Revision: 190872 >> URL: http://svn.freebsd.org/changeset/base/190872 >> >> Log: >> This delta syncs the em and igb drivers with Intel, >> adds header split and SCTP support into the igb driver. >> Various small improvements and fixes. >> >> From owner-svn-src-head@FreeBSD.ORG Mon Apr 13 08:50:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D628C106566B; Mon, 13 Apr 2009 08:50:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 5C6D28FC12; Mon, 13 Apr 2009 08:50:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-107-120-227.carlnfd1.nsw.optusnet.com.au (c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n3D8oRH6028758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Apr 2009 18:50:30 +1000 Date: Mon, 13 Apr 2009 18:50:27 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Rick Macklem In-Reply-To: <200904121904.n3CJ4RTa035520@svn.freebsd.org> Message-ID: <20090413170824.N52089@delplex.bde.org> References: <200904121904.n3CJ4RTa035520@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190971 - in head/sys: conf modules modules/nfssvc nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2009 08:50:33 -0000 On Sun, 12 Apr 2009, Rick Macklem wrote: > Log: > Change nfsserver so that it uses the nfssvc() system call provided > in sys/nfs/nfs_nfssvc.c by registering with it using the > nfsd_call_nfsserver function pointer. Also, add the build glue for > nfs_nfssvc.c optionally based on "nfsserver" and also as a loadable > module. > ... > Modified: head/sys/nfsserver/nfs.h > ============================================================================== > --- head/sys/nfsserver/nfs.h Sun Apr 12 17:43:41 2009 (r190970) > +++ head/sys/nfsserver/nfs.h Sun Apr 12 19:04:27 2009 (r190971) > @@ -40,6 +40,8 @@ > #include "opt_nfs.h" > #endif > > +#include > + Nested includes are style bugs or bugs (namespace pollution). > @@ -447,6 +442,13 @@ int nfsrv_symlink(struct nfsrv_descript > struct mbuf **mrq); > int nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, > struct mbuf **mrq); > +/* > + * #ifdef _SYS_SYSPROTO_H_ so that it is only defined when sysproto.h > + * has been included, so that "struct nfssvc_args" is defined. > + */ > +#ifdef _SYS_SYSPROTO_H_ > +int nfssvc_nfsserver(struct thread *, struct nfssvc_args *); > +#endif None of sysproto.h, or an ifdef for it, or a declaration of "struct nfssvc_args", or a comment about this are needed here. Only a declaration of "struct nfssvc_args *" in the correct scope is needed here. This should be provided by declaring it in file scope without a comment, as is done in hundreds or thousands of similar cases. grep shows 304 similar cases in /sys/sys/*.h, though only 7 cases matching "^struct.*args;". Forward declarations of a syscall args struct are relatively rarely needed since the args struct rarely need to be used outside of the main file that implements the syscall. "struct nfssvc_args *" is self-declared in the prototype but this is not in file scope so it is inconsistent unless it repeats a file-scope declaration that is always visible. > Modified: head/sys/nfsserver/nfs_srvkrpc.c > ============================================================================== > --- head/sys/nfsserver/nfs_srvkrpc.c Sun Apr 12 17:43:41 2009 (r190970) > +++ head/sys/nfsserver/nfs_srvkrpc.c Sun Apr 12 19:04:27 2009 (r190971) > ... > @@ -163,25 +166,14 @@ int32_t (*nfsrv3_procs[NFS_NPROCS])(stru > * - sockaddr with no IPv4-mapped addresses > * - mask for both INET and INET6 families if there is IPv4-mapped overlap > */ > -#ifndef _SYS_SYSPROTO_H_ > -struct nfssvc_args { > - int flag; > - caddr_t argp; > -}; > -#endif These sysproto ifdefs and their contents were to make the struct definitions visible nearby (so that you don't have to look in sysproto.h and decipher its macros) in such a way that they can be checked for compatibility with the actual declarations. This replaces the 4.4BSD method of declaring structs in pseudo-code in some places where args structs are used, in the form struct nfssvc_args /* { int flag; caddr_t argp; } */ *uap; in 4.4BSD-Lite1, and in the form struct nfssvc_args /* { syscallarg(int) flag; syscallarg(caddr_t) argp; } */ *uap; in 4.4BSD-Lite2, to match the change of adding syscallarg() in the actual declarations. 4.4BSD uses this most consistently for vfs syscalls and doesn't use it in any form for nfssvc_args -- it just declares the complete nfssvc_args struct unportably only once just before it is used, the same as for most syscall args structs in Net/2. NetBSD as of 2005 uses essentially exactly the version with syscallargs() above. The 4.4BSD-Lite1 method is bad since it is difficult to decipher pseudo-code so that it can be automatically compared with the actual declarations (the pseudo-code of course rots unless it is checked automatically). The 4.4BSD-Lite2 method is worse because it requires deciphering the syscallarg() macros to understand the pseudo-code. The 4.4BSD-Lite2 method also doesn't actually work in general, since it doesn't provide any control over padding between the fields and it only provides limited control over the layout within the fields. FreeBSD uses more complicated macros to provide more control over both. Automatic checking of the pseudo-code has not been implemented for FreeBSD and is further away than when the comments were changed to ifdefs. All of the pseudo-code has rotted perfectly by not keeping up with any of the changes to use macros in the actual code. The pseudo-code would be too hard to decipher if it had kept up. Urk, I just notice that FreeBSD still does this most bogusly for vfs syscalls. It has sysproto ifdefs in most cases, and also has 4.4BSD-Lite1-style comments in most cases, mainly as a result of mismerging 4.4BSD-Lite2. FreeBSD had moved all of the pseudo-code in comments to code in ifdefs. Then the merge brought back most of the comments in their modified form (with syscallarg()). Later, FreeBSD only removed the syscallarg()'s. Later, a few syscalls like lchflags() were imported from NetBSD. These usually have the pseudo-code in comments but not code in ifdefs. Similar pseudo-code is used in some cases (mainly in older code?) for automatically-generated args structs for vnops. It looks like: % /* % * Open called. % */ % /* ARGSUSED */ % static int % ufs_open(ap) % struct vop_open_args /* { % struct vnode *a_vp; % int a_mode; % struct ucred *a_cred; % struct thread *a_td; % } */ *ap; % { Bugs in this include: - the first comment adds less than nothing - /* ARGSUSED */ is bitrot. It was to quiet lint before args structs were used. Then vnops were passed a long list of args, often with many unused placeholder args. - the a_mode line has an extra space or space instead of a tab. With a new-style function declaration, the corresponding pseudo-code would be even harder to format normally. Many syscall entry points have a rotted /* ARGSUSED */ due to incomplete removal of their only unused arg (retval). Bruce From owner-svn-src-head@FreeBSD.ORG Mon Apr 13 09:17:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F4961065673; Mon, 13 Apr 2009 09:17:41 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DA0C8FC14; Mon, 13 Apr 2009 09:17:41 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3D9Hfb5064267; Mon, 13 Apr 2009 09:17:41 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3D9Hf9g064266; Mon, 13 Apr 2009 09:17:41 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200904130917.n3D9Hf9g064266@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 13 Apr 2009 09:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190991 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2009 09:17:41 -0000 Author: edwin Date: Mon Apr 13 09:17:40 2009 New Revision: 190991 URL: http://svn.freebsd.org/changeset/base/190991 Log: MFV of tzdata2009e - Jordan went into DST in the last Thursday in March instead of the last Friday in March. - Palestine has extended the DST time with one week before and one month after. MFC after: 1 week Modified: head/share/zoneinfo/ (props changed) head/share/zoneinfo/asia Modified: head/share/zoneinfo/asia ============================================================================== --- head/share/zoneinfo/asia Mon Apr 13 09:16:24 2009 (r190990) +++ head/share/zoneinfo/asia Mon Apr 13 09:17:40 2009 (r190991) @@ -1,4 +1,4 @@ -# @(#)asia 8.26 +# @(#)asia 8.29 #
 
 # This data is by no means authoritative; if you think you know better,
@@ -1049,6 +1049,40 @@ Zone	Asia/Tokyo	9:18:59	-	LMT	1887 Dec 3
 # http://www.petranews.gov.jo/nepras/2006/Sep/05/4000.htm
 # "Jordan will switch to winter time on Friday, October 27".
 #
+
+# From Phil Pizzey (2009-04-02):
+# ...I think I may have spotted an error in the timezone data for
+# Jordan.
+# The current (2009d) asia file shows Jordan going to daylight
+# saving
+# time on the last Thursday in March.
+#
+# Rule  Jordan      2000  max	-  Mar   lastThu     0:00s 1:00  S
+#
+# However timeanddate.com, which I usually find reliable, shows Jordan
+# going to daylight saving time on the last Friday in March since 2002.
+# Please see
+# 
+# http://www.timeanddate.com/worldclock/timezone.html?n=11
+# 
+
+# From Steffen Thorsen (2009-04-02):
+# This single one might be good enough, (2009-03-24, Arabic):
+# 
+# http://petra.gov.jo/Artical.aspx?Lng=2&Section=8&Artical=95279
+# 
+#
+# Google's translation:
+#
+# > The Council of Ministers decided in 2002 to adopt the principle of timely
+# > submission of the summer at 60 minutes as of midnight on the last Thursday
+# > of the month of March of each year.
+#
+# So - this means the midnight between Thursday and Friday since 2002.
+
+# From Arthur David Olson (2009-04-06):
+# We still have Jordan switching to DST on Thursdays in 2000 and 2001.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Jordan	1973	only	-	Jun	6	0:00	1:00	S
 Rule	Jordan	1973	1975	-	Oct	1	0:00	0	-
@@ -1071,8 +1105,9 @@ Rule	Jordan	1993	1998	-	Apr	Fri>=1	0:00	
 Rule	Jordan	1994	only	-	Sep	Fri>=15	0:00	0	-
 Rule	Jordan	1995	1998	-	Sep	Fri>=15	0:00s	0	-
 Rule	Jordan	1999	only	-	Jul	 1	0:00s	1:00	S
-Rule	Jordan	1999	2002	-	Sep	lastThu	0:00s	0	-
-Rule	Jordan	2000	max	-	Mar	lastThu	0:00s	1:00	S
+Rule	Jordan	1999	2002	-	Sep	lastFri	0:00s	0	-
+Rule	Jordan	2000	2001	-	Mar	lastThu	0:00s	1:00	S
+Rule	Jordan	2002	max	-	Mar	lastFri	0:00s	1:00	S
 Rule	Jordan	2003	only	-	Oct	24	0:00s	0	-
 Rule	Jordan	2004	only	-	Oct	15	0:00s	0	-
 Rule	Jordan	2005	only	-	Sep	lastFri	0:00s	0	-
@@ -1695,6 +1730,22 @@ Zone	Asia/Karachi	4:28:12 -	LMT	1907
 # http://www.worldtimezone.com/dst_news/dst_news_gazastrip01.html
 # 
 
+# From Alexander Krivenyshev (2009-03-26):
+# According to the Palestine News Network (arabic.pnn.ps), Palestinian
+# government decided to start Daylight Time on Thursday night March
+# 26 and continue until the night of 27 September 2009.
+#
+# (in Arabic)
+# 
+# http://arabic.pnn.ps/index.php?option=com_content&task=view&id=50850
+# 
+#
+# or
+# (English translation)
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_westbank01.html
+# 
+
 # The rules for Egypt are stolen from the `africa' file.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -1708,10 +1759,12 @@ Rule Palestine	1999	2005	-	Apr	Fri>=15	0
 Rule Palestine	1999	2003	-	Oct	Fri>=15	0:00	0	-
 Rule Palestine	2004	only	-	Oct	 1	1:00	0	-
 Rule Palestine	2005	only	-	Oct	 4	2:00	0	-
-Rule Palestine	2006	max	-	Apr	 1	0:00	1:00	S
+Rule Palestine	2006	2008	-	Apr	 1	0:00	1:00	S
 Rule Palestine	2006	only	-	Sep	22	0:00	0	-
 Rule Palestine	2007	only	-	Sep	Thu>=8	2:00	0	-
-Rule Palestine	2008	max	-	Aug	lastThu	2:00	0	-
+Rule Palestine	2008	only	-	Aug	lastFri	2:00	0	-
+Rule Palestine	2009	max	-	Mar	lastFri	0:00	1:00	S
+Rule Palestine	2009	max	-	Sep	lastMon	2:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 11:08:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CFB4D106567D;
	Mon, 13 Apr 2009 11:08:35 +0000 (UTC) (envelope-from ed@hoeg.nl)
Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211])
	by mx1.freebsd.org (Postfix) with ESMTP id 6A6F78FC21;
	Mon, 13 Apr 2009 11:08:35 +0000 (UTC) (envelope-from ed@hoeg.nl)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id A51891CD22; Mon, 13 Apr 2009 13:08:34 +0200 (CEST)
Date: Mon, 13 Apr 2009 13:08:34 +0200
From: Ed Schouten 
To: Christoph Mallon 
Message-ID: <20090413110834.GC32098@hoeg.nl>
References: <200904111401.n3BE1108088009@svn.freebsd.org>
	<20090411163528.GC46526@troutmask.apl.washington.edu>
	<20090411124335.0600a72f@kan.dnsalias.net> <49E1E01C.90704@gmx.de>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="15rqq6UvmZq3FwB1"
Content-Disposition: inline
In-Reply-To: <49E1E01C.90704@gmx.de>
User-Agent: Mutt/1.5.19 (2009-01-05)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Alexander Kabaev ,
	Steve Kargl 
Subject: Re: svn commit: r190919 - in head/sys: amd64/amd64 amd64/include
	i386/i386 i386/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 11:08:36 -0000


--15rqq6UvmZq3FwB1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi all,

Any comments on Christoph's patch before I commit it to SVN? It should
at least make the headers more consistent than they are right now.

--=20
 Ed Schouten 
 WWW: http://80386.nl/

--15rqq6UvmZq3FwB1
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAknjHTIACgkQ52SDGA2eCwWIiACfQ5qmYOwfL1giGOsOeY1t9skv
c+EAnjV0H612nZalOYw9GIQONKEGp2tT
=aGGB
-----END PGP SIGNATURE-----

--15rqq6UvmZq3FwB1--

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 11:39:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 356871065C73;
	Mon, 13 Apr 2009 11:39:05 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au
	[211.29.132.185])
	by mx1.freebsd.org (Postfix) with ESMTP id 998118FC1E;
	Mon, 13 Apr 2009 11:39:04 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from c122-107-120-227.carlnfd1.nsw.optusnet.com.au
	(c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227])
	by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	n3DBcciV031156
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 13 Apr 2009 21:38:40 +1000
Date: Mon, 13 Apr 2009 21:38:38 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: Ed Schouten 
In-Reply-To: <20090413110834.GC32098@hoeg.nl>
Message-ID: <20090413211354.G52297@delplex.bde.org>
References: <200904111401.n3BE1108088009@svn.freebsd.org>
	<20090411163528.GC46526@troutmask.apl.washington.edu>
	<20090411124335.0600a72f@kan.dnsalias.net> <49E1E01C.90704@gmx.de>
	<20090413110834.GC32098@hoeg.nl>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
	Steve Kargl , svn-src-head@freebsd.org,
	Christoph Mallon ,
	Alexander Kabaev 
Subject: Re: svn commit: r190919 - in head/sys: amd64/amd64 amd64/include
 i386/i386 i386/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 11:39:29 -0000

On Mon, 13 Apr 2009, Ed Schouten wrote:

> Any comments on Christoph's patch before I commit it to SVN? It should
> at least make the headers more consistent than they are right now.

It makes the headers much less consistent, since (if it was the big
patch that I saw) it only changes 1 file in each of 2 arches, making
these files perfectly inconsistent with all nearby files and more
inconsistent with the corresponding files for other arches.

The patch to actually make things consistent (in hundreds more headers
and C files, just for __volatile and __inline) would be larger than
I want to read, especially in installments when diffing with old versions.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 13:51:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 77BAB106566B;
	Mon, 13 Apr 2009 13:51:53 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5B8428FC13;
	Mon, 13 Apr 2009 13:51:53 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DDprN4073485;
	Mon, 13 Apr 2009 13:51:53 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DDprAS073484;
	Mon, 13 Apr 2009 13:51:53 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200904131351.n3DDprAS073484@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Mon, 13 Apr 2009 13:51:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191000 - head/tools/regression/acltools
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 13:51:54 -0000

Author: trasz
Date: Mon Apr 13 13:51:53 2009
New Revision: 191000
URL: http://svn.freebsd.org/changeset/base/191000

Log:
  Add a few more regression tests for POSIX.1e ACLs.

Modified:
  head/tools/regression/acltools/tools-posix.test

Modified: head/tools/regression/acltools/tools-posix.test
==============================================================================
--- head/tools/regression/acltools/tools-posix.test	Mon Apr 13 13:41:44 2009	(r190999)
+++ head/tools/regression/acltools/tools-posix.test	Mon Apr 13 13:51:53 2009	(r191000)
@@ -42,6 +42,51 @@ $ getfacl xxx
 $ ls -l xxx | cut -d' ' -f1
 > -rw-rw-r--+
 
+# Same as above, but for symlinks.
+$ ln -s xxx lll
+$ getfacl -h lll
+> # file: lll
+> # owner: root
+> # group: wheel
+> user::rwx
+> group::r-x
+> other::r-x
+
+$ getfacl -qh lll
+> user::rwx
+> group::r-x
+> other::r-x
+
+$ getfacl -q lll
+> user::rw-
+> user:42:r--
+> group::r--
+> group:43:-w-
+> mask::rw-
+> other::r--
+
+$ setfacl -hm u:44:x,g:45:w lll
+$ getfacl -h lll
+> # file: lll
+> # owner: root
+> # group: wheel
+> user::rwx
+> user:44:--x
+> group::r-x
+> group:45:-w-
+> mask::rwx
+> other::r-x
+
+# XXX: Why doesn't ls(1) print '+' for symbolic links with ACL set?
+$ ls -l lll | cut -d' ' -f1
+> lrwxrwxr-x
+
+# Check whether the original file is left untouched.
+$ ls -l xxx | cut -d' ' -f1
+> -rw-rw-r--+
+
+$ rm lll
+
 # Test removing entries.
 $ setfacl -x user:42: xxx
 $ getfacl xxx
@@ -173,6 +218,15 @@ $ ls -l nnn xxx yyy zzz | cut -d' ' -f1
 > -rw-r--r--+
 > -rw-r--r--+
 
+$ setfacl -bn nnn xxx yyy zzz
+> setfacl: stat() of nnn failed: No such file or directory
+
+$ ls -l nnn xxx yyy zzz | cut -d' ' -f1
+> ls: nnn: No such file or directory
+> -rw-r--r--
+> -rw-r--r--
+> -rw-r--r--
+
 $ rm xxx yyy zzz
 
 # Check whether chmod actually does what it should do.
@@ -210,14 +264,21 @@ $ getfacl -q ddd
 > group::r-x
 > other::r-x
 
+$ ls -l | grep ddd | cut -d' ' -f1
+> drwxr-xr-x
+
 $ getfacl -dq ddd
-$ setfacl -d -m u::rwx,g::rx,o::rx,mask::rwx ddd
+$ setfacl -dm u::rwx,g::rx,o::rx,mask::rwx ddd
 $ getfacl -dq ddd
 > user::rwx
 > group::r-x
 > mask::rwx
 > other::r-x
 
+# No change - ls(1) output doesn't take into account default ACLs.
+$ ls -l | grep ddd | cut -d' ' -f1
+> drwxr-xr-x
+
 $ setfacl -dm g:42:rwx,u:42:r ddd
 $ setfacl -dm g::w ddd
 $ getfacl -dq ddd
@@ -236,8 +297,59 @@ $ getfacl -dq ddd
 > mask::rw-
 > other::r-x
 
-> # XXX: Test inheritance.
+$ ls -l | grep ddd | cut -d' ' -f1
+> drwxr-xr-x
 
 $ rmdir ddd
 $ rm xxx
 
+# Test inheritance.
+$ mkdir ddd
+
+$ touch ddd/xxx
+$ getfacl -q ddd/xxx
+> user::rw-
+> group::r--
+> other::r--
+
+$ mkdir ddd/ddd
+$ getfacl -q ddd/ddd
+> user::rwx
+> group::r-x
+> other::r-x
+
+$ rmdir ddd/ddd
+$ rm ddd/xxx
+
+$ setfacl -dm u::rwx,g::rx,o::rx,mask::rwx ddd
+$ setfacl -dm g:42:rwx,u:43:r ddd
+$ getfacl -dq ddd
+> user::rwx
+> user:43:r--
+> group::r-x
+> group:42:rwx
+> mask::rwx
+> other::r-x
+
+$ touch ddd/xxx
+$ getfacl -q ddd/xxx
+> user::rw-
+> user:43:r--
+> group::r-x		# effective: r--
+> group:42:rwx		# effective: r--
+> mask::r--
+> other::r--
+
+$ mkdir ddd/ddd
+$ getfacl -q ddd/ddd
+> user::rwx
+> user:43:r--
+> group::r-x
+> group:42:rwx		# effective: r-x
+> mask::r-x
+> other::r-x
+
+$ rmdir ddd/ddd
+$ rm ddd/xxx
+$ rmdir ddd
+

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 15:28:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 67FE51065672
	for ; Mon, 13 Apr 2009 15:28:37 +0000 (UTC)
	(envelope-from silby@silby.com)
Received: from niwun.pair.com (niwun.pair.com [209.68.2.70])
	by mx1.freebsd.org (Postfix) with SMTP id 092D98FC25
	for ; Mon, 13 Apr 2009 15:28:36 +0000 (UTC)
	(envelope-from silby@silby.com)
Received: (qmail 67837 invoked by uid 3193); 13 Apr 2009 15:28:34 -0000
Received: from localhost (sendmail-bs@127.0.0.1)
	by localhost with SMTP; 13 Apr 2009 15:28:34 -0000
Date: Mon, 13 Apr 2009 11:28:34 -0400 (EDT)
From: Mike Silbersack 
X-X-Sender: silby@niwun.pair.com
To: Jack Vogel 
In-Reply-To: <2a41acea0904122238g86295c5v24a1ab96b37136bd@mail.gmail.com>
Message-ID: 
References: <200904100005.n3A05lIu025175@svn.freebsd.org>
	
	<2a41acea0904122238g86295c5v24a1ab96b37136bd@mail.gmail.com>
User-Agent: Alpine 1.00 (BSF 882 2007-12-20)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII
Cc: Jack F Vogel , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r190872 - head/sys/dev/e1000
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 15:28:38 -0000


On Sun, 12 Apr 2009, Jack Vogel wrote:

> There is quite a bit of shared code changes to support alternate mac
> addressing, if
> you look at the diffs you'll notice in attach I inserted a reset, and then
> also moved
> where hardware init is called, this is because the shared code now requires
> RAR(0)
> to have a valid address in it when it does setup, reset causes that, but
> init_hardware
> will zero the RAR array out.
>
> I have no idea what your environment is, but it sounds like it may be
> related.
>
> If you have a driver that works, you could try taking the new if_em.* and
> drop
> them in, see if that solves it. But right now my guess is this issue is in
> the shared
> code and not the core.
>
> Let me know what you find,
>
> Jack

Ok, I will try to help narrow it down.  I saved a working kernel (from 4 
days ago), so I can reboot with that one when I need network connectivity.

Mike "Silby" Silbersack

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 15:29:06 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2FA2E1065697;
	Mon, 13 Apr 2009 15:29:06 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id E69C98FC08;
	Mon, 13 Apr 2009 15:29:05 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 0AA3546B52;
	Mon, 13 Apr 2009 11:29:05 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 237338A050;
	Mon, 13 Apr 2009 11:28:44 -0400 (EDT)
From: John Baldwin 
To: Ed Schouten 
Date: Mon, 13 Apr 2009 10:48:16 -0400
User-Agent: KMail/1.9.7
References: <200904111401.n3BE1108088009@svn.freebsd.org>
In-Reply-To: <200904111401.n3BE1108088009@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200904131048.16545.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Mon, 13 Apr 2009 11:28:44 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=0.1 required=4.2 tests=RDNS_NONE autolearn=no
	version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190919 - in head/sys: amd64/amd64 amd64/include
	i386/i386 i386/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 15:29:07 -0000

On Saturday 11 April 2009 10:01:01 am Ed Schouten wrote:
> Author: ed
> Date: Sat Apr 11 14:01:01 2009
> New Revision: 190919
> URL: http://svn.freebsd.org/changeset/base/190919
> 
> Log:
>   Simplify in/out functions (for i386 and AMD64).
>   
>   Remove a hack to generate more efficient code for port numbers below
>   0x100, which has been obsolete for at least ten years, because GCC has
>   an asm constraint to specify that.
>   
>   Submitted by:	Christoph Mallon 

Hmm, it appears that you broke the DDB usage:

db> call inb(0x20)

Since the functions are now called 'inb_' and 'outb_'.  Perhaps the inline 
routines should be _inb() and _outb() and inb and outb should still be macros 
that wrap them that then get undefined in machdep.c for the functions used in 
DDB?

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 15:29:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9555210658A9;
	Mon, 13 Apr 2009 15:29:14 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 698EC8FC2F;
	Mon, 13 Apr 2009 15:29:14 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DFTEWC075683;
	Mon, 13 Apr 2009 15:29:14 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DFTEi6075682;
	Mon, 13 Apr 2009 15:29:14 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200904131529.n3DFTEi6075682@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Mon, 13 Apr 2009 15:29:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191003 - head/bin/ls
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 15:29:15 -0000

Author: trasz
Date: Mon Apr 13 15:29:14 2009
New Revision: 191003
URL: http://svn.freebsd.org/changeset/base/191003

Log:
  Add reference to strmode(3).

Modified:
  head/bin/ls/ls.1

Modified: head/bin/ls/ls.1
==============================================================================
--- head/bin/ls/ls.1	Mon Apr 13 14:25:36 2009	(r191002)
+++ head/bin/ls/ls.1	Mon Apr 13 15:29:14 2009	(r191003)
@@ -680,6 +680,7 @@ specification.
 .Xr sort 1 ,
 .Xr xterm 1 ,
 .Xr strftime 3 ,
+.Xr strmode 3 ,
 .Xr termcap 5 ,
 .Xr maclabel 7 ,
 .Xr symlink 7 ,

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 16:18:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 578CC106564A;
	Mon, 13 Apr 2009 16:18:13 +0000 (UTC) (envelope-from ed@hoeg.nl)
Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211])
	by mx1.freebsd.org (Postfix) with ESMTP id EA99E8FC18;
	Mon, 13 Apr 2009 16:18:12 +0000 (UTC) (envelope-from ed@hoeg.nl)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id 5138D1CD22; Mon, 13 Apr 2009 18:18:12 +0200 (CEST)
Date: Mon, 13 Apr 2009 18:18:12 +0200
From: Ed Schouten 
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
Message-ID: <20090413161812.GD32098@hoeg.nl>
References: <200904111401.n3BE1108088009@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="OAsA6xQjj2jRKPG2"
Content-Disposition: inline
In-Reply-To: <200904111401.n3BE1108088009@svn.freebsd.org>
User-Agent: Mutt/1.5.19 (2009-01-05)
Cc: 
Subject: Revert unneeded changes of r190919
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 16:18:13 -0000


--OAsA6xQjj2jRKPG2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi all,

Because the changes in r190919 did contain some nice fixes, but some of
them were unneeded or should not attempted to be fixed here, I've
decided to prepare a commit to revert the changes made in r190919,
except the improvements Christoph made to the inline assembly.

	http://80386.nl/pub/cmallon.diff

After this patch is applied, only the following things have changed:

- The inline functions in cpufunc.h will use the N modified to figure
  out how to call the instruction.
- The code in machdep.c will call _inb()/_outb() instead of rolling its
  own version.

This fixes the issue John is seeing.

I'm currently busy testing the patch. Any comments?

--=20
 Ed Schouten 
 WWW: http://80386.nl/

--OAsA6xQjj2jRKPG2
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAknjZcQACgkQ52SDGA2eCwVllQCfT9ljHcRtTu7w4WUEGORPsrpu
oocAnjlSMtcOEkZxlzjgEz+JrWowE1VP
=Oe83
-----END PGP SIGNATURE-----

--OAsA6xQjj2jRKPG2--

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 16:22:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C3040106566B;
	Mon, 13 Apr 2009 16:22:38 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B1F0B8FC1A;
	Mon, 13 Apr 2009 16:22:38 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DGMc6v076977;
	Mon, 13 Apr 2009 16:22:38 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DGMciN076976;
	Mon, 13 Apr 2009 16:22:38 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200904131622.n3DGMciN076976@svn.freebsd.org>
From: Xin LI 
Date: Mon, 13 Apr 2009 16:22:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191004 - head/usr.bin/truss
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 16:22:39 -0000

Author: delphij
Date: Mon Apr 13 16:22:38 2009
New Revision: 191004
URL: http://svn.freebsd.org/changeset/base/191004

Log:
  Correct a bug where pr_data should have been assigned.

Modified:
  head/usr.bin/truss/setup.c

Modified: head/usr.bin/truss/setup.c
==============================================================================
--- head/usr.bin/truss/setup.c	Mon Apr 13 15:29:14 2009	(r191003)
+++ head/usr.bin/truss/setup.c	Mon Apr 13 16:22:38 2009	(r191004)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copryight 1997 Sean Eric Fagan
  *
  * Redistribution and use in source and binary forms, with or without
@@ -214,8 +214,8 @@ waitevent(struct trussinfo *info)
 		}
 	}
 	if (WIFSIGNALED(waitval)) {
-	        info->pr_why = S_EXIT;
-		info->pr_why = 0;
-                return;
+		info->pr_why = S_EXIT;
+		info->pr_data = 0;
+		return;
 	}
 }

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 16:23:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 115E7106564A;
	Mon, 13 Apr 2009 16:23:33 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 005F68FC1D;
	Mon, 13 Apr 2009 16:23:33 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DGNWRh077032;
	Mon, 13 Apr 2009 16:23:32 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DGNWNh077031;
	Mon, 13 Apr 2009 16:23:32 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200904131623.n3DGNWNh077031@svn.freebsd.org>
From: Xin LI 
Date: Mon, 13 Apr 2009 16:23:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191005 - head/usr.bin/truss
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 16:23:33 -0000

Author: delphij
Date: Mon Apr 13 16:23:32 2009
New Revision: 191005
URL: http://svn.freebsd.org/changeset/base/191005

Log:
  Don't exit until all truss children were exit.

Modified:
  head/usr.bin/truss/main.c

Modified: head/usr.bin/truss/main.c
==============================================================================
--- head/usr.bin/truss/main.c	Mon Apr 13 16:22:38 2009	(r191004)
+++ head/usr.bin/truss/main.c	Mon Apr 13 16:23:32 2009	(r191005)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copryight 1997 Sean Eric Fagan
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -164,6 +165,8 @@ main(int ac, char **av)
 {
 	int c;
 	int i;
+	pid_t childpid;
+	int status;
 	char **command;
 	struct ex_types *funcs;
 	int initial_open;
@@ -288,8 +291,6 @@ START_TRACE:
 
 			if (trussinfo->curthread->in_fork &&
 			    (trussinfo->flags & FOLLOWFORKS)) {
-				int childpid;
-
 				trussinfo->curthread->in_fork = 0;
 				childpid =
 				    funcs->exit_syscall(trussinfo,
@@ -360,6 +361,11 @@ START_TRACE:
 		}
 	} while (trussinfo->pr_why != S_EXIT);
 	fflush(trussinfo->outfile);
-	
+
+	if (trussinfo->flags & FOLLOWFORKS)
+		do {
+			childpid = wait(&status);
+		} while (childpid != -1);
+
 	return (0);
 }

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 17:57:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E1083106564A;
	Mon, 13 Apr 2009 17:57:12 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D02C38FC15;
	Mon, 13 Apr 2009 17:57:12 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DHvCCl078960;
	Mon, 13 Apr 2009 17:57:12 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DHvCMA078959;
	Mon, 13 Apr 2009 17:57:12 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200904131757.n3DHvCMA078959@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Mon, 13 Apr 2009 17:57:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191006 - head/usr.sbin/ppp
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 17:57:13 -0000

Author: bz
Date: Mon Apr 13 17:57:12 2009
New Revision: 191006
URL: http://svn.freebsd.org/changeset/base/191006

Log:
  In case the peer address was already configured on the interface
  we were not properly handling proxy arp. Make sure we (try to) add
  the proxy arp entry/entries in this case as well.
  
  PR:		bin/131250
  Submitted by:	loos.br gmail.com (Luiz Otavio O Souza)
  MFC after:	3 days

Modified:
  head/usr.sbin/ppp/iface.c

Modified: head/usr.sbin/ppp/iface.c
==============================================================================
--- head/usr.sbin/ppp/iface.c	Mon Apr 13 16:23:32 2009	(r191005)
+++ head/usr.sbin/ppp/iface.c	Mon Apr 13 17:57:12 2009	(r191006)
@@ -456,6 +456,7 @@ iface_Add(struct iface *iface, struct nc
       if (ncprange_equal(&iface->addr[n].ifa, ifa) &&
           ncpaddr_equal(&iface->addr[n].peer, peer)) {
         close(s);
+        ncp_IfaceAddrAdded(ncp, iface->addr + n);
         return 1;	/* Already there */
       }
 

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 18:32:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 52C4E10656CD;
	Mon, 13 Apr 2009 18:32:27 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 188C98FC23;
	Mon, 13 Apr 2009 18:32:27 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DIWQFF079695;
	Mon, 13 Apr 2009 18:32:26 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DIWQ8O079692;
	Mon, 13 Apr 2009 18:32:26 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200904131832.n3DIWQ8O079692@svn.freebsd.org>
From: Robert Watson 
Date: Mon, 13 Apr 2009 18:32:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191007 - head/lib/libc/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 18:32:42 -0000

Author: rwatson
Date: Mon Apr 13 18:32:26 2009
New Revision: 191007
URL: http://svn.freebsd.org/changeset/base/191007

Log:
  Sort man page cross references by section, no need for a comma after the
  last cross reference.
  
  MFC after:	3 days

Modified:
  head/lib/libc/sys/sctp_generic_recvmsg.2
  head/lib/libc/sys/sctp_generic_sendmsg.2
  head/lib/libc/sys/sctp_peeloff.2

Modified: head/lib/libc/sys/sctp_generic_recvmsg.2
==============================================================================
--- head/lib/libc/sys/sctp_generic_recvmsg.2	Mon Apr 13 17:57:12 2009	(r191006)
+++ head/lib/libc/sys/sctp_generic_recvmsg.2	Mon Apr 13 18:32:26 2009	(r191007)
@@ -70,5 +70,5 @@ The argument
 is not a socket.
 .El
 .Sh SEE ALSO
-.Xr sctp 4 ,
 .Xr sctp_recvmsg 3 ,
+.Xr sctp 4

Modified: head/lib/libc/sys/sctp_generic_sendmsg.2
==============================================================================
--- head/lib/libc/sys/sctp_generic_sendmsg.2	Mon Apr 13 17:57:12 2009	(r191006)
+++ head/lib/libc/sys/sctp_generic_sendmsg.2	Mon Apr 13 18:32:26 2009	(r191007)
@@ -79,8 +79,8 @@ The argument
 is not a socket.
 .El
 .Sh SEE ALSO
-.Xr sctp 4 ,
 .Xr sctp_send 3 ,
-.Xr sctp_sendx 3 ,
 .Xr sctp_sendmsg 3 ,
 .Xr sctp_sendmsgx 3 ,
+.Xr sctp_sendx 3 ,
+.Xr sctp 4

Modified: head/lib/libc/sys/sctp_peeloff.2
==============================================================================
--- head/lib/libc/sys/sctp_peeloff.2	Mon Apr 13 17:57:12 2009	(r191006)
+++ head/lib/libc/sys/sctp_peeloff.2	Mon Apr 13 18:32:26 2009	(r191007)
@@ -78,4 +78,4 @@ The argument
 is not a socket.
 .El
 .Sh SEE ALSO
-.Xr sctp 4 ,
+.Xr sctp 4

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 18:56:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0AB511065670;
	Mon, 13 Apr 2009 18:56:54 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ED3F58FC0A;
	Mon, 13 Apr 2009 18:56:53 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DIur3C080304;
	Mon, 13 Apr 2009 18:56:53 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DIure6080303;
	Mon, 13 Apr 2009 18:56:53 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904131856.n3DIure6080303@svn.freebsd.org>
From: Tim Kientzle 
Date: Mon, 13 Apr 2009 18:56:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191008 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 18:56:54 -0000

Author: kientzle
Date: Mon Apr 13 18:56:53 2009
New Revision: 191008
URL: http://svn.freebsd.org/changeset/base/191008

Log:
  Re-enable backing up extended attributes, as the ZFS bug this
  triggered seems to have been fixed by John Baldwin's commit
  r189967.

Modified:
  head/lib/libarchive/config_freebsd.h

Modified: head/lib/libarchive/config_freebsd.h
==============================================================================
--- head/lib/libarchive/config_freebsd.h	Mon Apr 13 18:32:26 2009	(r191007)
+++ head/lib/libarchive/config_freebsd.h	Mon Apr 13 18:56:53 2009	(r191008)
@@ -34,12 +34,8 @@
 #define	HAVE_ACL_SET_FD_NP 1
 #define	HAVE_ACL_SET_FILE 1
 #define	HAVE_ACL_USER 1
-#if 0
-/* XXX Temporarily disable support for reading extended attributes from
- * disk, as it seems to be badly broken on ZFS. XXX */
 #define	HAVE_EXTATTR_GET_FILE 1
 #define	HAVE_EXTATTR_LIST_FILE 1
-#endif
 #define	HAVE_EXTATTR_SET_FD 1
 #define	HAVE_EXTATTR_SET_FILE 1
 #define	HAVE_SYS_ACL_H 1

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 19:10:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D3BDA106564A;
	Mon, 13 Apr 2009 19:10:56 +0000 (UTC)
	(envelope-from stefanf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C288A8FC16;
	Mon, 13 Apr 2009 19:10:56 +0000 (UTC)
	(envelope-from stefanf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DJAuQc080725;
	Mon, 13 Apr 2009 19:10:56 GMT (envelope-from stefanf@svn.freebsd.org)
Received: (from stefanf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DJAuqp080724;
	Mon, 13 Apr 2009 19:10:56 GMT (envelope-from stefanf@svn.freebsd.org)
Message-Id: <200904131910.n3DJAuqp080724@svn.freebsd.org>
From: Stefan Farfeleder 
Date: Mon, 13 Apr 2009 19:10:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191009 - head/bin/sh
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 19:10:57 -0000

Author: stefanf
Date: Mon Apr 13 19:10:56 2009
New Revision: 191009
URL: http://svn.freebsd.org/changeset/base/191009

Log:
  Parse 'cmd1 && ! cmd2 | cmd3' correctly, the bang should apply to the entire
  pipeline cmd2 | cmd3 and not just cmd2.
  
  PR:		130298
  Submitted by:	Jilles Tjoelker

Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==============================================================================
--- head/bin/sh/parser.c	Mon Apr 13 18:56:53 2009	(r191008)
+++ head/bin/sh/parser.c	Mon Apr 13 19:10:56 2009	(r191009)
@@ -250,6 +250,7 @@ pipeline(void)
 	int negate;
 
 	negate = 0;
+	checkkwd = 2;
 	TRACE(("pipeline: entered\n"));
 	while (readtoken() == TNOT)
 		negate = !negate;

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 19:12:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 90A2B106564A;
	Mon, 13 Apr 2009 19:12:28 +0000 (UTC)
	(envelope-from stefanf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7CE998FC0C;
	Mon, 13 Apr 2009 19:12:28 +0000 (UTC)
	(envelope-from stefanf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DJCSV1080829;
	Mon, 13 Apr 2009 19:12:28 GMT (envelope-from stefanf@svn.freebsd.org)
Received: (from stefanf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DJCSbs080828;
	Mon, 13 Apr 2009 19:12:28 GMT (envelope-from stefanf@svn.freebsd.org)
Message-Id: <200904131912.n3DJCSbs080828@svn.freebsd.org>
From: Stefan Farfeleder 
Date: Mon, 13 Apr 2009 19:12:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191010 - head/tools/regression/bin/sh/parser
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 19:12:30 -0000

Author: stefanf
Date: Mon Apr 13 19:12:28 2009
New Revision: 191010
URL: http://svn.freebsd.org/changeset/base/191010

Log:
  Add a test for r191009.

Added:
  head/tools/regression/bin/sh/parser/
  head/tools/regression/bin/sh/parser/and-pipe-not.0   (contents, props changed)

Added: head/tools/regression/bin/sh/parser/and-pipe-not.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/parser/and-pipe-not.0	Mon Apr 13 19:12:28 2009	(r191010)
@@ -0,0 +1,2 @@
+# $FreeBSD$
+true && ! true | false

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 19:20:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 10831106566B;
	Mon, 13 Apr 2009 19:20:33 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E86E38FC1A;
	Mon, 13 Apr 2009 19:20:32 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DJKWpR081080;
	Mon, 13 Apr 2009 19:20:32 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DJKWP4081076;
	Mon, 13 Apr 2009 19:20:32 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200904131920.n3DJKWP4081076@svn.freebsd.org>
From: Konstantin Belousov 
Date: Mon, 13 Apr 2009 19:20:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191011 - in head/sys: amd64/amd64 arm/arm i386/i386
	ia64/ia64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 19:20:33 -0000

Author: kib
Date: Mon Apr 13 19:20:32 2009
New Revision: 191011
URL: http://svn.freebsd.org/changeset/base/191011

Log:
  The bus_dmamap_load_uio(9) shall use pmap of the thread recorded in the
  uio_td to extract pages from, instead of unconditionally use kernel
  pmap.
  
  Submitted by:	Jason Harmening  (amd64 version)
  PR:	amd64/133592
  Reviewed by:	scottl (original patch), jhb
  MFC after:	2 weeks

Modified:
  head/sys/amd64/amd64/busdma_machdep.c
  head/sys/arm/arm/busdma_machdep.c
  head/sys/i386/i386/busdma_machdep.c
  head/sys/ia64/ia64/busdma_machdep.c

Modified: head/sys/amd64/amd64/busdma_machdep.c
==============================================================================
--- head/sys/amd64/amd64/busdma_machdep.c	Mon Apr 13 19:12:28 2009	(r191010)
+++ head/sys/amd64/amd64/busdma_machdep.c	Mon Apr 13 19:20:32 2009	(r191011)
@@ -606,7 +606,10 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm
 		vendaddr = (vm_offset_t)buf + buflen;
 
 		while (vaddr < vendaddr) {
-			paddr = pmap_kextract(vaddr);
+			if (pmap)
+				paddr = pmap_extract(pmap, vaddr);
+			else
+				paddr = pmap_kextract(vaddr);
 			if (run_filter(dmat, paddr) != 0)
 				map->pagesneeded++;
 			vaddr += (PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK));

Modified: head/sys/arm/arm/busdma_machdep.c
==============================================================================
--- head/sys/arm/arm/busdma_machdep.c	Mon Apr 13 19:12:28 2009	(r191010)
+++ head/sys/arm/arm/busdma_machdep.c	Mon Apr 13 19:20:32 2009	(r191011)
@@ -669,8 +669,8 @@ bus_dmamem_free(bus_dma_tag_t dmat, void
 }
 
 static int
-_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
-			bus_size_t buflen, int flags)
+_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap,
+    void *buf, bus_size_t buflen, int flags)
 {
 	vm_offset_t vaddr;
 	vm_offset_t vendaddr;
@@ -689,7 +689,10 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm
 		vendaddr = (vm_offset_t)buf + buflen;
 
 		while (vaddr < vendaddr) {
-			paddr = pmap_kextract(vaddr);
+			if (pmap != NULL)
+				paddr = pmap_extract(pmap, vaddr);
+			else
+				paddr = pmap_kextract(vaddr);
 			if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) &&
 			    run_filter(dmat, paddr) != 0)
 				map->pagesneeded++;
@@ -745,7 +748,8 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma
 	bmask = ~(dmat->boundary - 1);
 
 	if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) {
-		error = _bus_dmamap_count_pages(dmat, map, buf, buflen, flags);
+		error = _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen,
+		    flags);
 		if (error)
 			return (error);
 	}

Modified: head/sys/i386/i386/busdma_machdep.c
==============================================================================
--- head/sys/i386/i386/busdma_machdep.c	Mon Apr 13 19:12:28 2009	(r191010)
+++ head/sys/i386/i386/busdma_machdep.c	Mon Apr 13 19:20:32 2009	(r191011)
@@ -142,8 +142,8 @@ static bus_addr_t add_bounce_page(bus_dm
 				   vm_offset_t vaddr, bus_size_t size);
 static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage);
 int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr);
-int _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
-			    bus_size_t buflen, int flags);
+int _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap,
+    void *buf, bus_size_t buflen, int flags);
 
 #ifdef XEN
 #undef pmap_kextract
@@ -577,8 +577,8 @@ bus_dmamem_free(bus_dma_tag_t dmat, void
 }
 
 int
-_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
-			bus_size_t buflen, int flags)
+_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap,
+    void *buf, bus_size_t buflen, int flags)
 {
 	vm_offset_t vaddr;
 	vm_offset_t vendaddr;
@@ -598,7 +598,10 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm
 		vendaddr = (vm_offset_t)buf + buflen;
 
 		while (vaddr < vendaddr) {
-			paddr = pmap_kextract(vaddr);
+			if (pmap)
+				paddr = pmap_extract(pmap, vaddr);
+			else
+				paddr = pmap_kextract(vaddr);
 			if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) &&
 			    run_filter(dmat, paddr) != 0) {
 				map->pagesneeded++;
@@ -660,7 +663,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm
 		map = &nobounce_dmamap;
 
 	if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) {
-		error = _bus_dmamap_count_pages(dmat, map, buf, buflen, flags);
+		error = _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, flags);
 		if (error)
 			return (error);
 	}

Modified: head/sys/ia64/ia64/busdma_machdep.c
==============================================================================
--- head/sys/ia64/ia64/busdma_machdep.c	Mon Apr 13 19:12:28 2009	(r191010)
+++ head/sys/ia64/ia64/busdma_machdep.c	Mon Apr 13 19:20:32 2009	(r191011)
@@ -527,7 +527,10 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm
 		vendaddr = (vm_offset_t)buf + buflen;
 
 		while (vaddr < vendaddr) {
-			paddr = pmap_kextract(vaddr);
+			if (pmap != NULL)
+				paddr = pmap_extract(pmap, vaddr);
+			else
+				paddr = pmap_kextract(vaddr);
 			if (run_filter(dmat, paddr, 0) != 0)
 				map->pagesneeded++;
 			vaddr += PAGE_SIZE;

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 19:43:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AF1EF10657E0;
	Mon, 13 Apr 2009 19:43:37 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 98FF58FC1A;
	Mon, 13 Apr 2009 19:43:37 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DJhbVl081554;
	Mon, 13 Apr 2009 19:43:37 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DJhb6N081553;
	Mon, 13 Apr 2009 19:43:37 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200904131943.n3DJhb6N081553@svn.freebsd.org>
From: Marius Strobl 
Date: Mon, 13 Apr 2009 19:43:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191012 - head/sys/boot/sparc64/loader
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 19:43:44 -0000

Author: marius
Date: Mon Apr 13 19:43:37 2009
New Revision: 191012
URL: http://svn.freebsd.org/changeset/base/191012

Log:
  Fix whitespace.

Modified:
  head/sys/boot/sparc64/loader/main.c

Modified: head/sys/boot/sparc64/loader/main.c
==============================================================================
--- head/sys/boot/sparc64/loader/main.c	Mon Apr 13 19:20:32 2009	(r191011)
+++ head/sys/boot/sparc64/loader/main.c	Mon Apr 13 19:43:37 2009	(r191012)
@@ -472,7 +472,7 @@ dtlb_enter_sun4u(u_long vpn, u_long data
 	reg = rdpr(pstate);
 	wrpr(pstate, reg & ~PSTATE_IE, 0);
 	stxa(AA_DMMU_TAR, ASI_DMMU,
-	     TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL));
+	    TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL));
 	stxa(0, ASI_DTLB_DATA_IN_REG, data);
 	membar(Sync);
 	wrpr(pstate, reg, 0);
@@ -497,7 +497,7 @@ itlb_enter_sun4u(u_long vpn, u_long data
 				continue;
 
 			stxa(AA_IMMU_TAR, ASI_IMMU,
-			     TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL));
+			    TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL));
 			stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data);
 			flush(PROMBASE);
 			break;
@@ -509,7 +509,7 @@ itlb_enter_sun4u(u_long vpn, u_long data
 	}
 
 	stxa(AA_IMMU_TAR, ASI_IMMU,
-	     TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL));
+	    TLB_TAR_VA(vpn) | TLB_TAR_CTX(TLB_CTX_KERNEL));
 	stxa(0, ASI_ITLB_DATA_IN_REG, data);
 	flush(PROMBASE);
 	wrpr(pstate, reg, 0);

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 19:54:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4A6EB106566B;
	Mon, 13 Apr 2009 19:54:34 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 393D98FC1B;
	Mon, 13 Apr 2009 19:54:34 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DJsXCA081802;
	Mon, 13 Apr 2009 19:54:33 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DJsXNU081801;
	Mon, 13 Apr 2009 19:54:33 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200904131954.n3DJsXNU081801@svn.freebsd.org>
From: Konstantin Belousov 
Date: Mon, 13 Apr 2009 19:54:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191013 - head/sys/nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 19:54:35 -0000

Author: kib
Date: Mon Apr 13 19:54:33 2009
New Revision: 191013
URL: http://svn.freebsd.org/changeset/base/191013

Log:
  Remove trailing spaces

Modified:
  head/sys/nfsclient/nfs_socket.c

Modified: head/sys/nfsclient/nfs_socket.c
==============================================================================
--- head/sys/nfsclient/nfs_socket.c	Mon Apr 13 19:43:37 2009	(r191012)
+++ head/sys/nfsclient/nfs_socket.c	Mon Apr 13 19:54:33 2009	(r191013)
@@ -1442,8 +1442,8 @@ nfs_timer(void *arg)
 				nfs_softterm(rep);
 				mtx_unlock(&rep->r_mtx);
 				continue;
-			}				
-			mtx_unlock(&rep->r_mtx);			
+			}
+			mtx_unlock(&rep->r_mtx);
 		}
 		if (nfs_sigintr(nmp, rep, rep->r_td))
 			continue;

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 19:56:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E8D5106568C;
	Mon, 13 Apr 2009 19:56:35 +0000 (UTC)
	(envelope-from kientzle@freebsd.org)
Received: from kientzle.com (kientzle.com [66.166.149.50])
	by mx1.freebsd.org (Postfix) with ESMTP id 6C7558FC08;
	Mon, 13 Apr 2009 19:56:35 +0000 (UTC)
	(envelope-from kientzle@freebsd.org)
Received: (from root@localhost)
	by kientzle.com (8.14.3/8.14.3) id n3DJuZ35073162;
	Mon, 13 Apr 2009 12:56:35 -0700 (PDT)
	(envelope-from kientzle@freebsd.org)
Received: from dark.x.kientzle.com (fw2.kientzle.com [10.123.1.2])
	by kientzle.com with SMTP id gyggie2dks6eu6ifwf5r5ptv5s;
	Mon, 13 Apr 2009 12:56:34 -0700 (PDT)
	(envelope-from kientzle@freebsd.org)
Message-ID: <49E398F2.7090604@freebsd.org>
Date: Mon, 13 Apr 2009 12:56:34 -0700
From: Tim Kientzle 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US;
	rv:1.8.1.21) Gecko/20090409 SeaMonkey/1.1.15
MIME-Version: 1.0
To: John Baldwin 
References: <200903181619.n2IGJifl031031@svn.freebsd.org>
	<200903181406.32619.jhb@freebsd.org>
In-Reply-To: <200903181406.32619.jhb@freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r189967 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 19:56:37 -0000

John Baldwin wrote:
> On Wednesday 18 March 2009 12:19:44 pm John Baldwin wrote:
>> Author: jhb
>> Date: Wed Mar 18 16:19:44 2009
>> New Revision: 189967
>> URL: http://svn.freebsd.org/changeset/base/189967
>>
>> Log:
>>   The zfs_get_xattrdir() function is used to find the extended attribute
>>   directory for a znode.  When the directory already exists, it returns a
>>   referenced but unlocked vnode.  When a directory does not yet exist, it
>>   calls zfs_make_xattrdir() to create a new one.  zfs_make_xattrdir() returns
>>   the vnode both referenced and and locked and zfs_get_xattrdir() was leaking
>>   this vnode lock to its callers.  Fix this by dropping the vnode lock if
>>   zfs_make_xattrdir() successfully creates a new extended attribute
>>   directory.
> 
> This should fix the panics with ZFS and tar + EA.

Thanks.

One point I'm curious about.    This problem was
originally triggered by calls to extattr_list_fd().
This seems to imply that any call to extattr_list_fd()
will allocate an extended attribute directory if it
doesn't already exist.

This is surprising.  It also raises questions about
both performance (tar now does extattr_list_fd()
for every file being archived) and operation
with read-only mounts.

Tim


From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 20:43:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C21381065700;
	Mon, 13 Apr 2009 20:43:35 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 5C9A48FC20;
	Mon, 13 Apr 2009 20:43:35 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 6E00746B2C;
	Mon, 13 Apr 2009 16:43:33 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id C19268A04D;
	Mon, 13 Apr 2009 16:43:27 -0400 (EDT)
From: John Baldwin 
To: Tim Kientzle 
Date: Mon, 13 Apr 2009 16:30:25 -0400
User-Agent: KMail/1.9.7
References: <200903181619.n2IGJifl031031@svn.freebsd.org>
	<200903181406.32619.jhb@freebsd.org> <49E398F2.7090604@freebsd.org>
In-Reply-To: <49E398F2.7090604@freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200904131630.25715.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Mon, 13 Apr 2009 16:43:27 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=0.1 required=4.2 tests=RDNS_NONE autolearn=no
	version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r189967 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 20:43:36 -0000

On Monday 13 April 2009 3:56:34 pm Tim Kientzle wrote:
> John Baldwin wrote:
> > On Wednesday 18 March 2009 12:19:44 pm John Baldwin wrote:
> >> Author: jhb
> >> Date: Wed Mar 18 16:19:44 2009
> >> New Revision: 189967
> >> URL: http://svn.freebsd.org/changeset/base/189967
> >>
> >> Log:
> >>   The zfs_get_xattrdir() function is used to find the extended attribute
> >>   directory for a znode.  When the directory already exists, it returns a
> >>   referenced but unlocked vnode.  When a directory does not yet exist, it
> >>   calls zfs_make_xattrdir() to create a new one.  zfs_make_xattrdir() 
returns
> >>   the vnode both referenced and and locked and zfs_get_xattrdir() was 
leaking
> >>   this vnode lock to its callers.  Fix this by dropping the vnode lock if
> >>   zfs_make_xattrdir() successfully creates a new extended attribute
> >>   directory.
> > 
> > This should fix the panics with ZFS and tar + EA.
> 
> Thanks.
> 
> One point I'm curious about.    This problem was
> originally triggered by calls to extattr_list_fd().
> This seems to imply that any call to extattr_list_fd()
> will allocate an extended attribute directory if it
> doesn't already exist.
> 
> This is surprising.  It also raises questions about
> both performance (tar now does extattr_list_fd()
> for every file being archived) and operation
> with read-only mounts.

I'm not sure if it actually allocates space on disk or if it just allocates a 
virtual node to handle EA requests that only allocates disk space once it has 
at least one attribute to store.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 20:45:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C27871065676;
	Mon, 13 Apr 2009 20:45:29 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AFBD38FC0C;
	Mon, 13 Apr 2009 20:45:29 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DKjTnj082910;
	Mon, 13 Apr 2009 20:45:29 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DKjTsm082909;
	Mon, 13 Apr 2009 20:45:29 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200904132045.n3DKjTsm082909@svn.freebsd.org>
From: Sam Leffler 
Date: Mon, 13 Apr 2009 20:45:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191015 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 20:45:31 -0000

Author: sam
Date: Mon Apr 13 20:45:29 2009
New Revision: 191015
URL: http://svn.freebsd.org/changeset/base/191015

Log:
  fix txparms setup for 108G sta's: ieee80211_iserp_rateset does not
  identify a station operating in turbo-boost mode because it has a
  pure ofdm rate set; add an explicit check for the channel type
  instead of depending on IEEE80211_NODE_ERP being set

Modified:
  head/sys/net80211/ieee80211_node.c

Modified: head/sys/net80211/ieee80211_node.c
==============================================================================
--- head/sys/net80211/ieee80211_node.c	Mon Apr 13 20:19:28 2009	(r191014)
+++ head/sys/net80211/ieee80211_node.c	Mon Apr 13 20:45:29 2009	(r191015)
@@ -237,16 +237,17 @@ node_setuptxparms(struct ieee80211_node 
 		else
 			mode = IEEE80211_MODE_11NG;
 	} else {				/* legacy rate handling */
-		/* NB: 108A/108G should be handled as 11a/11g respectively */
 		if (IEEE80211_IS_CHAN_ST(ni->ni_chan))
 			mode = IEEE80211_MODE_STURBO_A;
 		else if (IEEE80211_IS_CHAN_HALF(ni->ni_chan))
 			mode = IEEE80211_MODE_HALF;
 		else if (IEEE80211_IS_CHAN_QUARTER(ni->ni_chan))
 			mode = IEEE80211_MODE_QUARTER;
+		/* NB: 108A should be handled as 11a */
 		else if (IEEE80211_IS_CHAN_A(ni->ni_chan))
 			mode = IEEE80211_MODE_11A;
-		else if (ni->ni_flags & IEEE80211_NODE_ERP)
+		else if (IEEE80211_IS_CHAN_108G(ni->ni_chan) ||
+		    (ni->ni_flags & IEEE80211_NODE_ERP))
 			mode = IEEE80211_MODE_11G;
 		else
 			mode = IEEE80211_MODE_11B;

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 20:50:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6705B1065854;
	Mon, 13 Apr 2009 20:50:08 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3A7A88FC1A;
	Mon, 13 Apr 2009 20:50:08 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DKo8J5083032;
	Mon, 13 Apr 2009 20:50:08 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DKo8O8083031;
	Mon, 13 Apr 2009 20:50:08 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200904132050.n3DKo8O8083031@svn.freebsd.org>
From: Sam Leffler 
Date: Mon, 13 Apr 2009 20:50:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191016 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 20:50:12 -0000

Author: sam
Date: Mon Apr 13 20:50:07 2009
New Revision: 191016
URL: http://svn.freebsd.org/changeset/base/191016

Log:
  check correct address for a bssid mtch

Modified:
  head/sys/net80211/ieee80211_tdma.c

Modified: head/sys/net80211/ieee80211_tdma.c
==============================================================================
--- head/sys/net80211/ieee80211_tdma.c	Mon Apr 13 20:45:29 2009	(r191015)
+++ head/sys/net80211/ieee80211_tdma.c	Mon Apr 13 20:50:07 2009	(r191016)
@@ -344,7 +344,7 @@ tdma_recv_mgmt(struct ieee80211_node *ni
 		/*
 		 * Check for state updates.
 		 */
-		if (IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_bssid)) {
+		if (IEEE80211_ADDR_EQ(wh->i_addr3, ni->ni_bssid)) {
 			/*
 			 * Count frame now that we know it's to be processed.
 			 */

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 20:51:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1F64D1065AC8;
	Mon, 13 Apr 2009 20:51:00 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4CE8C8FC29;
	Mon, 13 Apr 2009 20:50:51 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DKop9Y083081;
	Mon, 13 Apr 2009 20:50:51 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DKop7a083080;
	Mon, 13 Apr 2009 20:50:51 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200904132050.n3DKop7a083080@svn.freebsd.org>
From: Sam Leffler 
Date: Mon, 13 Apr 2009 20:50:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191017 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 20:51:11 -0000

Author: sam
Date: Mon Apr 13 20:50:51 2009
New Revision: 191017
URL: http://svn.freebsd.org/changeset/base/191017

Log:
  correct debug printf

Modified:
  head/sys/net80211/ieee80211_tdma.c

Modified: head/sys/net80211/ieee80211_tdma.c
==============================================================================
--- head/sys/net80211/ieee80211_tdma.c	Mon Apr 13 20:50:07 2009	(r191016)
+++ head/sys/net80211/ieee80211_tdma.c	Mon Apr 13 20:50:51 2009	(r191017)
@@ -467,7 +467,7 @@ tdma_update(struct ieee80211vap *vap, co
 		IEEE80211_DPRINTF(vap, IEEE80211_MSG_TDMA,
 		    "%s: slot %u slotcnt %u slotlen %u us bintval %u\n",
 		    __func__, ts->tdma_slot, ts->tdma_slotcnt,
-		    100*ts->tdma_slotlen, ts->tdma_bintval);
+		    ts->tdma_slotlen, ts->tdma_bintval);
 	}
 	/*
 	 * Notify driver.  Note we can be called before

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 20:53:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DB86B1065686;
	Mon, 13 Apr 2009 20:53:12 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C7B5F8FC17;
	Mon, 13 Apr 2009 20:53:12 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DKrCxi083161;
	Mon, 13 Apr 2009 20:53:12 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DKrCtB083160;
	Mon, 13 Apr 2009 20:53:12 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200904132053.n3DKrCtB083160@svn.freebsd.org>
From: Sam Leffler 
Date: Mon, 13 Apr 2009 20:53:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191018 - head/sys/net80211
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 20:53:16 -0000

Author: sam
Date: Mon Apr 13 20:53:12 2009
New Revision: 191018
URL: http://svn.freebsd.org/changeset/base/191018

Log:
  setup turboA/G fixed rate parameters too; this is needed, in particular,
  for turboG operation

Modified:
  head/sys/net80211/ieee80211_tdma.c

Modified: head/sys/net80211/ieee80211_tdma.c
==============================================================================
--- head/sys/net80211/ieee80211_tdma.c	Mon Apr 13 20:50:51 2009	(r191017)
+++ head/sys/net80211/ieee80211_tdma.c	Mon Apr 13 20:53:12 2009	(r191018)
@@ -78,8 +78,8 @@ __FBSDID("$FreeBSD$");
 #ifndef TDMA_TXRATE_11A_DEFAULT
 #define	TDMA_TXRATE_11A_DEFAULT	2*24
 #endif
-#ifndef TDMA_TXRATE_STURBO_A_DEFAULT
-#define	TDMA_TXRATE_STURBO_A_DEFAULT	2*24
+#ifndef TDMA_TXRATE_TURBO_DEFAULT
+#define	TDMA_TXRATE_TURBO_DEFAULT	2*24
 #endif
 #ifndef TDMA_TXRATE_HALF_DEFAULT
 #define	TDMA_TXRATE_HALF_DEFAULT	2*12
@@ -161,7 +161,9 @@ ieee80211_tdma_vattach(struct ieee80211v
 	settxparms(vap, IEEE80211_MODE_11A, TDMA_TXRATE_11A_DEFAULT);
 	settxparms(vap, IEEE80211_MODE_11B, TDMA_TXRATE_11B_DEFAULT);
 	settxparms(vap, IEEE80211_MODE_11G, TDMA_TXRATE_11G_DEFAULT);
-	settxparms(vap, IEEE80211_MODE_STURBO_A, TDMA_TXRATE_STURBO_A_DEFAULT);
+	settxparms(vap, IEEE80211_MODE_TURBO_A, TDMA_TXRATE_TURBO_DEFAULT);
+	settxparms(vap, IEEE80211_MODE_TURBO_G, TDMA_TXRATE_TURBO_DEFAULT);
+	settxparms(vap, IEEE80211_MODE_STURBO_A, TDMA_TXRATE_TURBO_DEFAULT);
 	settxparms(vap, IEEE80211_MODE_11NA, TDMA_TXRATE_11NA_DEFAULT);
 	settxparms(vap, IEEE80211_MODE_11NG, TDMA_TXRATE_11NG_DEFAULT);
 	settxparms(vap, IEEE80211_MODE_HALF, TDMA_TXRATE_HALF_DEFAULT);

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 20:54:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 295881065672;
	Mon, 13 Apr 2009 20:54:09 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1679A8FC1A;
	Mon, 13 Apr 2009 20:54:09 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DKs8KT083215;
	Mon, 13 Apr 2009 20:54:08 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DKs8hm083214;
	Mon, 13 Apr 2009 20:54:08 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200904132054.n3DKs8hm083214@svn.freebsd.org>
From: Sam Leffler 
Date: Mon, 13 Apr 2009 20:54:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191019 - head/sys/dev/ath/ath_rate/sample
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 20:54:11 -0000

Author: sam
Date: Mon Apr 13 20:54:08 2009
New Revision: 191019
URL: http://svn.freebsd.org/changeset/base/191019

Log:
  add a debug msg for when a fixed transmit rate is not applied because
  it's not found in the sta's negotiated rate set

Modified:
  head/sys/dev/ath/ath_rate/sample/sample.c

Modified: head/sys/dev/ath/ath_rate/sample/sample.c
==============================================================================
--- head/sys/dev/ath/ath_rate/sample/sample.c	Mon Apr 13 20:53:12 2009	(r191018)
+++ head/sys/dev/ath/ath_rate/sample/sample.c	Mon Apr 13 20:54:08 2009	(r191019)
@@ -766,6 +766,15 @@ ath_rate_ctl_reset(struct ath_softc *sc,
 				sn->static_rix = sc->sc_rixmap[tp->ucastrate];
 				break;
 			}
+#ifdef IEEE80211_DEBUG
+			if (sn->static_rix == -1) {
+				IEEE80211_NOTE(ni->ni_vap,
+				    IEEE80211_MSG_RATECTL, ni,
+				    "%s: ucastrate %u not found, nrates %u",
+				    __func__, tp->ucastrate,
+				    ni->ni_rates.rs_nrates);
+			}
+#endif
 	}
 
 	/*

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 20:57:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A750D106564A;
	Mon, 13 Apr 2009 20:57:34 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 95FF28FC14;
	Mon, 13 Apr 2009 20:57:34 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DKvYmk083324;
	Mon, 13 Apr 2009 20:57:34 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DKvYpC083322;
	Mon, 13 Apr 2009 20:57:34 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200904132057.n3DKvYpC083322@svn.freebsd.org>
From: Sam Leffler 
Date: Mon, 13 Apr 2009 20:57:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191020 - head/sys/dev/ath
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 20:57:35 -0000

Author: sam
Date: Mon Apr 13 20:57:34 2009
New Revision: 191020
URL: http://svn.freebsd.org/changeset/base/191020

Log:
  o fix dynamic slave-side tdma slot length updating: we need to re-setup the
    burst length in the tx q's
  o remove re-config of the beaconq on update; it's not needed

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Mon Apr 13 20:54:08 2009	(r191019)
+++ head/sys/dev/ath/if_ath.c	Mon Apr 13 20:57:34 2009	(r191020)
@@ -7120,6 +7120,8 @@ ath_tdma_update(struct ieee80211_node *n
 		const struct ieee80211_tdma_state *ts = vap->iv_tdma;
 
 		ath_tdma_bintvalsetup(sc, ts);
+		if (changed & TDMA_UPDATE_SLOTLEN)
+			ath_wme_update(ic);
 
 		DPRINTF(sc, ATH_DEBUG_TDMA,
 		    "%s: adopt slot %u slotcnt %u slotlen %u us "
@@ -7127,7 +7129,6 @@ ath_tdma_update(struct ieee80211_node *n
 		    ts->tdma_slot, ts->tdma_slotcnt, ts->tdma_slotlen,
 		    sc->sc_tdmabintval);
 
-		ath_beaconq_config(sc);
 		/* XXX right? */
 		ath_hal_intrset(ah, sc->sc_imask);
 		/* NB: beacon timers programmed below */

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 20:58:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 143A4106566B;
	Mon, 13 Apr 2009 20:58:48 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DD41B8FC13;
	Mon, 13 Apr 2009 20:58:47 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DKwlMf083386;
	Mon, 13 Apr 2009 20:58:47 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DKwl3G083384;
	Mon, 13 Apr 2009 20:58:47 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200904132058.n3DKwl3G083384@svn.freebsd.org>
From: Sam Leffler 
Date: Mon, 13 Apr 2009 20:58:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191021 - head/sys/dev/ath
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 20:58:48 -0000

Author: sam
Date: Mon Apr 13 20:58:47 2009
New Revision: 191021
URL: http://svn.freebsd.org/changeset/base/191021

Log:
  don't use caddr_t to match ieee80211_dump_pkt type; supplying the correct
  one costs nothing

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Mon Apr 13 20:57:34 2009	(r191020)
+++ head/sys/dev/ath/if_ath.c	Mon Apr 13 20:58:47 2009	(r191021)
@@ -4773,8 +4773,8 @@ ath_tx_start(struct ath_softc *sc, struc
 	m0->m_nextpkt = NULL;
 
 	if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT))
-		ieee80211_dump_pkt(ic, mtod(m0, caddr_t), m0->m_len,
-			sc->sc_hwmap[rix].ieeerate, -1);
+		ieee80211_dump_pkt(ic, mtod(m0, const uint8_t *), m0->m_len,
+		    sc->sc_hwmap[rix].ieeerate, -1);
 
 	if (bpf_peers_present(ifp->if_bpf)) {
 		u_int64_t tsf = ath_hal_gettsf64(ah);
@@ -5118,8 +5118,8 @@ ath_tx_draintxq(struct ath_softc *sc, st
 			ath_printtxbuf(sc, bf, txq->axq_qnum, ix,
 				ath_hal_txprocdesc(ah, bf->bf_desc,
 				    &bf->bf_status.ds_txstat) == HAL_OK);
-			ieee80211_dump_pkt(ic, mtod(bf->bf_m, caddr_t),
-				bf->bf_m->m_len, 0, -1);
+			ieee80211_dump_pkt(ic, mtod(bf->bf_m, const uint8_t *),
+			    bf->bf_m->m_len, 0, -1);
 		}
 #endif /* ATH_DEBUG */
 		bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap);
@@ -5187,8 +5187,9 @@ ath_draintxq(struct ath_softc *sc)
 			ath_printtxbuf(sc, bf, sc->sc_bhalq, 0,
 				ath_hal_txprocdesc(ah, bf->bf_desc,
 				    &bf->bf_status.ds_txstat) == HAL_OK);
-			ieee80211_dump_pkt(ifp->if_l2com, mtod(bf->bf_m, caddr_t),
-				bf->bf_m->m_len, 0, -1);
+			ieee80211_dump_pkt(ifp->if_l2com,
+			    mtod(bf->bf_m, const uint8_t *), bf->bf_m->m_len,
+			    0, -1);
 		}
 	}
 #endif /* ATH_DEBUG */
@@ -6783,7 +6784,7 @@ ath_tx_raw_start(struct ath_softc *sc, s
 
 	if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT))
 		ieee80211_dump_pkt(ic, mtod(m0, caddr_t), m0->m_len,
-			sc->sc_hwmap[rix].ieeerate, -1);
+		    sc->sc_hwmap[rix].ieeerate, -1);
 	
 	if (bpf_peers_present(ifp->if_bpf)) {
 		u_int64_t tsf = ath_hal_gettsf64(ah);

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 21:01:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B1C991065672;
	Mon, 13 Apr 2009 21:01:08 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8C03C8FC08;
	Mon, 13 Apr 2009 21:01:08 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DL18JO083520;
	Mon, 13 Apr 2009 21:01:08 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DL18cm083516;
	Mon, 13 Apr 2009 21:01:08 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200904132101.n3DL18cm083516@svn.freebsd.org>
From: Sam Leffler 
Date: Mon, 13 Apr 2009 21:01:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191022 - in head/sys/dev/ath/ath_hal: . ar5210 ar5211
	ar5212
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 21:01:09 -0000

Author: sam
Date: Mon Apr 13 21:01:08 2009
New Revision: 191022
URL: http://svn.freebsd.org/changeset/base/191022

Log:
  o eliminate a << in calculating the tx time for turbo mode by pre-multiplying
    data in the phy tables
  o correct the ctrl rate indices in the 5212 turbog phy table

Modified:
  head/sys/dev/ath/ath_hal/ah.c
  head/sys/dev/ath/ath_hal/ar5210/ar5210_phy.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_phy.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c

Modified: head/sys/dev/ath/ath_hal/ah.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.c	Mon Apr 13 20:58:47 2009	(r191021)
+++ head/sys/dev/ath/ath_hal/ah.c	Mon Apr 13 21:01:08 2009	(r191022)
@@ -287,8 +287,7 @@ ath_hal_computetxtime(struct ath_hal *ah
 				+ (numSymbols * OFDM_QUARTER_SYMBOL_TIME);
 		break;
 	case IEEE80211_T_TURBO:
-		/* we still save OFDM rates in kbps - so double them */
-		bitsPerSymbol = ((kbps << 1) * TURBO_SYMBOL_TIME) / 1000;
+		bitsPerSymbol	= (kbps * TURBO_SYMBOL_TIME) / 1000;
 		HALASSERT(bitsPerSymbol != 0);
 
 		numBits		= TURBO_PLCP_BITS + (frameLen << 3);

Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_phy.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5210/ar5210_phy.c	Mon Apr 13 20:58:47 2009	(r191021)
+++ head/sys/dev/ath/ath_hal/ar5210/ar5210_phy.c	Mon Apr 13 21:01:08 2009	(r191022)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5210_phy.c,v 1.3 2008/11/10 01:19:37 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 
@@ -50,14 +50,14 @@ HAL_RATE_TABLE ar5210_turbo_table = {
 	{
 /*                                                 short            ctrl  */
 /*                valid                rateCode Preamble  dot11Rate Rate */
-/*   6 Mb */ {  AH_TRUE, TURBO,   6000,    0x0b,    0x00, (0x80|12),   0 },
-/*   9 Mb */ {  AH_TRUE, TURBO,   9000,    0x0f,    0x00,        18,   0 },
-/*  12 Mb */ {  AH_TRUE, TURBO,  12000,    0x0a,    0x00, (0x80|24),   2 },
-/*  18 Mb */ {  AH_TRUE, TURBO,  18000,    0x0e,    0x00,        36,   2 },
-/*  24 Mb */ {  AH_TRUE, TURBO,  24000,    0x09,    0x00, (0x80|48),   4 },
-/*  36 Mb */ {  AH_TRUE, TURBO,  36000,    0x0d,    0x00,        72,   4 },
-/*  48 Mb */ {  AH_TRUE, TURBO,  48000,    0x08,    0x00,        96,   4 },
-/*  54 Mb */ {  AH_TRUE, TURBO,  54000,    0x0c,    0x00,       108,   4 }
+/*   6 Mb */ {  AH_TRUE, TURBO,  12000,    0x0b,    0x00, (0x80|12),   0 },
+/*   9 Mb */ {  AH_TRUE, TURBO,  18000,    0x0f,    0x00,        18,   0 },
+/*  12 Mb */ {  AH_TRUE, TURBO,  24000,    0x0a,    0x00, (0x80|24),   2 },
+/*  18 Mb */ {  AH_TRUE, TURBO,  36000,    0x0e,    0x00,        36,   2 },
+/*  24 Mb */ {  AH_TRUE, TURBO,  48000,    0x09,    0x00, (0x80|48),   4 },
+/*  36 Mb */ {  AH_TRUE, TURBO,  72000,    0x0d,    0x00,        72,   4 },
+/*  48 Mb */ {  AH_TRUE, TURBO,  96000,    0x08,    0x00,        96,   4 },
+/*  54 Mb */ {  AH_TRUE, TURBO, 108000,    0x0c,    0x00,       108,   4 }
 	},
 };
 

Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_phy.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5211/ar5211_phy.c	Mon Apr 13 20:58:47 2009	(r191021)
+++ head/sys/dev/ath/ath_hal/ar5211/ar5211_phy.c	Mon Apr 13 21:01:08 2009	(r191022)
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5211_phy.c,v 1.3 2008/11/10 01:19:37 sam Exp $
+ * $FreeBSD$
  */
 #include "opt_ah.h"
 
@@ -51,14 +51,14 @@ HAL_RATE_TABLE ar5211_turbo_table = {
 	{
 /*                                                 short            ctrl  */
 /*                valid                rateCode Preamble  dot11Rate Rate */
-/*   6 Mb */ {  AH_TRUE, TURBO,   6000,    0x0b,    0x00, (0x80|12),   0 },
-/*   9 Mb */ {  AH_TRUE, TURBO,   9000,    0x0f,    0x00,        18,   0 },
-/*  12 Mb */ {  AH_TRUE, TURBO,  12000,    0x0a,    0x00, (0x80|24),   2 },
-/*  18 Mb */ {  AH_TRUE, TURBO,  18000,    0x0e,    0x00,        36,   2 },
-/*  24 Mb */ {  AH_TRUE, TURBO,  24000,    0x09,    0x00, (0x80|48),   4 },
-/*  36 Mb */ {  AH_TRUE, TURBO,  36000,    0x0d,    0x00,        72,   4 },
-/*  48 Mb */ {  AH_TRUE, TURBO,  48000,    0x08,    0x00,        96,   4 },
-/*  54 Mb */ {  AH_TRUE, TURBO,  54000,    0x0c,    0x00,       108,   4 }
+/*   6 Mb */ {  AH_TRUE, TURBO,  12000,    0x0b,    0x00, (0x80|12),   0 },
+/*   9 Mb */ {  AH_TRUE, TURBO,  18000,    0x0f,    0x00,        18,   0 },
+/*  12 Mb */ {  AH_TRUE, TURBO,  24000,    0x0a,    0x00, (0x80|24),   2 },
+/*  18 Mb */ {  AH_TRUE, TURBO,  36000,    0x0e,    0x00,        36,   2 },
+/*  24 Mb */ {  AH_TRUE, TURBO,  48000,    0x09,    0x00, (0x80|48),   4 },
+/*  36 Mb */ {  AH_TRUE, TURBO,  72000,    0x0d,    0x00,        72,   4 },
+/*  48 Mb */ {  AH_TRUE, TURBO,  96000,    0x08,    0x00,        96,   4 },
+/*  54 Mb */ {  AH_TRUE, TURBO, 108000,    0x0c,    0x00,       108,   4 }
 	},
 };
 

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c	Mon Apr 13 20:58:47 2009	(r191021)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c	Mon Apr 13 21:01:08 2009	(r191022)
@@ -87,13 +87,13 @@ HAL_RATE_TABLE ar5212_turbog_table = {
 	{
 /*                                                 short            ctrl  */
 /*                valid                rateCode Preamble  dot11Rate Rate */
-/*   6 Mb */ {  AH_TRUE, TURBO,   6000,    0x0b,    0x00, (0x80|12),   0 },
-/*  12 Mb */ {  AH_TRUE, TURBO,  12000,    0x0a,    0x00, (0x80|24),   2 },
-/*  18 Mb */ {  AH_TRUE, TURBO,  18000,    0x0e,    0x00,        36,   2 },
-/*  24 Mb */ {  AH_TRUE, TURBO,  24000,    0x09,    0x00, (0x80|48),   3 },
-/*  36 Mb */ {  AH_TRUE, TURBO,  36000,    0x0d,    0x00,        72,   3 },
-/*  48 Mb */ {  AH_TRUE, TURBO,  48000,    0x08,    0x00,        96,   3 },
-/*  54 Mb */ {  AH_TRUE, TURBO,  54000,    0x0c,    0x00,       108,   3 }
+/*   6 Mb */ {  AH_TRUE, TURBO,  12000,    0x0b,    0x00, (0x80|12),   0 },
+/*  12 Mb */ {  AH_TRUE, TURBO,  24000,    0x0a,    0x00, (0x80|24),   1 },
+/*  18 Mb */ {  AH_TRUE, TURBO,  36000,    0x0e,    0x00,        36,   1 },
+/*  24 Mb */ {  AH_TRUE, TURBO,  48000,    0x09,    0x00, (0x80|48),   2 },
+/*  36 Mb */ {  AH_TRUE, TURBO,  72000,    0x0d,    0x00,        72,   2 },
+/*  48 Mb */ {  AH_TRUE, TURBO,  96000,    0x08,    0x00,        96,   2 },
+/*  54 Mb */ {  AH_TRUE, TURBO, 108000,    0x0c,    0x00,       108,   2 }
 	},
 };
 
@@ -103,14 +103,14 @@ HAL_RATE_TABLE ar5212_turboa_table = {
 	{
 /*                                                 short            ctrl  */
 /*                valid                rateCode Preamble  dot11Rate Rate */
-/*   6 Mb */ {  AH_TRUE, TURBO,   6000,    0x0b,    0x00, (0x80|12),   0 },
-/*   9 Mb */ {  AH_TRUE, TURBO,   9000,    0x0f,    0x00,        18,   0 },
-/*  12 Mb */ {  AH_TRUE, TURBO,  12000,    0x0a,    0x00, (0x80|24),   2 },
-/*  18 Mb */ {  AH_TRUE, TURBO,  18000,    0x0e,    0x00,        36,   2 },
-/*  24 Mb */ {  AH_TRUE, TURBO,  24000,    0x09,    0x00, (0x80|48),   4 },
-/*  36 Mb */ {  AH_TRUE, TURBO,  36000,    0x0d,    0x00,        72,   4 },
-/*  48 Mb */ {  AH_TRUE, TURBO,  48000,    0x08,    0x00,        96,   4 },
-/*  54 Mb */ {  AH_TRUE, TURBO,  54000,    0x0c,    0x00,       108,   4 }
+/*   6 Mb */ {  AH_TRUE, TURBO,  12000,    0x0b,    0x00, (0x80|12),   0 },
+/*   9 Mb */ {  AH_TRUE, TURBO,  18000,    0x0f,    0x00,        18,   0 },
+/*  12 Mb */ {  AH_TRUE, TURBO,  24000,    0x0a,    0x00, (0x80|24),   2 },
+/*  18 Mb */ {  AH_TRUE, TURBO,  36000,    0x0e,    0x00,        36,   2 },
+/*  24 Mb */ {  AH_TRUE, TURBO,  48000,    0x09,    0x00, (0x80|48),   4 },
+/*  36 Mb */ {  AH_TRUE, TURBO,  72000,    0x0d,    0x00,        72,   4 },
+/*  48 Mb */ {  AH_TRUE, TURBO,  96000,    0x08,    0x00,        96,   4 },
+/*  54 Mb */ {  AH_TRUE, TURBO, 108000,    0x0c,    0x00,       108,   4 }
 	},
 };
 

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 21:03:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5D4AE106564A;
	Mon, 13 Apr 2009 21:03:23 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4C62C8FC12;
	Mon, 13 Apr 2009 21:03:23 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DL3Lmk083597;
	Mon, 13 Apr 2009 21:03:21 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DL3LUK083595;
	Mon, 13 Apr 2009 21:03:21 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200904132103.n3DL3LUK083595@svn.freebsd.org>
From: Sam Leffler 
Date: Mon, 13 Apr 2009 21:03:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191023 - head/tools/tools/nanobsd/gateworks
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 21:03:23 -0000

Author: sam
Date: Mon Apr 13 21:03:21 2009
New Revision: 191023
URL: http://svn.freebsd.org/changeset/base/191023

Log:
  catch up with removal of ATH_SUPPORT_TDMA

Modified:
  head/tools/tools/nanobsd/gateworks/G2348
  head/tools/tools/nanobsd/gateworks/G2358

Modified: head/tools/tools/nanobsd/gateworks/G2348
==============================================================================
--- head/tools/tools/nanobsd/gateworks/G2348	Mon Apr 13 21:01:08 2009	(r191022)
+++ head/tools/tools/nanobsd/gateworks/G2348	Mon Apr 13 21:03:21 2009	(r191023)
@@ -100,7 +100,6 @@ device		wlan_tkip	# 802.11 TKIP support
 
 device		ath		# Atheros pci/cardbus NIC's
 device		ath_rate_sample	# SampleRate tx rate control for ath
-options		ATH_SUPPORT_TDMA
 options		ATH_DEBUG	# enable athdebug msgs
 options		ATH_DIAGAPI	# enable api for athregs
 

Modified: head/tools/tools/nanobsd/gateworks/G2358
==============================================================================
--- head/tools/tools/nanobsd/gateworks/G2358	Mon Apr 13 21:01:08 2009	(r191022)
+++ head/tools/tools/nanobsd/gateworks/G2358	Mon Apr 13 21:03:21 2009	(r191023)
@@ -103,7 +103,6 @@ device		ath		# Atheros pci/cardbus NIC's
 device		ath_rate_sample	# SampleRate tx rate control for ath
 options		ATH_DEBUG	# enable athdebug msgs
 options		ATH_DIAGAPI	# enable api for athregs
-options		ATH_SUPPORT_TDMA
 
 device		ath_hal		# Atheros HAL (includes binary component)
 options		AH_DEBUG

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 21:04:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 62D9E1065672;
	Mon, 13 Apr 2009 21:04:53 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 525808FC14;
	Mon, 13 Apr 2009 21:04:53 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DL4rPw083663;
	Mon, 13 Apr 2009 21:04:53 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DL4rqo083662;
	Mon, 13 Apr 2009 21:04:53 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200904132104.n3DL4rqo083662@svn.freebsd.org>
From: Sam Leffler 
Date: Mon, 13 Apr 2009 21:04:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191024 - head/tools/tools/nanobsd/gateworks
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 21:04:53 -0000

Author: sam
Date: Mon Apr 13 21:04:53 2009
New Revision: 191024
URL: http://svn.freebsd.org/changeset/base/191024

Log:
  switch usb setup to usb2; it still doesn't work right but the
  old stuff is now removed and we want this to build

Modified:
  head/tools/tools/nanobsd/gateworks/G2348

Modified: head/tools/tools/nanobsd/gateworks/G2348
==============================================================================
--- head/tools/tools/nanobsd/gateworks/G2348	Mon Apr 13 21:03:21 2009	(r191023)
+++ head/tools/tools/nanobsd/gateworks/G2348	Mon Apr 13 21:04:53 2009	(r191024)
@@ -108,16 +108,11 @@ options		AH_DEBUG
 #options		AH_ASSERT
 options		AH_SUPPORT_AR5416
 
-# NB: must use old usb stack; new one does not work
-makeoptions	WITH_LEGACY	# NB: required to get includes
-device		ousb
+device		usb
 #options		USB_DEBUG
-device		oohci
-device		oehci
-device		ougen
+device		ohci
+device		ehci
 
-device		oaxe
-
-device		oumass
+device		umass
 device		scbus           # SCSI bus (required for SCSI)
 device		da              # Direct Access (disks)

From owner-svn-src-head@FreeBSD.ORG  Mon Apr 13 23:09:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A466F106566C;
	Mon, 13 Apr 2009 23:09:44 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 931258FC1A;
	Mon, 13 Apr 2009 23:09:44 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DN9iXE086401;
	Mon, 13 Apr 2009 23:09:44 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DN9itX086400;
	Mon, 13 Apr 2009 23:09:44 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904132309.n3DN9itX086400@svn.freebsd.org>
From: Kip Macy 
Date: Mon, 13 Apr 2009 23:09:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191028 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Mon, 13 Apr 2009 23:09:45 -0000

Author: kmacy
Date: Mon Apr 13 23:09:44 2009
New Revision: 191028
URL: http://svn.freebsd.org/changeset/base/191028

Log:
  - use a shared lock for reads
  - remove stale comment
  
  Reviewed by:	jeffr

Modified:
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/vfs_vnops.c
==============================================================================
--- head/sys/kern/vfs_vnops.c	Mon Apr 13 23:08:37 2009	(r191027)
+++ head/sys/kern/vfs_vnops.c	Mon Apr 13 23:09:44 2009	(r191028)
@@ -379,14 +379,8 @@ vn_rdwr(rw, vp, base, len, offset, segfl
 			    != 0)
 				return (error);
 			vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-		} else {
-			/*
-			 * XXX This should be LK_SHARED but I don't trust VFS
-			 * enough to leave it like that until it has been
-			 * reviewed further.
-			 */
-			vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-		}
+		} else
+			vn_lock(vp, LK_SHARED | LK_RETRY);
 
 	}
 	ASSERT_VOP_LOCKED(vp, "IO_NODELOCKED with no vp lock held");

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 00:27:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B1A731065714;
	Tue, 14 Apr 2009 00:27:59 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9F8078FC14;
	Tue, 14 Apr 2009 00:27:59 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3E0Rxpc088565;
	Tue, 14 Apr 2009 00:27:59 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3E0RxZe088564;
	Tue, 14 Apr 2009 00:27:59 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904140027.n3E0RxZe088564@svn.freebsd.org>
From: Kip Macy 
Date: Tue, 14 Apr 2009 00:27:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191033 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 00:28:00 -0000

Author: kmacy
Date: Tue Apr 14 00:27:59 2009
New Revision: 191033
URL: http://svn.freebsd.org/changeset/base/191033

Log:
  Adapt buf_ring abstraction interface to allow consumers to interoperate with ALTQ

Modified:
  head/sys/net/if_var.h

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h	Tue Apr 14 00:27:05 2009	(r191032)
+++ head/sys/net/if_var.h	Tue Apr 14 00:27:59 2009	(r191033)
@@ -560,6 +560,12 @@ drbr_enqueue(struct ifnet *ifp, struct b
 	int len = m->m_pkthdr.len;
 	int mflags = m->m_flags;
 
+#ifdef ALTQ
+	if (ALTQ_IS_ENABLED(&ifp->if_snd)) {
+		IFQ_ENQUEUE(&ifp->if_snd, m, error);
+		return (error);
+	}
+#endif
 	if ((error = buf_ring_enqueue(br, m)) == ENOBUFS) {
 		br->br_drops++;
 		_IF_DROP(&ifp->if_snd);
@@ -580,8 +586,31 @@ drbr_free(struct buf_ring *br, struct ma
 
 	buf_ring_free(br, type);
 }
+
+static __inline struct mbuf *
+drbr_dequeue(struct ifnet *ifp, struct buf_ring *br)
+{
+#ifdef ALTQ
+	struct mbuf *m;
+
+	if (ALTQ_IS_ENABLED(&ifp->if_snd)) {	
+		IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
+		return (m);
+	}
 #endif
+	return (buf_ring_dequeue_sc(br));
+}
 
+static __inline int
+drbr_empty(struct ifnet *ifp, struct buf_ring *br)
+{
+#ifdef ALTQ
+	if (ALTQ_IS_ENABLED(&ifp->if_snd))
+		return (IFQ_DRV_IS_EMPTY(&ifp->if_snd));
+#endif
+	return (buf_ring_empty(br));
+}
+#endif
 /*
  * 72 was chosen below because it is the size of a TCP/IP
  * header (40) + the minimum mss (32).

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 03:13:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D561C106564A;
	Tue, 14 Apr 2009 03:13:05 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C48248FC1E;
	Tue, 14 Apr 2009 03:13:05 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3E3D5vK092402;
	Tue, 14 Apr 2009 03:13:05 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3E3D53Q092401;
	Tue, 14 Apr 2009 03:13:05 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200904140313.n3E3D53Q092401@svn.freebsd.org>
From: Warner Losh 
Date: Tue, 14 Apr 2009 03:13:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191036 - head/sys/dev/pccard
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 03:13:06 -0000

Author: imp
Date: Tue Apr 14 03:13:05 2009
New Revision: 191036
URL: http://svn.freebsd.org/changeset/base/191036

Log:
  Another NE-2000 clone.  The GVC NIC-2000P Ethernet adapter.  Based on
  the MN5017 chipset.  There's no vendor/product pair on this card, so
  it needs to be matched by the CIS strings.

Modified:
  head/sys/dev/pccard/pccarddevs

Modified: head/sys/dev/pccard/pccarddevs
==============================================================================
--- head/sys/dev/pccard/pccarddevs	Tue Apr 14 00:38:02 2009	(r191035)
+++ head/sys/dev/pccard/pccarddevs	Tue Apr 14 03:13:05 2009	(r191036)
@@ -671,6 +671,7 @@ vendor FUJITSU2			-1	Fujitsu
 vendor FUTUREDOMAIN		-1	FutureDomain
 vendor FREECOM			-1	Freecom
 vendor GEMTEK			-1	Gem Tek
+vendor GVC			-1	GVC
 vendor ICOM			-1	ICOM Inc
 vendor INTERSIL2		-1	Intersil
 vendor IODATA3			-1	I-O DATA
@@ -740,6 +741,7 @@ product FUJITSU2 FMV_J182A	{ "FUJITSU", 
 product FUJITSU2 ITCFJ182A	{ "FUJITSU", "LAN&spCard(ITCFJ182)", "Ver.01", NULL } FUJITSU ITCFJ182A CompactCard
 product FUTUREDOMAIN SCSI2GO	{ "Future&spDomain&spCorporation", "SCSI&spPCMCIA&spCredit&spCard&spController", NULL, NULL } Future Domain SCSI2GO
 product GEMTEK WLAN		{ "Intersil", "PRISM&sp2_5&spPCMCIA&spADAPTER", "ISL37300P", "Eval-RevA" } GEMTEK Prism2_5 WaveLAN Card
+product GVC NIC_2000P		{ "GVC", "NIC-2000p", "ETHERNET", NULL } GVC PCMCIA Ethernet Adapeter
 product IBM SCSICARD		{ "IBM&spCorp.", "SCSI&spPCMCIA&spCard", NULL, NULL } IBM SCSI PCMCIA Card
 product ICOM SL200		{ "Icom", "SL-200", NULL, NULL } Icom SL-200
 product INTERSIL2 PRISM2	{ "INTERSIL", "HFA384x/IEEE", "Version&sp01.02", NULL } Intersil Prism II

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 03:17:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 93AF4106566B;
	Tue, 14 Apr 2009 03:17:44 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 838368FC16;
	Tue, 14 Apr 2009 03:17:44 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3E3HiMX092520;
	Tue, 14 Apr 2009 03:17:44 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3E3HigF092519;
	Tue, 14 Apr 2009 03:17:44 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904140317.n3E3HigF092519@svn.freebsd.org>
From: Kip Macy 
Date: Tue, 14 Apr 2009 03:17:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191037 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 03:17:45 -0000

Author: kmacy
Date: Tue Apr 14 03:17:44 2009
New Revision: 191037
URL: http://svn.freebsd.org/changeset/base/191037

Log:
  call default if_qflush on ifq if default method isn't used by the driver

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Tue Apr 14 03:13:05 2009	(r191036)
+++ head/sys/net/if.c	Tue Apr 14 03:17:44 2009	(r191037)
@@ -1509,6 +1509,8 @@ if_unroute(struct ifnet *ifp, int flag, 
 		if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family))
 			pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
 	ifp->if_qflush(ifp);
+	if (ifp->if_snd.ifq_head != NULL)
+		if_qflush(ifp);
 	
 #ifdef DEV_CARP
 	if (ifp->if_carp)

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 03:37:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 28C24106566B;
	Tue, 14 Apr 2009 03:37:00 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 17D4A8FC21;
	Tue, 14 Apr 2009 03:37:00 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3E3axdd092981;
	Tue, 14 Apr 2009 03:36:59 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3E3ax9n092979;
	Tue, 14 Apr 2009 03:36:59 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904140336.n3E3ax9n092979@svn.freebsd.org>
From: Kip Macy 
Date: Tue, 14 Apr 2009 03:36:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191038 - head/sys/dev/e1000
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 03:37:00 -0000

Author: kmacy
Date: Tue Apr 14 03:36:59 2009
New Revision: 191038
URL: http://svn.freebsd.org/changeset/base/191038

Log:
  - define em_transmit and em_qflush
  - make buF_ring usage conditional but enabled by default
  
  Reviewed by:	jfv

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h

Modified: head/sys/dev/e1000/if_em.c
==============================================================================
--- head/sys/dev/e1000/if_em.c	Tue Apr 14 03:17:44 2009	(r191037)
+++ head/sys/dev/e1000/if_em.c	Tue Apr 14 03:36:59 2009	(r191038)
@@ -39,6 +39,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -897,6 +898,9 @@ em_detach(device_t dev)
 	bus_generic_detach(dev);
 	if_free(ifp);
 
+#ifdef IFNET_BUF_RING
+	drbr_free(adapter->br, M_DEVBUF);
+#endif
 	em_free_transmit_structures(adapter);
 	em_free_receive_structures(adapter);
 
@@ -991,6 +995,110 @@ em_resume(device_t dev)
  *  the packet is requeued.
  **********************************************************************/
 
+#ifdef IFNET_BUF_RING
+static int
+em_transmit_locked(struct ifnet *ifp, struct mbuf *m)
+{
+	struct adapter	*adapter = ifp->if_softc;
+	int error;
+
+	EM_TX_LOCK_ASSERT(adapter);
+	if (((ifp->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) !=
+	    IFF_DRV_RUNNING)
+	    || (!adapter->link_active)) {
+		error = drbr_enqueue(ifp, adapter->br, m);
+		return (error);
+	}
+	
+	if (ADAPTER_RING_EMPTY(adapter) &&
+	    (adapter->num_tx_desc_avail > EM_TX_OP_THRESHOLD)) {
+		if (em_xmit(adapter, &m)) {
+			if (m && (error = drbr_enqueue(ifp, adapter->br, m)) != 0) {
+				return (error);
+			}
+		} else{
+			/* Send a copy of the frame to the BPF listener */
+			ETHER_BPF_MTAP(ifp, m);
+		}
+	} else if ((error = drbr_enqueue(ifp, adapter->br, m)) != 0)
+		return (error);
+	
+	if (!ADAPTER_RING_EMPTY(adapter))
+		em_start_locked(ifp);
+
+	return (0);
+}
+	
+static int
+em_transmit(struct ifnet *ifp, struct mbuf *m)
+{
+	
+	struct adapter *adapter = ifp->if_softc;
+	int error = 0;
+
+	if(EM_TX_TRYLOCK(adapter)) {
+		if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+			error = em_transmit_locked(ifp, m);
+		EM_TX_UNLOCK(adapter);
+	} else 
+		error = drbr_enqueue(ifp, adapter->br, m);
+
+	return (error);
+}
+
+static void
+em_qflush(struct ifnet *ifp)
+{
+	struct mbuf *m;
+	struct adapter *adapter = (struct adapter *)ifp->if_softc;
+
+	EM_TX_LOCK(adapter);
+	while ((m = buf_ring_dequeue_sc(adapter->br)) != NULL)
+		m_freem(m);
+	EM_TX_UNLOCK(adapter);
+}
+
+static void
+em_start_locked(struct ifnet *ifp)
+{
+	struct adapter	*adapter = ifp->if_softc;
+	struct mbuf	*m_head;
+
+	EM_TX_LOCK_ASSERT(adapter);
+
+	if ((ifp->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) !=
+	    IFF_DRV_RUNNING)
+		return;
+	if (!adapter->link_active)
+		return;
+
+	while ((adapter->num_tx_desc_avail > EM_TX_OP_THRESHOLD)
+	    && (!ADAPTER_RING_EMPTY(adapter))) {
+
+		m_head = buf_ring_dequeue_sc(adapter->br);
+		if (m_head == NULL)
+			break;
+		/*
+		 *  Encapsulation can modify our pointer, and or make it
+		 *  NULL on failure.  In that event, we can't requeue.
+		 */
+		if (em_xmit(adapter, &m_head)) {
+			if (m_head == NULL)
+				break;
+			break;
+		}
+
+		/* Send a copy of the frame to the BPF listener */
+		ETHER_BPF_MTAP(ifp, m_head);
+
+		/* Set timeout in case hardware has problems transmitting. */
+		adapter->watchdog_timer = EM_TX_TIMEOUT;
+	}
+	if ((adapter->num_tx_desc_avail <= EM_TX_OP_THRESHOLD))
+		ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+
+}
+#else
 static void
 em_start_locked(struct ifnet *ifp)
 {
@@ -1030,6 +1138,8 @@ em_start_locked(struct ifnet *ifp)
 	}
 }
 
+#endif
+
 static void
 em_start(struct ifnet *ifp)
 {
@@ -1603,7 +1713,7 @@ em_poll(struct ifnet *ifp, enum poll_cmd
 	EM_TX_LOCK(adapter);
 	em_txeof(adapter);
 
-	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+	if (!ADAPTER_RING_EMPTY(adapter))
 		em_start_locked(ifp);
 	EM_TX_UNLOCK(adapter);
 }
@@ -1658,7 +1768,7 @@ em_intr(void *arg)
 out:
 	EM_CORE_UNLOCK(adapter);
 	if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
-	    !IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+	    !ADAPTER_RING_EMPTY(adapter))
 		em_start(ifp);
 }
 
@@ -1697,7 +1807,7 @@ em_handle_rxtx(void *context, int pendin
 		EM_TX_LOCK(adapter);
 		em_txeof(adapter);
 
-		if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+		if (!ADAPTER_RING_EMPTY(adapter))
 			em_start_locked(ifp);
 		EM_TX_UNLOCK(adapter);
 	}
@@ -1853,9 +1963,15 @@ em_handle_tx(void *context, int pending)
 	struct ifnet	*ifp = adapter->ifp;
 
 	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+#ifdef IFNET_BUF_RING
+		if (!EM_TX_TRYLOCK(adapter))
+			return;
+#else
 		EM_TX_LOCK(adapter);
+#endif
+
 		em_txeof(adapter);
-		if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+		if (!ADAPTER_RING_EMPTY(adapter))
 			em_start_locked(ifp);
 		EM_TX_UNLOCK(adapter);
 	}
@@ -2075,22 +2191,14 @@ em_xmit(struct adapter *adapter, struct 
 		error = bus_dmamap_load_mbuf_sg(adapter->txtag, map,
 		    *m_headp, segs, &nsegs, BUS_DMA_NOWAIT);
 
-		if (error == ENOMEM) {
-			adapter->no_tx_dma_setup++;
-			return (error);
-		} else if (error != 0) {
+		if (error) {
 			adapter->no_tx_dma_setup++;
 			m_freem(*m_headp);
 			*m_headp = NULL;
 			return (error);
 		}
-	} else if (error == ENOMEM) {
-		adapter->no_tx_dma_setup++;
-		return (error);
 	} else if (error != 0) {
 		adapter->no_tx_dma_setup++;
-		m_freem(*m_headp);
-		*m_headp = NULL;
 		return (error);
 	}
 
@@ -2531,6 +2639,8 @@ em_local_timer(void *arg)
 
 	EM_CORE_LOCK_ASSERT(adapter);
 
+	taskqueue_enqueue(adapter->tq,
+	    &adapter->rxtx_task);
 	em_update_link_status(adapter);
 	em_update_stats_counters(adapter);
 
@@ -3126,6 +3236,11 @@ em_setup_interface(device_t dev, struct 
 
 	ifp->if_capabilities = ifp->if_capenable = 0;
 
+#ifdef IFNET_BUF_RING
+	ifp->if_transmit = em_transmit;
+	ifp->if_qflush = em_qflush;
+	adapter->br = buf_ring_alloc(2048, M_DEVBUF, M_WAITOK, &adapter->tx_mtx);
+#endif	
 	if (adapter->hw.mac.type >= e1000_82543) {
 		int version_cap;
 #if __FreeBSD_version < 700000

Modified: head/sys/dev/e1000/if_em.h
==============================================================================
--- head/sys/dev/e1000/if_em.h	Tue Apr 14 03:17:44 2009	(r191037)
+++ head/sys/dev/e1000/if_em.h	Tue Apr 14 03:36:59 2009	(r191038)
@@ -36,6 +36,7 @@
 #ifndef _EM_H_DEFINED_
 #define _EM_H_DEFINED_
 
+#define	IFNET_BUF_RING
 /* Tunables */
 
 /*
@@ -301,6 +302,9 @@ struct em_dma_alloc {
 /* Our adapter structure */
 struct adapter {
 	struct ifnet	*ifp;
+#ifdef IFNET_BUF_RING
+	struct buf_ring	*br;
+#endif
 	struct e1000_hw	hw;
 
 	/* FreeBSD operating-system-specific structures. */
@@ -482,6 +486,7 @@ typedef struct _DESCRIPTOR_PAIR
 #define	EM_RX_LOCK_DESTROY(_sc)		mtx_destroy(&(_sc)->rx_mtx)
 #define	EM_CORE_LOCK(_sc)		mtx_lock(&(_sc)->core_mtx)
 #define	EM_TX_LOCK(_sc)			mtx_lock(&(_sc)->tx_mtx)
+#define	EM_TX_TRYLOCK(_sc)		mtx_trylock(&(_sc)->tx_mtx)
 #define	EM_RX_LOCK(_sc)			mtx_lock(&(_sc)->rx_mtx)
 #define	EM_CORE_UNLOCK(_sc)		mtx_unlock(&(_sc)->core_mtx)
 #define	EM_TX_UNLOCK(_sc)		mtx_unlock(&(_sc)->tx_mtx)
@@ -489,4 +494,9 @@ typedef struct _DESCRIPTOR_PAIR
 #define	EM_CORE_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->core_mtx, MA_OWNED)
 #define	EM_TX_LOCK_ASSERT(_sc)		mtx_assert(&(_sc)->tx_mtx, MA_OWNED)
 
+#ifdef IFNET_BUF_RING
+#define ADAPTER_RING_EMPTY(adapter) drbr_empty((adapter)->ifp, (adapter)->br)
+#else
+#define ADAPTER_RING_EMPTY(adapter) IFQ_DRV_IS_EMPTY(&((adapter)->ifp->if_snd))
+#endif
 #endif /* _EM_H_DEFINED_ */

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 04:15:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 10ED1106566C;
	Tue, 14 Apr 2009 04:15:57 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 009D88FC12;
	Tue, 14 Apr 2009 04:15:57 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3E4FuED093746;
	Tue, 14 Apr 2009 04:15:56 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3E4FuXl093745;
	Tue, 14 Apr 2009 04:15:56 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200904140415.n3E4FuXl093745@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Tue, 14 Apr 2009 04:15:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191039 - head/sys/powerpc/aim
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 04:15:57 -0000

Author: nwhitehorn
Date: Tue Apr 14 04:15:56 2009
New Revision: 191039
URL: http://svn.freebsd.org/changeset/base/191039

Log:
  Changing the overflow trap to use bla to branch to dbtrap in r190946 was
  bogus. Revert to a branch that does not set LR. It's been a long week...

Modified:
  head/sys/powerpc/aim/trap_subr.S

Modified: head/sys/powerpc/aim/trap_subr.S
==============================================================================
--- head/sys/powerpc/aim/trap_subr.S	Tue Apr 14 03:36:59 2009	(r191038)
+++ head/sys/powerpc/aim/trap_subr.S	Tue Apr 14 04:15:56 2009	(r191039)
@@ -460,7 +460,7 @@ disitrap:
 	stw	%r30,(PC_DBSAVE  +CPUSAVE_R30)(%r1) /* save r30 */
 	lwz	%r31,(PC_DISISAVE+CPUSAVE_R31)(%r1) /* get  r31 */
 	stw	%r31,(PC_DBSAVE  +CPUSAVE_R31)(%r1) /* save r31 */
-	bla	dbtrap
+	b	dbtrap
 #endif
 
 	/* XXX need stack probe here */

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 07:50:30 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F3EF61065670;
	Tue, 14 Apr 2009 07:50:29 +0000 (UTC) (envelope-from rrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C7FBC8FC18;
	Tue, 14 Apr 2009 07:50:29 +0000 (UTC) (envelope-from rrs@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3E7oTks098631;
	Tue, 14 Apr 2009 07:50:29 GMT (envelope-from rrs@svn.freebsd.org)
Received: (from rrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3E7oTcU098629;
	Tue, 14 Apr 2009 07:50:29 GMT (envelope-from rrs@svn.freebsd.org)
Message-Id: <200904140750.n3E7oTcU098629@svn.freebsd.org>
From: Randall Stewart 
Date: Tue, 14 Apr 2009 07:50:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191049 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 07:50:30 -0000

Author: rrs
Date: Tue Apr 14 07:50:29 2009
New Revision: 191049
URL: http://svn.freebsd.org/changeset/base/191049

Log:
  Move the flight size reduction to right after
  we recognize its a retransmit, ahead of the PR-SCTP
  work. Without this fix, we end up NOT reducing flight
  size and causing an miscalculation when PR-SCTP is active
  and data is skipped.
  
  Obtained from:	Michael Tuexen.

Modified:
  head/sys/netinet/sctp_indata.c

Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c	Tue Apr 14 06:35:37 2009	(r191048)
+++ head/sys/netinet/sctp_indata.c	Tue Apr 14 07:50:29 2009	(r191049)
@@ -3833,9 +3833,30 @@ sctp_strike_gap_ack_chunks(struct sctp_t
 			}
 		}
 		if (tp1->sent == SCTP_DATAGRAM_RESEND) {
-			/* Increment the count to resend */
 			struct sctp_nets *alt;
 
+			/* fix counts and things */
+			if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) {
+				sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_RSND,
+				    (tp1->whoTo ? (tp1->whoTo->flight_size) : 0),
+				    tp1->book_size,
+				    (uintptr_t) tp1->whoTo,
+				    tp1->rec.data.TSN_seq);
+			}
+			if (tp1->whoTo) {
+				tp1->whoTo->net_ack++;
+				sctp_flight_size_decrease(tp1);
+			}
+			if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_RWND_ENABLE) {
+				sctp_log_rwnd(SCTP_INCREASE_PEER_RWND,
+				    asoc->peers_rwnd, tp1->send_size, SCTP_BASE_SYSCTL(sctp_peer_chunk_oh));
+			}
+			/* add back to the rwnd */
+			asoc->peers_rwnd += (tp1->send_size + SCTP_BASE_SYSCTL(sctp_peer_chunk_oh));
+
+			/* remove from the total flight */
+			sctp_total_flight_decrease(stcb, tp1);
+
 			if ((stcb->asoc.peer_supports_prsctp) &&
 			    (PR_SCTP_RTX_ENABLED(tp1->flags))) {
 				/*
@@ -3957,27 +3978,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t
 				 */
 				tp1->do_rtt = 0;
 			}
-			/* fix counts and things */
-			if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) {
-				sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_RSND,
-				    (tp1->whoTo ? (tp1->whoTo->flight_size) : 0),
-				    tp1->book_size,
-				    (uintptr_t) tp1->whoTo,
-				    tp1->rec.data.TSN_seq);
-			}
-			if (tp1->whoTo) {
-				tp1->whoTo->net_ack++;
-				sctp_flight_size_decrease(tp1);
-			}
-			if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_RWND_ENABLE) {
-				sctp_log_rwnd(SCTP_INCREASE_PEER_RWND,
-				    asoc->peers_rwnd, tp1->send_size, SCTP_BASE_SYSCTL(sctp_peer_chunk_oh));
-			}
-			/* add back to the rwnd */
-			asoc->peers_rwnd += (tp1->send_size + SCTP_BASE_SYSCTL(sctp_peer_chunk_oh));
-
-			/* remove from the total flight */
-			sctp_total_flight_decrease(stcb, tp1);
 			if (alt != tp1->whoTo) {
 				/* yes, there is an alternate. */
 				sctp_free_remote_addr(tp1->whoTo);

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 08:15:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A43D31065673;
	Tue, 14 Apr 2009 08:15:39 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 776B18FC1D;
	Tue, 14 Apr 2009 08:15:39 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3E8FdLW099353;
	Tue, 14 Apr 2009 08:15:39 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3E8FdX4099352;
	Tue, 14 Apr 2009 08:15:39 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200904140815.n3E8FdX4099352@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 14 Apr 2009 08:15:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191052 - head/share/zoneinfo
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 08:15:40 -0000

Author: edwin
Date: Tue Apr 14 08:15:39 2009
New Revision: 191052
URL: http://svn.freebsd.org/changeset/base/191052

Log:
  MFV of tzdata2009f
  
  Correct DST information for Pakistan for 2009.

Modified:
  head/share/zoneinfo/   (props changed)
  head/share/zoneinfo/asia

Modified: head/share/zoneinfo/asia
==============================================================================
--- head/share/zoneinfo/asia	Tue Apr 14 08:12:45 2009	(r191051)
+++ head/share/zoneinfo/asia	Tue Apr 14 08:15:39 2009	(r191052)
@@ -1,4 +1,4 @@
-# @(#)asia	8.29
+# @(#)asia	8.30
 # 
 
 # This data is by no means authoritative; if you think you know better,
@@ -1589,11 +1589,46 @@ Zone	Asia/Muscat	3:54:20 -	LMT	1920
 # http://dailymailnews.com/200808/28/news/dmbrn03.html
 # 
 
+# From Alexander Krivenyshev (2009-04-08):
+# Based on previous media reports that "... proposed plan to
+# advance clocks by one hour from May 1 will cause disturbance
+# to the working schedules rather than bringing discipline in
+# official working."
+# 
+# http://www.thenews.com.pk/daily_detail.asp?id=171280
+# 
+#
+# recent news that instead of May 2009 - Pakistan plan to
+# introduce DST from April 15, 2009
+#
+# FYI: Associated Press Of Pakistan
+# April 08, 2009
+# Cabinet okays proposal to advance clocks by one hour from April 15
+# 
+# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=73043&Itemid=1
+# 
+#
+# or
+#
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_pakistan05.html
+# 
+#
+# ....
+# The Federal Cabinet on Wednesday approved the proposal to
+# advance clocks in the country by one hour from April 15 to
+# conserve energy"
+
+# From Arthur David Olson (2009-04-10):
+# Assume for now that Pakistan will end DST in 2009 as it did in 2008.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
 Rule Pakistan	2002	only	-	Oct	Sun>=2	0:01	0	-
 Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
 Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
+Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
+Rule Pakistan	2009	only	-	Nov	1	0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
 			5:30	-	IST	1942 Sep

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 09:22:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D521F106564A;
	Tue, 14 Apr 2009 09:22:28 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id AF5458FC1C;
	Tue, 14 Apr 2009 09:22:28 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 5034B46B45;
	Tue, 14 Apr 2009 05:22:28 -0400 (EDT)
Date: Tue, 14 Apr 2009 10:22:28 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Kip Macy 
In-Reply-To: <200904140317.n3E3HigF092519@svn.freebsd.org>
Message-ID: 
References: <200904140317.n3E3HigF092519@svn.freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191037 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 09:22:29 -0000

On Tue, 14 Apr 2009, Kip Macy wrote:

>  call default if_qflush on ifq if default method isn't used by the driver
>
...
> Modified: head/sys/net/if.c
> ==============================================================================
> --- head/sys/net/if.c	Tue Apr 14 03:13:05 2009	(r191036)
> +++ head/sys/net/if.c	Tue Apr 14 03:17:44 2009	(r191037)
> @@ -1509,6 +1509,8 @@ if_unroute(struct ifnet *ifp, int flag,
> 		if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family))
> 			pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
> 	ifp->if_qflush(ifp);
> +	if (ifp->if_snd.ifq_head != NULL)
> +		if_qflush(ifp);

The commit message should perhaps read:

   Call default if_qflush on ifq if there are still packets left in the default
   queue after calling the driver's flush method.

However, this seems a bit odd: what if the driver uses if_snd as its queue but 
implements other differences in the transmit routine?  In that case, we might 
impose default queue properties on if_snd even though the driver doesn't use 
them.  Could you talk a bit about the circumstances under which the driver 
provides an if_qflush that doesn't drain its queues properly?

Robert N M Watson
Computer Laboratory
University of Cambridge

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 10:28:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81713106564A;
	Tue, 14 Apr 2009 10:28:38 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au
	[211.29.132.188])
	by mx1.freebsd.org (Postfix) with ESMTP id 02F8B8FC0A;
	Tue, 14 Apr 2009 10:28:37 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from c122-107-120-227.carlnfd1.nsw.optusnet.com.au
	(c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227])
	by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	n3EAS9vh002186
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 14 Apr 2009 20:28:13 +1000
Date: Tue, 14 Apr 2009 20:28:09 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: Ed Schouten 
In-Reply-To: <20090413161812.GD32098@hoeg.nl>
Message-ID: <20090414202138.O53192@delplex.bde.org>
References: <200904111401.n3BE1108088009@svn.freebsd.org>
	<20090413161812.GD32098@hoeg.nl>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: Revert unneeded changes of r190919
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 10:28:38 -0000

On Mon, 13 Apr 2009, Ed Schouten wrote:

> Because the changes in r190919 did contain some nice fixes, but some of
> them were unneeded or should not attempted to be fixed here, I've
> decided to prepare a commit to revert the changes made in r190919,
> except the improvements Christoph made to the inline assembly.
>
> 	http://80386.nl/pub/cmallon.diff

Review of what I can quote easily in mail: this url appears to be
syntactically correct.

This is OK, but I would prefer to use temporary hacks in machdep.c
than to mess up cpufunc.h with macros.  Temporary until machdep.c is
done right.  In one right version, a file other than machdep.c would
provide all the functions in cpufunc.h as extern functions callable
by ddb, and _all_ the functions in cpufunc.h certainly shouldn't be
messed up with macros.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 10:30:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B3E44106566C;
	Tue, 14 Apr 2009 10:30:23 +0000 (UTC) (envelope-from ed@hoeg.nl)
Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211])
	by mx1.freebsd.org (Postfix) with ESMTP id 501838FC13;
	Tue, 14 Apr 2009 10:30:23 +0000 (UTC) (envelope-from ed@hoeg.nl)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id B688C1CD22; Tue, 14 Apr 2009 12:30:22 +0200 (CEST)
Date: Tue, 14 Apr 2009 12:30:22 +0200
From: Ed Schouten 
To: Bruce Evans 
Message-ID: <20090414103022.GI32098@hoeg.nl>
References: <200904111401.n3BE1108088009@svn.freebsd.org>
	<20090413161812.GD32098@hoeg.nl>
	<20090414202138.O53192@delplex.bde.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="xSXKkePCxtN78XFb"
Content-Disposition: inline
In-Reply-To: <20090414202138.O53192@delplex.bde.org>
User-Agent: Mutt/1.5.19 (2009-01-05)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: Revert unneeded changes of r190919
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 10:30:24 -0000


--xSXKkePCxtN78XFb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Bruce Evans  wrote:
> Review of what I can quote easily in mail: this url appears to be
> syntactically correct.
>
> This is OK, but I would prefer to use temporary hacks in machdep.c
> than to mess up cpufunc.h with macros.  Temporary until machdep.c is
> done right.  In one right version, a file other than machdep.c would
> provide all the functions in cpufunc.h as extern functions callable
> by ddb, and _all_ the functions in cpufunc.h certainly shouldn't be
> messed up with macros.

Yes, that's true. I guess I'll just change volatile -> __volatile in
cpufunc.h to match the rest of the file.

--=20
 Ed Schouten 
 WWW: http://80386.nl/

--xSXKkePCxtN78XFb
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAknkZb4ACgkQ52SDGA2eCwUdAQCePq3eOwcvaHNLbFQU1hhHgsVI
Dp4An28fKLiwba1SOBpSHC9B+wptMAh3
=djG9
-----END PGP SIGNATURE-----

--xSXKkePCxtN78XFb--

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 10:41:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 41AD91065687;
	Tue, 14 Apr 2009 10:41:32 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au
	[211.29.132.186])
	by mx1.freebsd.org (Postfix) with ESMTP id B3F038FC17;
	Tue, 14 Apr 2009 10:41:31 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from c122-107-120-227.carlnfd1.nsw.optusnet.com.au
	(c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227])
	by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	n3EAfSOx007096
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 14 Apr 2009 20:41:29 +1000
Date: Tue, 14 Apr 2009 20:41:28 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: John Baldwin 
In-Reply-To: <200904131048.16545.jhb@freebsd.org>
Message-ID: <20090414202845.Y53192@delplex.bde.org>
References: <200904111401.n3BE1108088009@svn.freebsd.org>
	<200904131048.16545.jhb@freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Ed Schouten 
Subject: Re: svn commit: r190919 - in head/sys: amd64/amd64 amd64/include
 i386/i386 i386/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 10:41:33 -0000

On Mon, 13 Apr 2009, John Baldwin wrote:

> On Saturday 11 April 2009 10:01:01 am Ed Schouten wrote:
>> Log:
>>   Simplify in/out functions (for i386 and AMD64).
>>
>>   Remove a hack to generate more efficient code for port numbers below
>>   0x100, which has been obsolete for at least ten years, because GCC has
>>   an asm constraint to specify that.
>>
>>   Submitted by:	Christoph Mallon 
>
> Hmm, it appears that you broke the DDB usage:
>
> db> call inb(0x20)
>
> Since the functions are now called 'inb_' and 'outb_'.

I pointed this out in an early review, sigh.

> Perhaps the inline
> routines should be _inb() and _outb() and inb and outb should still be macros
> that wrap them that then get undefined in machdep.c for the functions used in
> DDB?

That would be ugly.  We use better methods in atomic.h to un-inline
_all_ the functions in atomic.h without changing their names, and _all_
the functions in cpufunc.h should be un-inlined too.  However, in*()
and out*() are useful enough to deserve full ddb support as commands.
As commands, they can have the same names as the inline functions with
no problems.  I don't want cpufunc.h to be messed up with special
macros to support just 2 functions.  (atomic.h has some preprocessor
messes to support atomic.c, but it at least does this generally.)

Bruce

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 11:23:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4BB94106564A;
	Tue, 14 Apr 2009 11:23:10 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1FA8A8FC29;
	Tue, 14 Apr 2009 11:23:10 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EBN9DS004481;
	Tue, 14 Apr 2009 11:23:09 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EBN9sL004480;
	Tue, 14 Apr 2009 11:23:09 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200904141123.n3EBN9sL004480@svn.freebsd.org>
From: Ed Schouten 
Date: Tue, 14 Apr 2009 11:23:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191054 - head/sys/dev/joy
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 11:23:10 -0000

Author: ed
Date: Tue Apr 14 11:23:09 2009
New Revision: 191054
URL: http://svn.freebsd.org/changeset/base/191054

Log:
  Use si_drv1 to store joy(4)'s softc.
  
  There are still some calls to dev2unit() left, but I guess we should
  take care of those another time.

Modified:
  head/sys/dev/joy/joy.c

Modified: head/sys/dev/joy/joy.c
==============================================================================
--- head/sys/dev/joy/joy.c	Tue Apr 14 10:55:20 2009	(r191053)
+++ head/sys/dev/joy/joy.c	Tue Apr 14 11:23:09 2009	(r191054)
@@ -55,14 +55,10 @@ __FBSDID("$FreeBSD$");
  */
 
 #define joypart(d) (dev2unit(d)&1)
-#define UNIT(d) ((dev2unit(d)>>1)&3)
 #ifndef JOY_TIMEOUT
 #define JOY_TIMEOUT   2000 /* 2 milliseconds */
 #endif
 
-#define JOY_SOFTC(unit) (struct joy_softc *) \
-        devclass_get_softc(joy_devclass,(unit))
-
 static	d_open_t	joyopen;
 static	d_close_t	joyclose;
 static	d_read_t	joyread;
@@ -111,6 +107,7 @@ joy_attach(device_t dev)
 	joy->port = rman_get_bushandle(joy->res);
 	joy->timeout[0] = joy->timeout[1] = 0;
 	joy->d = make_dev(&joy_cdevsw, unit, 0, 0, 0600, "joy%d", unit);
+	joy->d->si_drv1 = joy;
 	return (0);
 }
 
@@ -131,7 +128,7 @@ static int
 joyopen(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
 	int i = joypart (dev);
-	struct joy_softc *joy = JOY_SOFTC(UNIT(dev));
+	struct joy_softc *joy = dev->si_drv1;
 
 	if (joy->timeout[i])
 		return (EBUSY);
@@ -144,7 +141,7 @@ static int
 joyclose(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
 	int i = joypart (dev);
-	struct joy_softc *joy = JOY_SOFTC(UNIT(dev));
+	struct joy_softc *joy = dev->si_drv1;
 
 	joy->timeout[i] = 0;
 	return (0);
@@ -153,7 +150,7 @@ joyclose(struct cdev *dev, int flags, in
 static int
 joyread(struct cdev *dev, struct uio *uio, int flag)
 {
-	struct joy_softc *joy = JOY_SOFTC(UNIT(dev));
+	struct joy_softc *joy = dev->si_drv1;
 	bus_space_handle_t port = joy->port;
 	bus_space_tag_t bt = joy->bt;
 	struct timespec t, start, end;
@@ -217,7 +214,7 @@ joyread(struct cdev *dev, struct uio *ui
 static int
 joyioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
 {
-	struct joy_softc *joy = JOY_SOFTC(UNIT(dev));
+	struct joy_softc *joy = dev->si_drv1;
 	int i = joypart (dev);
 	int x;
 

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 11:39:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9095D106567E;
	Tue, 14 Apr 2009 11:39:56 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7E3EE8FC20;
	Tue, 14 Apr 2009 11:39:56 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EBdukv004808;
	Tue, 14 Apr 2009 11:39:56 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EBdudA004806;
	Tue, 14 Apr 2009 11:39:56 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200904141139.n3EBdudA004806@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Tue, 14 Apr 2009 11:39:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191055 - head/lib/libc/string
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 11:39:57 -0000

Author: trasz
Date: Tue Apr 14 11:39:56 2009
New Revision: 191055
URL: http://svn.freebsd.org/changeset/base/191055

Log:
  There is no way for strmode(3) to append '+' if the file has ACL,
  because there is no way to figure that out based on the file mode
  itself.  Make the manual page match reality.

Modified:
  head/lib/libc/string/strmode.3
  head/lib/libc/string/strmode.c

Modified: head/lib/libc/string/strmode.3
==============================================================================
--- head/lib/libc/string/strmode.3	Tue Apr 14 11:23:09 2009	(r191054)
+++ head/lib/libc/string/strmode.3	Tue Apr 14 11:39:56 2009	(r191055)
@@ -128,9 +128,7 @@ The file is executable or the directory 
 None of the above apply.
 .El
 .Pp
-The last character is a plus sign ``+'' if any there are any alternate
-or additional access control methods associated with the inode, otherwise
-it will be a space.
+The last character will always be a space.
 .Sh SEE ALSO
 .Xr chmod 1 ,
 .Xr find 1 ,

Modified: head/lib/libc/string/strmode.c
==============================================================================
--- head/lib/libc/string/strmode.c	Tue Apr 14 11:23:09 2009	(r191054)
+++ head/lib/libc/string/strmode.c	Tue Apr 14 11:39:56 2009	(r191055)
@@ -143,6 +143,6 @@ strmode(/* mode_t */ int mode, char *p)
 		*p++ = 't';
 		break;
 	}
-	*p++ = ' ';		/* will be a '+' if ACL's implemented */
+	*p++ = ' ';
 	*p = '\0';
 }

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 11:57:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ECF151065674;
	Tue, 14 Apr 2009 11:57:26 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DB2D68FC13;
	Tue, 14 Apr 2009 11:57:26 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EBvQWA005145;
	Tue, 14 Apr 2009 11:57:26 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EBvQ0K005144;
	Tue, 14 Apr 2009 11:57:26 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200904141157.n3EBvQ0K005144@svn.freebsd.org>
From: Ed Schouten 
Date: Tue, 14 Apr 2009 11:57:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191056 - head/sys/dev/tdfx
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 11:57:27 -0000

Author: ed
Date: Tue Apr 14 11:57:26 2009
New Revision: 191056
URL: http://svn.freebsd.org/changeset/base/191056

Log:
  Let tdfx(4) use si_drv1 instead of using dev2unit().

Modified:
  head/sys/dev/tdfx/tdfx_pci.c

Modified: head/sys/dev/tdfx/tdfx_pci.c
==============================================================================
--- head/sys/dev/tdfx/tdfx_pci.c	Tue Apr 14 11:39:56 2009	(r191055)
+++ head/sys/dev/tdfx/tdfx_pci.c	Tue Apr 14 11:57:26 2009	(r191056)
@@ -255,6 +255,7 @@ tdfx_attach(device_t dev) { 
 	 */
 	tdfx_info->devt = make_dev(&tdfx_cdev, device_get_unit(dev),
 		UID_ROOT, GID_WHEEL, 0600, "3dfx%x", device_get_unit(dev));
+	tdfx_info->devt->si_drv1 = tdfx_info;
 	
 	return 0;
 }
@@ -393,8 +394,7 @@ tdfx_open(struct cdev *dev, int flags, i
 	 *	The open cdev method handles open(2) calls to /dev/3dfx[n] 
 	 * We can pretty much allow any opening of the device.
 	 */
-	struct tdfx_softc *tdfx_info = devclass_get_softc(tdfx_devclass, 
-			UNIT(dev2unit(dev)));
+	struct tdfx_softc *tdfx_info = dev->si_drv1;
 	if(tdfx_info->busy != 0) return EBUSY;
 #ifdef	DEBUG
 	printf("3dfx: Opened by #%d\n", td->td_proc->p_pid);
@@ -411,8 +411,7 @@ tdfx_close(struct cdev *dev, int fflag, 
 	 *	The close cdev method handles close(2) calls to /dev/3dfx[n] 
 	 * We'll always want to close the device when it's called.
 	 */
-	struct tdfx_softc *tdfx_info = devclass_get_softc(tdfx_devclass, 
-		UNIT(dev2unit(dev)));
+	struct tdfx_softc *tdfx_info = dev->si_drv1;
 	if(tdfx_info->busy == 0) return EBADF;
 	tdfx_info->busy = 0;
 #ifdef	DEBUG
@@ -434,8 +433,7 @@ tdfx_mmap(struct cdev *dev, vm_offset_t 
 	/* struct tdfx_softc* tdfx_info; */
 	
 	/* Get the configuration for our card XXX*/
-	/*tdfx_info = (struct tdfx_softc*)devclass_get_softc(tdfx_devclass,
-			UNIT(dev2unit(dev)));*/
+	/*tdfx_info = dev->si_drv1; */
 	/************************/
 
 	struct tdfx_softc* tdfx_info[2];

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 13:11:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED4211065673;
	Tue, 14 Apr 2009 13:11:34 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C01EB8FC0C;
	Tue, 14 Apr 2009 13:11:34 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EDBYl2006666;
	Tue, 14 Apr 2009 13:11:34 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EDBYVr006665;
	Tue, 14 Apr 2009 13:11:34 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200904141311.n3EDBYVr006665@svn.freebsd.org>
From: Ed Schouten 
Date: Tue, 14 Apr 2009 13:11:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191057 - head/sys/dev/agp
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 13:11:36 -0000

Author: ed
Date: Tue Apr 14 13:11:34 2009
New Revision: 191057
URL: http://svn.freebsd.org/changeset/base/191057

Log:
  Use si_drv1 instead of dev2unit() inside agp(4).
  
  Reviewed by:	rnoland

Modified:
  head/sys/dev/agp/agp.c

Modified: head/sys/dev/agp/agp.c
==============================================================================
--- head/sys/dev/agp/agp.c	Tue Apr 14 11:57:26 2009	(r191056)
+++ head/sys/dev/agp/agp.c	Tue Apr 14 13:11:34 2009	(r191057)
@@ -81,7 +81,6 @@ static struct cdevsw agp_cdevsw = {
 };
 
 static devclass_t agp_devclass;
-#define KDEV2DEV(kdev)	devclass_get_device(agp_devclass, dev2unit(kdev))
 
 /* Helper functions for implementing chipset mini drivers. */
 
@@ -254,11 +253,8 @@ agp_generic_attach(device_t dev)
 	sc->as_nextid = 1;
 
 	sc->as_devnode = make_dev(&agp_cdevsw,
-				  device_get_unit(dev),
-				  UID_ROOT,
-				  GID_WHEEL,
-				  0600,
-				  "agpgart");
+	    0, UID_ROOT, GID_WHEEL, 0600, "agpgart");
+	sc->as_devnode->si_drv1 = dev;
 
 	return 0;
 }
@@ -802,7 +798,7 @@ agp_unbind_user(device_t dev, agp_unbind
 static int
 agp_open(struct cdev *kdev, int oflags, int devtype, struct thread *td)
 {
-	device_t dev = KDEV2DEV(kdev);
+	device_t dev = kdev->si_drv1;
 	struct agp_softc *sc = device_get_softc(dev);
 
 	if (!sc->as_isopen) {
@@ -816,7 +812,7 @@ agp_open(struct cdev *kdev, int oflags, 
 static int
 agp_close(struct cdev *kdev, int fflag, int devtype, struct thread *td)
 {
-	device_t dev = KDEV2DEV(kdev);
+	device_t dev = kdev->si_drv1;
 	struct agp_softc *sc = device_get_softc(dev);
 	struct agp_memory *mem;
 
@@ -839,7 +835,7 @@ agp_close(struct cdev *kdev, int fflag, 
 static int
 agp_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int fflag, struct thread *td)
 {
-	device_t dev = KDEV2DEV(kdev);
+	device_t dev = kdev->si_drv1;
 
 	switch (cmd) {
 	case AGPIOC_INFO:
@@ -874,7 +870,7 @@ agp_ioctl(struct cdev *kdev, u_long cmd,
 static int
 agp_mmap(struct cdev *kdev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
 {
-	device_t dev = KDEV2DEV(kdev);
+	device_t dev = kdev->si_drv1;
 	struct agp_softc *sc = device_get_softc(dev);
 
 	if (offset > AGP_GET_APERTURE(dev))

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 13:18:40 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6EEF1106564A;
	Tue, 14 Apr 2009 13:18:40 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 435D48FC1F;
	Tue, 14 Apr 2009 13:18:40 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EDIelm006828;
	Tue, 14 Apr 2009 13:18:40 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EDIe1S006827;
	Tue, 14 Apr 2009 13:18:40 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200904141318.n3EDIe1S006827@svn.freebsd.org>
From: Ed Schouten 
Date: Tue, 14 Apr 2009 13:18:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191058 - head/sys/dev/powermac_nvram
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 13:18:40 -0000

Author: ed
Date: Tue Apr 14 13:18:39 2009
New Revision: 191058
URL: http://svn.freebsd.org/changeset/base/191058

Log:
  Use si_drv1 instead of dev2unit() in powermac_nvram.
  
  Reviewed by:	nwhitehorn

Modified:
  head/sys/dev/powermac_nvram/powermac_nvram.c

Modified: head/sys/dev/powermac_nvram/powermac_nvram.c
==============================================================================
--- head/sys/dev/powermac_nvram/powermac_nvram.c	Tue Apr 14 13:11:34 2009	(r191057)
+++ head/sys/dev/powermac_nvram/powermac_nvram.c	Tue Apr 14 13:18:39 2009	(r191058)
@@ -89,10 +89,6 @@ DRIVER_MODULE(powermac_nvram, nexus, pow
  * Cdev methods.
  */
 
-#define	NVRAM_UNIT(dev)		dev2unit(dev)
-#define	NVRAM_SOFTC(unit)	((struct powermac_nvram_softc *) \
-     devclass_get_softc(powermac_nvram_devclass, unit))
-
 static	d_open_t	powermac_nvram_open;
 static	d_close_t	powermac_nvram_close;
 static	d_read_t	powermac_nvram_read;
@@ -169,6 +165,7 @@ powermac_nvram_attach(device_t dev)
 
 	sc->sc_cdev = make_dev(&powermac_nvram_cdevsw, 0, 0, 0, 0600,
 	    "powermac_nvram");
+	sc->sc_cdev->si_drv1 = sc;
 
 	return 0;
 }
@@ -192,9 +189,8 @@ powermac_nvram_detach(device_t dev)
 static int
 powermac_nvram_open(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
-	struct powermac_nvram_softc *sc;
+	struct powermac_nvram_softc *sc = dev->si_drv1;
 
-	sc = NVRAM_SOFTC(NVRAM_UNIT(dev));
 	if (sc->sc_isopen)
 		return EBUSY;
 	sc->sc_isopen = 1;
@@ -205,12 +201,10 @@ powermac_nvram_open(struct cdev *dev, in
 static int
 powermac_nvram_close(struct cdev *dev, int fflag, int devtype, struct thread *td)
 {
-	struct powermac_nvram_softc *sc;
+	struct powermac_nvram_softc *sc = dev->si_drv1;
 	struct core99_header *header;
 	vm_offset_t bank;
 
-	sc = NVRAM_SOFTC(NVRAM_UNIT(dev));
-
 	if (sc->sc_wpos != sizeof(sc->sc_data)) {
 		/* Short write, restore in-memory copy */
 		bcopy((void *)sc->sc_bank, (void *)sc->sc_data, NVRAM_SIZE);
@@ -246,9 +240,7 @@ static int
 powermac_nvram_read(struct cdev *dev, struct uio *uio, int ioflag)
 {
 	int rv, amnt, data_available;
-	struct powermac_nvram_softc *sc;
-
-	sc = NVRAM_SOFTC(NVRAM_UNIT(dev));
+	struct powermac_nvram_softc *sc = dev->si_drv1;
 
 	rv = 0;
 	while (uio->uio_resid > 0) {
@@ -271,9 +263,7 @@ static int
 powermac_nvram_write(struct cdev *dev, struct uio *uio, int ioflag)
 {
 	int rv, amnt, data_available;
-	struct powermac_nvram_softc *sc;
-
-	sc = NVRAM_SOFTC(NVRAM_UNIT(dev));
+	struct powermac_nvram_softc *sc = dev->si_drv1;
 
 	if (sc->sc_wpos >= sizeof(sc->sc_data))
 		return EINVAL;

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 14:02:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1BCB0106567C;
	Tue, 14 Apr 2009 14:02:44 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E46758FC19;
	Tue, 14 Apr 2009 14:02:43 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EE2haI007750;
	Tue, 14 Apr 2009 14:02:43 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EE2hwB007748;
	Tue, 14 Apr 2009 14:02:43 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200904141402.n3EE2hwB007748@svn.freebsd.org>
From: Ed Schouten 
Date: Tue, 14 Apr 2009 14:02:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191060 - in head/sys/dev: twa twe
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 14:02:45 -0000

Author: ed
Date: Tue Apr 14 14:02:43 2009
New Revision: 191060
URL: http://svn.freebsd.org/changeset/base/191060

Log:
  Use si_drv1 instead of dev2unit() in twe(4) and twa(4)
  
  Reviewed by:	scottl

Modified:
  head/sys/dev/twa/tw_osl_freebsd.c
  head/sys/dev/twe/twe_freebsd.c

Modified: head/sys/dev/twa/tw_osl_freebsd.c
==============================================================================
--- head/sys/dev/twa/tw_osl_freebsd.c	Tue Apr 14 13:43:09 2009	(r191059)
+++ head/sys/dev/twa/tw_osl_freebsd.c	Tue Apr 14 14:02:43 2009	(r191060)
@@ -88,8 +88,7 @@ static devclass_t	twa_devclass;
 static TW_INT32
 twa_open(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, d_thread_t *proc)
 {
-	TW_INT32		unit = dev2unit(dev);
-	struct twa_softc	*sc = devclass_get_softc(twa_devclass, unit);
+	struct twa_softc	*sc = (struct twa_softc *)(dev->si_drv1);
 
 	tw_osli_dbg_dprintf(5, sc, "entered");
 	sc->state |= TW_OSLI_CTLR_STATE_OPEN;
@@ -114,8 +113,7 @@ twa_open(struct cdev *dev, TW_INT32 flag
 static TW_INT32
 twa_close(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, d_thread_t *proc)
 {
-	TW_INT32		unit = dev2unit(dev);
-	struct twa_softc	*sc = devclass_get_softc(twa_devclass, unit);
+	struct twa_softc	*sc = (struct twa_softc *)(dev->si_drv1);
 
 	tw_osli_dbg_dprintf(5, sc, "entered");
 	sc->state &= ~TW_OSLI_CTLR_STATE_OPEN;

Modified: head/sys/dev/twe/twe_freebsd.c
==============================================================================
--- head/sys/dev/twe/twe_freebsd.c	Tue Apr 14 13:43:09 2009	(r191059)
+++ head/sys/dev/twe/twe_freebsd.c	Tue Apr 14 14:02:43 2009	(r191060)
@@ -81,8 +81,7 @@ static struct cdevsw twe_cdevsw = {
 static int
 twe_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
 {
-    int			unit = dev2unit(dev);
-    struct twe_softc	*sc = devclass_get_softc(twe_devclass, unit);
+    struct twe_softc		*sc = (struct twe_softc *)dev->si_drv1;
 
     sc->twe_state |= TWE_STATE_OPEN;
     return(0);
@@ -94,8 +93,7 @@ twe_open(struct cdev *dev, int flags, in
 static int
 twe_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
 {
-    int			unit = dev2unit(dev);
-    struct twe_softc	*sc = devclass_get_softc(twe_devclass, unit);
+    struct twe_softc		*sc = (struct twe_softc *)dev->si_drv1;
 
     sc->twe_state &= ~TWE_STATE_OPEN;
     return (0);

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 14:19:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D5CB7106564A;
	Tue, 14 Apr 2009 14:19:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C533B8FC19;
	Tue, 14 Apr 2009 14:19:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EEJIPI009143;
	Tue, 14 Apr 2009 14:19:18 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EEJIpw009142;
	Tue, 14 Apr 2009 14:19:18 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200904141419.n3EEJIpw009142@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 14 Apr 2009 14:19:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191061 - head/sys/boot/i386/libi386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 14:19:19 -0000

Author: jhb
Date: Tue Apr 14 14:19:18 2009
New Revision: 191061
URL: http://svn.freebsd.org/changeset/base/191061

Log:
  Use a disk address instead of an int to hold the starting offset of an
  open partition.  This fixes access to partitions whose starting offset
  is >= 2 TB.
  
  Submitted by:	"James R. Van Artsdalen"  james jrv.org
  MFC after:	3 days

Modified:
  head/sys/boot/i386/libi386/biosdisk.c

Modified: head/sys/boot/i386/libi386/biosdisk.c
==============================================================================
--- head/sys/boot/i386/libi386/biosdisk.c	Tue Apr 14 14:02:43 2009	(r191060)
+++ head/sys/boot/i386/libi386/biosdisk.c	Tue Apr 14 14:19:18 2009	(r191061)
@@ -83,7 +83,7 @@ struct open_disk {
     int			od_cyl;			/* BIOS geometry */
     int			od_hds;
     int			od_sec;
-    int			od_boff;		/* block offset from beginning of BIOS disk */
+    daddr_t			od_boff;		/* block offset from beginning of BIOS disk */
     int			od_flags;
 #define BD_MODEINT13		0x0000
 #define BD_MODEEDD1		0x0001

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 17:14:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D3C811065709;
	Tue, 14 Apr 2009 17:14:35 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A71618FC19;
	Tue, 14 Apr 2009 17:14:35 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EHEZtq014387;
	Tue, 14 Apr 2009 17:14:35 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EHEZqZ014386;
	Tue, 14 Apr 2009 17:14:35 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <200904141714.n3EHEZqZ014386@svn.freebsd.org>
From: Jack F Vogel 
Date: Tue, 14 Apr 2009 17:14:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191065 - head/sys/dev/e1000
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 17:14:37 -0000

Author: jfv
Date: Tue Apr 14 17:14:35 2009
New Revision: 191065
URL: http://svn.freebsd.org/changeset/base/191065

Log:
  Thanks to Michael Tuexen and Randall Scott for providing a
  few important bug fixes found while they were doing SCTP
  development, and that I somehow lost during the scramble.
  
  Thanks guys!!

Modified:
  head/sys/dev/e1000/if_igb.c

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Tue Apr 14 16:48:49 2009	(r191064)
+++ head/sys/dev/e1000/if_igb.c	Tue Apr 14 17:14:35 2009	(r191065)
@@ -94,7 +94,7 @@ int	igb_display_debug_stats = 0;
 /*********************************************************************
  *  Driver version:
  *********************************************************************/
-char igb_driver_version[] = "version - 1.5.2";
+char igb_driver_version[] = "version - 1.5.3";
 
 
 /*********************************************************************
@@ -4002,7 +4002,7 @@ igb_rxeof(struct rx_ring *rxr, int count
 		accept_frame = 1;
 		hlen = plen = len_adj = 0;
 		sendmp = mh = mp = NULL;
-		ptype = (u16)cur->wb.lower.lo_dword.data;
+		ptype = (u16)(cur->wb.lower.lo_dword.data >> 4);
 
 		/* Sync the buffers */
 		bus_dmamap_sync(rxr->rxtag, rxr->rx_buffers[i].map,
@@ -4103,16 +4103,16 @@ igb_rxeof(struct rx_ring *rxr, int count
 					rxr->lmp = mh->m_next;
 				}
 			} else {
-				/* Chain mbuf's together */
-				mh->m_flags &= ~M_PKTHDR;
-				rxr->lmp->m_next = mh;
-				rxr->lmp = rxr->lmp->m_next;
-				rxr->fmp->m_pkthdr.len += mh->m_len;
 				/* Adjust for CRC frag */
 				if (len_adj) {
 					rxr->lmp->m_len -= len_adj;
 					rxr->fmp->m_pkthdr.len -= len_adj;
 				}
+				/* Chain mbuf's together */
+				mh->m_flags &= ~M_PKTHDR;
+				rxr->lmp->m_next = mh;
+				rxr->lmp = rxr->lmp->m_next;
+				rxr->fmp->m_pkthdr.len += mh->m_len;
 			}
 
 			if (eop) {
@@ -4256,7 +4256,7 @@ igb_rx_checksum(u32 staterr, struct mbuf
 #endif
 		/* Did it pass? */
 		if (!(errors & E1000_RXD_ERR_TCPE)) {
-			mp->m_pkthdr.csum_flags = type;
+			mp->m_pkthdr.csum_flags |= type;
 			if (!sctp)
 				mp->m_pkthdr.csum_data = htons(0xffff);
 		}

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 17:26:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8950B106564A;
	Tue, 14 Apr 2009 17:26:07 +0000 (UTC)
	(envelope-from jfvogel@gmail.com)
Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.176])
	by mx1.freebsd.org (Postfix) with ESMTP id 467348FC0A;
	Tue, 14 Apr 2009 17:26:07 +0000 (UTC)
	(envelope-from jfvogel@gmail.com)
Received: by wa-out-1112.google.com with SMTP id m38so1487773waf.27
	for ; Tue, 14 Apr 2009 10:26:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:in-reply-to:references
	:date:message-id:subject:from:to:cc:content-type;
	bh=P0PHQhaqtN771kU9B3ff3Iep8jB0rYiqqx0zfgN0g20=;
	b=gecLRawOiHVt7OES67h0vilbYyirXFvmAzDXG31WOsoubthWUSAZunK8k5llktoYa6
	yDYso/+h5QmERImysnUiz+uSXPbBHl/kOcNDDqnPULQsGF9j2C1J9GzyiPwMYsvZuSAt
	Wrtqh0U+ISJDGq46XlFRXjIPVzn2A6qNhqSfI=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	b=qCncCxTdIAxlqPiI56rdyM2hZh3HiWv5/V/w7AlUbtjevN9nz44ERoTl9Oc/sTFAi7
	OiU8mRhi2Hmxo2zXzdw1VppKVRRaLnD/UNlJX+KI3EFeTAjmT469ErxOeyE6buhojNGh
	cQSVZZZcadZrInjxUvZmyeXsz2FxHK3r/nSyE=
MIME-Version: 1.0
Received: by 10.114.95.12 with SMTP id s12mr3773577wab.223.1239729966881; Tue, 
	14 Apr 2009 10:26:06 -0700 (PDT)
In-Reply-To: <200904141714.n3EHEZqZ014386@svn.freebsd.org>
References: <200904141714.n3EHEZqZ014386@svn.freebsd.org>
Date: Tue, 14 Apr 2009 10:26:06 -0700
Message-ID: <2a41acea0904141026r10712a8fr356e35e33e0c1c9e@mail.gmail.com>
From: Jack Vogel 
To: Jack F Vogel 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Content-Filtered-By: Mailman/MimeDel 2.1.5
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191065 - head/sys/dev/e1000
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 17:26:08 -0000

LOL, er I meant Randall Stewert,  must be thinking of old films, sorry
Randall :)

On Tue, Apr 14, 2009 at 10:14 AM, Jack F Vogel  wrote:

> Author: jfv
> Date: Tue Apr 14 17:14:35 2009
> New Revision: 191065
> URL: http://svn.freebsd.org/changeset/base/191065
>
> Log:
>  Thanks to Michael Tuexen and Randall Scott for providing a
>  few important bug fixes found while they were doing SCTP
>  development, and that I somehow lost during the scramble.
>
>  Thanks guys!!
>
> Modified:
>  head/sys/dev/e1000/if_igb.c
>
> Modified: head/sys/dev/e1000/if_igb.c
>
> ==============================================================================
> --- head/sys/dev/e1000/if_igb.c Tue Apr 14 16:48:49 2009        (r191064)
> +++ head/sys/dev/e1000/if_igb.c Tue Apr 14 17:14:35 2009        (r191065)
> @@ -94,7 +94,7 @@ int   igb_display_debug_stats = 0;
>  /*********************************************************************
>  *  Driver version:
>  *********************************************************************/
> -char igb_driver_version[] = "version - 1.5.2";
> +char igb_driver_version[] = "version - 1.5.3";
>
>
>  /*********************************************************************
> @@ -4002,7 +4002,7 @@ igb_rxeof(struct rx_ring *rxr, int count
>                accept_frame = 1;
>                hlen = plen = len_adj = 0;
>                sendmp = mh = mp = NULL;
> -               ptype = (u16)cur->wb.lower.lo_dword.data;
> +               ptype = (u16)(cur->wb.lower.lo_dword.data >> 4);
>
>                /* Sync the buffers */
>                bus_dmamap_sync(rxr->rxtag, rxr->rx_buffers[i].map,
> @@ -4103,16 +4103,16 @@ igb_rxeof(struct rx_ring *rxr, int count
>                                        rxr->lmp = mh->m_next;
>                                }
>                        } else {
> -                               /* Chain mbuf's together */
> -                               mh->m_flags &= ~M_PKTHDR;
> -                               rxr->lmp->m_next = mh;
> -                               rxr->lmp = rxr->lmp->m_next;
> -                               rxr->fmp->m_pkthdr.len += mh->m_len;
>                                /* Adjust for CRC frag */
>                                if (len_adj) {
>                                        rxr->lmp->m_len -= len_adj;
>                                        rxr->fmp->m_pkthdr.len -= len_adj;
>                                }
> +                               /* Chain mbuf's together */
> +                               mh->m_flags &= ~M_PKTHDR;
> +                               rxr->lmp->m_next = mh;
> +                               rxr->lmp = rxr->lmp->m_next;
> +                               rxr->fmp->m_pkthdr.len += mh->m_len;
>                        }
>
>                        if (eop) {
> @@ -4256,7 +4256,7 @@ igb_rx_checksum(u32 staterr, struct mbuf
>  #endif
>                /* Did it pass? */
>                if (!(errors & E1000_RXD_ERR_TCPE)) {
> -                       mp->m_pkthdr.csum_flags = type;
> +                       mp->m_pkthdr.csum_flags |= type;
>                        if (!sctp)
>                                mp->m_pkthdr.csum_data = htons(0xffff);
>                }
>

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 17:34:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7899C106566B;
	Tue, 14 Apr 2009 17:34:32 +0000 (UTC) (envelope-from sam@freebsd.org)
Received: from ebb.errno.com (ebb.errno.com [69.12.149.25])
	by mx1.freebsd.org (Postfix) with ESMTP id 34CDB8FC08;
	Tue, 14 Apr 2009 17:34:32 +0000 (UTC) (envelope-from sam@freebsd.org)
Received: from trouble.errno.com (trouble.errno.com [10.0.0.248])
	(authenticated bits=0)
	by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n3EHYV8x093108
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 14 Apr 2009 10:34:32 -0700 (PDT) (envelope-from sam@freebsd.org)
Message-ID: <49E4C927.2080508@freebsd.org>
Date: Tue, 14 Apr 2009 10:34:31 -0700
From: Sam Leffler 
Organization: FreeBSD Project
User-Agent: Thunderbird 2.0.0.18 (X11/20081209)
MIME-Version: 1.0
To: Jack F Vogel 
References: <200904141714.n3EHEZqZ014386@svn.freebsd.org>
In-Reply-To: <200904141714.n3EHEZqZ014386@svn.freebsd.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-DCC-URT-Metrics: ebb.errno.com; whitelist
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191065 - head/sys/dev/e1000
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 17:34:33 -0000

Jack F Vogel wrote:
> Author: jfv
> Date: Tue Apr 14 17:14:35 2009
> New Revision: 191065
> URL: http://svn.freebsd.org/changeset/base/191065
>
> Log:
>   Thanks to Michael Tuexen and Randall Scott for providing a
>   few important bug fixes found while they were doing SCTP
>   development, and that I somehow lost during the scramble.
>   
>   Thanks guys!!
>
>   
Attribution is great but perhaps you could say what bugs were fixed?

    Sam


From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 17:44:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 063F3106566C;
	Tue, 14 Apr 2009 17:44:45 +0000 (UTC)
	(envelope-from jfvogel@gmail.com)
Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.231])
	by mx1.freebsd.org (Postfix) with ESMTP id AF9FF8FC16;
	Tue, 14 Apr 2009 17:44:44 +0000 (UTC)
	(envelope-from jfvogel@gmail.com)
Received: by rv-out-0506.google.com with SMTP id l9so2545669rvb.43
	for ; Tue, 14 Apr 2009 10:44:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:in-reply-to:references
	:date:message-id:subject:from:to:cc:content-type;
	bh=yr6y6zzMMYQDzuWKhYEbOjJTPzqseU120USUQATc+aw=;
	b=Kxc8eIsTQ2DYyoCwpm/U74blltqL3xbVcLup8LJLuysvjcQi6Uk9lRJTZjSUGf3Vuo
	NFEhZRtvYp4xkbWAxzQTwfQScpiOtraGZ7ZiGjhR28gN35iyqLdv1J/nqH0yGyPPS6cl
	WPlmA4lYqcVxEzgMtaMnwp3VbnaHqdD2CDlUg=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	b=eo8VwlKIPTuhEuHXfXyNOJnaJiERpiaNJW0vI0MUkiIJA19whT+TGqT8HjvTPvzTSX
	rKXmI5Ffimtv7xYLBMSzPFRvOZO0NYU2z0tfIAS0lhqWyPNVnTaiHrHKEoyqH1u3y3Gx
	Ol3SoXdxRwZwTQhSuPzJkGfUyCbsN52G9PxUY=
MIME-Version: 1.0
Received: by 10.114.111.1 with SMTP id j1mr3806485wac.79.1239731084403; Tue, 
	14 Apr 2009 10:44:44 -0700 (PDT)
In-Reply-To: <49E4C927.2080508@freebsd.org>
References: <200904141714.n3EHEZqZ014386@svn.freebsd.org>
	<49E4C927.2080508@freebsd.org>
Date: Tue, 14 Apr 2009 10:44:44 -0700
Message-ID: <2a41acea0904141044l49e6ef80hc23a740f02f85ce1@mail.gmail.com>
From: Jack Vogel 
To: Sam Leffler 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Content-Filtered-By: Mailman/MimeDel 2.1.5
Cc: Jack F Vogel , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r191065 - head/sys/dev/e1000
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 17:44:45 -0000

2 SCTP specific bugs, one is a missing shift to correctly identify SCTP type
in the
descriptor, the second was incorrectly assigning rather than 'or-ing' the
csum_flags,
leading to the inability to do other types of offload downstream.

The third bug was more subtle, the code to detect a CRC fragment in rxeof
was
being done at the wrong point, resulting in a crash/panic.

Jack


On Tue, Apr 14, 2009 at 10:34 AM, Sam Leffler  wrote:

> Jack F Vogel wrote:
>
>> Author: jfv
>> Date: Tue Apr 14 17:14:35 2009
>> New Revision: 191065
>> URL: http://svn.freebsd.org/changeset/base/191065
>>
>> Log:
>>  Thanks to Michael Tuexen and Randall Scott for providing a
>>  few important bug fixes found while they were doing SCTP
>>  development, and that I somehow lost during the scramble.
>>    Thanks guys!!
>>
>>
>>
> Attribution is great but perhaps you could say what bugs were fixed?
>
>   Sam
>
>

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 18:15:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 13CF31065D8A;
	Tue, 14 Apr 2009 18:15:28 +0000 (UTC)
	(envelope-from kientzle@freebsd.org)
Received: from kientzle.com (kientzle.com [66.166.149.50])
	by mx1.freebsd.org (Postfix) with ESMTP id CD7718FC13;
	Tue, 14 Apr 2009 18:15:27 +0000 (UTC)
	(envelope-from kientzle@freebsd.org)
Received: (from root@localhost)
	by kientzle.com (8.14.3/8.14.3) id n3EIFRPK085132;
	Tue, 14 Apr 2009 11:15:27 -0700 (PDT)
	(envelope-from kientzle@freebsd.org)
Received: from dark.x.kientzle.com (fw2.kientzle.com [10.123.1.2])
	by kientzle.com with SMTP id 8tx3cevexbcvvtdhm7yvzt4ips;
	Tue, 14 Apr 2009 11:15:27 -0700 (PDT)
	(envelope-from kientzle@freebsd.org)
Message-ID: <49E4D2BF.2040503@freebsd.org>
Date: Tue, 14 Apr 2009 11:15:27 -0700
From: Tim Kientzle 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US;
	rv:1.8.1.21) Gecko/20090409 SeaMonkey/1.1.15
MIME-Version: 1.0
To: Edward Tomasz Napierala 
References: <200904141139.n3EBdudA004806@svn.freebsd.org>
In-Reply-To: <200904141139.n3EBdudA004806@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191055 - head/lib/libc/string
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 18:15:32 -0000

Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Tue Apr 14 11:39:56 2009
> New Revision: 191055
> URL: http://svn.freebsd.org/changeset/base/191055
> 
> Log:
>   There is no way for strmode(3) to append '+' if the file has ACL,
>   because there is no way to figure that out based on the file mode
>   itself.  Make the manual page match reality.

Yep, that '+' is why libarchive has a custom strmode()
that accepts more information than just the mode.

A related issue:  It would be really nice to be
able to find out whether a file had extended ACLs
or extended attributes based on the information
returned from stat(2).  That would allow programs
like tar to avoid a fair number of system calls.
Even just a single bit "HAS_EXTENSIONS" would help
a lot, since most files don't have any extended
ACLs or extended attributes.  It would also allow
users of strmode() (such as ls) to insert that '+'
sign themselves.

The only place I see to do this is to appropriate
some bits from st_flags.

Tim

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 18:32:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E879D1065678;
	Tue, 14 Apr 2009 18:32:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D3F568FC0C;
	Tue, 14 Apr 2009 18:32:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EIWbFn016143;
	Tue, 14 Apr 2009 18:32:37 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EIWbo4016142;
	Tue, 14 Apr 2009 18:32:37 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200904141832.n3EIWbo4016142@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 14 Apr 2009 18:32:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191069 - head/sys/dev/pci
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 18:32:40 -0000

Author: jhb
Date: Tue Apr 14 18:32:37 2009
New Revision: 191069
URL: http://svn.freebsd.org/changeset/base/191069

Log:
  - Consolidate duplicated code for reading and sizing BARs and writing base
    addresses to BARs into new pci_read_bar() and pci_write_bar() routines.
    pci_add_map(), pci_alloc_map(), and pci_delete_resource() now use these
    routines to work with BARs.
  - Just pass the device_t for the new PCI device to various routines instead
    of passing the device, bus, slot, and function.
  
  Reviewed by:	imp

Modified:
  head/sys/dev/pci/pci.c

Modified: head/sys/dev/pci/pci.c
==============================================================================
--- head/sys/dev/pci/pci.c	Tue Apr 14 18:28:07 2009	(r191068)
+++ head/sys/dev/pci/pci.c	Tue Apr 14 18:32:37 2009	(r191069)
@@ -77,12 +77,11 @@ static int		pci_mapsize(uint64_t testval
 static int		pci_maprange(uint64_t mapreg);
 static void		pci_fixancient(pcicfgregs *cfg);
 
-static int		pci_porten(device_t pcib, int b, int s, int f);
-static int		pci_memen(device_t pcib, int b, int s, int f);
+static int		pci_porten(device_t dev);
+static int		pci_memen(device_t dev);
 static void		pci_assign_interrupt(device_t bus, device_t dev,
 			    int force_route);
-static int		pci_add_map(device_t pcib, device_t bus, device_t dev,
-			    int b, int s, int f, int reg,
+static int		pci_add_map(device_t bus, device_t dev, int reg,
 			    struct resource_list *rl, int force, int prefetch);
 static int		pci_probe(device_t dev);
 static int		pci_attach(device_t dev);
@@ -2258,51 +2257,36 @@ pci_print_verbose(struct pci_devinfo *di
 }
 
 static int
-pci_porten(device_t pcib, int b, int s, int f)
+pci_porten(device_t dev)
 {
-	return (PCIB_READ_CONFIG(pcib, b, s, f, PCIR_COMMAND, 2)
-		& PCIM_CMD_PORTEN) != 0;
+	return (pci_read_config(dev, PCIR_COMMAND, 2) & PCIM_CMD_PORTEN) != 0;
 }
 
 static int
-pci_memen(device_t pcib, int b, int s, int f)
+pci_memen(device_t dev)
 {
-	return (PCIB_READ_CONFIG(pcib, b, s, f, PCIR_COMMAND, 2)
-		& PCIM_CMD_MEMEN) != 0;
+	return (pci_read_config(dev, PCIR_COMMAND, 2) & PCIM_CMD_MEMEN) != 0;
 }
 
-/*
- * Add a resource based on a pci map register. Return 1 if the map
- * register is a 32bit map register or 2 if it is a 64bit register.
- */
-static int
-pci_add_map(device_t pcib, device_t bus, device_t dev,
-    int b, int s, int f, int reg, struct resource_list *rl, int force,
-    int prefetch)
+static void
+pci_read_bar(device_t dev, int reg, pci_addr_t *mapp, pci_addr_t *testvalp)
 {
-	pci_addr_t base, map;
-	pci_addr_t start, end, count;
-	uint8_t ln2size;
-	uint8_t ln2range;
-	uint32_t testval;
+	pci_addr_t map, testval;
+	int ln2range;
 	uint16_t cmd;
-	int type;
-	int barlen;
-	struct resource *res;
 
-	map = PCIB_READ_CONFIG(pcib, b, s, f, reg, 4);
+	map = pci_read_config(dev, reg, 4);
 	ln2range = pci_maprange(map);
 	if (ln2range == 64)
-		map |= (uint64_t)PCIB_READ_CONFIG(pcib, b, s, f, reg + 4, 4) <<
-		    32;
+		map |= (pci_addr_t)pci_read_config(dev, reg + 4, 4) << 32;
 
 	/*
 	 * Disable decoding via the command register before
 	 * determining the BAR's length since we will be placing it in
 	 * a weird state.
 	 */
-	cmd = PCIB_READ_CONFIG(pcib, b, s, f, PCIR_COMMAND, 2);
-	PCIB_WRITE_CONFIG(pcib, b, s, f, PCIR_COMMAND,
+	cmd = pci_read_config(dev, PCIR_COMMAND, 2);
+	pci_write_config(dev, PCIR_COMMAND,
 	    cmd & ~(PCI_BAR_MEM(map) ? PCIM_CMD_MEMEN : PCIM_CMD_PORTEN), 2);
 
 	/*
@@ -2310,29 +2294,65 @@ pci_add_map(device_t pcib, device_t bus,
 	 * log_2(size) bits of the BAR will stick as 0 when we read
 	 * the value back.
 	 */
-	PCIB_WRITE_CONFIG(pcib, b, s, f, reg, 0xffffffff, 4);
-	testval = PCIB_READ_CONFIG(pcib, b, s, f, reg, 4);
+	pci_write_config(dev, reg, 0xffffffff, 4);
+	testval = pci_read_config(dev, reg, 4);
 	if (ln2range == 64) {
-		PCIB_WRITE_CONFIG(pcib, b, s, f, reg + 4, 0xffffffff, 4);
-		testval |= (uint64_t)PCIB_READ_CONFIG(pcib, b, s, f, reg + 4,
-		    4) << 32;
+		pci_write_config(dev, reg + 4, 0xffffffff, 4);
+		testval |= (pci_addr_t)pci_read_config(dev, reg + 4, 4) << 32;
 	}
 
-	/* Restore the BAR and command register. */
-	PCIB_WRITE_CONFIG(pcib, b, s, f, reg, map, 4);
+	/*
+	 * Restore the original value of the BAR.  We may have reprogrammed
+	 * the BAR of the low-level console device and when booting verbose,
+	 * we need the console device addressable.
+	 */
+	pci_write_config(dev, reg, map, 4);
 	if (ln2range == 64)
-		PCIB_WRITE_CONFIG(pcib, b, s, f, reg + 4, map >> 32, 4);
-	PCIB_WRITE_CONFIG(pcib, b, s, f, PCIR_COMMAND, cmd, 2);
+		pci_write_config(dev, reg + 4, map >> 32, 4);
+	pci_write_config(dev, PCIR_COMMAND, cmd, 2);
 
+	*mapp = map;
+	*testvalp = testval;
+}
+
+static void
+pci_write_bar(device_t dev, int reg, pci_addr_t base)
+{
+	pci_addr_t map;
+	int ln2range;
+
+	map = pci_read_config(dev, reg, 4);
+	ln2range = pci_maprange(map);
+	pci_write_config(dev, reg, base, 4);
+	if (ln2range == 64)
+		pci_write_config(dev, reg + 4, base >> 32, 4);
+}
+
+/*
+ * Add a resource based on a pci map register. Return 1 if the map
+ * register is a 32bit map register or 2 if it is a 64bit register.
+ */
+static int
+pci_add_map(device_t bus, device_t dev, int reg, struct resource_list *rl,
+    int force, int prefetch)
+{
+	pci_addr_t base, map, testval;
+	pci_addr_t start, end, count;
+	int barlen, maprange, mapsize, type;
+	uint16_t cmd;
+	struct resource *res;
+
+	pci_read_bar(dev, reg, &map, &testval);
 	if (PCI_BAR_MEM(map)) {
 		type = SYS_RES_MEMORY;
 		if (map & PCIM_BAR_MEM_PREFETCH)
 			prefetch = 1;
 	} else
 		type = SYS_RES_IOPORT;
-	ln2size = pci_mapsize(testval);
+	mapsize = pci_mapsize(testval);
 	base = pci_mapbase(map);
-	barlen = ln2range == 64 ? 2 : 1;
+	maprange = pci_maprange(map);
+	barlen = maprange == 64 ? 2 : 1;
 
 	/*
 	 * For I/O registers, if bottom bit is set, and the next bit up
@@ -2343,16 +2363,16 @@ pci_add_map(device_t pcib, device_t bus,
 	 */
 	if (PCI_BAR_IO(testval) && (testval & PCIM_BAR_IO_RESERVED) != 0)
 		return (barlen);
-	if ((type == SYS_RES_MEMORY && ln2size < 4) ||
-	    (type == SYS_RES_IOPORT && ln2size < 2))
+	if ((type == SYS_RES_MEMORY && mapsize < 4) ||
+	    (type == SYS_RES_IOPORT && mapsize < 2))
 		return (barlen);
 
 	if (bootverbose) {
 		printf("\tmap[%02x]: type %s, range %2d, base %#jx, size %2d",
-		    reg, pci_maptype(map), ln2range, (uintmax_t)base, ln2size);
-		if (type == SYS_RES_IOPORT && !pci_porten(pcib, b, s, f))
+		    reg, pci_maptype(map), maprange, (uintmax_t)base, mapsize);
+		if (type == SYS_RES_IOPORT && !pci_porten(dev))
 			printf(", port disabled\n");
-		else if (type == SYS_RES_MEMORY && !pci_memen(pcib, b, s, f))
+		else if (type == SYS_RES_MEMORY && !pci_memen(dev))
 			printf(", memory disabled\n");
 		else
 			printf(", enabled\n");
@@ -2374,7 +2394,8 @@ pci_add_map(device_t pcib, device_t bus,
 	if ((u_long)base != base) {
 		device_printf(bus,
 		    "pci%d:%d:%d:%d bar %#x too many address bits",
-		    pci_get_domain(dev), b, s, f, reg);
+		    pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev),
+		    pci_get_function(dev), reg);
 		return (barlen);
 	}
 
@@ -2387,30 +2408,30 @@ pci_add_map(device_t pcib, device_t bus,
 	 */
 	if (pci_enable_io_modes) {
 		/* Turn on resources that have been left off by a lazy BIOS */
-		if (type == SYS_RES_IOPORT && !pci_porten(pcib, b, s, f)) {
-			cmd = PCIB_READ_CONFIG(pcib, b, s, f, PCIR_COMMAND, 2);
+		if (type == SYS_RES_IOPORT && !pci_porten(dev)) {
+			cmd = pci_read_config(dev, PCIR_COMMAND, 2);
 			cmd |= PCIM_CMD_PORTEN;
-			PCIB_WRITE_CONFIG(pcib, b, s, f, PCIR_COMMAND, cmd, 2);
+			pci_write_config(dev, PCIR_COMMAND, cmd, 2);
 		}
-		if (type == SYS_RES_MEMORY && !pci_memen(pcib, b, s, f)) {
-			cmd = PCIB_READ_CONFIG(pcib, b, s, f, PCIR_COMMAND, 2);
+		if (type == SYS_RES_MEMORY && !pci_memen(dev)) {
+			cmd = pci_read_config(dev, PCIR_COMMAND, 2);
 			cmd |= PCIM_CMD_MEMEN;
-			PCIB_WRITE_CONFIG(pcib, b, s, f, PCIR_COMMAND, cmd, 2);
+			pci_write_config(dev, PCIR_COMMAND, cmd, 2);
 		}
 	} else {
-		if (type == SYS_RES_IOPORT && !pci_porten(pcib, b, s, f))
+		if (type == SYS_RES_IOPORT && !pci_porten(dev))
 			return (barlen);
-		if (type == SYS_RES_MEMORY && !pci_memen(pcib, b, s, f))
+		if (type == SYS_RES_MEMORY && !pci_memen(dev))
 			return (barlen);
 	}
 
-	count = 1 << ln2size;
+	count = 1 << mapsize;
 	if (base == 0 || base == pci_mapbase(testval)) {
 		start = 0;	/* Let the parent decide. */
 		end = ~0ULL;
 	} else {
 		start = base;
-		end = base + (1 << ln2size) - 1;
+		end = base + (1 << mapsize) - 1;
 	}
 	resource_list_add(rl, type, reg, start, end, count);
 
@@ -2435,9 +2456,7 @@ pci_add_map(device_t pcib, device_t bus,
 		start = rman_get_start(res);
 		rman_set_device(res, bus);
 	}
-	pci_write_config(dev, reg, start, 4);
-	if (ln2range == 64)
-		pci_write_config(dev, reg + 4, start >> 32, 4);
+	pci_write_bar(dev, reg, start);
 	return (barlen);
 }
 
@@ -2449,8 +2468,8 @@ pci_add_map(device_t pcib, device_t bus,
  * addressing mode.
  */
 static void
-pci_ata_maps(device_t pcib, device_t bus, device_t dev, int b,
-    int s, int f, struct resource_list *rl, int force, uint32_t prefetchmask)
+pci_ata_maps(device_t bus, device_t dev, struct resource_list *rl, int force,
+    uint32_t prefetchmask)
 {
 	struct resource *r;
 	int rid, type, progif;
@@ -2468,9 +2487,9 @@ pci_ata_maps(device_t pcib, device_t bus
 	progif = pci_read_config(dev, PCIR_PROGIF, 1);
 	type = SYS_RES_IOPORT;
 	if (progif & PCIP_STORAGE_IDE_MODEPRIM) {
-		pci_add_map(pcib, bus, dev, b, s, f, PCIR_BAR(0), rl, force,
+		pci_add_map(bus, dev, PCIR_BAR(0), rl, force,
 		    prefetchmask & (1 << 0));
-		pci_add_map(pcib, bus, dev, b, s, f, PCIR_BAR(1), rl, force,
+		pci_add_map(bus, dev, PCIR_BAR(1), rl, force,
 		    prefetchmask & (1 << 1));
 	} else {
 		rid = PCIR_BAR(0);
@@ -2485,9 +2504,9 @@ pci_ata_maps(device_t pcib, device_t bus
 		rman_set_device(r, bus);
 	}
 	if (progif & PCIP_STORAGE_IDE_MODESEC) {
-		pci_add_map(pcib, bus, dev, b, s, f, PCIR_BAR(2), rl, force,
+		pci_add_map(bus, dev, PCIR_BAR(2), rl, force,
 		    prefetchmask & (1 << 2));
-		pci_add_map(pcib, bus, dev, b, s, f, PCIR_BAR(3), rl, force,
+		pci_add_map(bus, dev, PCIR_BAR(3), rl, force,
 		    prefetchmask & (1 << 3));
 	} else {
 		rid = PCIR_BAR(2);
@@ -2501,9 +2520,9 @@ pci_ata_maps(device_t pcib, device_t bus
 		    1, 0);
 		rman_set_device(r, bus);
 	}
-	pci_add_map(pcib, bus, dev, b, s, f, PCIR_BAR(4), rl, force,
+	pci_add_map(bus, dev, PCIR_BAR(4), rl, force,
 	    prefetchmask & (1 << 4));
-	pci_add_map(pcib, bus, dev, b, s, f, PCIR_BAR(5), rl, force,
+	pci_add_map(bus, dev, PCIR_BAR(5), rl, force,
 	    prefetchmask & (1 << 5));
 }
 
@@ -2558,18 +2577,11 @@ pci_assign_interrupt(device_t bus, devic
 void
 pci_add_resources(device_t bus, device_t dev, int force, uint32_t prefetchmask)
 {
-	device_t pcib;
 	struct pci_devinfo *dinfo = device_get_ivars(dev);
 	pcicfgregs *cfg = &dinfo->cfg;
 	struct resource_list *rl = &dinfo->resources;
 	struct pci_quirk *q;
-	int b, i, f, s;
-
-	pcib = device_get_parent(bus);
-
-	b = cfg->bus;
-	s = cfg->slot;
-	f = cfg->func;
+	int i;
 
 	/* ATA devices needs special map treatment */
 	if ((pci_get_class(dev) == PCIC_STORAGE) &&
@@ -2577,11 +2589,11 @@ pci_add_resources(device_t bus, device_t
 	    ((pci_get_progif(dev) & PCIP_STORAGE_IDE_MASTERDEV) ||
 	     (!pci_read_config(dev, PCIR_BAR(0), 4) &&
 	      !pci_read_config(dev, PCIR_BAR(2), 4))) )
-		pci_ata_maps(pcib, bus, dev, b, s, f, rl, force, prefetchmask);
+		pci_ata_maps(bus, dev, rl, force, prefetchmask);
 	else
 		for (i = 0; i < cfg->nummaps;)
-			i += pci_add_map(pcib, bus, dev, b, s, f, PCIR_BAR(i),
-			    rl, force, prefetchmask & (1 << i));
+			i += pci_add_map(bus, dev, PCIR_BAR(i), rl, force,
+			    prefetchmask & (1 << i));
 
 	/*
 	 * Add additional, quirked resources.
@@ -2589,8 +2601,7 @@ pci_add_resources(device_t bus, device_t
 	for (q = &pci_quirks[0]; q->devid; q++) {
 		if (q->devid == ((cfg->device << 16) | cfg->vendor)
 		    && q->type == PCI_QUIRK_MAP_REG)
-			pci_add_map(pcib, bus, dev, b, s, f, q->arg1, rl,
-			  force, 0);
+			pci_add_map(bus, dev, q->arg1, rl, force, 0);
 	}
 
 	if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) {
@@ -3424,8 +3435,7 @@ pci_alloc_map(device_t dev, device_t chi
 	struct resource_list_entry *rle;
 	struct resource *res;
 	pci_addr_t map, testval;
-	uint16_t cmd;
-	int maprange, mapsize;
+	int mapsize;
 
 	/*
 	 * Weed out the bogons, and figure out how large the BAR/map
@@ -3435,38 +3445,7 @@ pci_alloc_map(device_t dev, device_t chi
 	 * it fails here, that other code is broken.
 	 */
 	res = NULL;
-	map = pci_read_config(child, *rid, 4);
-	maprange = pci_maprange(map);
-	if (maprange == 64)
-		map |= (pci_addr_t)pci_read_config(child, *rid + 4, 4) << 32;
-
-	/*
-	 * Disable decoding via the command register before
-	 * determining the BAR's length since we will be placing it in
-	 * a weird state.
-	 */
-	cmd = pci_read_config(child, PCIR_COMMAND, 2);
-	pci_write_config(child, PCIR_COMMAND,
-	    cmd & ~(PCI_BAR_MEM(map) ? PCIM_CMD_MEMEN : PCIM_CMD_PORTEN), 2);
-
-	/* Determine the BAR's length. */
-	pci_write_config(child, *rid, 0xffffffff, 4);
-	testval = pci_read_config(child, *rid, 4);
-	if (maprange == 64) {
-		pci_write_config(child, *rid + 4, 0xffffffff, 4);
-		testval |= (pci_addr_t)pci_read_config(child, *rid + 4, 4) <<
-		    32;
-	}
-
-	/*
-	 * Restore the original value of the BAR.  We may have reprogrammed
-	 * the BAR of the low-level console device and when booting verbose,
-	 * we need the console device addressable.
-	 */
-	pci_write_config(child, *rid, map, 4);
-	if (maprange == 64)
-		pci_write_config(child, *rid + 4, map >> 32, 4);
-	pci_write_config(child, PCIR_COMMAND, cmd, 2);
+	pci_read_bar(child, *rid, &map, &testval);
 
 	/* Ignore a BAR with a base of 0. */
 	if (pci_mapbase(testval) == 0)
@@ -3491,6 +3470,7 @@ pci_alloc_map(device_t dev, device_t chi
 			goto out;
 		}
 	}
+
 	/*
 	 * For real BARs, we need to override the size that
 	 * the driver requests, because that's what the BAR
@@ -3531,9 +3511,7 @@ pci_alloc_map(device_t dev, device_t chi
 		    "Lazy allocation of %#lx bytes rid %#x type %d at %#lx\n",
 		    count, *rid, type, rman_get_start(res));
 	map = rman_get_start(res);
-	pci_write_config(child, *rid, map, 4);
-	if (maprange == 64)
-		pci_write_config(child, *rid + 4, map >> 32, 4);
+	pci_write_bar(child, *rid, map);
 out:;
 	return (res);
 }
@@ -3698,8 +3676,7 @@ pci_delete_resource(device_t dev, device
 		switch (type) {
 		case SYS_RES_IOPORT:
 		case SYS_RES_MEMORY:
-			/* XXX: 64-bit BARs? */
-			pci_write_config(child, rid, 0, 4);
+			pci_write_bar(child, rid, 0);
 			break;
 		}
 		bus_release_resource(dev, type, rid, rle->res);

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 19:02:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 68CC41065670;
	Tue, 14 Apr 2009 19:02:35 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3AF838FC1A;
	Tue, 14 Apr 2009 19:02:35 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EJ2ZIg016854;
	Tue, 14 Apr 2009 19:02:35 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EJ2Zbw016853;
	Tue, 14 Apr 2009 19:02:35 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200904141902.n3EJ2Zbw016853@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 14 Apr 2009 19:02:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191071 - head/sys/boot/sparc64/loader
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 19:02:36 -0000

Author: marius
Date: Tue Apr 14 19:02:34 2009
New Revision: 191071
URL: http://svn.freebsd.org/changeset/base/191071

Log:
  Fix masking of TTE bits; the TD_*_MASK macros need shifting via the
  corresponding TD_*_SHIFT.
  
  MFC after:	3 days

Modified:
  head/sys/boot/sparc64/loader/main.c

Modified: head/sys/boot/sparc64/loader/main.c
==============================================================================
--- head/sys/boot/sparc64/loader/main.c	Tue Apr 14 18:52:39 2009	(r191070)
+++ head/sys/boot/sparc64/loader/main.c	Tue Apr 14 19:02:34 2009	(r191071)
@@ -434,9 +434,10 @@ dtlb_va_to_pa_sun4u(vm_offset_t va)
 			continue;
 		reg = dtlb_get_data_sun4u(i);
 		wrpr(pstate, pstate, 0);
+		reg >>= TD_PA_SHIFT;
 		if (cpu_impl >= CPU_IMPL_ULTRASPARCIII)
-			return ((reg & TD_PA_CH_MASK) >> TD_PA_SHIFT);
-		return ((reg & TD_PA_SF_MASK) >> TD_PA_SHIFT);
+			return (reg & TD_PA_CH_MASK);
+		return (reg & TD_PA_SF_MASK);
 	}
 	wrpr(pstate, pstate, 0);
 	return (-1);
@@ -456,9 +457,10 @@ itlb_va_to_pa_sun4u(vm_offset_t va)
 			continue;
 		reg = itlb_get_data_sun4u(i);
 		wrpr(pstate, pstate, 0);
+		reg >>= TD_PA_SHIFT;
 		if (cpu_impl >= CPU_IMPL_ULTRASPARCIII)
-			return ((reg & TD_PA_CH_MASK) >> TD_PA_SHIFT);
-		return ((reg & TD_PA_SF_MASK) >> TD_PA_SHIFT);
+			return (reg & TD_PA_CH_MASK);
+		return (reg & TD_PA_SF_MASK);
 	}
 	wrpr(pstate, pstate, 0);
 	return (-1);
@@ -846,7 +848,7 @@ pmap_print_tte_sun4u(tte_t tag, tte_t tt
 {
 
 	printf("%s %s ",
-	    page_sizes[(tte & TD_SIZE_MASK) >> TD_SIZE_SHIFT],
+	    page_sizes[(tte >> TD_SIZE_SHIFT) & TD_SIZE_MASK],
 	    tag & TD_G ? "G" : " ");
 	printf(tte & TD_W ? "W " : "  ");
 	printf(tte & TD_P ? "\e[33mP\e[0m " : "  ");

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 19:11:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 66D2A106566B;
	Tue, 14 Apr 2009 19:11:03 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0B50E8FC16;
	Tue, 14 Apr 2009 19:11:03 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EJB2S5017050;
	Tue, 14 Apr 2009 19:11:02 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EJB2g2017048;
	Tue, 14 Apr 2009 19:11:02 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200904141911.n3EJB2g2017048@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 14 Apr 2009 19:11:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191072 - head/sys/dev/fb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 19:11:03 -0000

Author: marius
Date: Tue Apr 14 19:11:02 2009
New Revision: 191072
URL: http://svn.freebsd.org/changeset/base/191072

Log:
  Fix whitespace.

Modified:
  head/sys/dev/fb/machfb.c

Modified: head/sys/dev/fb/machfb.c
==============================================================================
--- head/sys/dev/fb/machfb.c	Tue Apr 14 19:02:34 2009	(r191071)
+++ head/sys/dev/fb/machfb.c	Tue Apr 14 19:11:02 2009	(r191072)
@@ -53,12 +53,12 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
- 
+
 #include 
 __FBSDID("$FreeBSD$");
 
 /*
- * Driver for ATI Mach64 graphics chips. Some code is derived from the
+ * Driver for ATI Mach64 graphics chips.  Some code is derived from the
  * ATI Rage Pro and Derivatives Programmer's Guide.
  */
 
@@ -100,7 +100,7 @@ __FBSDID("$FreeBSD$");
 struct machfb_softc {
 	video_adapter_t		sc_va;		/* must be first */
 
-	phandle_t		sc_node;	
+	phandle_t		sc_node;
 	uint16_t		sc_chip_id;
 	uint8_t			sc_chip_rev;
 
@@ -572,7 +572,7 @@ machfb_init(int unit, video_adapter_t *a
 
 	vid_init_struct(adp, MACHFB_DRIVER_NAME, -1, unit);
 
- 	if (OF_getprop(sc->sc_node, "height", &sc->sc_height,
+	if (OF_getprop(sc->sc_node, "height", &sc->sc_height,
 	    sizeof(sc->sc_height)) == -1)
 		return (ENXIO);
 	if (OF_getprop(sc->sc_node, "width", &sc->sc_width,
@@ -630,12 +630,12 @@ machfb_init(int unit, video_adapter_t *a
 
 	machfb_init_engine(sc);
 #if 0
-	mach64_adjust_frame(0, 0);
+	machfb_adjust_frame(0, 0);
 #endif
 	machfb_set_mode(adp, 0);
 
 	/*
-	 * Install our 16-color color map. This is done only once and with
+	 * Install our 16-color color map.  This is done only once and with
 	 * an offset of 16 on sparc64 as there the OBP driver expects white
 	 * to be at index 0 and black at 255 (some versions also use 1 - 8
 	 * for color text support or the full palette for the boot banner
@@ -880,13 +880,13 @@ machfb_mmap(video_adapter_t *adp, vm_off
 
 	if (adp->va_mem_base != 0 && offset >= adp->va_mem_base &&
 	    offset < adp->va_mem_base + adp->va_mem_size) {
-	    	*paddr = sc->sc_vmemh + offset - adp->va_mem_base;
+		*paddr = sc->sc_vmemh + offset - adp->va_mem_base;
 		return (0);
 	}
 
 	if (offset >= adp->va_registers &&
 	    offset < adp->va_registers + adp->va_registers_size) {
-	    	*paddr = sc->sc_memh + offset - adp->va_registers;
+		*paddr = sc->sc_memh + offset - adp->va_registers;
 		return (0);
 	}
 
@@ -1083,7 +1083,7 @@ machfb_puts(video_adapter_t *adp, vm_off
 	for (i = 0; i < len; i++) {
 		/*
 		 * Accelerate continuous blanks by drawing a respective
-		 * rectangle instead. Drawing a rectangle of any size
+		 * rectangle instead.  Drawing a rectangle of any size
 		 * takes about the same number of operations as drawing
 		 * a single character.
 		 */
@@ -1091,7 +1091,7 @@ machfb_puts(video_adapter_t *adp, vm_off
 		a = (s[i] & 0xff00) >> 8;
 		if (c == 0x00 || c == 0x20 || c == 0xdb || c == 0xff) {
 			color2 = (a >> (c == 0xdb ? 0 : 4) & 0xf);
-	    		x2 = (((off + i) % adp->va_info.vi_width) *
+			x2 = (((off + i) % adp->va_info.vi_width) *
 			    adp->va_info.vi_cwidth) + sc->sc_xmargin;
 			y2 = (((off + i) / adp->va_info.vi_width) *
 			    adp->va_info.vi_cheight) + sc->sc_ymargin;
@@ -1135,7 +1135,7 @@ machfb_putm(video_adapter_t *adp, int x,
 
 	if ((!(sc->sc_flags & MACHFB_CUREN)) &&
 	    (error = machfb_cursor_install(sc)) < 0)
-	    	return (error);
+		return (error);
 	else {
 		/*
 		 * The hardware cursor always must be disabled when
@@ -1174,7 +1174,7 @@ machfb_pci_probe(device_t dev)
 			return (BUS_PROBE_DEFAULT);
 		}
 	}
-	
+
 	return (ENXIO);
 }
 
@@ -1192,8 +1192,8 @@ machfb_pci_attach(device_t dev)
 	node = ofw_bus_get_node(dev);
 	if ((sc = (struct machfb_softc *)vid_get_adapter(vid_find_adapter(
 	    MACHFB_DRIVER_NAME, 0))) != NULL && sc->sc_node == node) {
-	    	device_printf(dev, "console\n");
-	    	device_set_softc(dev, sc);
+		device_printf(dev, "console\n");
+		device_set_softc(dev, sc);
 	} else {
 		sc = device_get_softc(dev);
 		bzero(sc, sizeof(struct machfb_softc));
@@ -1203,7 +1203,7 @@ machfb_pci_attach(device_t dev)
 		sc->sc_chip_rev = pci_get_revid(dev);
 	}
 	adp = &sc->sc_va;
-		
+
 	/*
 	 * Regardless whether we are the console and already allocated
 	 * resources in machfb_configure() or not we have to allocate
@@ -1214,7 +1214,7 @@ machfb_pci_attach(device_t dev)
 	pci_write_config(dev, PCIR_COMMAND,
 	    pci_read_config(dev, PCIR_COMMAND, 2) | PCIM_CMD_PORTEN |
 	    PCIM_CMD_MEMEN, 2);
-	
+
 	sc->sc_memrid = PCIR_BAR(0);
 	if ((sc->sc_memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
 	    &sc->sc_memrid, RF_ACTIVE)) == NULL) {
@@ -1228,18 +1228,18 @@ machfb_pci_attach(device_t dev)
 	sc->sc_regt = sc->sc_memt;
 	bus_space_subregion(sc->sc_regt, sc->sc_memh, MACH64_REG_OFF,
 	    MACH64_REG_SIZE, &sc->sc_regh);
-    	adp->va_buffer = (vm_offset_t)rman_get_virtual(sc->sc_memres);
+	adp->va_buffer = (vm_offset_t)rman_get_virtual(sc->sc_memres);
 	adp->va_buffer_size = rman_get_size(sc->sc_memres);
 
 	/*
 	 * Depending on the firmware version the VGA I/O and/or memory
-	 * resources of the Mach64 chips come up disabled. We generally
+	 * resources of the Mach64 chips come up disabled.  We generally
 	 * enable them above (pci(4) actually already did this unless
 	 * pci_enable_io_modes is not set) but this doesn't necessarily
-	 * mean that we get valid ones. Invalid resources seem to have
-	 * in common that they start at address 0. We don't allocate
+	 * mean that we get valid ones.  Invalid resources seem to have
+	 * in common that they start at address 0.  We don't allocate
 	 * them in this case in order to avoid warnings in apb(4) and
-	 * crashes when using these invalid resources. Xorg is aware
+	 * crashes when using these invalid resources.  Xorg is aware
 	 * of this and doesn't use the VGA resources in this case (but
 	 * demands them if they are valid).
 	 */
@@ -1288,9 +1288,9 @@ machfb_pci_attach(device_t dev)
 		/*
 		 * During device configuration we don't necessarily probe
 		 * the adapter which is the console first so we can't use
-		 * the device unit number for the video adapter unit. The
+		 * the device unit number for the video adapter unit.  The
 		 * worst case would be that we use the video adapter unit
-		 * 0 twice. As it doesn't really matter which unit number
+		 * 0 twice.  As it doesn't really matter which unit number
 		 * the corresponding video adapter has just use the next
 		 * unused one.
 		 */
@@ -1299,7 +1299,7 @@ machfb_pci_attach(device_t dev)
 				break;
 		if ((error = sw->init(i, adp, 0)) != 0) {
 			device_printf(dev, "cannot initialize adapter\n");
-		    	goto fail_vmemres;
+			goto fail_vmemres;
 		}
 	}
 
@@ -1333,7 +1333,7 @@ machfb_pci_attach(device_t dev)
 	/*
 	 * Allocate one page for the mouse pointer image at the end of
 	 * the little endian aperture, right before the memory mapped
-	 * registers that might also reside there. Must be done after
+	 * registers that might also reside there.  Must be done after
 	 * sc_memsize was set and possibly adjusted to account for the
 	 * memory mapped registers.
 	 */
@@ -1346,7 +1346,7 @@ machfb_pci_attach(device_t dev)
 	/*
 	 * Register a handler that performs some cosmetic surgery like
 	 * turning off the mouse pointer on halt in preparation for
-	 * handing the screen over to the OFW. Register another handler
+	 * handing the screen over to the OFW.  Register another handler
 	 * that turns off the CRTC when resetting, otherwise the OFW
 	 * boot command issued by cpu_reset() just doesn't work.
 	 */
@@ -1358,12 +1358,12 @@ machfb_pci_attach(device_t dev)
 	return (0);
 
  fail_vmemres:
- 	if (sc->sc_vmemres != NULL)
-	 	bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_vmemrid,
+	if (sc->sc_vmemres != NULL)
+		bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_vmemrid,
 		    sc->sc_vmemres);
  fail_viores:
- 	if (sc->sc_viores != NULL)
-	 	bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_viorid,
+	if (sc->sc_viores != NULL)
+		bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_viorid,
 		    sc->sc_viores);
  fail_memres:
 	bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_memrid, sc->sc_memres);
@@ -1556,7 +1556,7 @@ machfb_adjust_frame(struct machfb_softc 
 	offset = ((x + y * sc->sc_width) * (sc->sc_depth >> 3)) >> 3;
 
 	regw(sc, CRTC_OFF_PITCH, (regr(sc, CRTC_OFF_PITCH) & 0xfff00000) |
-	     offset);
+	    offset);
 }
 #endif
 

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 19:17:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2234E106577F;
	Tue, 14 Apr 2009 19:17:58 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id BDBE48FC1F;
	Tue, 14 Apr 2009 19:17:57 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id AB4D646B64;
	Tue, 14 Apr 2009 15:17:56 -0400 (EDT)
Date: Tue, 14 Apr 2009 20:17:56 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Tim Kientzle 
In-Reply-To: <49E4D2BF.2040503@freebsd.org>
Message-ID: 
References: <200904141139.n3EBdudA004806@svn.freebsd.org>
	<49E4D2BF.2040503@freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Edward Tomasz Napierala 
Subject: Re: svn commit: r191055 - head/lib/libc/string
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 19:17:59 -0000

On Tue, 14 Apr 2009, Tim Kientzle wrote:

>>   There is no way for strmode(3) to append '+' if the file has ACL,
>>   because there is no way to figure that out based on the file mode
>>   itself.  Make the manual page match reality.
>
> Yep, that '+' is why libarchive has a custom strmode() that accepts more 
> information than just the mode.
>
> A related issue:  It would be really nice to be able to find out whether a 
> file had extended ACLs or extended attributes based on the information 
> returned from stat(2).  That would allow programs like tar to avoid a fair 
> number of system calls. Even just a single bit "HAS_EXTENSIONS" would help a 
> lot, since most files don't have any extended ACLs or extended attributes. 
> It would also allow users of strmode() (such as ls) to insert that '+' sign 
> themselves.
>
> The only place I see to do this is to appropriate some bits from st_flags.

Kirk, Poul-Henning, and I discussed precisely this during the initial UFS2 
design session.  The idea was that we'd allocate a system flag that was 
essentially a "there are ACL-related extended attributes", which could be used 
in-kernel to avoid EA reads, and from userspace to avoid (or trigger) ACL 
reads.  I still think it would be a good idea to do this, although we might 
want to think a bit about failure modes if there's a crash between EA update 
and inode update.

Robert N M Watson
Computer Laboratory
University of Cambridge

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 19:20:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C2CD01065714;
	Tue, 14 Apr 2009 19:20:27 +0000 (UTC) (envelope-from rrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AF3D58FC2B;
	Tue, 14 Apr 2009 19:20:27 +0000 (UTC) (envelope-from rrs@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EJKRte017304;
	Tue, 14 Apr 2009 19:20:27 GMT (envelope-from rrs@svn.freebsd.org)
Received: (from rrs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EJKReU017303;
	Tue, 14 Apr 2009 19:20:27 GMT (envelope-from rrs@svn.freebsd.org)
Message-Id: <200904141920.n3EJKReU017303@svn.freebsd.org>
From: Randall Stewart 
Date: Tue, 14 Apr 2009 19:20:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191073 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 19:20:29 -0000

Author: rrs
Date: Tue Apr 14 19:20:27 2009
New Revision: 191073
URL: http://svn.freebsd.org/changeset/base/191073

Log:
  Add missing address lock when we look at the ifa list

Modified:
  head/sys/netinet/sctp_bsd_addr.c

Modified: head/sys/netinet/sctp_bsd_addr.c
==============================================================================
--- head/sys/netinet/sctp_bsd_addr.c	Tue Apr 14 19:11:02 2009	(r191072)
+++ head/sys/netinet/sctp_bsd_addr.c	Tue Apr 14 19:20:27 2009	(r191073)
@@ -189,11 +189,11 @@ sctp_is_desired_interface_type(struct if
 }
 
 
+
+
 static void
 sctp_init_ifns_for_vrf(int vrfid)
 {
-
-
 	/*
 	 * Here we must apply ANY locks needed by the IFN we access and also
 	 * make sure we lock any IFA that exists as we float through the
@@ -206,8 +206,8 @@ sctp_init_ifns_for_vrf(int vrfid)
 	uint32_t ifa_flags;
 
 	TAILQ_FOREACH(ifn, &MODULE_GLOBAL(MOD_NET, ifnet), if_list) {
+		IF_ADDR_LOCK(ifn);
 		TAILQ_FOREACH(ifa, &ifn->if_addrlist, ifa_list) {
-
 			if (ifa->ifa_addr == NULL) {
 				continue;
 			}
@@ -248,10 +248,10 @@ sctp_init_ifns_for_vrf(int vrfid)
 				sctp_ifa->localifa_flags &= ~SCTP_ADDR_DEFER_USE;
 			}
 		}
+		IF_ADDR_UNLOCK(ifn);
 	}
 }
 
-
 void
 sctp_init_vrf_list(int vrfid)
 {

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 20:23:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1D6821065769;
	Tue, 14 Apr 2009 20:23:48 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 686728FC19;
	Tue, 14 Apr 2009 20:23:47 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EKNlrm018910;
	Tue, 14 Apr 2009 20:23:47 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EKNlBO018909;
	Tue, 14 Apr 2009 20:23:47 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200904142023.n3EKNlBO018909@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 14 Apr 2009 20:23:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191076 - head/sys/dev/fb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 20:23:50 -0000

Author: marius
Date: Tue Apr 14 20:23:47 2009
New Revision: 191076
URL: http://svn.freebsd.org/changeset/base/191076

Log:
  - Remove the second license as I'm also fine with the first one.
  - Remove redundant softc members for RIDs.
  - Change some softc members to be unsigned where more appropriate.
  - Add some missing const.
  - Remove support for mmap(2)'ing VGA I/O as it was broken [1] and
    not required by X.Org anyway.
  - Fix some confusion between bus, physical and virtual addresses
    which mostly consisted in using members of struct video_adapter
    inappropriately but wasn't fatal except for the regular framebuffer
    mmap(2)'ing.
  - Remove redundant bzero(9)'ing of the softc.
  - Don't map the framebuffer twice in case the firmware has already
    mapped it as besides wasting resources this isn't possible with
    all MMUs. This is a bit tricky as a) just because the firmware
    provides a property with a virtual address doesn't mean it's
    actually mapped (but typically is when the framebuffer is the
    console) and b) the firmware doesn't necessarily map the it with
    the same byteorder as we do. This make machfb(4) work on machines
    with cheetah-class MMUs (including X.Org).
  
  Reported by:	Michael Plass [1]
  MFC after:	3 days

Modified:
  head/sys/dev/fb/machfb.c

Modified: head/sys/dev/fb/machfb.c
==============================================================================
--- head/sys/dev/fb/machfb.c	Tue Apr 14 20:10:53 2009	(r191075)
+++ head/sys/dev/fb/machfb.c	Tue Apr 14 20:23:47 2009	(r191076)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2002 Bang Jun-Young
+ * Copyright (c) 2005 Marius Strobl 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,33 +27,6 @@
  *
  *	from: NetBSD: machfb.c,v 1.23 2005/03/07 21:45:24 martin Exp
  */
-/*-
- * Copyright (c) 2005 Marius Strobl 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions, and the following disclaimer,
- *    without modification, immediately at the beginning of the file.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
 
 #include 
 __FBSDID("$FreeBSD$");
@@ -66,18 +40,23 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 
+#include 
+#include 
+
 #include 
 #include 
 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -104,58 +83,53 @@ struct machfb_softc {
 	uint16_t		sc_chip_id;
 	uint8_t			sc_chip_rev;
 
-	int			sc_memrid;
-	int			sc_viorid;
-	int			sc_vmemrid;
 	struct resource		*sc_memres;
-	struct resource		*sc_viores;
 	struct resource		*sc_vmemres;
 	bus_space_tag_t		sc_memt;
 	bus_space_tag_t		sc_regt;
-	bus_space_tag_t		sc_viot;
-	bus_space_tag_t		sc_vmemt;
 	bus_space_handle_t	sc_memh;
 	bus_space_handle_t	sc_regh;
-	bus_space_handle_t	sc_vioh;
-	bus_space_handle_t	sc_vmemh;
+	u_long			sc_mem;
+	u_long			sc_vmem;
 
-	int			sc_height;
-	int			sc_width;
-	int			sc_depth;
-	int			sc_xmargin;
-	int			sc_ymargin;
+	u_int			sc_height;
+	u_int			sc_width;
+	u_int			sc_depth;
+	u_int			sc_xmargin;
+	u_int			sc_ymargin;
 
 	size_t			sc_memsize;
-	int			sc_memtype;
-	int			sc_mem_freq;
-	int			sc_ramdac_freq;
-	int			sc_ref_freq;
-
-	int			sc_ref_div;
-	int			sc_mclk_post_div;
-	int			sc_mclk_fb_div;
+	u_int			sc_memtype;
+	u_int			sc_mem_freq;
+	u_int			sc_ramdac_freq;
+	u_int			sc_ref_freq;
+
+	u_int			sc_ref_div;
+	u_int			sc_mclk_post_div;
+	u_int			sc_mclk_fb_div;
 
 	const u_char		*sc_font;
-	int			sc_cbwidth;
+	u_int			sc_cbwidth;
 	vm_offset_t		sc_curoff;
 
 	int			sc_bg_cache;
 	int			sc_fg_cache;
-	int			sc_draw_cache;
+	u_int			sc_draw_cache;
 #define	MACHFB_DRAW_CHAR	(1 << 0)
 #define	MACHFB_DRAW_FILLRECT	(1 << 1)
 
-	int			sc_flags;
+	u_int			sc_flags;
 #define	MACHFB_CONSOLE		(1 << 0)
 #define	MACHFB_CUREN		(1 << 1)
 #define	MACHFB_DSP		(1 << 2)
+#define	MACHFB_SWAP		(1 << 3)
 };
 
 static const struct {
 	uint16_t	chip_id;
 	const char	*name;
 	uint32_t	ramdac_freq;
-} machfb_info[] = {
+} const machfb_info[] = {
 	{ ATI_MACH64_CT, "ATI Mach64 CT", 135000 },
 	{ ATI_RAGE_PRO_AGP, "ATI 3D Rage Pro (AGP)", 230000 },
 	{ ATI_RAGE_PRO_AGP1X, "ATI 3D Rage Pro (AGP 1x)", 230000 },
@@ -193,7 +167,7 @@ static const struct machfb_cmap {
 	uint8_t red;
 	uint8_t green;
 	uint8_t blue;
-} machfb_default_cmap[16] = {
+} const machfb_default_cmap[16] = {
 	{0x00, 0x00, 0x00},	/* black */
 	{0x00, 0x00, 0xff},	/* blue */
 	{0x00, 0xff, 0x00},	/* green */
@@ -214,7 +188,7 @@ static const struct machfb_cmap {
 
 #define	MACHFB_CMAP_OFF		16
 
-static const u_char machfb_mouse_pointer_bits[64][8] = {
+static const u_char const machfb_mouse_pointer_bits[64][8] = {
 	{ 0x00, 0x00, },	/* ............ */
 	{ 0x80, 0x00, },	/* *........... */
 	{ 0xc0, 0x00, },	/* **.......... */
@@ -243,12 +217,12 @@ static const u_char machfb_mouse_pointer
  * Lookup table to perform a bit-swap of the mouse pointer bits,
  * map set bits to CUR_CLR0 and unset bits to transparent.
  */
-static const u_char machfb_mouse_pointer_lut[] = {
+static const u_char const machfb_mouse_pointer_lut[] = {
 	0xaa, 0x2a, 0x8a, 0x0a, 0xa2, 0x22, 0x82, 0x02,
 	0xa8, 0x28, 0x88, 0x08, 0xa0, 0x20, 0x80, 0x00
 };
 
-static const char *machfb_memtype_names[] = {
+static const char *const machfb_memtype_names[] = {
 	"(N/A)", "DRAM", "EDO DRAM", "EDO DRAM", "SDRAM", "SGRAM", "WRAM",
 	"(unknown type)"
 };
@@ -351,8 +325,6 @@ static video_switch_t machfbvidsw = {
 	.clear			= machfb_clear,
 	.fill_rect		= machfb_fill_rect,
 	.bitblt			= machfb_bitblt,
-	NULL,
-	NULL,
 	.diag			= machfb_diag,
 	.save_cursor_palette	= machfb_save_cursor_palette,
 	.load_cursor_palette	= machfb_load_cursor_palette,
@@ -698,7 +670,7 @@ machfb_set_mode(video_adapter_t *adp, in
 
 	sc->sc_bg_cache = -1;
 	sc->sc_fg_cache = -1;
-	sc->sc_draw_cache = -1;
+	sc->sc_draw_cache = 0;
 
 	return (0);
 }
@@ -869,30 +841,28 @@ machfb_mmap(video_adapter_t *adp, vm_off
     int prot)
 {
 	struct machfb_softc *sc;
+	video_info_t *vi;
 
 	sc = (struct machfb_softc *)adp;
+	vi = &adp->va_info;
 
-	if (adp->va_io_base != 0 && offset >= adp->va_io_base &&
-	    offset < adp->va_io_base + adp->va_io_size) {
-		*paddr = sc->sc_vioh + offset - adp->va_io_size;
-		return (0);
-	}
-
-	if (adp->va_mem_base != 0 && offset >= adp->va_mem_base &&
-	    offset < adp->va_mem_base + adp->va_mem_size) {
-		*paddr = sc->sc_vmemh + offset - adp->va_mem_base;
+	/* BAR 2 - VGA memory */
+	if (sc->sc_vmem != 0 && offset >= sc->sc_vmem &&
+	    offset < sc->sc_vmem + vi->vi_registers_size) {
+		*paddr = vi->vi_registers + offset - sc->sc_vmem;
 		return (0);
 	}
 
-	if (offset >= adp->va_registers &&
-	    offset < adp->va_registers + adp->va_registers_size) {
-		*paddr = sc->sc_memh + offset - adp->va_registers;
+	/* BAR 0 - framebuffer */
+	if (offset >= sc->sc_mem &&
+	    offset < sc->sc_mem + vi->vi_buffer_size) {
+		*paddr = vi->vi_buffer + offset - sc->sc_mem;
 		return (0);
 	}
 
 	/* 'regular' framebuffer mmap()ing */
 	if (offset < adp->va_window_size) {
-		*paddr = adp->va_window + offset;
+		*paddr = vi->vi_window + offset;
 		return (0);
 	}
 
@@ -1184,10 +1154,11 @@ machfb_pci_attach(device_t dev)
 	struct machfb_softc *sc;
 	video_adapter_t *adp;
 	video_switch_t *sw;
+	video_info_t *vi;
 	phandle_t node;
-	uint32_t *p32, saved_value;
+	int error, i, rid;
+	uint32_t *p32, u32;
 	uint8_t *p;
-	int error, i;
 
 	node = ofw_bus_get_node(dev);
 	if ((sc = (struct machfb_softc *)vid_get_adapter(vid_find_adapter(
@@ -1196,18 +1167,19 @@ machfb_pci_attach(device_t dev)
 		device_set_softc(dev, sc);
 	} else {
 		sc = device_get_softc(dev);
-		bzero(sc, sizeof(struct machfb_softc));
 
 		sc->sc_node = node;
 		sc->sc_chip_id = pci_get_device(dev);
 		sc->sc_chip_rev = pci_get_revid(dev);
 	}
 	adp = &sc->sc_va;
+	vi = &adp->va_info;
 
 	/*
-	 * Regardless whether we are the console and already allocated
-	 * resources in machfb_configure() or not we have to allocate
-	 * them here (again) in order for rman_get_virtual() to work.
+	 * Allocate resources regardless of whether we are the console
+	 * and already obtained the bus tag and handle for the framebuffer
+	 * in machfb_configure() or not so the resources are marked as
+	 * taken in the respective RMAN.
 	 */
 
 	/* Enable memory and IO access. */
@@ -1215,21 +1187,44 @@ machfb_pci_attach(device_t dev)
 	    pci_read_config(dev, PCIR_COMMAND, 2) | PCIM_CMD_PORTEN |
 	    PCIM_CMD_MEMEN, 2);
 
-	sc->sc_memrid = PCIR_BAR(0);
+	/*
+	 * NB: we need to take care that the framebuffer isn't mapped
+	 * in twice as besides wasting resources this isn't possible with
+	 * all MMUs.
+	 */
+	rid = PCIR_BAR(0);
 	if ((sc->sc_memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
-	    &sc->sc_memrid, RF_ACTIVE)) == NULL) {
+	    &rid, 0)) == NULL) {
 		device_printf(dev, "cannot allocate memory resources\n");
 		return (ENXIO);
 	}
+	if (OF_getprop(sc->sc_node, "address", &u32, sizeof(u32)) > 0 &&
+		vtophys(u32) == rman_get_bushandle(sc->sc_memres))
+		adp->va_mem_base = u32;
+	else {
+		bus_release_resource(dev, SYS_RES_MEMORY,
+		    rman_get_rid(sc->sc_memres), sc->sc_memres);
+		rid = PCIR_BAR(0);
+		if ((sc->sc_memres = bus_alloc_resource_any(dev,
+		    SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) {
+			device_printf(dev,
+			    "cannot allocate memory resources\n");
+			return (ENXIO);
+		}
+		adp->va_mem_base =
+		    (vm_offset_t)rman_get_virtual(sc->sc_memres);
+	}
 	sc->sc_memt = rman_get_bustag(sc->sc_memres);
 	sc->sc_memh = rman_get_bushandle(sc->sc_memres);
-	adp->va_registers = rman_get_start(sc->sc_memres);
-	adp->va_registers_size = rman_get_size(sc->sc_memres);
 	sc->sc_regt = sc->sc_memt;
 	bus_space_subregion(sc->sc_regt, sc->sc_memh, MACH64_REG_OFF,
 	    MACH64_REG_SIZE, &sc->sc_regh);
-	adp->va_buffer = (vm_offset_t)rman_get_virtual(sc->sc_memres);
-	adp->va_buffer_size = rman_get_size(sc->sc_memres);
+	adp->va_mem_size = rman_get_size(sc->sc_memres);
+	adp->va_buffer = adp->va_mem_base;
+	adp->va_buffer_size = adp->va_mem_size;
+	sc->sc_mem = rman_get_start(sc->sc_memres);
+	vi->vi_buffer = sc->sc_memh;
+	vi->vi_buffer_size = adp->va_buffer_size;
 
 	/*
 	 * Depending on the firmware version the VGA I/O and/or memory
@@ -1239,46 +1234,27 @@ machfb_pci_attach(device_t dev)
 	 * mean that we get valid ones.  Invalid resources seem to have
 	 * in common that they start at address 0.  We don't allocate
 	 * them in this case in order to avoid warnings in apb(4) and
-	 * crashes when using these invalid resources.  Xorg is aware
+	 * crashes when using these invalid resources.  X.Org is aware
 	 * of this and doesn't use the VGA resources in this case (but
 	 * demands them if they are valid).
 	 */
-	sc->sc_viorid = PCIR_BAR(1);
-	if (bus_get_resource_start(dev, SYS_RES_IOPORT, sc->sc_viorid) != 0) {
-		if ((sc->sc_viores = bus_alloc_resource_any(dev,
-		    SYS_RES_IOPORT, &sc->sc_viorid, RF_ACTIVE)) == NULL) {
-			device_printf(dev,
-			    "cannot allocate VGA I/O resources\n");
-			error = ENXIO;
-			goto fail_memres;
-		}
-		sc->sc_viot = rman_get_bustag(sc->sc_viores);
-		sc->sc_vioh = rman_get_bushandle(sc->sc_viores);
-		adp->va_io_base = rman_get_start(sc->sc_viores);
-		adp->va_io_size = rman_get_size(sc->sc_viores);
-	}
-
-	sc->sc_vmemrid = PCIR_BAR(2);
-	if (bus_get_resource_start(dev, SYS_RES_MEMORY, sc->sc_vmemrid) != 0) {
+	rid = PCIR_BAR(2);
+	if (bus_get_resource_start(dev, SYS_RES_MEMORY, rid) != 0) {
 		if ((sc->sc_vmemres = bus_alloc_resource_any(dev,
-		    SYS_RES_MEMORY, &sc->sc_vmemrid, RF_ACTIVE)) == NULL) {
+		    SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) {
 			device_printf(dev,
 			    "cannot allocate VGA memory resources\n");
 			error = ENXIO;
-			goto fail_viores;
+			goto fail_memres;
 		}
-		sc->sc_vmemt = rman_get_bustag(sc->sc_vmemres);
-		sc->sc_vmemh = rman_get_bushandle(sc->sc_vmemres);
-		adp->va_mem_base = rman_get_start(sc->sc_vmemres);
-		adp->va_mem_size = rman_get_size(sc->sc_vmemres);
+		adp->va_registers =
+		    (vm_offset_t)rman_get_virtual(sc->sc_vmemres);
+		adp->va_registers_size = rman_get_size(sc->sc_vmemres);
+		sc->sc_vmem = rman_get_start(sc->sc_vmemres);
+		vi->vi_registers = rman_get_bushandle(sc->sc_vmemres);
+		vi->vi_registers_size = adp->va_registers_size;
 	}
 
-	device_printf(dev,
-	    "%d MB aperture at 0x%08x, %d KB registers at 0x%08x\n",
-	    (u_int)(adp->va_buffer_size / (1024 * 1024)),
-	    (u_int)adp->va_buffer, MACH64_REG_SIZE / 1024,
-	    (u_int)sc->sc_regh);
-
 	if (!(sc->sc_flags & MACHFB_CONSOLE)) {
 		if ((sw = vid_get_switch(MACHFB_DRIVER_NAME)) == NULL) {
 			device_printf(dev, "cannot get video switch\n");
@@ -1303,33 +1279,46 @@ machfb_pci_attach(device_t dev)
 		}
 	}
 
-	device_printf(dev,
-	    "%ld KB %s %d.%d MHz, maximum RAMDAC clock %d MHz, %sDSP\n",
-	    (u_long)sc->sc_memsize, machfb_memtype_names[sc->sc_memtype],
-	    sc->sc_mem_freq / 1000, sc->sc_mem_freq % 1000,
-	    sc->sc_ramdac_freq / 1000,
-	    (sc->sc_flags & MACHFB_DSP) ? "" : "no ");
-	device_printf(dev, "resolution %dx%d at %d bpp\n",
-	    sc->sc_width, sc->sc_height, sc->sc_depth);
-
 	/*
 	 * Test whether the aperture is byte swapped or not, set
-	 * va_window and va_window_size as appropriate.
+	 * va_window and va_window_size as appropriate.  Note that
+	 * the aperture could be mapped either big or little endian
+	 * on independently of the endianess of the host so this
+	 * has to be a runtime test.
 	 */
 	p32 = (uint32_t *)adp->va_buffer;
-	saved_value = *p32;
+	u32 = *p32;
 	p = (uint8_t *)adp->va_buffer;
 	*p32 = 0x12345678;
 	if (!(p[0] == 0x12 && p[1] == 0x34 && p[2] == 0x56 && p[3] == 0x78)) {
 		adp->va_window = adp->va_buffer + 0x800000;
 		adp->va_window_size = adp->va_buffer_size - 0x800000;
+		vi->vi_window = vi->vi_buffer + 0x800000;
+		vi->vi_window_size = vi->vi_buffer_size - 0x800000;
+		sc->sc_flags |= MACHFB_SWAP;
 	} else {
 		adp->va_window = adp->va_buffer;
 		adp->va_window_size = adp->va_buffer_size;
+		vi->vi_window = vi->vi_buffer;
+		vi->vi_window_size = vi->vi_buffer_size;
 	}
-	*p32 = saved_value;
+	*p32 = u32;
 	adp->va_window_gran = adp->va_window_size;
 
+	device_printf(dev,
+	    "%d MB aperture at %p %sswapped\n",
+	    (u_int)(adp->va_window_size / (1024 * 1024)),
+	    (void *)adp->va_window, (sc->sc_flags & MACHFB_SWAP) ?
+	    "" : "not ");
+	device_printf(dev,
+	    "%ld KB %s %d.%d MHz, maximum RAMDAC clock %d MHz, %sDSP\n",
+	    (u_long)sc->sc_memsize, machfb_memtype_names[sc->sc_memtype],
+	    sc->sc_mem_freq / 1000, sc->sc_mem_freq % 1000,
+	    sc->sc_ramdac_freq / 1000,
+	    (sc->sc_flags & MACHFB_DSP) ? "" : "no ");
+	device_printf(dev, "resolution %dx%d at %d bpp\n",
+	    sc->sc_width, sc->sc_height, sc->sc_depth);
+
 	/*
 	 * Allocate one page for the mouse pointer image at the end of
 	 * the little endian aperture, right before the memory mapped
@@ -1359,14 +1348,11 @@ machfb_pci_attach(device_t dev)
 
  fail_vmemres:
 	if (sc->sc_vmemres != NULL)
-		bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_vmemrid,
-		    sc->sc_vmemres);
- fail_viores:
-	if (sc->sc_viores != NULL)
-		bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_viorid,
-		    sc->sc_viores);
+		bus_release_resource(dev, SYS_RES_MEMORY,
+		    rman_get_rid(sc->sc_vmemres), sc->sc_vmemres);
  fail_memres:
-	bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_memrid, sc->sc_memres);
+	bus_release_resource(dev, SYS_RES_MEMORY,
+	    rman_get_rid(sc->sc_memres), sc->sc_memres);
 
 	return (error);
 }
@@ -1396,7 +1382,7 @@ machfb_cursor_enable(struct machfb_softc
 static int
 machfb_cursor_install(struct machfb_softc *sc)
 {
-	uint16_t *p;
+	uint16_t *p, v;
 	uint8_t fg;
 	int i, j;
 
@@ -1410,12 +1396,18 @@ machfb_cursor_install(struct machfb_soft
 	    machfb_default_cmap[fg].green << 16 |
 	    machfb_default_cmap[fg].blue << 8);
 	p = (uint16_t *)(sc->sc_va.va_buffer + sc->sc_curoff);
-	for (i = 0; i < 64; i++)
-		for (j = 0; j < 8; j++)
-			*(p++) = machfb_mouse_pointer_lut[
-			    machfb_mouse_pointer_bits[i][j] >> 4] |
+	for (i = 0; i < 64; i++) {
+		for (j = 0; j < 8; j++) {
+			v = machfb_mouse_pointer_lut[
+			    machfb_mouse_pointer_bits[i][j] >> 4] << 8 |
 			    machfb_mouse_pointer_lut[
-			    machfb_mouse_pointer_bits[i][j] & 0x0f] << 8;
+			    machfb_mouse_pointer_bits[i][j] & 0x0f];
+			if (sc->sc_flags & MACHFB_SWAP)
+				*(p++) = bswap16(v);
+			else
+				*(p++) = v;
+		}
+	}
 
 	return (0);
 }
@@ -1424,7 +1416,7 @@ static int
 machfb_get_memsize(struct machfb_softc *sc)
 {
 	int tmp, memsize;
-	int mem_tab[] = {
+	const int const mem_tab[] = {
 		512, 1024, 2048, 4096, 6144, 8192, 12288, 16384
 	};
 

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 20:51:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1C2F1106564A;
	Tue, 14 Apr 2009 20:51:59 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0A76D8FC13;
	Tue, 14 Apr 2009 20:51:59 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EKpwOJ019544;
	Tue, 14 Apr 2009 20:51:58 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EKpwDd019543;
	Tue, 14 Apr 2009 20:51:58 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200904142051.n3EKpwDd019543@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 14 Apr 2009 20:51:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191077 - head/sys/dev/fb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 20:51:59 -0000

Author: marius
Date: Tue Apr 14 20:51:58 2009
New Revision: 191077
URL: http://svn.freebsd.org/changeset/base/191077

Log:
  Fix whitespace.

Modified:
  head/sys/dev/fb/creator.c

Modified: head/sys/dev/fb/creator.c
==============================================================================
--- head/sys/dev/fb/creator.c	Tue Apr 14 20:23:47 2009	(r191076)
+++ head/sys/dev/fb/creator.c	Tue Apr 14 20:51:58 2009	(r191077)
@@ -474,7 +474,7 @@ creator_init(int unit, video_adapter_t *
 
 	vid_init_struct(adp, CREATOR_DRIVER_NAME, -1, unit);
 
- 	if (OF_getprop(sc->sc_node, "height", &sc->sc_height,
+	if (OF_getprop(sc->sc_node, "height", &sc->sc_height,
 	    sizeof(sc->sc_height)) == -1)
 		return (ENXIO);
 	if (OF_getprop(sc->sc_node, "width", &sc->sc_width,
@@ -503,7 +503,7 @@ creator_init(int unit, video_adapter_t *
 		FFB_WRITE(sc, FFB_DAC, FFB_DAC_TYPE, FFB_DAC_CFG_DID);
 		if (((FFB_READ(sc, FFB_DAC, FFB_DAC_VALUE) &
 		    FFB_DAC_CFG_DID_PNUM) >> 12) != 0x236e) {
-		    	sc->sc_flags |= CREATOR_PAC1;
+			sc->sc_flags |= CREATOR_PAC1;
 			FFB_WRITE(sc, FFB_DAC, FFB_DAC_TYPE, FFB_DAC_CFG_UCTRL);
 			if (((FFB_READ(sc, FFB_DAC, FFB_DAC_VALUE) &
 			    FFB_DAC_UCTRL_MANREV) >> 8) <= 2)
@@ -517,7 +517,7 @@ creator_init(int unit, video_adapter_t *
 	/*
 	 * Setting V_ADP_MODECHANGE serves as hack so creator_set_mode()
 	 * (which will invalidate our caches and restore our settings) is
-	 * called when the X server shuts down. Otherwise screen corruption
+	 * called when the X server shuts down.  Otherwise screen corruption
 	 * happens most of the time.
 	 */
 	adp->va_flags |= V_ADP_COLOR | V_ADP_MODECHANGE | V_ADP_BORDER |
@@ -916,8 +916,8 @@ creator_bus_attach(device_t dev)
 	node = ofw_bus_get_node(dev);
 	if ((sc = (struct creator_softc *)vid_get_adapter(vid_find_adapter(
 	    CREATOR_DRIVER_NAME, 0))) != NULL && sc->sc_node == node) {
-	    	device_printf(dev, "console\n");
-	    	device_set_softc(dev, sc);
+		device_printf(dev, "console\n");
+		device_set_softc(dev, sc);
 	} else {
 		sc = device_get_softc(dev);
 		sc->sc_node = node;
@@ -930,9 +930,9 @@ creator_bus_attach(device_t dev)
 	 * and FFB_FBC register banks in creator_configure() or not so
 	 * the resources are marked as taken in the respective RMAN.
 	 * The supported cards use either 15 (Creator, Elite3D?) or 24
-	 * (Creator3D?) register banks. We make sure that we can also
+	 * (Creator3D?) register banks.  We make sure that we can also
 	 * allocate the resources for at least the FFB_DAC and FFB_FBC
-	 * banks here. We try but don't actually care whether we can
+	 * banks here.  We try but don't actually care whether we can
 	 * allocate more than these two resources and just limit the
 	 * range accessible via creator_fb_mmap() accordingly.
 	 */
@@ -965,7 +965,7 @@ creator_bus_attach(device_t dev)
 	    rman_get_start(sc->sc_reg[i]) > rman_get_start(sc->sc_reg[i - 1]);
 	    i++)
 		;
-    	adp->va_mem_size = rman_get_end(sc->sc_reg[i - 1]) -
+	adp->va_mem_size = rman_get_end(sc->sc_reg[i - 1]) -
 	    adp->va_mem_base + 1;
 
 	if (!(sc->sc_flags & CREATOR_CONSOLE)) {
@@ -977,9 +977,9 @@ creator_bus_attach(device_t dev)
 		/*
 		 * During device configuration we don't necessarily probe
 		 * the adapter which is the console first so we can't use
-		 * the device unit number for the video adapter unit. The
+		 * the device unit number for the video adapter unit.  The
 		 * worst case would be that we use the video adapter unit
-		 * 0 twice. As it doesn't really matter which unit number
+		 * 0 twice.  As it doesn't really matter which unit number
 		 * the corresponding video adapter has just use the next
 		 * unused one.
 		 */
@@ -990,7 +990,7 @@ creator_bus_attach(device_t dev)
 			sc->sc_flags |= CREATOR_AFB;
 		if ((error = sw->init(i, adp, 0)) != 0) {
 			device_printf(dev, "cannot initialize adapter\n");
-		    	goto fail;
+			goto fail;
 		}
 	}
 
@@ -1019,7 +1019,7 @@ creator_bus_attach(device_t dev)
 	for (i = 0; i < FFB_NREG && sc->sc_reg[i] != NULL; i++)
 		bus_release_resource(dev, SYS_RES_MEMORY,
 		    rman_get_rid(sc->sc_reg[i]), sc->sc_reg[i]);
- 	return (error);
+	return (error);
 }
 
 /*
@@ -1064,7 +1064,7 @@ creator_fb_mmap(struct cdev *dev, vm_off
 	for (i = 0; i < CREATOR_FB_MAP_SIZE; i++) {
 		if (offset >= creator_fb_map[i].virt &&
 		    offset < creator_fb_map[i].virt + creator_fb_map[i].size) {
-		    	offset += creator_fb_map[i].phys -
+			offset += creator_fb_map[i].phys -
 			    creator_fb_map[i].virt;
 			if (offset >= sc->sc_va.va_mem_size)
 				return (EINVAL);

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 23:05:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AAF31106564A;
	Tue, 14 Apr 2009 23:05:36 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9904B8FC08;
	Tue, 14 Apr 2009 23:05:36 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EN5a5X022660;
	Tue, 14 Apr 2009 23:05:36 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EN5a2E022652;
	Tue, 14 Apr 2009 23:05:36 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904142305.n3EN5a2E022652@svn.freebsd.org>
From: Kip Macy 
Date: Tue, 14 Apr 2009 23:05:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191080 - in head: . sbin/route sys/net sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 23:05:37 -0000

Author: kmacy
Date: Tue Apr 14 23:05:36 2009
New Revision: 191080
URL: http://svn.freebsd.org/changeset/base/191080

Log:
  Extend route command:
  	- add show as alias for get
  	- add weights to allow mpath to do more than equal cost
  	- add sticky / nostick to disable / re-enable per-connection load balancing
  
  This adds a field to rt_metrics_lite so network bits of world will need to be re-built.
  
  Reviewed by:	jeli & qingli

Modified:
  head/UPDATING
  head/sbin/route/keywords
  head/sbin/route/route.c
  head/sys/net/radix_mpath.c
  head/sys/net/route.c
  head/sys/net/route.h
  head/sys/net/rtsock.c
  head/sys/sys/param.h

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Tue Apr 14 22:53:22 2009	(r191079)
+++ head/UPDATING	Tue Apr 14 23:05:36 2009	(r191080)
@@ -22,6 +22,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
 	to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20090414:
+	The size of rt_metrics_lite and by extension rtentry has changed.
+	Networking administration apps will need to be recompiled.
+	The route command now supports show as an alias for get, weighting 
+	of routes, sticky and nostick flags to alter the behavior of stateful
+	load balancing.
+	Bump __FreeBSD_version to 800078.
 20090408:
 	Do not use Giant for kbdmux(4) locking. This is wrong and
 	apparently causing more problems than it solves. This will

Modified: head/sbin/route/keywords
==============================================================================
--- head/sbin/route/keywords	Tue Apr 14 22:53:22 2009	(r191079)
+++ head/sbin/route/keywords	Tue Apr 14 23:05:36 2009	(r191080)
@@ -33,6 +33,7 @@ mtu
 net
 netmask
 nostatic
+nostick
 osi
 prefixlen
 proto1
@@ -44,8 +45,11 @@ rtt
 rttvar
 sa
 sendpipe
+show
 ssthresh
 static
+sticky
+weight
 x25
 xns
 xresolve

Modified: head/sbin/route/route.c
==============================================================================
--- head/sbin/route/route.c	Tue Apr 14 22:53:22 2009	(r191079)
+++ head/sbin/route/route.c	Tue Apr 14 23:05:36 2009	(r191080)
@@ -169,6 +169,7 @@ main(argc, argv)
 	if (*argv)
 		switch (keyword(*argv)) {
 		case K_GET:
+		case K_SHOW:
 			uid = 0;
 			/* FALLTHROUGH */
 
@@ -548,6 +549,7 @@ set_metric(value, key)
 	caseof(K_SSTHRESH, RTV_SSTHRESH, rmx_ssthresh);
 	caseof(K_RTT, RTV_RTT, rmx_rtt);
 	caseof(K_RTTVAR, RTV_RTTVAR, rmx_rttvar);
+	caseof(K_WEIGHT, RTV_WEIGHT, rmx_weight);
 	}
 	rtm_inits |= flag;
 	if (lockrest || locking)
@@ -571,8 +573,9 @@ newroute(argc, argv)
 		errx(EX_NOPERM, "must be root to alter routing table");
 	}
 	cmd = argv[0];
-	if (*cmd != 'g')
+	if (*cmd != 'g' && *cmd != 's')
 		shutdown(s, SHUT_RD); /* Don't want to read back our messages */
+
 	while (--argc > 0) {
 		if (**(++argv)== '-') {
 			switch (key = keyword(1 + *argv)) {
@@ -635,6 +638,12 @@ newroute(argc, argv)
 			case K_STATIC:
 				flags |= RTF_STATIC;
 				break;
+			case K_STICKY:
+				flags |= RTF_STICKY;
+				break;
+			case K_NOSTICK:
+				flags &= ~RTF_STICKY;
+				break;
 			case K_IFA:
 				if (!--argc)
 					usage((char *)NULL);
@@ -688,6 +697,7 @@ newroute(argc, argv)
 			case K_SSTHRESH:
 			case K_RTT:
 			case K_RTTVAR:
+			case K_WEIGHT:
 				if (!--argc)
 					usage((char *)NULL);
 				set_metric(*++argv, key);
@@ -741,7 +751,7 @@ newroute(argc, argv)
 		} else
 			break;
 	}
-	if (*cmd == 'g')
+	if (*cmd == 'g' || *cmd == 's')
 		exit(ret != 0);
 	if (!qflag) {
 		oerrno = errno;
@@ -1193,7 +1203,7 @@ rtmsg(cmd, flags)
 		cmd = RTM_ADD;
 	else if (cmd == 'c')
 		cmd = RTM_CHANGE;
-	else if (cmd == 'g') {
+	else if (cmd == 'g' || cmd == 's') {
 		cmd = RTM_GET;
 		if (so_ifp.sa.sa_family == 0) {
 			so_ifp.sa.sa_family = AF_LINK;
@@ -1297,13 +1307,13 @@ char *msgtypes[] = {
 };
 
 char metricnames[] =
-"\011pksent\010rttvar\7rtt\6ssthresh\5sendpipe\4recvpipe\3expire\2hopcount"
+"\011weight\010rttvar\7rtt\6ssthresh\5sendpipe\4recvpipe\3expire"
 "\1mtu";
 char routeflags[] =
-"\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE\010MASK_PRESENT"
-"\011CLONING\012XRESOLVE\013LLINFO\014STATIC\015BLACKHOLE\016b016"
-"\017PROTO2\020PROTO1\021PRCLONING\022WASCLONED\023PROTO3\024CHAINDELETE"
-"\025PINNED\026LOCAL\027BROADCAST\030MULTICAST";
+"\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE"
+"\012XRESOLVE\013LLINFO\014STATIC\015BLACKHOLE"
+"\017PROTO2\020PROTO1\021PRCLONING\022WASCLONED\023PROTO3"
+"\025PINNED\026LOCAL\027BROADCAST\030MULTICAST\035STICKY";
 char ifnetflags[] =
 "\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5PTP\6b6\7RUNNING\010NOARP"
 "\011PPROMISC\012ALLMULTI\013OACTIVE\014SIMPLEX\015LINK0\016LINK1"
@@ -1466,14 +1476,13 @@ print_getmsg(rtm, msglen)
 #define msec(u)	(((u) + 500) / 1000)		/* usec to msec */
 
 	(void) printf("\n%s\n", "\
- recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire");
+ recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire");
 	printf("%8ld%c ", rtm->rtm_rmx.rmx_recvpipe, lock(RPIPE));
 	printf("%8ld%c ", rtm->rtm_rmx.rmx_sendpipe, lock(SPIPE));
 	printf("%8ld%c ", rtm->rtm_rmx.rmx_ssthresh, lock(SSTHRESH));
 	printf("%8ld%c ", msec(rtm->rtm_rmx.rmx_rtt), lock(RTT));
-	printf("%8ld%c ", msec(rtm->rtm_rmx.rmx_rttvar), lock(RTTVAR));
-	printf("%8ld%c ", rtm->rtm_rmx.rmx_hopcount, lock(HOPCOUNT));
 	printf("%8ld%c ", rtm->rtm_rmx.rmx_mtu, lock(MTU));
+	printf("%8ld%c ", rtm->rtm_rmx.rmx_weight, lock(WEIGHT));
 	if (rtm->rtm_rmx.rmx_expire)
 		rtm->rtm_rmx.rmx_expire -= time(0);
 	printf("%8ld%c\n", rtm->rtm_rmx.rmx_expire, lock(EXPIRE));

Modified: head/sys/net/radix_mpath.c
==============================================================================
--- head/sys/net/radix_mpath.c	Tue Apr 14 22:53:22 2009	(r191079)
+++ head/sys/net/radix_mpath.c	Tue Apr 14 23:05:36 2009	(r191080)
@@ -77,15 +77,18 @@ rn_mpath_next(struct radix_node *rn)
 		return NULL;
 }
 
-u_int32_t
+uint32_t
 rn_mpath_count(struct radix_node *rn)
 {
-	u_int32_t i;
-
-	i = 1;
-	while ((rn = rn_mpath_next(rn)) != NULL)
-		i++;
-	return i;
+	uint32_t i = 0;
+	struct rtentry *rt;
+	
+	while (rn != NULL) {
+		rt = (struct rtentry *)rn;
+		i += rt->rt_rmx.rmx_weight;
+		rn = rn_mpath_next(rn);
+	}
+	return (i);
 }
 
 struct rtentry *
@@ -256,10 +259,12 @@ different:
 }
 
 void
-rtalloc_mpath_fib(struct route *ro, u_int32_t hash, u_int fibnum)
+rtalloc_mpath_fib(struct route *ro, uint32_t hash, u_int fibnum)
 {
 	struct radix_node *rn0, *rn;
 	u_int32_t n;
+	struct rtentry *rt;
+	int64_t weight;
 
 	/*
 	 * XXX we don't attempt to lookup cached route again; what should
@@ -284,25 +289,31 @@ rtalloc_mpath_fib(struct route *ro, u_in
 	/* gw selection by Modulo-N Hash (RFC2991) XXX need improvement? */
 	hash += hashjitter;
 	hash %= n;
-	while (hash-- > 0 && rn) {
+	for (weight = abs((int32_t)hash), rt = ro->ro_rt;
+	     weight >= rt->rt_rmx.rmx_weight && rn; 
+	     weight -= rt->rt_rmx.rmx_weight) {
+		
 		/* stay within the multipath routes */
 		if (rn->rn_dupedkey && rn->rn_mask != rn->rn_dupedkey->rn_mask)
 			break;
 		rn = rn->rn_dupedkey;
+		rt = (struct rtentry *)rn;
 	}
-
 	/* XXX try filling rt_gwroute and avoid unreachable gw  */
 
-	/* if gw selection fails, use the first match (default) */
+	/* gw selection has failed - there must be only zero weight routes */
 	if (!rn) {
 		RT_UNLOCK(ro->ro_rt);
+		ro->ro_rt = NULL;
 		return;
 	}
-	
-	RTFREE_LOCKED(ro->ro_rt);
-	ro->ro_rt = (struct rtentry *)rn;
-	RT_LOCK(ro->ro_rt);
-	RT_ADDREF(ro->ro_rt);
+	if (ro->ro_rt != rt) {
+		RTFREE_LOCKED(ro->ro_rt);
+		ro->ro_rt = (struct rtentry *)rn;
+		RT_LOCK(ro->ro_rt);
+		RT_ADDREF(ro->ro_rt);
+
+	} 
 	RT_UNLOCK(ro->ro_rt);
 }
 

Modified: head/sys/net/route.c
==============================================================================
--- head/sys/net/route.c	Tue Apr 14 22:53:22 2009	(r191079)
+++ head/sys/net/route.c	Tue Apr 14 23:05:36 2009	(r191080)
@@ -826,6 +826,103 @@ bad:
 	return (error);
 }
 
+#ifdef RADIX_MPATH
+static int
+rn_mpath_update(int req, struct rt_addrinfo *info,
+    struct radix_node_head *rnh, struct rtentry **ret_nrt)
+{
+	/*
+	 * if we got multipath routes, we require users to specify
+	 * a matching RTAX_GATEWAY.
+	 */
+	struct rtentry *rt, *rto = NULL;
+	register struct radix_node *rn;
+	int error = 0;
+
+	rn = rnh->rnh_matchaddr(dst, rnh);
+	if (rn == NULL)
+		return (ESRCH);
+	rto = rt = RNTORT(rn);
+	rt = rt_mpath_matchgate(rt, gateway);
+	if (rt == NULL)
+		return (ESRCH);
+	/*
+	 * this is the first entry in the chain
+	 */
+	if (rto == rt) {
+		rn = rn_mpath_next((struct radix_node *)rt);
+		/*
+		 * there is another entry, now it's active
+		 */
+		if (rn) {
+			rto = RNTORT(rn);
+			RT_LOCK(rto);
+			rto->rt_flags |= RTF_UP;
+			RT_UNLOCK(rto);
+		} else if (rt->rt_flags & RTF_GATEWAY) {
+			/*
+			 * For gateway routes, we need to 
+			 * make sure that we we are deleting
+			 * the correct gateway. 
+			 * rt_mpath_matchgate() does not 
+			 * check the case when there is only
+			 * one route in the chain.  
+			 */
+			if (gateway &&
+			    (rt->rt_gateway->sa_len != gateway->sa_len ||
+				memcmp(rt->rt_gateway, gateway, gateway->sa_len)))
+				error = ESRCH;
+			goto done;
+		}
+		/*
+		 * use the normal delete code to remove
+		 * the first entry
+		 */
+		if (req != RTM_DELETE) 
+			goto nondelete;
+
+		error = ENOENT;
+		goto done;
+	}
+		
+	/*
+	 * if the entry is 2nd and on up
+	 */
+	if ((req == RTM_DELETE) && !rt_mpath_deldup(rto, rt))
+		panic ("rtrequest1: rt_mpath_deldup");
+	RT_LOCK(rt);
+	RT_ADDREF(rt);
+	if (req == RTM_DELETE) {
+		rt->rt_flags &= ~RTF_UP;
+		/*
+		 * One more rtentry floating around that is not
+		 * linked to the routing table. rttrash will be decremented
+		 * when RTFREE(rt) is eventually called.
+		 */
+		V_rttrash++;
+		
+	}
+	
+nondelete:
+	if (req != RTM_DELETE)
+		panic("unrecognized request %d", req);
+	
+
+	/*
+	 * If the caller wants it, then it can have it,
+	 * but it's up to it to free the rtentry as we won't be
+	 * doing it.
+	 */
+	if (ret_nrt) {
+		*ret_nrt = rt;
+		RT_UNLOCK(rt);
+	} else
+		RTFREE_LOCKED(rt);
+done:
+	return (error);
+}
+#endif
+
 int
 rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
 				u_int fibnum)
@@ -864,65 +961,15 @@ rtrequest1_fib(int req, struct rt_addrin
 	switch (req) {
 	case RTM_DELETE:
 #ifdef RADIX_MPATH
-		/*
-		 * if we got multipath routes, we require users to specify
-		 * a matching RTAX_GATEWAY.
-		 */
 		if (rn_mpath_capable(rnh)) {
-			struct rtentry *rto = NULL;
-
-			rn = rnh->rnh_matchaddr(dst, rnh);
-			if (rn == NULL)
-				senderr(ESRCH);
- 			rto = rt = RNTORT(rn);
-			rt = rt_mpath_matchgate(rt, gateway);
-			if (!rt)
-				senderr(ESRCH);
-			/*
-			 * this is the first entry in the chain
-			 */
-			if (rto == rt) {
-				rn = rn_mpath_next((struct radix_node *)rt);
-				/*
-				 * there is another entry, now it's active
-				 */
-				if (rn) {
-					rto = RNTORT(rn);
-					RT_LOCK(rto);
-					rto->rt_flags |= RTF_UP;
-					RT_UNLOCK(rto);
-				} else if (rt->rt_flags & RTF_GATEWAY) {
-					/*
-					 * For gateway routes, we need to 
-					 * make sure that we we are deleting
-					 * the correct gateway. 
-					 * rt_mpath_matchgate() does not 
-					 * check the case when there is only
-					 * one route in the chain.  
-					 */
-					if (gateway &&
-					    (rt->rt_gateway->sa_len != gateway->sa_len ||
-					    memcmp(rt->rt_gateway, gateway, gateway->sa_len)))
-						senderr(ESRCH);
-				}
-				/*
-				 * use the normal delete code to remove
-				 * the first entry
-				 */
-				goto normal_rtdel;
-			}
+			error = rn_mpath_update(req, info, rnh, ret_nrt);
 			/*
-			 * if the entry is 2nd and on up
+			 * "bad" holds true for the success case
+			 * as well
 			 */
-			if (!rt_mpath_deldup(rto, rt))
-				panic ("rtrequest1: rt_mpath_deldup");
-			RT_LOCK(rt);
-			RT_ADDREF(rt);
-			rt->rt_flags &= ~RTF_UP;
-			goto deldone;  /* done with the RTM_DELETE command */
+			if (error != ENOENT)
+				goto bad;
 		}
-
-normal_rtdel:
 #endif
 		/*
 		 * Remove the item from the tree and return it.
@@ -944,9 +991,6 @@ normal_rtdel:
 		if ((ifa = rt->rt_ifa) && ifa->ifa_rtrequest)
 			ifa->ifa_rtrequest(RTM_DELETE, rt, info);
 
-#ifdef RADIX_MPATH
-deldone:
-#endif
 		/*
 		 * One more rtentry floating around that is not
 		 * linked to the routing table. rttrash will be decremented
@@ -1019,6 +1063,7 @@ deldone:
 		IFAREF(ifa);
 		rt->rt_ifa = ifa;
 		rt->rt_ifp = ifa->ifa_ifp;
+		rt->rt_rmx.rmx_weight = 1;
 
 #ifdef RADIX_MPATH
 		/* do not permit exactly the same dst/mask/gw pair */

Modified: head/sys/net/route.h
==============================================================================
--- head/sys/net/route.h	Tue Apr 14 22:53:22 2009	(r191079)
+++ head/sys/net/route.h	Tue Apr 14 23:05:36 2009	(r191080)
@@ -58,6 +58,7 @@ struct rt_metrics_lite {
 	u_long	rmx_mtu;	/* MTU for this path */
 	u_long	rmx_expire;	/* lifetime for route, e.g. redirect */
 	u_long	rmx_pksent;	/* packets sent using this route */
+	u_long	rmx_weight;	/* absolute weight */ 
 };
 
 struct rt_metrics {
@@ -71,7 +72,8 @@ struct rt_metrics {
 	u_long	rmx_rtt;	/* estimated round trip time */
 	u_long	rmx_rttvar;	/* estimated rtt variance */
 	u_long	rmx_pksent;	/* packets sent using this route */
-	u_long	rmx_filler[4];	/* will be used for T/TCP later */
+	u_long	rmx_weight;	/* route weight */
+	u_long	rmx_filler[3];	/* will be used for T/TCP later */
 };
 
 /*
@@ -193,13 +195,15 @@ struct ortentry {
 #define	RTF_LOCAL	0x200000 	/* route represents a local address */
 #define	RTF_BROADCAST	0x400000	/* route represents a bcast address */
 #define	RTF_MULTICAST	0x800000	/* route represents a mcast address */
-					/* 0x1000000 and up unassigned */
-#define	RTF_RNH_LOCKED	 0x40000000	/* radix node head locked by caller */
+					/* 0x8000000 and up unassigned */
+#define	RTF_STICKY	 0x10000000	/* always route dst->src */
+
+#define	RTF_RNH_LOCKED	 0x40000000	/* radix node head is locked */
 
 /* Mask of RTF flags that are allowed to be modified by RTM_CHANGE. */
 #define RTF_FMASK	\
 	(RTF_PROTO1 | RTF_PROTO2 | RTF_PROTO3 | RTF_BLACKHOLE | \
-	 RTF_REJECT | RTF_STATIC)
+	 RTF_REJECT | RTF_STATIC | RTF_STICKY)
 
 /*
  * Routing statistics.
@@ -225,12 +229,11 @@ struct rt_msghdr {
 	int	rtm_seq;	/* for sender to identify action */
 	int	rtm_errno;	/* why failed */
 	int	rtm_fmask;	/* bitmask used in RTM_CHANGE message */
-#define	rtm_use	rtm_fmask	/* deprecated, use rtm_rmx->rmx_pksent */
 	u_long	rtm_inits;	/* which metrics we are initializing */
 	struct	rt_metrics rtm_rmx; /* metrics themselves */
 };
 
-#define RTM_VERSION	5	/* Up the ante and ignore older versions */
+#define RTM_VERSION	6	/* Up the ante and ignore older versions */
 
 /*
  * Message types.
@@ -265,6 +268,7 @@ struct rt_msghdr {
 #define RTV_SSTHRESH	0x20	/* init or lock _ssthresh */
 #define RTV_RTT		0x40	/* init or lock _rtt */
 #define RTV_RTTVAR	0x80	/* init or lock _rttvar */
+#define RTV_WEIGHT	0x100	/* init or lock _weight */
 
 /*
  * Bitmask values for rtm_addrs.

Modified: head/sys/net/rtsock.c
==============================================================================
--- head/sys/net/rtsock.c	Tue Apr 14 22:53:22 2009	(r191079)
+++ head/sys/net/rtsock.c	Tue Apr 14 23:05:36 2009	(r191080)
@@ -637,7 +637,6 @@ route_output(struct mbuf *m, struct sock
 			}
 			(void)rt_msg2(rtm->rtm_type, &info, (caddr_t)rtm, NULL);
 			rtm->rtm_flags = rt->rt_flags;
-			rtm->rtm_use = 0;
 			rt_getmetrics(&rt->rt_rmx, &rtm->rtm_rmx);
 			rtm->rtm_addrs = info.rti_addrs;
 			break;
@@ -691,10 +690,8 @@ route_output(struct mbuf *m, struct sock
 				rt->rt_ifp = info.rti_ifp;
 			}
 			/* Allow some flags to be toggled on change. */
-			if (rtm->rtm_fmask & RTF_FMASK)
-				rt->rt_flags = (rt->rt_flags &
-				    ~rtm->rtm_fmask) |
-				    (rtm->rtm_flags & rtm->rtm_fmask);
+			rt->rt_flags = (rt->rt_flags & ~RTF_FMASK) |
+				    (rtm->rtm_flags & RTF_FMASK);
 			rt_setmetrics(rtm->rtm_inits, &rtm->rtm_rmx,
 					&rt->rt_rmx);
 			rtm->rtm_index = rt->rt_ifp->if_index;
@@ -773,6 +770,7 @@ rt_setmetrics(u_long which, const struct
 	 * of tcp hostcache. The rest is ignored.
 	 */
 	metric(RTV_MTU, rmx_mtu);
+	metric(RTV_WEIGHT, rmx_weight);
 	/* Userland -> kernel timebase conversion. */
 	if (which & RTV_EXPIRE)
 		out->rmx_expire = in->rmx_expire ?
@@ -786,6 +784,7 @@ rt_getmetrics(const struct rt_metrics_li
 #define metric(e) out->e = in->e;
 	bzero(out, sizeof(*out));
 	metric(rmx_mtu);
+	metric(rmx_weight);
 	/* Kernel -> userland timebase conversion. */
 	out->rmx_expire = in->rmx_expire ?
 	    in->rmx_expire - time_uptime + time_second : 0;
@@ -1257,7 +1256,10 @@ sysctl_dumpentry(struct radix_node *rn, 
 		struct rt_msghdr *rtm = (struct rt_msghdr *)w->w_tmem;
 
 		rtm->rtm_flags = rt->rt_flags;
-		rtm->rtm_use = rt->rt_rmx.rmx_pksent;
+		/*
+		 * let's be honest about this being a retarded hack
+		 */
+		rtm->rtm_fmask = rt->rt_rmx.rmx_pksent;
 		rt_getmetrics(&rt->rt_rmx, &rtm->rtm_rmx);
 		rtm->rtm_index = rt->rt_ifp->if_index;
 		rtm->rtm_errno = rtm->rtm_pid = rtm->rtm_seq = 0;

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Tue Apr 14 22:53:22 2009	(r191079)
+++ head/sys/sys/param.h	Tue Apr 14 23:05:36 2009	(r191080)
@@ -57,7 +57,7 @@
  *		is created, otherwise 1.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 800077	/* Master, propagated to newvers */
+#define __FreeBSD_version 800078	/* Master, propagated to newvers */
 
 #ifndef LOCORE
 #include 

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 23:12:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E1B541065670;
	Tue, 14 Apr 2009 23:12:01 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.29])
	by mx1.freebsd.org (Postfix) with ESMTP id 6F3BF8FC15;
	Tue, 14 Apr 2009 23:12:01 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: by yw-out-2324.google.com with SMTP id 5so1680164ywh.13
	for ; Tue, 14 Apr 2009 16:12:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=S3/ozca8hsOAjXuCbZXZ0krnfPCXYla2IK1hZcSQWjE=;
	b=tABr/YLpuBGvdhO0Ta1Dbb3GQIVAZZfdThsFYnvy9vwIx/jBrAzOFh5AhPPjoYJLFw
	cvJFZoSy4DuXmw9S4dUaTGzYUFxdyqyRiT+puG53jKIViXCSGG7vpg0ZP/gLpSFCi/vN
	gwLCpv6U6jVzFtAbA2meaRYkvSz1USXqnYxHo=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=M9JnlPnBtXf4v2oxKe3r2jy64+w4dqTqugFMwDmyJ7/PMh5huXLk70vMgn6EWtUXSK
	pmfHSPbLj6vnGAI/0PI6lJ56iMqC2jY+xrf2n903LPaa4A/3zgxQRsOpgNXxP9KM6UDc
	GSHC983oltE1ul6ygKfqoQFgj8yUrtMi9/VYU=
MIME-Version: 1.0
Sender: mat.macy@gmail.com
Received: by 10.100.105.15 with SMTP id d15mr10978024anc.140.1239749108056; 
	Tue, 14 Apr 2009 15:45:08 -0700 (PDT)
In-Reply-To: 
References: <200904140317.n3E3HigF092519@svn.freebsd.org>
	
Date: Tue, 14 Apr 2009 15:45:08 -0700
X-Google-Sender-Auth: 0a398aaf73c831e3
Message-ID: <3c1674c90904141545tc2aa075l512cb76c1f334069@mail.gmail.com>
From: Kip Macy 
To: Robert Watson 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191037 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 23:12:02 -0000

On Tue, Apr 14, 2009 at 2:22 AM, Robert Watson  wrote:
> On Tue, 14 Apr 2009, Kip Macy wrote:
>
>> =A0call default if_qflush on ifq if default method isn't used by the dri=
ver
>>
> ...
>>
>> Modified: head/sys/net/if.c
>>
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- head/sys/net/if.c =A0 Tue Apr 14 03:13:05 2009 =A0 =A0 =A0 =A0(r1910=
36)
>> +++ head/sys/net/if.c =A0 Tue Apr 14 03:17:44 2009 =A0 =A0 =A0 =A0(r1910=
37)
>> @@ -1509,6 +1509,8 @@ if_unroute(struct ifnet *ifp, int flag,
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (fam =3D=3D PF_UNSPEC || (fam =3D=3D i=
fa->ifa_addr->sa_family))
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pfctlinput(PRC_IFDOWN, if=
a->ifa_addr);
>> =A0 =A0 =A0 =A0ifp->if_qflush(ifp);
>> + =A0 =A0 =A0 if (ifp->if_snd.ifq_head !=3D NULL)
>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if_qflush(ifp);
>
> The commit message should perhaps read:
>
> =A0Call default if_qflush on ifq if there are still packets left in the
> default
> =A0queue after calling the driver's flush method.
>
> However, this seems a bit odd: what if the driver uses if_snd as its queu=
e
> but implements other differences in the transmit routine? =A0In that case=
, we
> might impose default queue properties on if_snd even though the driver
> doesn't use them. =A0Could you talk a bit about the circumstances under w=
hich
> the driver provides an if_qflush that doesn't drain its queues properly?


I'm afraid I don't understand the question. If a driver only uses
if_snd for its transmit routine then there is no reason for it to
override the default if_qflush implementation.

-Kip

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 23:46:58 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5614A106564A;
	Tue, 14 Apr 2009 23:46:58 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 45E118FC17;
	Tue, 14 Apr 2009 23:46:58 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3ENkwK7023750;
	Tue, 14 Apr 2009 23:46:58 GMT (envelope-from kan@svn.freebsd.org)
Received: (from kan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3ENkwuK023749;
	Tue, 14 Apr 2009 23:46:58 GMT (envelope-from kan@svn.freebsd.org)
Message-Id: <200904142346.n3ENkwuK023749@svn.freebsd.org>
From: Alexander Kabaev 
Date: Tue, 14 Apr 2009 23:46:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191081 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 23:46:59 -0000

Author: kan
Date: Tue Apr 14 23:46:57 2009
New Revision: 191081
URL: http://svn.freebsd.org/changeset/base/191081

Log:
  Fix yet another negative dotodot entry fallout.
  
  Reported by: pho

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Tue Apr 14 23:05:36 2009	(r191080)
+++ head/sys/kern/vfs_cache.c	Tue Apr 14 23:46:57 2009	(r191081)
@@ -421,6 +421,18 @@ retry_wlocked:
 				*vpp = dvp->v_cache_dd->nc_vp;
 			else
 				*vpp = dvp->v_cache_dd->nc_dvp;
+			/* Return failure if negative entry was found. */
+			if (*vpp == NULL) {
+				numneghits++;
+				nchstats.ncs_neghits++;
+				SDT_PROBE(vfs, namecache, lookup, hit_negative,
+				    dvp, "..", 0, 0, 0);
+				if (wlocked)
+					CACHE_WUNLOCK();
+				else
+					CACHE_RUNLOCK();
+				return (ENOENT);
+			}
 			CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..",
 			    dvp, cnp->cn_nameptr, *vpp);
 			SDT_PROBE(vfs, namecache, lookup, hit, dvp, "..",

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 14 23:56:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B98C4106566C;
	Tue, 14 Apr 2009 23:56:48 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A91E88FC12;
	Tue, 14 Apr 2009 23:56:48 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3ENumm7024021;
	Tue, 14 Apr 2009 23:56:48 GMT (envelope-from kan@svn.freebsd.org)
Received: (from kan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3ENumPX024020;
	Tue, 14 Apr 2009 23:56:48 GMT (envelope-from kan@svn.freebsd.org)
Message-Id: <200904142356.n3ENumPX024020@svn.freebsd.org>
From: Alexander Kabaev 
Date: Tue, 14 Apr 2009 23:56:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191082 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 14 Apr 2009 23:56:49 -0000

Author: kan
Date: Tue Apr 14 23:56:48 2009
New Revision: 191082
URL: http://svn.freebsd.org/changeset/base/191082

Log:
  Redo previous change using simpler patch that happens to be also
  more correct.
  
  Submitted by: tor

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Tue Apr 14 23:46:57 2009	(r191081)
+++ head/sys/kern/vfs_cache.c	Tue Apr 14 23:56:48 2009	(r191082)
@@ -423,15 +423,8 @@ retry_wlocked:
 				*vpp = dvp->v_cache_dd->nc_dvp;
 			/* Return failure if negative entry was found. */
 			if (*vpp == NULL) {
-				numneghits++;
-				nchstats.ncs_neghits++;
-				SDT_PROBE(vfs, namecache, lookup, hit_negative,
-				    dvp, "..", 0, 0, 0);
-				if (wlocked)
-					CACHE_WUNLOCK();
-				else
-					CACHE_RUNLOCK();
-				return (ENOENT);
+				ncp = dvp->v_cache_dd;
+				goto negative_success;
 			}
 			CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..",
 			    dvp, cnp->cn_nameptr, *vpp);
@@ -486,6 +479,7 @@ retry_wlocked:
 		goto success;
 	}
 
+negative_success:
 	/* We found a negative match, and want to create it, so purge */
 	if (cnp->cn_nameiop == CREATE) {
 		numnegzaps++;

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 00:52:05 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 32F86106566B;
	Wed, 15 Apr 2009 00:52:05 +0000 (UTC)
	(envelope-from kientzle@freebsd.org)
Received: from kientzle.com (kientzle.com [66.166.149.50])
	by mx1.freebsd.org (Postfix) with ESMTP id D40AF8FC15;
	Wed, 15 Apr 2009 00:52:04 +0000 (UTC)
	(envelope-from kientzle@freebsd.org)
Received: (from root@localhost)
	by kientzle.com (8.14.3/8.14.3) id n3F0q3ZY089397;
	Tue, 14 Apr 2009 17:52:03 -0700 (PDT)
	(envelope-from kientzle@freebsd.org)
Received: from dark.x.kientzle.com (fw2.kientzle.com [10.123.1.2])
	by kientzle.com with SMTP id xf96jbz6xayjxcu9r85gcb2kfw;
	Tue, 14 Apr 2009 17:52:03 -0700 (PDT)
	(envelope-from kientzle@freebsd.org)
Message-ID: <49E52FB3.9070800@freebsd.org>
Date: Tue, 14 Apr 2009 17:52:03 -0700
From: Tim Kientzle 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US;
	rv:1.8.1.21) Gecko/20090409 SeaMonkey/1.1.15
MIME-Version: 1.0
To: Robert Watson 
References: <200904141139.n3EBdudA004806@svn.freebsd.org>
	<49E4D2BF.2040503@freebsd.org>
	
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Edward Tomasz Napierala 
Subject: Re: svn commit: r191055 - head/lib/libc/string
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 00:52:05 -0000

Robert Watson wrote:
> On Tue, 14 Apr 2009, Tim Kientzle wrote:
>> A related issue:  It would be really nice to be able to find out 
>> whether a file had extended ACLs or extended attributes based on the 
>> information returned from stat(2).
> 
> Kirk, Poul-Henning, and I discussed precisely this during the initial 
> UFS2 design session.  The idea was that we'd allocate a system flag that 
> was essentially a "there are ACL-related extended attributes",

I was thinking a bit that indicated the existence
of *any* extended metadata, not just ACLs.
Userspace consumers can then query EAs, ACLs, etc.
if they see this bit set.

If we have bits to burn, we could assign separate
bits for specific types of extended metadata--such
as ACLs--but I think we need to start with something
pretty broad.  The variety of extended metadata is
only going to increase over time.

> could be used in-kernel to avoid EA reads, and from userspace to avoid 
> (or trigger) ACL reads.  I still think it would be a good idea to do 
> this, although we might want to think a bit about failure modes if 
> there's a crash between EA update and inode update.

You could synthesize this bit at stat() time and not
store it on disk at all.  Alternatively, you could
order inode update before EA update to get conservative
behavior:  If the bit isn't set, that would guarantee
that there was no extended metadata.  Note that this
fits well with having a single bit that indicates
"there exists some extended metadata"; clients will
have to be prepared to handle the case where the bit is
set but the particular metadata of interest to them
isn't there after all.

My primary concern here is finding ways to avoid extraneous
system calls; whether the bit is stored on disk or is
synthesized sounds like a filesystem-level optimization
that I don't personally much care about.

Tim

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 08:44:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9C497106566C;
	Wed, 15 Apr 2009 08:44:27 +0000 (UTC)
	(envelope-from trasz@freebsd.org)
Received: from pin.if.uz.zgora.pl (pin.if.uz.zgora.pl [212.109.128.251])
	by mx1.freebsd.org (Postfix) with ESMTP id 5E1EB8FC16;
	Wed, 15 Apr 2009 08:44:27 +0000 (UTC)
	(envelope-from trasz@freebsd.org)
Received: by pin.if.uz.zgora.pl (Postfix, from userid 1001)
	id BA51A39BA2; Wed, 15 Apr 2009 10:31:03 +0200 (CEST)
Date: Wed, 15 Apr 2009 10:31:03 +0200
From: Edward Tomasz Napierala 
To: Tim Kientzle 
Message-ID: <20090415083103.GA23062@pin.if.uz.zgora.pl>
References: <200904141139.n3EBdudA004806@svn.freebsd.org>
	<49E4D2BF.2040503@freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: inline
In-Reply-To: <49E4D2BF.2040503@freebsd.org>
User-Agent: Mutt/1.5.18 (2008-05-17)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191055 - head/lib/libc/string
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 08:44:28 -0000

On 0414T1115, Tim Kientzle wrote:
> >   There is no way for strmode(3) to append '+' if the file has ACL,
> >   because there is no way to figure that out based on the file mode
> >   itself.  Make the manual page match reality.
> 
> Yep, that '+' is why libarchive has a custom strmode()
> that accepts more information than just the mode.
> 
> A related issue:  It would be really nice to be
> able to find out whether a file had extended ACLs
> or extended attributes based on the information
> returned from stat(2).  That would allow programs
> like tar to avoid a fair number of system calls.
> Even just a single bit "HAS_EXTENSIONS" would help
> a lot, since most files don't have any extended
> ACLs or extended attributes.  It would also allow
> users of strmode() (such as ls) to insert that '+'
> sign themselves.

I know about the idea of adding a bit to the inode flags, but I never
thought about exposing it to the userland in mode_t.  Can we actually
do this without risking confusing some applications that expect only
the standard mode bits to be set?

-- 
If you cut off my head, what would I say?  Me and my head, or me and my body?


From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 17:14:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6DA221065675;
	Wed, 15 Apr 2009 17:14:43 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5C0E38FC08;
	Wed, 15 Apr 2009 17:14:43 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FHEh5J049111;
	Wed, 15 Apr 2009 17:14:43 GMT
	(envelope-from kensmith@svn.freebsd.org)
Received: (from kensmith@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FHEhA5049110;
	Wed, 15 Apr 2009 17:14:43 GMT
	(envelope-from kensmith@svn.freebsd.org)
Message-Id: <200904151714.n3FHEhA5049110@svn.freebsd.org>
From: Ken Smith 
Date: Wed, 15 Apr 2009 17:14:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191110 - head/usr.sbin/pkg_install/add
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 17:14:43 -0000

Author: kensmith
Date: Wed Apr 15 17:14:43 2009
New Revision: 191110
URL: http://svn.freebsd.org/changeset/base/191110

Log:
  Add release package directories for 6.4 and 7.2.

Modified:
  head/usr.sbin/pkg_install/add/main.c

Modified: head/usr.sbin/pkg_install/add/main.c
==============================================================================
--- head/usr.sbin/pkg_install/add/main.c	Wed Apr 15 17:06:46 2009	(r191109)
+++ head/usr.sbin/pkg_install/add/main.c	Wed Apr 15 17:14:43 2009	(r191110)
@@ -78,8 +78,10 @@ struct {
 	{ 601000, 601099, "/packages-6.1-release" },
 	{ 602000, 602099, "/packages-6.2-release" },
 	{ 603000, 603099, "/packages-6.3-release" },
+	{ 604000, 604099, "/packages-6.4-release" },
 	{ 700000, 700099, "/packages-7.0-release" },
 	{ 701000, 701099, "/packages-7.1-release" },
+	{ 702000, 702099, "/packages-7.2-release" },
 	{ 300000, 399000, "/packages-3-stable" },
 	{ 400000, 499000, "/packages-4-stable" },
 	{ 502100, 502128, "/packages-5-current" },

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 17:31:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D63151065888;
	Wed, 15 Apr 2009 17:31:22 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C0C728FC1A;
	Wed, 15 Apr 2009 17:31:22 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FHVM28049814;
	Wed, 15 Apr 2009 17:31:22 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FHVMWj049809;
	Wed, 15 Apr 2009 17:31:22 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <200904151731.n3FHVMWj049809@svn.freebsd.org>
From: Jung-uk Kim 
Date: Wed, 15 Apr 2009 17:31:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191111 - in head/sys: amd64/include amd64/include/pc
	boot/i386/libi386 i386/include i386/include/pc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 17:31:25 -0000

Author: jkim
Date: Wed Apr 15 17:31:22 2009
New Revision: 191111
URL: http://svn.freebsd.org/changeset/base/191111

Log:
  A simple rewrite of biossmap.c:
  
  - Do not iterate int 15h, function e820h twice.  Instead, we use STAILQ to
  store each return buffer and copy all at once.
  - Export optional extended attributes defined in ACPI 3.0 as separate
  metadata.  Currently, there are only two bits defined in the specification.
  For example, if the descriptor has extended attributes and it is not
  enabled, it has to be ignored by OS.  We may implement it in the kernel
  later if it is necessary and proven correct in reality.
  - Check return buffer size strictly as suggested in ACPI 3.0.
  
  Reviewed by:	jhb

Modified:
  head/sys/amd64/include/metadata.h
  head/sys/amd64/include/pc/bios.h
  head/sys/boot/i386/libi386/biossmap.c
  head/sys/i386/include/metadata.h
  head/sys/i386/include/pc/bios.h

Modified: head/sys/amd64/include/metadata.h
==============================================================================
--- head/sys/amd64/include/metadata.h	Wed Apr 15 17:14:43 2009	(r191110)
+++ head/sys/amd64/include/metadata.h	Wed Apr 15 17:31:22 2009	(r191111)
@@ -30,5 +30,6 @@
 #define	_MACHINE_METADATA_H_
 
 #define	MODINFOMD_SMAP		0x1001
+#define	MODINFOMD_SMAP_XATTR	0x1002
 
 #endif /* !_MACHINE_METADATA_H_ */

Modified: head/sys/amd64/include/pc/bios.h
==============================================================================
--- head/sys/amd64/include/pc/bios.h	Wed Apr 15 17:14:43 2009	(r191110)
+++ head/sys/amd64/include/pc/bios.h	Wed Apr 15 17:31:22 2009	(r191111)
@@ -48,6 +48,10 @@ extern u_int32_t	bios_sigsearch(u_int32_
 #define	SMAP_TYPE_ACPI_NVS	4
 #define	SMAP_TYPE_ACPI_ERROR	5
 
+#define	SMAP_XATTR_ENABLED	0x00000001
+#define	SMAP_XATTR_NON_VOLATILE	0x00000002
+#define	SMAP_XATTR_MASK		(SMAP_XATTR_ENABLED | SMAP_XATTR_NON_VOLATILE)
+
 struct bios_smap {
     u_int64_t	base;
     u_int64_t	length;

Modified: head/sys/boot/i386/libi386/biossmap.c
==============================================================================
--- head/sys/boot/i386/libi386/biossmap.c	Wed Apr 15 17:14:43 2009	(r191110)
+++ head/sys/boot/i386/libi386/biossmap.c	Wed Apr 15 17:31:22 2009	(r191111)
@@ -33,74 +33,107 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
+#include 
 #include 
 #include "bootstrap.h"
 #include "libi386.h"
 #include "btxv86.h"
 
-static struct {
-	struct bios_smap _smap_entry;
-	char pad[8];		/* Bad BIOS writer, no cookie! */
-} smap;
+#define	V86_CY(x)	((x) & PSL_C)
 
-static struct bios_smap *smapbase;
-static int smaplen;
+struct smap_buf {
+	struct bios_smap	smap;
+	uint32_t		xattr;	/* Extended attribute from ACPI 3.0 */
+	STAILQ_ENTRY(smap_buf)	bufs;
+};
+
+#define	SMAP_BUFSIZE		offsetof(struct smap_buf, bufs)
+
+static struct bios_smap		*smapbase;
+static uint32_t			*smapattr;
+static u_int			smaplen;
 
 void
 bios_getsmap(void)
 {
-	int n;
+	struct smap_buf		buf;
+	STAILQ_HEAD(smap_head, smap_buf) head =
+	    STAILQ_HEAD_INITIALIZER(head);
+	struct smap_buf		*cur, *next;
+	u_int			n, x;
 
+	STAILQ_INIT(&head);
 	n = 0;
-	smaplen = 0;
-	/* Count up segments in system memory map */
+	x = 0;
 	v86.ebx = 0;
 	do {
 		v86.ctl = V86_FLAGS;
-		v86.addr = 0x15;		/* int 0x15 function 0xe820*/
-		v86.eax = 0xe820;
-		v86.ecx = sizeof(struct bios_smap);
+		v86.addr = 0x15;
+		v86.eax = 0xe820;	/* int 0x15 function 0xe820 */
+		v86.ecx = SMAP_BUFSIZE;
 		v86.edx = SMAP_SIG;
-		v86.es = VTOPSEG(&smap);
-		v86.edi = VTOPOFF(&smap);
+		v86.es = VTOPSEG(&buf);
+		v86.edi = VTOPOFF(&buf);
 		v86int();
-		if ((v86.efl & 1) || (v86.eax != SMAP_SIG))
+		if (V86_CY(v86.efl) || v86.eax != SMAP_SIG ||
+		    v86.ecx < sizeof(buf.smap) || v86.ecx > SMAP_BUFSIZE)
 			break;
+
+		next = malloc(sizeof(*next));
+		if (next == NULL)
+			break;
+		next->smap = buf.smap;
+		if (v86.ecx == SMAP_BUFSIZE) {
+			next->xattr = buf.xattr;
+			x++;
+		}
+		STAILQ_INSERT_TAIL(&head, next, bufs);
 		n++;
 	} while (v86.ebx != 0);
-	if (n == 0)
-		return;
-	n += 10;	/* spare room */
-	smapbase = malloc(n * sizeof(*smapbase));
+	smaplen = n;
 
-	/* Save system memory map */
-	v86.ebx = 0;
-	do {
-		v86.ctl = V86_FLAGS;
-		v86.addr = 0x15;		/* int 0x15 function 0xe820*/
-		v86.eax = 0xe820;
-		v86.ecx = sizeof(struct bios_smap);
-		v86.edx = SMAP_SIG;
-		v86.es = VTOPSEG(&smap);
-		v86.edi = VTOPOFF(&smap);
-		v86int();
-		bcopy(&smap, &smapbase[smaplen], sizeof(struct bios_smap));
-		smaplen++;
-		if ((v86.efl & 1) || (v86.eax != SMAP_SIG))
-			break;
-	} while (v86.ebx != 0 && smaplen < n);
+	if (smaplen > 0) {
+		smapbase = malloc(smaplen * sizeof(*smapbase));
+		if (smapbase != NULL) {
+			n = 0;
+			STAILQ_FOREACH(cur, &head, bufs)
+				smapbase[n++] = cur->smap;
+		}
+		if (smaplen == x) {
+			smapattr = malloc(smaplen * sizeof(*smapattr));
+			if (smapattr != NULL) {
+				n = 0;
+				STAILQ_FOREACH(cur, &head, bufs)
+					smapattr[n++] = cur->xattr &
+					    SMAP_XATTR_MASK;
+			}
+		} else
+			smapattr = NULL;
+		cur = STAILQ_FIRST(&head);
+		while (cur != NULL) {
+			next = STAILQ_NEXT(cur, bufs);
+			free(cur);
+			cur = next;
+		}
+	}
 }
 
 void
 bios_addsmapdata(struct preloaded_file *kfp)
 {
-	int len;
+	size_t			size;
 
-	if (smapbase == 0 || smaplen == 0)
+	if (smapbase == NULL || smaplen == 0)
 		return;
-	len = smaplen * sizeof(*smapbase);
-	file_addmetadata(kfp, MODINFOMD_SMAP, len, smapbase);
+	size = smaplen * sizeof(*smapbase);
+	file_addmetadata(kfp, MODINFOMD_SMAP, size, smapbase);
+	if (smapattr != NULL) {
+		size = smaplen * sizeof(*smapattr);
+		file_addmetadata(kfp, MODINFOMD_SMAP_XATTR, size, smapattr);
+	}
 }
 
 COMMAND_SET(smap, "smap", "show BIOS SMAP", command_smap);
@@ -108,12 +141,22 @@ COMMAND_SET(smap, "smap", "show BIOS SMA
 static int
 command_smap(int argc, char *argv[])
 {
-	int i;
+	u_int			i;
 
-	if (smapbase == 0 || smaplen == 0)
+	if (smapbase == NULL || smaplen == 0)
 		return (CMD_ERROR);
-	for (i = 0; i < smaplen; i++)
-		printf("SMAP type=%02x base=%016llx len=%016llx\n",
-		    smapbase[i].type, smapbase[i].base, smapbase[i].length);
+	if (smapattr != NULL)
+		for (i = 0; i < smaplen; i++)
+			printf("SMAP type=%02x base=%016llx len=%016llx attr=%02x\n",
+			    (unsigned int)smapbase[i].type,
+			    (unsigned long long)smapbase[i].base,
+			    (unsigned long long)smapbase[i].length,
+			    (unsigned int)smapattr[i]);
+	else
+		for (i = 0; i < smaplen; i++)
+			printf("SMAP type=%02x base=%016llx len=%016llx\n",
+			    (unsigned int)smapbase[i].type,
+			    (unsigned long long)smapbase[i].base,
+			    (unsigned long long)smapbase[i].length);
 	return (CMD_OK);
 }

Modified: head/sys/i386/include/metadata.h
==============================================================================
--- head/sys/i386/include/metadata.h	Wed Apr 15 17:14:43 2009	(r191110)
+++ head/sys/i386/include/metadata.h	Wed Apr 15 17:31:22 2009	(r191111)
@@ -30,5 +30,6 @@
 #define	_MACHINE_METADATA_H_
 
 #define	MODINFOMD_SMAP		0x1001
+#define	MODINFOMD_SMAP_XATTR	0x1002
 
 #endif /* !_MACHINE_METADATA_H_ */

Modified: head/sys/i386/include/pc/bios.h
==============================================================================
--- head/sys/i386/include/pc/bios.h	Wed Apr 15 17:14:43 2009	(r191110)
+++ head/sys/i386/include/pc/bios.h	Wed Apr 15 17:31:22 2009	(r191111)
@@ -281,6 +281,10 @@ struct PIR_table 
 #define	SMAP_TYPE_ACPI_NVS	4
 #define	SMAP_TYPE_ACPI_ERROR	5
 
+#define	SMAP_XATTR_ENABLED	0x00000001
+#define	SMAP_XATTR_NON_VOLATILE	0x00000002
+#define	SMAP_XATTR_MASK		(SMAP_XATTR_ENABLED | SMAP_XATTR_NON_VOLATILE)
+
 struct bios_smap {
     u_int64_t	base;
     u_int64_t	length;

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 18:06:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7ED181065677;
	Wed, 15 Apr 2009 18:06:02 +0000 (UTC)
	(envelope-from kientzle@freebsd.org)
Received: from kientzle.com (kientzle.com [66.166.149.50])
	by mx1.freebsd.org (Postfix) with ESMTP id 4E3668FC29;
	Wed, 15 Apr 2009 18:06:02 +0000 (UTC)
	(envelope-from kientzle@freebsd.org)
Received: (from root@localhost)
	by kientzle.com (8.14.3/8.14.3) id n3FI5wOf097871;
	Wed, 15 Apr 2009 11:05:58 -0700 (PDT)
	(envelope-from kientzle@freebsd.org)
Received: from dark.x.kientzle.com (fw2.kientzle.com [10.123.1.2])
	by kientzle.com with SMTP id wwm457v32mhaqzcmyfpdrqykd2;
	Wed, 15 Apr 2009 11:05:58 -0700 (PDT)
	(envelope-from kientzle@freebsd.org)
Message-ID: <49E62206.2070706@freebsd.org>
Date: Wed, 15 Apr 2009 11:05:58 -0700
From: Tim Kientzle 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US;
	rv:1.8.1.21) Gecko/20090409 SeaMonkey/1.1.15
MIME-Version: 1.0
To: Edward Tomasz Napierala 
References: <200904141139.n3EBdudA004806@svn.freebsd.org>
	<49E4D2BF.2040503@freebsd.org>
	<20090415083103.GA23062@pin.if.uz.zgora.pl>
In-Reply-To: <20090415083103.GA23062@pin.if.uz.zgora.pl>
Content-Type: text/plain; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191055 - head/lib/libc/string
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 18:06:03 -0000

Edward Tomasz Napierala wrote:
> On 0414T1115, Tim Kientzle wrote:
>>>   There is no way for strmode(3) to append '+' if the file has ACL,
>>>   because there is no way to figure that out based on the file mode
>>>   itself.  Make the manual page match reality.
>> Yep, that '+' is why libarchive has a custom strmode()
>> that accepts more information than just the mode.
>>
>> A related issue:  It would be really nice to be
>> able to find out whether a file had extended ACLs
>> or extended attributes based on the information
>> returned from stat(2).
> 
> I know about the idea of adding a bit to the inode flags, but I never
> thought about exposing it to the userland in mode_t.  Can we actually
> do this without risking confusing some applications that expect only
> the standard mode bits to be set?

Unfortunately, mode_t is very full and extending
it would probably cause chaos.

I was thinking of a bit in the fflags field.
That wouldn't help strmode(), of course,
but would make it easy for strmode() users
(such as ls) to add a '+' if they wanted to.

Tim


From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 18:15:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A75AA1065676;
	Wed, 15 Apr 2009 18:15:29 +0000 (UTC) (envelope-from zec@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 968FC8FC1B;
	Wed, 15 Apr 2009 18:15:29 +0000 (UTC) (envelope-from zec@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FIFTJn050767;
	Wed, 15 Apr 2009 18:15:29 GMT (envelope-from zec@svn.freebsd.org)
Received: (from zec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FIFTLf050766;
	Wed, 15 Apr 2009 18:15:29 GMT (envelope-from zec@svn.freebsd.org)
Message-Id: <200904151815.n3FIFTLf050766@svn.freebsd.org>
From: Marko Zec 
Date: Wed, 15 Apr 2009 18:15:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191112 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 18:15:30 -0000

Author: zec
Date: Wed Apr 15 18:15:29 2009
New Revision: 191112
URL: http://svn.freebsd.org/changeset/base/191112

Log:
  In the !VIMAGE_GLOBALS case, make sure not to call vnet_net_iattach()
  both via the vnet_mod_register() framework and then directly, but only
  once.
  
  Reviewed by:	bz
  Approved by:	julian (mentor)

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Wed Apr 15 17:31:22 2009	(r191111)
+++ head/sys/net/if.c	Wed Apr 15 18:15:29 2009	(r191112)
@@ -401,8 +401,9 @@ if_init(void *dummy __unused)
 
 #ifndef VIMAGE_GLOBALS
 	vnet_mod_register(&vnet_net_modinfo);
-#endif
+#else
 	vnet_net_iattach(NULL);
+#endif
 
 	IFNET_LOCK_INIT();
 	ifdev_setbyindex(0, make_dev(&net_cdevsw, 0, UID_ROOT, GID_WHEEL,

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 19:05:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2D7C2106566B;
	Wed, 15 Apr 2009 19:05:27 +0000 (UTC)
	(envelope-from oleg@lath.rinet.ru)
Received: from lath.rinet.ru (lath.rinet.ru [195.54.192.90])
	by mx1.freebsd.org (Postfix) with ESMTP id DE36A8FC1F;
	Wed, 15 Apr 2009 19:05:26 +0000 (UTC)
	(envelope-from oleg@lath.rinet.ru)
Received: by lath.rinet.ru (Postfix, from userid 222)
	id 162FE7049; Wed, 15 Apr 2009 22:52:01 +0400 (MSD)
Date: Wed, 15 Apr 2009 22:52:01 +0400
From: Oleg Bulyzhin 
To: Luigi Rizzo 
Message-ID: <20090415185201.GA83843@lath.rinet.ru>
References: <200904091246.n39Ck05i004627@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200904091246.n39Ck05i004627@svn.freebsd.org>
User-Agent: Mutt/1.5.18 (2008-05-17)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190865 - in head: sbin/ipfw sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 19:05:28 -0000


Converting numbytes (struct dn_pipe) to dn_key (which is uint64_t) may break
WFQ.  ready_event_wfq() code depends on signed 'numbytes'. 

P.S. i vote for modifing ready_event_wfq() to deal with unsigned numbytes.

-- 
Oleg.

================================================================
=== Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru ===
================================================================


From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 19:10:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D7CC71065679;
	Wed, 15 Apr 2009 19:10:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C6C5C8FC14;
	Wed, 15 Apr 2009 19:10:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FJAb6t051985;
	Wed, 15 Apr 2009 19:10:37 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FJAboB051984;
	Wed, 15 Apr 2009 19:10:37 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200904151910.n3FJAboB051984@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 15 Apr 2009 19:10:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191113 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 19:10:38 -0000

Author: jhb
Date: Wed Apr 15 19:10:37 2009
New Revision: 191113
URL: http://svn.freebsd.org/changeset/base/191113

Log:
  Update comment above _fget() for earlier change to FWRITE failures return
  EBADF rather than EINVAL.
  
  Submitted by:	Jaakko Heinonen  jh saunalahti fi
  MFC after:	1 month

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Wed Apr 15 18:15:29 2009	(r191112)
+++ head/sys/kern/kern_descrip.c	Wed Apr 15 19:10:37 2009	(r191113)
@@ -2027,10 +2027,8 @@ finit(struct file *fp, u_int flag, short
  * Extract the file pointer associated with the specified descriptor for the
  * current user process.
  *
- * If the descriptor doesn't exist, EBADF is returned.
- *
- * If the descriptor exists but doesn't match 'flags' then return EBADF for
- * read attempts and EINVAL for write attempts.
+ * If the descriptor doesn't exist or doesn't match 'flags', EBADF is
+ * returned.
  *
  * If 'hold' is set (non-zero) the file's refcount will be bumped on return.
  * It should be dropped with fdrop().  If it is not set, then the refcount

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 19:58:42 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 107B5106564A;
	Wed, 15 Apr 2009 19:58:42 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E89198FC13;
	Wed, 15 Apr 2009 19:58:41 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FJwflh052983;
	Wed, 15 Apr 2009 19:58:41 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FJwfqD052982;
	Wed, 15 Apr 2009 19:58:41 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200904151958.n3FJwfqD052982@svn.freebsd.org>
From: Ed Schouten 
Date: Wed, 15 Apr 2009 19:58:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191114 - head/sys/pc98/cbus
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 19:58:42 -0000

Author: ed
Date: Wed Apr 15 19:58:41 2009
New Revision: 191114
URL: http://svn.freebsd.org/changeset/base/191114

Log:
  Migrate the olpt(4) driver to si_drv1 instead of using dev2unit().
  
  Approved by:	nyan

Modified:
  head/sys/pc98/cbus/olpt.c

Modified: head/sys/pc98/cbus/olpt.c
==============================================================================
--- head/sys/pc98/cbus/olpt.c	Wed Apr 15 19:10:37 2009	(r191113)
+++ head/sys/pc98/cbus/olpt.c	Wed Apr 15 19:58:41 2009	(r191114)
@@ -136,9 +136,6 @@
 static int volatile lptflag = 1;
 #endif
 
-#define	LPTUNIT(s)	((s)&0x03)
-#define	LPTFLAGS(s)	((s)&0xfc)
-
 struct lpt_softc {
 	struct resource *res_port;
 	struct resource *res_irq;
@@ -318,6 +315,7 @@ lpt_attach(device_t dev)
 {
 	int	rid, unit;
 	struct	lpt_softc	*sc;
+	struct	cdev		*cdev;
 
 	unit = device_get_unit(dev);
 	sc = device_get_softc(dev);
@@ -360,10 +358,12 @@ lpt_attach(device_t dev)
 		device_printf(dev, "Interrupt-driven port");
 	}
 
-	/* XXX what to do about the flags in the minor number? */
-	make_dev(&lpt_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, "lpt%d", unit);
-	make_dev(&lpt_cdevsw, unit | LP_BYPASS,
+	cdev = make_dev(&lpt_cdevsw, 0,
+			UID_ROOT, GID_WHEEL, 0600, "lpt%d", unit);
+	cdev->si_drv1 = sc;
+	cdev = make_dev(&lpt_cdevsw, LP_BYPASS,
 			UID_ROOT, GID_WHEEL, 0600, "lpctl%d", unit);
+	cdev->si_drv1 = sc;
 
 	return 0;
 }
@@ -377,11 +377,10 @@ lpt_attach(device_t dev)
 static	int
 lptopen (struct cdev *dev, int flags, int fmt, struct thread *td)
 {
-	struct lpt_softc *sc;
+	struct lpt_softc *sc = dev->si_drv1;
 	int s;
 	int port;
 
-	sc = devclass_get_softc(olpt_devclass, LPTUNIT(dev2unit(dev)));
 	if (sc->sc_port == 0)
 		return (ENXIO);
 
@@ -391,7 +390,7 @@ lptopen (struct cdev *dev, int flags, in
 	} else
 		sc->sc_state |= INIT;
 
-	sc->sc_flags = LPTFLAGS(dev2unit(dev));
+	sc->sc_flags = dev2unit(dev);
 
 	/* Check for open with BYPASS flag set. */
 	if (sc->sc_flags & LP_BYPASS) {
@@ -467,9 +466,8 @@ lptout (void *arg)
 static	int
 lptclose(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
-	struct lpt_softc *sc;
+	struct lpt_softc *sc = dev->si_drv1;
 
-	sc = devclass_get_softc(olpt_devclass, LPTUNIT(dev2unit(dev)));
 	if(sc->sc_flags & LP_BYPASS)
 		goto end_close;
 
@@ -556,9 +554,8 @@ lptwrite(struct cdev *dev, struct uio * 
 {
 	register unsigned n;
 	int pl, err;
-	struct lpt_softc *sc;
+	struct lpt_softc *sc = dev->si_drv1;
 
-	sc = devclass_get_softc(olpt_devclass, LPTUNIT(dev2unit(dev)));
 	if(sc->sc_flags & LP_BYPASS) {
 		/* we can't do writes in bypass mode */
 		return(EPERM);
@@ -613,12 +610,9 @@ static	int
 lptioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
 {
 	int	error = 0;
-        struct	lpt_softc *sc;
-        u_int	unit = LPTUNIT(dev2unit(dev));
+	struct lpt_softc *sc = dev->si_drv1;
 	u_char	old_sc_irq;	/* old printer IRQ status */
 
-        sc = devclass_get_softc(olpt_devclass, unit);
-
 	switch (cmd) {
 	case LPT_IRQ :
 		if(sc->sc_irq & LP_HAS_IRQ) {
@@ -637,8 +631,8 @@ lptioctl(struct cdev *dev, u_long cmd, c
 			else
 				sc->sc_irq |= LP_ENABLE_IRQ;
 			if (old_sc_irq != sc->sc_irq )
-				log(LOG_NOTICE, "lpt%c switched to %s mode\n",
-					(char)unit+'0',
+				log(LOG_NOTICE, "%s switched to %s mode\n",
+					devtoname(dev),
 					(sc->sc_irq & LP_ENABLE_IRQ)?
 					"interrupt-driven":"polled");
 		} else /* polled port */

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 20:08:27 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3C5821065673;
	Wed, 15 Apr 2009 20:08:27 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2B6478FC19;
	Wed, 15 Apr 2009 20:08:27 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FK8RB4053222;
	Wed, 15 Apr 2009 20:08:27 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FK8RQa053221;
	Wed, 15 Apr 2009 20:08:27 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200904152008.n3FK8RQa053221@svn.freebsd.org>
From: Ed Schouten 
Date: Wed, 15 Apr 2009 20:08:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191115 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 20:08:28 -0000

Author: ed
Date: Wed Apr 15 20:08:26 2009
New Revision: 191115
URL: http://svn.freebsd.org/changeset/base/191115

Log:
  Don't use si_drv0 directly.
  
  We should still access si_drv0 using dev2unit(). Also change the
  KASSERT() to really print the udev instead of the unit number. I suspect
  it's still useful to print the unit number, especially for devices that
  use clone lists, so keep the unit number in the panic string.

Modified:
  head/sys/kern/kern_conf.c

Modified: head/sys/kern/kern_conf.c
==============================================================================
--- head/sys/kern/kern_conf.c	Wed Apr 15 19:58:41 2009	(r191114)
+++ head/sys/kern/kern_conf.c	Wed Apr 15 20:08:26 2009	(r191115)
@@ -523,7 +523,7 @@ newdev(struct cdevsw *csw, int y, struct
 	if (csw->d_flags & D_NEEDMINOR) {
 		/* We may want to return an existing device */
 		LIST_FOREACH(si2, &csw->d_devs, si_list) {
-			if (si2->si_drv0 == udev) {
+			if (dev2unit(si2) == udev) {
 				dev_free_devlocked(si);
 				return (si2);
 			}
@@ -1042,7 +1042,7 @@ clone_cleanup(struct clonedevs **cdp)
 		if (!(cp->cdp_flags & CDP_SCHED_DTR)) {
 			cp->cdp_flags |= CDP_SCHED_DTR;
 			KASSERT(dev->si_flags & SI_NAMED,
-				("Driver has goofed in cloning underways udev %x", dev->si_drv0));
+				("Driver has goofed in cloning underways udev %x unit %x", dev2udev(dev), dev2unit(dev)));
 			destroy_devl(dev);
 		}
 	}

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 20:15:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D0825106564A;
	Wed, 15 Apr 2009 20:15:36 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BF44E8FC22;
	Wed, 15 Apr 2009 20:15:36 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FKFaRH053440;
	Wed, 15 Apr 2009 20:15:36 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FKFaax053439;
	Wed, 15 Apr 2009 20:15:36 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200904152015.n3FKFaax053439@svn.freebsd.org>
From: Ed Schouten 
Date: Wed, 15 Apr 2009 20:15:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191116 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 20:15:37 -0000

Author: ed
Date: Wed Apr 15 20:15:36 2009
New Revision: 191116
URL: http://svn.freebsd.org/changeset/base/191116

Log:
  Remove unneeded variable and casting from newdev().
  
  Remove the `udev' variable, which has a different type than the original
  function argument and si_drv0. The `udev' name is also misleading,
  because it is not the number returned by dev2udev(). Rename this
  argument to `unit'. It is the same number as returned by dev2unit().

Modified:
  head/sys/kern/kern_conf.c

Modified: head/sys/kern/kern_conf.c
==============================================================================
--- head/sys/kern/kern_conf.c	Wed Apr 15 20:08:26 2009	(r191115)
+++ head/sys/kern/kern_conf.c	Wed Apr 15 20:15:36 2009	(r191116)
@@ -513,23 +513,21 @@ notify_destroy(struct cdev *dev)
 }
 
 static struct cdev *
-newdev(struct cdevsw *csw, int y, struct cdev *si)
+newdev(struct cdevsw *csw, int unit, struct cdev *si)
 {
 	struct cdev *si2;
-	dev_t	udev;
 
 	mtx_assert(&devmtx, MA_OWNED);
-	udev = y;
 	if (csw->d_flags & D_NEEDMINOR) {
 		/* We may want to return an existing device */
 		LIST_FOREACH(si2, &csw->d_devs, si_list) {
-			if (dev2unit(si2) == udev) {
+			if (dev2unit(si2) == unit) {
 				dev_free_devlocked(si);
 				return (si2);
 			}
 		}
 	}
-	si->si_drv0 = udev;
+	si->si_drv0 = unit;
 	si->si_devsw = csw;
 	LIST_INSERT_HEAD(&csw->d_devs, si, si_list);
 	return (si);

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 20:33:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D0610106566B;
	Wed, 15 Apr 2009 20:33:19 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 9A63C8FC08;
	Wed, 15 Apr 2009 20:33:19 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 49FB946B03;
	Wed, 15 Apr 2009 16:33:19 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 1D2698A04D;
	Wed, 15 Apr 2009 16:33:18 -0400 (EDT)
From: John Baldwin 
To: Ed Schouten 
Date: Wed, 15 Apr 2009 16:32:41 -0400
User-Agent: KMail/1.9.7
References: <200904151958.n3FJwfqD052982@svn.freebsd.org>
In-Reply-To: <200904151958.n3FJwfqD052982@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200904151632.41653.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Wed, 15 Apr 2009 16:33:18 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=0.1 required=4.2 tests=RDNS_NONE autolearn=no
	version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191114 - head/sys/pc98/cbus
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 20:33:20 -0000

On Wednesday 15 April 2009 3:58:41 pm Ed Schouten wrote:
> Author: ed
> Date: Wed Apr 15 19:58:41 2009
> New Revision: 191114
> URL: http://svn.freebsd.org/changeset/base/191114
> 
> Log:
>   Migrate the olpt(4) driver to si_drv1 instead of using dev2unit().

When I performed similar changes in lpt(4) I stored the flags in si_drv2 
instead of the minor number.  You might want to do the same here so the 
drivers are closer.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 20:34:20 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3DF2E106567C;
	Wed, 15 Apr 2009 20:34:20 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 113C48FC25;
	Wed, 15 Apr 2009 20:34:20 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FKYJ6v053890;
	Wed, 15 Apr 2009 20:34:19 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FKYJG6053885;
	Wed, 15 Apr 2009 20:34:19 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904152034.n3FKYJG6053885@svn.freebsd.org>
From: Kip Macy 
Date: Wed, 15 Apr 2009 20:34:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191117 - in head: . sys/net sys/netinet sys/netinet6
	sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 20:34:21 -0000

Author: kmacy
Date: Wed Apr 15 20:34:19 2009
New Revision: 191117
URL: http://svn.freebsd.org/changeset/base/191117

Log:
  add an llentry to struct route{_in6} to allow it to be passed around with
  the rtentry

Modified:
  head/UPDATING
  head/sys/net/route.h
  head/sys/netinet/sctp_structs.h
  head/sys/netinet6/in6.h
  head/sys/sys/param.h

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Wed Apr 15 20:15:36 2009	(r191116)
+++ head/UPDATING	Wed Apr 15 20:34:19 2009	(r191117)
@@ -22,6 +22,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
 	to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20090415:
+	Add an llentry to struct route and struct route_in6. Modules
+	embedding a struct route will need to be recompiled. 
+	Bump __FreeBSD_version to 800079.
+
 20090414:
 	The size of rt_metrics_lite and by extension rtentry has changed.
 	Networking administration apps will need to be recompiled.

Modified: head/sys/net/route.h
==============================================================================
--- head/sys/net/route.h	Wed Apr 15 20:15:36 2009	(r191116)
+++ head/sys/net/route.h	Wed Apr 15 20:34:19 2009	(r191117)
@@ -47,6 +47,7 @@
  */
 struct route {
 	struct	rtentry *ro_rt;
+	struct	llentry *ro_lle;
 	struct	sockaddr ro_dst;
 };
 

Modified: head/sys/netinet/sctp_structs.h
==============================================================================
--- head/sys/netinet/sctp_structs.h	Wed Apr 15 20:15:36 2009	(r191116)
+++ head/sys/netinet/sctp_structs.h	Wed Apr 15 20:34:19 2009	(r191117)
@@ -146,6 +146,7 @@ struct sctp_asconf_iterator {
 
 struct sctp_net_route {
 	sctp_rtentry_t *ro_rt;
+	void *ro_lle;
 	union sctp_sockstore _l_addr;	/* remote peer addr */
 	struct sctp_ifa *_s_addr;	/* our selected src addr */
 };

Modified: head/sys/netinet6/in6.h
==============================================================================
--- head/sys/netinet6/in6.h	Wed Apr 15 20:15:36 2009	(r191116)
+++ head/sys/netinet6/in6.h	Wed Apr 15 20:34:19 2009	(r191117)
@@ -371,6 +371,7 @@ extern const struct in6_addr in6addr_lin
 #if __BSD_VISIBLE
 struct route_in6 {
 	struct	rtentry *ro_rt;
+	struct	llentry *ro_lle;
 	struct	sockaddr_in6 ro_dst;
 };
 #endif

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Wed Apr 15 20:15:36 2009	(r191116)
+++ head/sys/sys/param.h	Wed Apr 15 20:34:19 2009	(r191117)
@@ -57,7 +57,7 @@
  *		is created, otherwise 1.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 800078	/* Master, propagated to newvers */
+#define __FreeBSD_version 800079	/* Master, propagated to newvers */
 
 #ifndef LOCORE
 #include 

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 20:43:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 18E5A106567B;
	Wed, 15 Apr 2009 20:43:12 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A577C8FC0A;
	Wed, 15 Apr 2009 20:43:12 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FKhCGd054081;
	Wed, 15 Apr 2009 20:43:12 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FKhCVs054080;
	Wed, 15 Apr 2009 20:43:12 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200904152043.n3FKhCVs054080@svn.freebsd.org>
From: Ed Schouten 
Date: Wed, 15 Apr 2009 20:43:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191118 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 20:43:13 -0000

Author: ed
Date: Wed Apr 15 20:43:12 2009
New Revision: 191118
URL: http://svn.freebsd.org/changeset/base/191118

Log:
  Remove dead code from devtoname().
  
  In the good old days it was possible to have dev_t's that referred to
  nonexistent devices. In these cases devtoname() automatically generated
  names. This is no longer possible, so remove this dead code.
  
  Discussed with:	kib

Modified:
  head/sys/kern/kern_conf.c

Modified: head/sys/kern/kern_conf.c
==============================================================================
--- head/sys/kern/kern_conf.c	Wed Apr 15 20:34:19 2009	(r191117)
+++ head/sys/kern/kern_conf.c	Wed Apr 15 20:43:12 2009	(r191118)
@@ -859,24 +859,7 @@ destroy_dev(struct cdev *dev)
 const char *
 devtoname(struct cdev *dev)
 {
-	char *p;
-	struct cdevsw *csw;
-	int mynor;
-
-	if (dev->si_name[0] == '#' || dev->si_name[0] == '\0') {
-		p = dev->si_name;
-		csw = dev_refthread(dev);
-		if (csw != NULL) {
-			sprintf(p, "(%s)", csw->d_name);
-			dev_relthread(dev);
-		}
-		p += strlen(p);
-		mynor = dev2unit(dev);
-		if (mynor < 0 || mynor > 255)
-			sprintf(p, "/%#x", (u_int)mynor);
-		else
-			sprintf(p, "/%d", mynor);
-	}
+
 	return (dev->si_name);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 20:49:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 96DE71065675;
	Wed, 15 Apr 2009 20:49:59 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 853F18FC2E;
	Wed, 15 Apr 2009 20:49:59 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FKnx5c054351;
	Wed, 15 Apr 2009 20:49:59 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FKnx47054349;
	Wed, 15 Apr 2009 20:49:59 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904152049.n3FKnx47054349@svn.freebsd.org>
From: Kip Macy 
Date: Wed, 15 Apr 2009 20:49:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191120 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 20:50:00 -0000

Author: kmacy
Date: Wed Apr 15 20:49:59 2009
New Revision: 191120
URL: http://svn.freebsd.org/changeset/base/191120

Log:
  make LLTABLE visible to netinet

Modified:
  head/sys/netinet/if_ether.c
  head/sys/netinet/in_var.h

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c	Wed Apr 15 20:46:47 2009	(r191119)
+++ head/sys/netinet/if_ether.c	Wed Apr 15 20:49:59 2009	(r191120)
@@ -81,8 +81,6 @@ __FBSDID("$FreeBSD$");
 
 #define SIN(s) ((struct sockaddr_in *)s)
 #define SDL(s) ((struct sockaddr_dl *)s)
-#define LLTABLE(ifp)	\
-	((struct in_ifinfo *)(ifp)->if_afdata[AF_INET])->ii_llt
 
 SYSCTL_DECL(_net_link_ether);
 SYSCTL_NODE(_net_link_ether, PF_INET, inet, CTLFLAG_RW, 0, "");

Modified: head/sys/netinet/in_var.h
==============================================================================
--- head/sys/netinet/in_var.h	Wed Apr 15 20:46:47 2009	(r191119)
+++ head/sys/netinet/in_var.h	Wed Apr 15 20:49:59 2009	(r191120)
@@ -95,6 +95,8 @@ struct	in_aliasreq {
 #ifdef	_KERNEL
 extern	u_char	inetctlerrmap[];
 
+#define LLTABLE(ifp)	\
+	((struct in_ifinfo *)(ifp)->if_afdata[AF_INET])->ii_llt
 /*
  * Hash table for IP addresses.
  */

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 20:53:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B73191065676;
	Wed, 15 Apr 2009 20:53:34 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A5AA38FC0A;
	Wed, 15 Apr 2009 20:53:34 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FKrYov054454;
	Wed, 15 Apr 2009 20:53:34 GMT (envelope-from brooks@svn.freebsd.org)
Received: (from brooks@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FKrYAx054453;
	Wed, 15 Apr 2009 20:53:34 GMT (envelope-from brooks@svn.freebsd.org)
Message-Id: <200904152053.n3FKrYAx054453@svn.freebsd.org>
From: Brooks Davis 
Date: Wed, 15 Apr 2009 20:53:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191121 - head/sbin/ifconfig
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 20:53:35 -0000

Author: brooks
Date: Wed Apr 15 20:53:34 2009
New Revision: 191121
URL: http://svn.freebsd.org/changeset/base/191121

Log:
  The structs ifaliasreq and in_aliasreq have exactly the same layout and
  member names, but we really do mean to use in_aliasreq here.
  
  MFC after:	1 week

Modified:
  head/sbin/ifconfig/af_inet.c

Modified: head/sbin/ifconfig/af_inet.c
==============================================================================
--- head/sbin/ifconfig/af_inet.c	Wed Apr 15 20:49:59 2009	(r191120)
+++ head/sbin/ifconfig/af_inet.c	Wed Apr 15 20:53:34 2009	(r191121)
@@ -52,7 +52,7 @@ static const char rcsid[] =
 
 #include "ifconfig.h"
 
-static struct ifaliasreq in_addreq;
+static struct in_aliasreq in_addreq;
 static struct ifreq in_ridreq;
 
 static void
@@ -169,7 +169,7 @@ in_status_tunnel(int s)
 static void
 in_set_tunnel(int s, struct addrinfo *srcres, struct addrinfo *dstres)
 {
-	struct ifaliasreq addreq;
+	struct in_aliasreq addreq;
 
 	memset(&addreq, 0, sizeof(addreq));
 	strncpy(addreq.ifra_name, name, IFNAMSIZ);

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 20:58:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 11F181065673;
	Wed, 15 Apr 2009 20:58:17 +0000 (UTC) (envelope-from ed@hoeg.nl)
Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211])
	by mx1.freebsd.org (Postfix) with ESMTP id A2FEE8FC1B;
	Wed, 15 Apr 2009 20:58:16 +0000 (UTC) (envelope-from ed@hoeg.nl)
Received: by palm.hoeg.nl (Postfix, from userid 1000)
	id 752F21CFFA; Wed, 15 Apr 2009 22:58:15 +0200 (CEST)
Date: Wed, 15 Apr 2009 22:58:15 +0200
From: Ed Schouten 
To: John Baldwin 
Message-ID: <20090415205815.GA58540@hoeg.nl>
References: <200904151958.n3FJwfqD052982@svn.freebsd.org>
	<200904151632.41653.jhb@freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="OXfL5xGRrasGEqWY"
Content-Disposition: inline
In-Reply-To: <200904151632.41653.jhb@freebsd.org>
User-Agent: Mutt/1.5.19 (2009-01-05)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191114 - head/sys/pc98/cbus
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 20:58:18 -0000


--OXfL5xGRrasGEqWY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello John,

* John Baldwin  wrote:
> When I performed similar changes in lpt(4) I stored the flags in si_drv2=
=20
> instead of the minor number.  You might want to do the same here so the=
=20
> drivers are closer.

I guess in the very far future we'll hopefully just get rid of
dev2unit() and allow the struct field that stores the unit number
(si_drv0) to be used by the drivers directly. An advantage of the unit
number is that it's an integer type, unlike si_drv1 and si_drv2.

I guess it's good to just leave it the way it is right now, because it
was the least intrusive way to fix it like this and best of all, if I
ever get the chance to remove dev2unit(), I'm forced to let it use
si_drv0 instead of keeping evil casts from/to pointers.

--=20
 Ed Schouten 
 WWW: http://80386.nl/

--OXfL5xGRrasGEqWY
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAknmSmcACgkQ52SDGA2eCwX2GQCfbuLU+H7LUa/Cir3Fr/lPBmFS
8dwAnjZwzxY2LTqag+/IuZJDr1GCms7Y
=PE5l
-----END PGP SIGNATURE-----

--OXfL5xGRrasGEqWY--

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 21:36:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AD4961065673;
	Wed, 15 Apr 2009 21:36:34 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9B04B8FC13;
	Wed, 15 Apr 2009 21:36:34 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FLaY6x055497;
	Wed, 15 Apr 2009 21:36:34 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FLaYwS055496;
	Wed, 15 Apr 2009 21:36:34 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904152136.n3FLaYwS055496@svn.freebsd.org>
From: Kip Macy 
Date: Wed, 15 Apr 2009 21:36:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191124 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 21:36:36 -0000

Author: kmacy
Date: Wed Apr 15 21:36:34 2009
New Revision: 191124
URL: http://svn.freebsd.org/changeset/base/191124

Log:
  revert RTM_VERSION change - it doesn't do what I thought it does and changing breaks
  ifconfig needlessly

Modified:
  head/sys/net/route.h

Modified: head/sys/net/route.h
==============================================================================
--- head/sys/net/route.h	Wed Apr 15 21:22:29 2009	(r191123)
+++ head/sys/net/route.h	Wed Apr 15 21:36:34 2009	(r191124)
@@ -234,7 +234,7 @@ struct rt_msghdr {
 	struct	rt_metrics rtm_rmx; /* metrics themselves */
 };
 
-#define RTM_VERSION	6	/* Up the ante and ignore older versions */
+#define RTM_VERSION	5	/* Up the ante and ignore older versions */
 
 /*
  * Message types.

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 21:39:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1A2DB10656C1;
	Wed, 15 Apr 2009 21:39:57 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0869A8FC13;
	Wed, 15 Apr 2009 21:39:57 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FLdufW055594;
	Wed, 15 Apr 2009 21:39:56 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FLduZ3055593;
	Wed, 15 Apr 2009 21:39:56 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904152139.n3FLduZ3055593@svn.freebsd.org>
From: Kip Macy 
Date: Wed, 15 Apr 2009 21:39:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191125 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 21:39:57 -0000

Author: kmacy
Date: Wed Apr 15 21:39:56 2009
New Revision: 191125
URL: http://svn.freebsd.org/changeset/base/191125

Log:
  provide additional convenience macros for inpcb locking (upgrade, downgrade, exclusive)

Modified:
  head/sys/netinet/in_pcb.h

Modified: head/sys/netinet/in_pcb.h
==============================================================================
--- head/sys/netinet/in_pcb.h	Wed Apr 15 21:36:34 2009	(r191124)
+++ head/sys/netinet/in_pcb.h	Wed Apr 15 21:39:56 2009	(r191125)
@@ -313,7 +313,10 @@ struct inpcbinfo {
 #define INP_TRY_WLOCK(inp)	rw_try_wlock(&(inp)->inp_lock)
 #define INP_RUNLOCK(inp)	rw_runlock(&(inp)->inp_lock)
 #define INP_WUNLOCK(inp)	rw_wunlock(&(inp)->inp_lock)
-#define INP_LOCK_ASSERT(inp)	rw_assert(&(inp)->inp_lock, RA_LOCKED)
+#define	INP_TRY_UPGRADE(inp)	rw_try_upgrade(&(inp)->inp_lock)
+#define	INP_DOWNGRADE(inp)	rw_downgrade(&(inp)->inp_lock)
+#define	INP_WLOCKED(inp)	rw_wowned(&(inp)->inp_lock)
+#define	INP_LOCK_ASSERT(inp)	rw_assert(&(inp)->inp_lock, RA_LOCKED)
 #define	INP_RLOCK_ASSERT(inp)	rw_assert(&(inp)->inp_lock, RA_RLOCKED)
 #define	INP_WLOCK_ASSERT(inp)	rw_assert(&(inp)->inp_lock, RA_WLOCKED)
 #define	INP_UNLOCK_ASSERT(inp)	rw_assert(&(inp)->inp_lock, RA_UNLOCKED)

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 22:09:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6DE32106566C;
	Wed, 15 Apr 2009 22:09:43 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 514378FC14;
	Wed, 15 Apr 2009 22:09:43 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FM9hvA056231;
	Wed, 15 Apr 2009 22:09:43 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FM9h0O056228;
	Wed, 15 Apr 2009 22:09:43 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904152209.n3FM9h0O056228@svn.freebsd.org>
From: Kip Macy 
Date: Wed, 15 Apr 2009 22:09:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191126 - in head: . sys/netinet sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 22:09:44 -0000

Author: kmacy
Date: Wed Apr 15 22:09:42 2009
New Revision: 191126
URL: http://svn.freebsd.org/changeset/base/191126

Log:
  - add second flags field to to inpcb
  - update comments in vflag

Modified:
  head/UPDATING
  head/sys/netinet/in_pcb.h
  head/sys/sys/param.h

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Wed Apr 15 21:39:56 2009	(r191125)
+++ head/UPDATING	Wed Apr 15 22:09:42 2009	(r191126)
@@ -23,6 +23,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
 	ln -s aj /etc/malloc.conf.)
 
 20090415:
+	Anticipate overflowing inp_flags - add inp_flags2. 
+	This changes most offsets in inpcb, so checking v4 connection
+	state will require a world rebuild. 
+	Bump __FreeBSD_version to 800080.
+20090415:
 	Add an llentry to struct route and struct route_in6. Modules
 	embedding a struct route will need to be recompiled. 
 	Bump __FreeBSD_version to 800079.

Modified: head/sys/netinet/in_pcb.h
==============================================================================
--- head/sys/netinet/in_pcb.h	Wed Apr 15 21:39:56 2009	(r191125)
+++ head/sys/netinet/in_pcb.h	Wed Apr 15 22:09:42 2009	(r191126)
@@ -163,6 +163,7 @@ struct inpcb {
 	struct	ucred	*inp_cred;	/* (c) cache of socket cred */
 	u_int32_t inp_flow;		/* (i) IPv6 flow information */
 	int	inp_flags;		/* (i) generic IP/datagram flags */
+	int	inp_flags2;		/* (i) generic IP/datagram flags #2*/
 	u_char	inp_vflag;		/* (i) IP version flag (v4/v6) */
 	u_char	inp_ip_ttl;		/* (i) time to live proto */
 	u_char	inp_ip_p;		/* (c) protocol proto */
@@ -380,16 +381,14 @@ void 	inp_4tuple_get(struct inpcb *inp, 
 	(ntohs((lport)) & (mask))
 
 /*
- * Flags for inp_vflags -- historically version flags only, but now quite a
- * bit more due to an overflow of inp_flag, leading to some locking ambiguity
- * as some bits are stable from initial allocation, and others may change.
+ * Flags for inp_vflags -- historically version flags only
  */
 #define	INP_IPV4	0x1
 #define	INP_IPV6	0x2
 #define	INP_IPV6PROTO	0x4		/* opened under IPv6 protocol */
 
 /*
- * Flags for inp_flag.
+ * Flags for inp_flags.
  */
 #define	INP_RECVOPTS		0x00000001 /* receive incoming IP options */
 #define	INP_RECVRETOPTS		0x00000002 /* receive IP options for reply */
@@ -431,6 +430,10 @@ void 	inp_4tuple_get(struct inpcb *inp, 
 				 IN6P_TCLASS|IN6P_AUTOFLOWLABEL|IN6P_RFC2292|\
 				 IN6P_MTU)
 
+/*
+ * Flags for inp_flags2.
+ */
+
 #define	INPLOOKUP_WILDCARD	1
 #define	sotoinpcb(so)	((struct inpcb *)(so)->so_pcb)
 #define	sotoin6pcb(so)	sotoinpcb(so) /* for KAME src sync over BSD*'s */

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Wed Apr 15 21:39:56 2009	(r191125)
+++ head/sys/sys/param.h	Wed Apr 15 22:09:42 2009	(r191126)
@@ -57,7 +57,7 @@
  *		is created, otherwise 1.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 800079	/* Master, propagated to newvers */
+#define __FreeBSD_version 800080	/* Master, propagated to newvers */
 
 #ifndef LOCORE
 #include 

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 22:10:33 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E5851065674;
	Wed, 15 Apr 2009 22:10:33 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 81A888FC0A;
	Wed, 15 Apr 2009 22:10:33 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FMAXUI056294;
	Wed, 15 Apr 2009 22:10:33 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FMAXXr056293;
	Wed, 15 Apr 2009 22:10:33 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200904152210.n3FMAXXr056293@svn.freebsd.org>
From: Sam Leffler 
Date: Wed, 15 Apr 2009 22:10:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191127 - head/tools/tools/net80211/wlanwds
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 22:10:34 -0000

Author: sam
Date: Wed Apr 15 22:10:33 2009
New Revision: 191127
URL: http://svn.freebsd.org/changeset/base/191127

Log:
  o remove the -p option; use the %parent pointer sysctl to find the parent ifnet
  o remove the -b option; users can just embed the bridge ifnet in the script
  o add -j option to create wds vaps on join/rejoin ops

Modified:
  head/tools/tools/net80211/wlanwds/wlanwds.c

Modified: head/tools/tools/net80211/wlanwds/wlanwds.c
==============================================================================
--- head/tools/tools/net80211/wlanwds/wlanwds.c	Wed Apr 15 22:09:42 2009	(r191126)
+++ head/tools/tools/net80211/wlanwds/wlanwds.c	Wed Apr 15 22:10:33 2009	(r191127)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2006-2007 Sam Leffler, Errno Consulting
+ * Copyright (c) 2006-2009 Sam Leffler, Errno Consulting
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -39,8 +39,7 @@
  *
  * Note we query only internal state which means if we don't see
  * a vap created we won't handle leave/delete properly.  Also there
- * are several fixed pathnames/strings.  Some require fixing
- * kernel support (e.g. sysctl to find parent device of a vap).
+ * are several fixed pathnames/strings.
  *
  * Code liberaly swiped from wlanwatch; probably should nuke printfs.
  */
@@ -84,10 +83,9 @@ struct wds {
 };
 static struct wds *wds;
 
-static	const char *bridge = "bridge0";
-static	const char *parent = "mv0";		/* XXX no sysctl to find this */
 static	const char *script = "/usr/local/bin/wdsup";
 static	int verbose = 0;
+static	int discover_on_join = 0;
 
 static	void handle_rtmsg(struct rt_msghdr *rtm, int msglen);
 static	void wds_discovery(const char *ifname,
@@ -103,13 +101,10 @@ main(int argc, char *argv[])
 	int n, s, c;
 	char msg[2048];
 
-	while ((c = getopt(argc, argv, "b:p:s:vn")) != -1)
+	while ((c = getopt(argc, argv, "js:vn")) != -1)
 		switch (c) {
-		case 'b':
-			bridge = optarg;
-			break;
-		case 'p':
-			parent = optarg;
+		case 'j':
+			discover_on_join = 1;
 			break;
 		case 's':
 			script = optarg;
@@ -118,8 +113,9 @@ main(int argc, char *argv[])
 			verbose = 1;
 			break;
 		case '?':
-			errx(1, "usage: %s [-b ] [-p ] [-s ]\n"
-				" [-v (for verbose)]\n", argv[0]);
+			errx(1, "usage: %s [-s ]\n"
+				" [-v (for verbose)]\n"
+				" [-j (act on join/rejoin events)]\n", argv[0]);
 			/*NOTREACHED*/
 		}
 
@@ -188,20 +184,23 @@ handle_rtmsg(struct rt_msghdr *rtm, int 
 			if (verbose)
 				printf("\n");
 			break;
+		case RTM_IEEE80211_JOIN:
+		case RTM_IEEE80211_REJOIN:
+			if (!discover_on_join)
+				break;
+			/* fall thru... */
 		case RTM_IEEE80211_WDS:
 			if (verbose)
 				printf("%.19s %s wds discovery", cnow,
 				    ether_sprintf(V(ieee80211_wds_event)->iev_addr));
-			/* XXX wlan0 */
-			wds_discovery("wlan0", V(ieee80211_wds_event)->iev_addr);
+			wds_discovery(ifan->ifan_name,
+			    V(ieee80211_wds_event)->iev_addr);
 			if (verbose)
 				printf("\n");
 			break;
 		case RTM_IEEE80211_ASSOC:
 		case RTM_IEEE80211_REASSOC:
 		case RTM_IEEE80211_DISASSOC:
-		case RTM_IEEE80211_JOIN:
-		case RTM_IEEE80211_REJOIN:
 		case RTM_IEEE80211_SCAN:
 		case RTM_IEEE80211_REPLAY:
 		case RTM_IEEE80211_MICHAEL:
@@ -221,6 +220,8 @@ static void
 wds_discovery(const char *ifname, const uint8_t bssid[IEEE80211_ADDR_LEN])
 {
 	struct wds *p;
+	char oid[256], parent[256];
+	int parentlen;
 
 	for (p = wds; p != NULL; p = p->next)
 		if (IEEE80211_ADDR_EQ(p->bssid, bssid)) {
@@ -228,13 +229,22 @@ wds_discovery(const char *ifname, const 
 				printf(" (already created)");
 			return;
 		}
+
+	/* fetch parent interface name */
+	snprintf(oid, sizeof(oid), "net.wlan.%s.%%parent", ifname+4);
+	parentlen = sizeof(parent);
+	if (sysctlbyname(oid, parent, &parentlen, NULL, 0) < 0) {
+		warn("%s: no pointer to parent interface", __func__);
+		return;
+	}
+	parent[parentlen] = '\0';
+
 	p = malloc(sizeof(struct wds));
 	if (p == NULL) {
 		warn("%s: malloc", __func__);
 		return;
 	}
 	IEEE80211_ADDR_COPY(p->bssid, bssid);
-	/* XXX mv0: no sysctl to find parent device */
 	if (wds_vap_create(parent, p) >= 0) {
 		char cmd[1024];
 		int status;
@@ -249,8 +259,7 @@ wds_discovery(const char *ifname, const 
 		/*
 		 * XXX launch script to setup bridge, etc.
 		 */
-		snprintf(cmd, sizeof(cmd), "%s %s %s",
-			script, p->ifname, bridge);
+		snprintf(cmd, sizeof(cmd), "%s %s", script, p->ifname);
 		status = system(cmd);
 		if (status)
 			warnx("vap setup script %s exited with status %d\n",

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 22:11:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D8159106566B;
	Wed, 15 Apr 2009 22:11:04 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C62558FC18;
	Wed, 15 Apr 2009 22:11:04 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FMB4jj056355;
	Wed, 15 Apr 2009 22:11:04 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FMB40K056354;
	Wed, 15 Apr 2009 22:11:04 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200904152211.n3FMB40K056354@svn.freebsd.org>
From: Sam Leffler 
Date: Wed, 15 Apr 2009 22:11:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191128 - head/tools/tools/net80211/scripts
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 22:11:05 -0000

Author: sam
Date: Wed Apr 15 22:11:04 2009
New Revision: 191128
URL: http://svn.freebsd.org/changeset/base/191128

Log:
  no more need for -p option to wlanwds; it knows how to find the parent now

Modified:
  head/tools/tools/net80211/scripts/setup.wdsmain

Modified: head/tools/tools/net80211/scripts/setup.wdsmain
==============================================================================
--- head/tools/tools/net80211/scripts/setup.wdsmain	Wed Apr 15 22:10:33 2009	(r191127)
+++ head/tools/tools/net80211/scripts/setup.wdsmain	Wed Apr 15 22:11:04 2009	(r191128)
@@ -33,7 +33,7 @@ ifconfig $BRIDGE addm \$DEV
 ifconfig \$DEV up
 EOF
 chmod +x $WDSUP
-$WLANWDS -v -p $WIRELESS -s $WDSUP &
+$WLANWDS -v -s $WDSUP &
 
 ifconfig $BRIDGE addm $WLAN_AP addm $WIRED up
 ifconfig $WIRED up

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 22:22:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C16A1106564A;
	Wed, 15 Apr 2009 22:22:00 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AFB478FC0A;
	Wed, 15 Apr 2009 22:22:00 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FMM0CQ056564;
	Wed, 15 Apr 2009 22:22:00 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FMM0U0056563;
	Wed, 15 Apr 2009 22:22:00 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904152222.n3FMM0U0056563@svn.freebsd.org>
From: Kip Macy 
Date: Wed, 15 Apr 2009 22:22:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191129 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 22:22:01 -0000

Author: kmacy
Date: Wed Apr 15 22:22:00 2009
New Revision: 191129
URL: http://svn.freebsd.org/changeset/base/191129

Log:
  - convert pspare pointers in inpcb to an llentry and rtentry cache
  - add flags to indicate their validity

Modified:
  head/sys/netinet/in_pcb.h

Modified: head/sys/netinet/in_pcb.h
==============================================================================
--- head/sys/netinet/in_pcb.h	Wed Apr 15 22:11:04 2009	(r191128)
+++ head/sys/netinet/in_pcb.h	Wed Apr 15 22:22:00 2009	(r191129)
@@ -170,7 +170,8 @@ struct inpcb {
 	u_char	inp_ip_minttl;		/* (i) minimum TTL or drop */
 	uint32_t inp_flowid;		/* (x) flow id / queue id */
 	u_int	inp_refcount;		/* (i) refcount */
-	void	*inp_pspare[2];		/* (x) rtentry / general use */
+	struct llentry	*inp_lle;	/* cached L2 information */
+	struct rtentry	*inp_rt;	/* cached L3 information */
 
 	/* Local and foreign ports, local and foreign addr. */
 	struct	in_conninfo inp_inc;	/* (i/p) list for PCB's local port */
@@ -433,6 +434,8 @@ void 	inp_4tuple_get(struct inpcb *inp, 
 /*
  * Flags for inp_flags2.
  */
+#define	INP_LLE_VALID		0x00000001 /* cached lle is valid */	
+#define	INP_RT_VALID		0x00000002 /* cached rtentry is valid */
 
 #define	INPLOOKUP_WILDCARD	1
 #define	sotoinpcb(so)	((struct inpcb *)(so)->so_pcb)

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 15 22:38:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 56B1810656CF;
	Wed, 15 Apr 2009 22:38:23 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 426C28FC23;
	Wed, 15 Apr 2009 22:38:23 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FMcNCJ056921;
	Wed, 15 Apr 2009 22:38:23 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FMcMmt056914;
	Wed, 15 Apr 2009 22:38:22 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200904152238.n3FMcMmt056914@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 15 Apr 2009 22:38:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191130 - in head/sys: amd64/conf conf geom/part
	i386/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 15 Apr 2009 22:38:24 -0000

Author: marcel
Date: Wed Apr 15 22:38:22 2009
New Revision: 191130
URL: http://svn.freebsd.org/changeset/base/191130

Log:
  Add a compat option to the EBR scheme that controls the
  naming of the partitions (GEOM_PART_EBR_COMPAT).  When
  compatibility is enabled, changes to the partitioning are
  disallowed.
  
  Remove the device name aliasing added previously to provide
  backward compatibility, but which in practice doesn't give
  us anything.
  
  Enable compatibility on amd64 and i386.

Modified:
  head/sys/amd64/conf/DEFAULTS
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/geom/part/g_part.c
  head/sys/geom/part/g_part_ebr.c
  head/sys/geom/part/g_part_if.m
  head/sys/i386/conf/DEFAULTS

Modified: head/sys/amd64/conf/DEFAULTS
==============================================================================
--- head/sys/amd64/conf/DEFAULTS	Wed Apr 15 22:22:00 2009	(r191129)
+++ head/sys/amd64/conf/DEFAULTS	Wed Apr 15 22:38:22 2009	(r191130)
@@ -18,4 +18,5 @@ device		uart_ns8250
 # Default partitioning schemes
 options 	GEOM_PART_BSD
 options 	GEOM_PART_EBR
+options 	GEOM_PART_EBR_COMPAT
 options 	GEOM_PART_MBR

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Wed Apr 15 22:22:00 2009	(r191129)
+++ head/sys/conf/NOTES	Wed Apr 15 22:38:22 2009	(r191130)
@@ -148,6 +148,7 @@ options 	GEOM_NOP		# Test class.
 options 	GEOM_PART_APM		# Apple partitioning
 options 	GEOM_PART_BSD		# BSD disklabel
 options 	GEOM_PART_EBR		# Extended Boot Records
+options 	GEOM_PART_EBR_COMPAT	# Backward compatible partition names
 options 	GEOM_PART_GPT		# GPT partitioning
 options 	GEOM_PART_MBR		# MBR partitioning
 options 	GEOM_PART_PC98		# PC-9800 disk partitioning

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Wed Apr 15 22:22:00 2009	(r191129)
+++ head/sys/conf/options	Wed Apr 15 22:38:22 2009	(r191130)
@@ -93,6 +93,7 @@ GEOM_NOP	opt_geom.h
 GEOM_PART_APM	opt_geom.h
 GEOM_PART_BSD	opt_geom.h
 GEOM_PART_EBR	opt_geom.h
+GEOM_PART_EBR_COMPAT	opt_geom.h
 GEOM_PART_GPT	opt_geom.h
 GEOM_PART_MBR	opt_geom.h
 GEOM_PART_PC98	opt_geom.h

Modified: head/sys/geom/part/g_part.c
==============================================================================
--- head/sys/geom/part/g_part.c	Wed Apr 15 22:22:00 2009	(r191129)
+++ head/sys/geom/part/g_part.c	Wed Apr 15 22:38:22 2009	(r191130)
@@ -245,9 +245,9 @@ static void
 g_part_new_provider(struct g_geom *gp, struct g_part_table *table,
     struct g_part_entry *entry)
 {
-	char buf[32];
 	struct g_consumer *cp;
 	struct g_provider *pp;
+	struct sbuf *sb;
 	off_t offset;
 
 	cp = LIST_FIRST(&gp->consumer);
@@ -258,8 +258,11 @@ g_part_new_provider(struct g_geom *gp, s
 		entry->gpe_offset = offset;
 
 	if (entry->gpe_pp == NULL) {
-		entry->gpe_pp = g_new_providerf(gp, "%s%s", gp->name,
-		    G_PART_NAME(table, entry, buf, sizeof(buf)));
+		sb = sbuf_new_auto();
+		G_PART_FULLNAME(table, entry, sb, gp->name);
+		sbuf_finish(sb);
+		entry->gpe_pp = g_new_providerf(gp, "%s", sbuf_data(sb));
+		sbuf_delete(sb);
 		entry->gpe_pp->private = entry;		/* Close the circle. */
 	}
 	entry->gpe_pp->index = entry->gpe_index - 1;	/* index is 1-based. */
@@ -413,7 +416,6 @@ done:
 static int
 g_part_ctl_add(struct gctl_req *req, struct g_part_parms *gpp)
 {
-	char buf[32];
 	struct g_geom *gp;
 	struct g_provider *pp;
 	struct g_part_entry *delent, *last, *entry;
@@ -509,8 +511,8 @@ g_part_ctl_add(struct gctl_req *req, str
 	/* Provide feedback if so requested. */
 	if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
 		sb = sbuf_new_auto();
-		sbuf_printf(sb, "%s%s added\n", gp->name,
-		    G_PART_NAME(table, entry, buf, sizeof(buf)));
+		G_PART_FULLNAME(table, entry, sb, gp->name);
+		sbuf_cat(sb, " added\n");
 		sbuf_finish(sb);
 		gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
 		sbuf_delete(sb);
@@ -773,7 +775,6 @@ fail:
 static int
 g_part_ctl_delete(struct gctl_req *req, struct g_part_parms *gpp)
 {
-	char buf[32];
 	struct g_geom *gp;
 	struct g_provider *pp;
 	struct g_part_entry *entry;
@@ -822,8 +823,8 @@ g_part_ctl_delete(struct gctl_req *req, 
 	/* Provide feedback if so requested. */
 	if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
 		sb = sbuf_new_auto();
-		sbuf_printf(sb, "%s%s deleted\n", gp->name,
-		    G_PART_NAME(table, entry, buf, sizeof(buf)));
+		G_PART_FULLNAME(table, entry, sb, gp->name);
+		sbuf_cat(sb, " deleted\n");
 		sbuf_finish(sb);
 		gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
 		sbuf_delete(sb);
@@ -889,7 +890,6 @@ g_part_ctl_destroy(struct gctl_req *req,
 static int
 g_part_ctl_modify(struct gctl_req *req, struct g_part_parms *gpp)
 {
-	char buf[32];
 	struct g_geom *gp;
 	struct g_part_entry *entry;
 	struct g_part_table *table;
@@ -925,8 +925,8 @@ g_part_ctl_modify(struct gctl_req *req, 
 	/* Provide feedback if so requested. */
 	if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
 		sb = sbuf_new_auto();
-		sbuf_printf(sb, "%s%s modified\n", gp->name,
-		    G_PART_NAME(table, entry, buf, sizeof(buf)));
+		G_PART_FULLNAME(table, entry, sb, gp->name);
+		sbuf_cat(sb, " modified\n");
 		sbuf_finish(sb);
 		gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
 		sbuf_delete(sb);
@@ -959,7 +959,6 @@ static int
 g_part_ctl_setunset(struct gctl_req *req, struct g_part_parms *gpp,
     unsigned int set)
 {
-	char buf[32];
 	struct g_geom *gp;
 	struct g_part_entry *entry;
 	struct g_part_table *table;
@@ -992,9 +991,9 @@ g_part_ctl_setunset(struct gctl_req *req
 	/* Provide feedback if so requested. */
 	if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
 		sb = sbuf_new_auto();
-		sbuf_printf(sb, "%s%s has %s %sset\n", gp->name,
-		    G_PART_NAME(table, entry, buf, sizeof(buf)),
-		    gpp->gpp_attrib, (set) ? "" : "un");
+		G_PART_FULLNAME(table, entry, sb, gp->name);
+		sbuf_printf(sb, " has %s %sset\n", gpp->gpp_attrib,
+		    (set) ? "" : "un");
 		sbuf_finish(sb);
 		gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
 		sbuf_delete(sb);

Modified: head/sys/geom/part/g_part_ebr.c
==============================================================================
--- head/sys/geom/part/g_part_ebr.c	Wed Apr 15 22:22:00 2009	(r191129)
+++ head/sys/geom/part/g_part_ebr.c	Wed Apr 15 22:38:22 2009	(r191130)
@@ -24,6 +24,8 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "opt_geom.h"
+
 #include 
 __FBSDID("$FreeBSD$");
 
@@ -54,18 +56,19 @@ struct g_part_ebr_table {
 struct g_part_ebr_entry {
 	struct g_part_entry	base;
 	struct dos_partition	ent;
-	int	alias;
 };
 
 static int g_part_ebr_add(struct g_part_table *, struct g_part_entry *,
     struct g_part_parms *);
 static int g_part_ebr_create(struct g_part_table *, struct g_part_parms *);
 static int g_part_ebr_destroy(struct g_part_table *, struct g_part_parms *);
-static int g_part_ebr_devalias(struct g_part_table *, struct g_part_entry *,
-    char *, size_t);
 static void g_part_ebr_dumpconf(struct g_part_table *, struct g_part_entry *,
     struct sbuf *, const char *);
 static int g_part_ebr_dumpto(struct g_part_table *, struct g_part_entry *);
+#if defined(GEOM_PART_EBR_COMPAT)
+static void g_part_ebr_fullname(struct g_part_table *, struct g_part_entry *,
+    struct sbuf *, const char *);
+#endif
 static int g_part_ebr_modify(struct g_part_table *, struct g_part_entry *,  
     struct g_part_parms *);
 static const char *g_part_ebr_name(struct g_part_table *, struct g_part_entry *,
@@ -84,9 +87,11 @@ static kobj_method_t g_part_ebr_methods[
 	KOBJMETHOD(g_part_add,		g_part_ebr_add),
 	KOBJMETHOD(g_part_create,	g_part_ebr_create),
 	KOBJMETHOD(g_part_destroy,	g_part_ebr_destroy),
-	KOBJMETHOD(g_part_devalias,	g_part_ebr_devalias),
 	KOBJMETHOD(g_part_dumpconf,	g_part_ebr_dumpconf),
 	KOBJMETHOD(g_part_dumpto,	g_part_ebr_dumpto),
+#if defined(GEOM_PART_EBR_COMPAT)
+	KOBJMETHOD(g_part_fullname,	g_part_ebr_fullname),
+#endif
 	KOBJMETHOD(g_part_modify,	g_part_ebr_modify),
 	KOBJMETHOD(g_part_name,		g_part_ebr_name),
 	KOBJMETHOD(g_part_precheck,	g_part_ebr_precheck),
@@ -274,25 +279,6 @@ g_part_ebr_destroy(struct g_part_table *
 	return (0);
 }
 
-static int
-g_part_ebr_devalias(struct g_part_table *table, struct g_part_entry *baseentry,
-    char *buf, size_t bufsz)
-{
-	struct g_part_ebr_entry *entry;
-	size_t len;
-
-	entry = (struct g_part_ebr_entry *)baseentry;
-	if (entry->alias == 0)
-		return (ENOENT);
-
-	len = strlcpy(buf, table->gpt_gp->name, bufsz);
-	if (len == 0)
-		return (EINVAL);
-
-	snprintf(buf + len - 1, bufsz - len, "%d", entry->alias);
-	return (0);
-}
-
 static void
 g_part_ebr_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, 
     struct sbuf *sb, const char *indent)
@@ -324,6 +310,24 @@ g_part_ebr_dumpto(struct g_part_table *t
 	return ((entry->ent.dp_typ == DOSPTYP_386BSD) ? 1 : 0);
 }
 
+#if defined(GEOM_PART_EBR_COMPAT)
+static void
+g_part_ebr_fullname(struct g_part_table *table, struct g_part_entry *entry,
+    struct sbuf *sb, const char *pfx)
+{
+	struct g_part_entry *iter;
+	u_int idx;
+
+	idx = 5;
+	LIST_FOREACH(iter, &table->gpt_entry, gpe_entry) {
+		if (iter == entry)
+			break;
+		idx++;
+	}
+	sbuf_printf(sb, "%.*s%u", strlen(pfx) - 1, pfx, idx);
+}
+#endif
+
 static int
 g_part_ebr_modify(struct g_part_table *basetable,
     struct g_part_entry *baseentry, struct g_part_parms *gpp)
@@ -352,7 +356,9 @@ static int
 g_part_ebr_precheck(struct g_part_table *table, enum g_part_ctl req,
     struct g_part_parms *gpp)
 {
-
+#if defined(GEOM_PART_EBR_COMPAT)
+	return (ECANCELED);
+#else
 	/*
 	 * The index is a function of the start of the partition.
 	 * This is not something the user can override, nor is it
@@ -361,8 +367,8 @@ g_part_ebr_precheck(struct g_part_table 
 	 */
 	if (req == G_PART_CTL_ADD)
 		gpp->gpp_index = (gpp->gpp_start / table->gpt_sectors) + 1;
-
 	return (0);
+#endif
 }
 
 static int
@@ -444,13 +450,12 @@ g_part_ebr_read(struct g_part_table *bas
 	u_char *buf;
 	off_t ofs, msize;
 	u_int lba;
-	int alias, error, index;
+	int error, index;
 
 	pp = cp->provider;
 	table = (struct g_part_ebr_table *)basetable;
 	msize = pp->mediasize / pp->sectorsize;
 
-	alias = 5;
 	lba = 0;
 	while (1) {
 		ofs = (off_t)lba * pp->sectorsize;
@@ -477,7 +482,6 @@ g_part_ebr_read(struct g_part_table *bas
 		    pp->sectorsize;
 		entry = (struct g_part_ebr_entry *)baseentry;
 		entry->ent = ent[0];
-		entry->alias = alias++;
 
 		if (ent[1].dp_typ == 0)
 			break;

Modified: head/sys/geom/part/g_part_if.m
==============================================================================
--- head/sys/geom/part/g_part_if.m	Wed Apr 15 22:22:00 2009	(r191129)
+++ head/sys/geom/part/g_part_if.m	Wed Apr 15 22:38:22 2009	(r191130)
@@ -42,6 +42,16 @@ INTERFACE g_part;
 
 # Default implementations of methods.
 CODE {
+	static void
+	default_fullname(struct g_part_table *table,
+	    struct g_part_entry *entry, struct sbuf *sb, const char *pfx)
+	{
+		char buf[32];
+
+		sbuf_printf(sb, "%s%s", pfx,
+		    G_PART_NAME(table, entry, buf, sizeof(buf)));
+	}
+
 	static int
 	default_precheck(struct g_part_table *t __unused,
 	    enum g_part_ctl r __unused, struct g_part_parms *p __unused)
@@ -98,6 +108,14 @@ METHOD int dumpto {
 	struct g_part_entry *entry;
 };
 
+# fullname() - write the name of the given partition entry to the sbuf.
+METHOD void fullname {
+	struct g_part_table *table;
+	struct g_part_entry *entry;
+	struct sbuf *sb;
+	const char *pfx;
+} DEFAULT default_fullname;
+
 # modify() - scheme specific processing for the modify verb.
 METHOD int modify {
 	struct g_part_table *table;

Modified: head/sys/i386/conf/DEFAULTS
==============================================================================
--- head/sys/i386/conf/DEFAULTS	Wed Apr 15 22:22:00 2009	(r191129)
+++ head/sys/i386/conf/DEFAULTS	Wed Apr 15 22:38:22 2009	(r191130)
@@ -22,6 +22,7 @@ device		uart_ns8250
 # Default partitioning schemes
 options 	GEOM_PART_BSD
 options 	GEOM_PART_EBR
+options 	GEOM_PART_EBR_COMPAT
 options 	GEOM_PART_MBR
 
 # enable support for native hardware

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 05:52:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 51EAA106564A;
	Thu, 16 Apr 2009 05:52:48 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 410398FC0A;
	Thu, 16 Apr 2009 05:52:48 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3G5qm1X069963;
	Thu, 16 Apr 2009 05:52:48 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3G5qmGc069962;
	Thu, 16 Apr 2009 05:52:48 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200904160552.n3G5qmGc069962@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Thu, 16 Apr 2009 05:52:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191134 - head/sys/geom/part
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 05:52:48 -0000

Author: marcel
Date: Thu Apr 16 05:52:47 2009
New Revision: 191134
URL: http://svn.freebsd.org/changeset/base/191134

Log:
  Precision '*' expects an int and strlen() returns a size_t.
  Compensate.

Modified:
  head/sys/geom/part/g_part_ebr.c

Modified: head/sys/geom/part/g_part_ebr.c
==============================================================================
--- head/sys/geom/part/g_part_ebr.c	Thu Apr 16 04:05:39 2009	(r191133)
+++ head/sys/geom/part/g_part_ebr.c	Thu Apr 16 05:52:47 2009	(r191134)
@@ -324,7 +324,7 @@ g_part_ebr_fullname(struct g_part_table 
 			break;
 		idx++;
 	}
-	sbuf_printf(sb, "%.*s%u", strlen(pfx) - 1, pfx, idx);
+	sbuf_printf(sb, "%.*s%u", (int)strlen(pfx) - 1, pfx, idx);
 }
 #endif
 

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 09:33:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 01038106566B;
	Thu, 16 Apr 2009 09:33:53 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E3D9B8FC18;
	Thu, 16 Apr 2009 09:33:52 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3G9XqXt075496;
	Thu, 16 Apr 2009 09:33:52 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3G9Xqrs075495;
	Thu, 16 Apr 2009 09:33:52 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200904160933.n3G9Xqrs075495@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 16 Apr 2009 09:33:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191135 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 09:33:53 -0000

Author: kib
Date: Thu Apr 16 09:33:52 2009
New Revision: 191135
URL: http://svn.freebsd.org/changeset/base/191135

Log:
  Export the number of times bufdaemon got help from the normal threads.

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Thu Apr 16 05:52:47 2009	(r191134)
+++ head/sys/kern/vfs_bio.c	Thu Apr 16 09:33:52 2009	(r191135)
@@ -202,6 +202,9 @@ SYSCTL_INT(_vfs, OID_AUTO, getnewbufrest
 static int flushbufqtarget = 100;
 SYSCTL_INT(_vfs, OID_AUTO, flushbufqtarget, CTLFLAG_RW, &flushbufqtarget, 0,
     "Amount of work to do in flushbufqueues when helping bufdaemon");
+static long notbufdflashes;
+SYSCTL_LONG(_vfs, OID_AUTO, notbufdflashes, CTLFLAG_RD, ¬bufdflashes, 0,
+    "Number of dirty buffer flushes done by the bufdaemon helpers");
 
 /*
  * Wakeup point for bufdaemon, as well as indicator of whether it is already
@@ -2281,6 +2284,7 @@ flushbufqueues(struct vnode *lvp, int qu
 			else {
 				bremfree(bp);
 				bwrite(bp);
+				notbufdflashes++;
 			}
 			vn_finished_write(mp);
 			VOP_UNLOCK(vp, 0);

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 09:37:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B8A1A1065689;
	Thu, 16 Apr 2009 09:37:48 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A6D958FC0C;
	Thu, 16 Apr 2009 09:37:48 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3G9bmjK075615;
	Thu, 16 Apr 2009 09:37:48 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3G9bmwb075614;
	Thu, 16 Apr 2009 09:37:48 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200904160937.n3G9bmwb075614@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 16 Apr 2009 09:37:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191136 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 09:37:49 -0000

Author: kib
Date: Thu Apr 16 09:37:48 2009
New Revision: 191136
URL: http://svn.freebsd.org/changeset/base/191136

Log:
  In flushbufqueues(), do not allocate sentinel buffer on the stack,
  struct buf is large. Use sleeping malloc(9) call, and zero the allocated
  buf as a debugging feature.

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Thu Apr 16 09:33:52 2009	(r191135)
+++ head/sys/kern/vfs_bio.c	Thu Apr 16 09:37:48 2009	(r191136)
@@ -2189,7 +2189,7 @@ SYSCTL_INT(_vfs, OID_AUTO, flushwithdeps
 static int
 flushbufqueues(struct vnode *lvp, int queue, int flushdeps)
 {
-	struct buf sentinel;
+	struct buf *sentinel;
 	struct vnode *vp;
 	struct mount *mp;
 	struct buf *bp;
@@ -2205,14 +2205,15 @@ flushbufqueues(struct vnode *lvp, int qu
 		target = flushbufqtarget;
 	flushed = 0;
 	bp = NULL;
-	sentinel.b_qindex = QUEUE_SENTINEL;
+	sentinel = malloc(sizeof(struct buf), M_TEMP, M_WAITOK | M_ZERO);
+	sentinel->b_qindex = QUEUE_SENTINEL;
 	mtx_lock(&bqlock);
-	TAILQ_INSERT_HEAD(&bufqueues[queue], &sentinel, b_freelist);
+	TAILQ_INSERT_HEAD(&bufqueues[queue], sentinel, b_freelist);
 	while (flushed != target) {
-		bp = TAILQ_NEXT(&sentinel, b_freelist);
+		bp = TAILQ_NEXT(sentinel, b_freelist);
 		if (bp != NULL) {
-			TAILQ_REMOVE(&bufqueues[queue], &sentinel, b_freelist);
-			TAILQ_INSERT_AFTER(&bufqueues[queue], bp, &sentinel,
+			TAILQ_REMOVE(&bufqueues[queue], sentinel, b_freelist);
+			TAILQ_INSERT_AFTER(&bufqueues[queue], bp, sentinel,
 			    b_freelist);
 		} else
 			break;
@@ -2304,8 +2305,9 @@ flushbufqueues(struct vnode *lvp, int qu
 		vn_finished_write(mp);
 		BUF_UNLOCK(bp);
 	}
-	TAILQ_REMOVE(&bufqueues[queue], &sentinel, b_freelist);
+	TAILQ_REMOVE(&bufqueues[queue], sentinel, b_freelist);
 	mtx_unlock(&bqlock);
+	free(sentinel, M_TEMP);
 	return (flushed);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 09:57:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6990F106566C;
	Thu, 16 Apr 2009 09:57:08 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 577D98FC1A;
	Thu, 16 Apr 2009 09:57:08 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3G9v8am076067;
	Thu, 16 Apr 2009 09:57:08 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3G9v8ko076066;
	Thu, 16 Apr 2009 09:57:08 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <200904160957.n3G9v8ko076066@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 16 Apr 2009 09:57:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191137 - head/sys/ufs/ufs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 09:57:09 -0000

Author: kib
Date: Thu Apr 16 09:57:08 2009
New Revision: 191137
URL: http://svn.freebsd.org/changeset/base/191137

Log:
  Verify that '..' still exists with the same inode number after
  VFS_VGET() has returned in ufs_lookup(). If the '..' lookup started
  immediately before the parent directory was removed, we might return
  either cleared or unrelated inode otherwise.
  
  Ufs_lookup() is split into new function ufs_lookup_() that either does
  lookup, or verifies that directory entry exists and references supplied
  inode number.
  
  Reviewed by:	tegge
  Tested by:	pho,
  	Andreas Tobler  (previous version)
  MFC after:	1 month

Modified:
  head/sys/ufs/ufs/ufs_lookup.c

Modified: head/sys/ufs/ufs/ufs_lookup.c
==============================================================================
--- head/sys/ufs/ufs/ufs_lookup.c	Thu Apr 16 09:37:48 2009	(r191136)
+++ head/sys/ufs/ufs/ufs_lookup.c	Thu Apr 16 09:57:08 2009	(r191137)
@@ -77,6 +77,9 @@ SYSCTL_INT(_debug, OID_AUTO, dircheck, C
 /* true if old FS format...*/
 #define OFSFMT(vp)	((vp)->v_mount->mnt_maxsymlinklen <= 0)
 
+static int ufs_lookup_(struct vnode *, struct vnode **, struct componentname *,
+    ino_t);
+
 /*
  * Convert a component of a pathname into a pointer to a locked inode.
  * This is a very central and rather complicated routine.
@@ -130,7 +133,14 @@ ufs_lookup(ap)
 		struct componentname *a_cnp;
 	} */ *ap;
 {
-	struct vnode *vdp;		/* vnode for directory being searched */
+
+	return (ufs_lookup_(ap->a_dvp, ap->a_vpp, ap->a_cnp, 0));
+}
+
+static int
+ufs_lookup_(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp,
+    ino_t dd_ino)
+{
 	struct inode *dp;		/* inode for directory being searched */
 	struct buf *bp;			/* a buffer of directory entries */
 	struct direct *ep;		/* the current directory entry */
@@ -150,8 +160,6 @@ ufs_lookup(ap)
 	doff_t enduseful;		/* pointer past last used dir slot */
 	u_long bmask;			/* block offset mask */
 	int namlen, error;
-	struct vnode **vpp = ap->a_vpp;
-	struct componentname *cnp = ap->a_cnp;
 	struct ucred *cred = cnp->cn_cred;
 	int flags = cnp->cn_flags;
 	int nameiop = cnp->cn_nameiop;
@@ -164,9 +172,9 @@ ufs_lookup(ap)
  *  XXX there was a soft-update diff about this I couldn't merge.
  * I think this was the equiv.
  */
-	*vpp = NULL;
+	if (vpp != NULL)
+		*vpp = NULL;
 
-	vdp = ap->a_dvp;
 	dp = VTOI(vdp);
 
 	/*
@@ -363,7 +371,7 @@ foundentry:
 					slotoffset = i_offset;
 					slotsize = ep->d_reclen;
 					enduseful = dp->i_size;
-					ap->a_cnp->cn_flags |= ISWHITEOUT;
+					cnp->cn_flags |= ISWHITEOUT;
 					numdirpasses--;
 					goto notfound;
 				}
@@ -397,8 +405,8 @@ notfound:
 	 */
 	if ((nameiop == CREATE || nameiop == RENAME ||
 	     (nameiop == DELETE &&
-	      (ap->a_cnp->cn_flags & DOWHITEOUT) &&
-	      (ap->a_cnp->cn_flags & ISWHITEOUT))) &&
+	      (cnp->cn_flags & DOWHITEOUT) &&
+	      (cnp->cn_flags & ISWHITEOUT))) &&
 	    (flags & ISLASTCN) && dp->i_effnlink != 0) {
 		/*
 		 * Access for write is interpreted as allowing
@@ -453,7 +461,7 @@ notfound:
 	 * Insert name into cache (as non-existent) if appropriate.
 	 */
 	if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE)
-		cache_enter(vdp, *vpp, cnp);
+		cache_enter(vdp, NULL, cnp);
 	return (ENOENT);
 
 found:
@@ -479,6 +487,12 @@ found:
 	if ((flags & ISLASTCN) && nameiop == LOOKUP)
 		dp->i_diroff = i_offset &~ (DIRBLKSIZ - 1);
 
+	if (dd_ino != 0) {
+		if (ino != dd_ino)
+			return (ENOENT);
+		return (0);
+	}
+
 	/*
 	 * If deleting, and at end of pathname, return
 	 * parameters which can be used to remove file.
@@ -580,6 +594,18 @@ found:
 		error = vn_vget_ino(pdp, ino, cnp->cn_lkflags, &tdp);
 		if (error)
 			return (error);
+
+		/*
+		 * Recheck that ".." entry in the vdp directory points
+		 * to the inode we looked up before vdp lock was
+		 * dropped.
+		 */
+		error = ufs_lookup_(pdp, NULL, cnp, ino);
+		if (error) {
+			vput(tdp);
+			return (error);
+		}
+
 		*vpp = tdp;
 	} else if (dp->i_number == ino) {
 		VREF(vdp);	/* we want ourself, ie "." */

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 11:09:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E7CC21065674;
	Thu, 16 Apr 2009 11:09:13 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D3F2A8FC0A;
	Thu, 16 Apr 2009 11:09:13 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GB9DaV078410;
	Thu, 16 Apr 2009 11:09:13 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GB9DCP078409;
	Thu, 16 Apr 2009 11:09:13 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200904161109.n3GB9DCP078409@svn.freebsd.org>
From: Robert Watson 
Date: Thu, 16 Apr 2009 11:09:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191138 - in head/sys: dev/ar dev/ray dev/sr modules
	modules/ar modules/netgraph/sync_ar modules/netgraph/sync_sr
	modules/ray modules/sr
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 11:09:14 -0000

Author: rwatson
Date: Thu Apr 16 11:09:13 2009
New Revision: 191138
URL: http://svn.freebsd.org/changeset/base/191138

Log:
  Garbage collect unbuildable and unusable non-MPSAFE network device
  drivers that depended on the historic IFF_NEEDSGIANT compatibility
  mechanism:
  
    ar(4)
    ray(4)
    sr(4)
  
  Discussed on:	arch@

Deleted:
  head/sys/dev/ar/
  head/sys/dev/ray/
  head/sys/dev/sr/
  head/sys/modules/ar/
  head/sys/modules/netgraph/sync_ar/
  head/sys/modules/netgraph/sync_sr/
  head/sys/modules/ray/
  head/sys/modules/sr/
Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Thu Apr 16 09:57:08 2009	(r191137)
+++ head/sys/modules/Makefile	Thu Apr 16 11:09:13 2009	(r191138)
@@ -539,7 +539,6 @@ _zfs=		zfs
 #	nsp s3 sbni stg vesa
 # acpi is not enabled because it is broken as a module on ia64
 _aic=		aic
-#_ar=		ar	not 64-bit clean
 _an=		an
 _arcnet=	arcnet
 _asr=		asr
@@ -564,7 +563,6 @@ _smbfs=		smbfs
 _sound=		sound
 _splash=	splash
 _sppp=		sppp
-#_sr=		sr		not 64bit clean
 _streams=	streams
 _wi=		wi
 _xe=		xe

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 11:09:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6F21F1065686;
	Thu, 16 Apr 2009 11:09:59 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 518638FC12;
	Thu, 16 Apr 2009 11:09:59 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GB9xcv078458;
	Thu, 16 Apr 2009 11:09:59 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GB9xlT078457;
	Thu, 16 Apr 2009 11:09:59 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200904161109.n3GB9xlT078457@svn.freebsd.org>
From: Robert Watson 
Date: Thu, 16 Apr 2009 11:09:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191139 - head/share/man/man4/man4.i386
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 11:10:06 -0000

Author: rwatson
Date: Thu Apr 16 11:09:59 2009
New Revision: 191139
URL: http://svn.freebsd.org/changeset/base/191139

Log:
  Remove man pages ar(4), ray(4), and sr(4) following removal of these
  non-MPSAFE device drivers.

Deleted:
  head/share/man/man4/man4.i386/ar.4
  head/share/man/man4/man4.i386/ray.4
  head/share/man/man4/man4.i386/sr.4
Modified:
  head/share/man/man4/man4.i386/Makefile

Modified: head/share/man/man4/man4.i386/Makefile
==============================================================================
--- head/share/man/man4/man4.i386/Makefile	Thu Apr 16 11:09:13 2009	(r191138)
+++ head/share/man/man4/man4.i386/Makefile	Thu Apr 16 11:09:59 2009	(r191139)
@@ -4,7 +4,6 @@ MAN=	aic.4 \
 	alpm.4 \
 	amdpm.4 \
 	apm.4 \
-	ar.4 \
 	ce.4 \
 	cp.4 \
 	CPU_ELAN.4 \
@@ -29,12 +28,10 @@ MAN=	aic.4 \
 	perfmon.4 \
 	pnp.4 \
 	pnpbios.4 \
-	ray.4 \
 	sbni.4 \
 	scd.4 \
 	smapi.4 \
 	snc.4 \
-	sr.4 \
 	streams.4 \
 	svr4.4 \
 	viapm.4 \

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 11:20:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 58C6C106566B;
	Thu, 16 Apr 2009 11:20:19 +0000 (UTC) (envelope-from raj@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3DE378FC1D;
	Thu, 16 Apr 2009 11:20:19 +0000 (UTC) (envelope-from raj@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GBKJQE078717;
	Thu, 16 Apr 2009 11:20:19 GMT (envelope-from raj@svn.freebsd.org)
Received: (from raj@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GBKIfn078711;
	Thu, 16 Apr 2009 11:20:18 GMT (envelope-from raj@svn.freebsd.org)
Message-Id: <200904161120.n3GBKIfn078711@svn.freebsd.org>
From: Rafal Jaworowski 
Date: Thu, 16 Apr 2009 11:20:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191140 - in head/sys: arm/mv dev/mge
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 11:20:20 -0000

Author: raj
Date: Thu Apr 16 11:20:18 2009
New Revision: 191140
URL: http://svn.freebsd.org/changeset/base/191140

Log:
  Adjust Marvell Discovery (MV78xxx) support to recognize newest chip revisions,
  handle Z0 revision (early silicon) explicitly due to its quirks.
  
  Obtained from:	Marvell, Semihalf

Modified:
  head/sys/arm/mv/common.c
  head/sys/arm/mv/gpio.c
  head/sys/arm/mv/ic.c
  head/sys/arm/mv/mv_pci.c
  head/sys/arm/mv/mvreg.h
  head/sys/dev/mge/if_mge.c

Modified: head/sys/arm/mv/common.c
==============================================================================
--- head/sys/arm/mv/common.c	Thu Apr 16 11:09:59 2009	(r191139)
+++ head/sys/arm/mv/common.c	Thu Apr 16 11:20:18 2009	(r191140)
@@ -91,7 +91,8 @@ cpu_extra_feat(void)
 	uint32_t ef = 0;
 
 	soc_id(&dev, &rev);
-	if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100)
+	if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100_Z0 ||
+	    dev == MV_DEV_MV78100)
 		__asm __volatile("mrc p15, 1, %0, c15, c1, 0" : "=r" (ef));
 	else if (dev == MV_DEV_88F5182 || dev == MV_DEV_88F5281)
 		__asm __volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (ef));
@@ -166,6 +167,9 @@ soc_identify(void)
 		else if (r == 2)
 			rev = "A0";
 		break;
+	case MV_DEV_MV78100_Z0:
+		dev = "Marvell MV78100 Z0";
+		break;
 	case MV_DEV_MV78100:
 		dev = "Marvell MV78100";
 		break;
@@ -199,15 +203,16 @@ soc_decode_win(void)
 	decode_win_cpu_setup();
 	decode_win_usb_setup();
 	decode_win_eth_setup(MV_ETH0_BASE);
-	if (dev == MV_DEV_MV78100)
+	if (dev == MV_DEV_MV78100 || dev == MV_DEV_MV78100_Z0)
 		decode_win_eth_setup(MV_ETH1_BASE);
-	if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100)
+	if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100 ||
+	    dev == MV_DEV_MV78100_Z0)
 		decode_win_cesa_setup();
 
 	decode_win_idma_setup();
 	decode_win_xor_setup();
 
-	if (dev == MV_DEV_MV78100) {
+	if (dev == MV_DEV_MV78100 || dev == MV_DEV_MV78100_Z0) {
 		decode_win_pcie_setup(MV_PCIE00_BASE);
 		decode_win_pcie_setup(MV_PCIE01_BASE);
 		decode_win_pcie_setup(MV_PCIE02_BASE);
@@ -360,7 +365,8 @@ win_cpu_can_remap(int i)
 	if ((dev == MV_DEV_88F5182 && i < 2) ||
 	    (dev == MV_DEV_88F5281 && i < 4) ||
 	    (dev == MV_DEV_88F6281 && i < 4) ||
-	    (dev == MV_DEV_MV78100 && i < 8))
+	    (dev == MV_DEV_MV78100 && i < 8) ||
+	    (dev == MV_DEV_MV78100_Z0 && i < 8))
 		return (1);
 
 	return (0);
@@ -590,7 +596,7 @@ usb_max_ports(void)
 	uint32_t dev, rev;
 
 	soc_id(&dev, &rev);
-	return (dev == MV_DEV_MV78100 ? 3 : 1);
+	return ((dev == MV_DEV_MV78100 || dev == MV_DEV_MV78100_Z0) ? 3 : 1);
 }
 
 static void
@@ -1109,14 +1115,18 @@ win_xor_can_remap(int i)
 	return (0);
 }
 
-static __inline int
+static int
 xor_max_eng(void)
 {
 	uint32_t dev, rev;
 
 	soc_id(&dev, &rev);
-	return ((dev == MV_DEV_88F6281) ? 2 :
-	    (dev == MV_DEV_MV78100) ? 1 : 0);
+	if (dev == MV_DEV_88F6281)
+		return (2);
+	else if ((dev == MV_DEV_MV78100) || (dev == MV_DEV_MV78100_Z0))
+		return (1);
+	else
+		return (0);
 }
 
 static void

Modified: head/sys/arm/mv/gpio.c
==============================================================================
--- head/sys/arm/mv/gpio.c	Thu Apr 16 11:09:59 2009	(r191139)
+++ head/sys/arm/mv/gpio.c	Thu Apr 16 11:20:18 2009	(r191140)
@@ -123,12 +123,13 @@ mv_gpio_attach(device_t dev)
 		return (ENXIO);
 	mv_gpio_softc = sc;
 
-	/* Get board id and revision */
+	/* Get chip id and revision */
 	soc_id(&dev_id, &rev_id);
 
 	if (dev_id == MV_DEV_88F5182 ||
 	    dev_id == MV_DEV_88F5281 ||
-	    dev_id == MV_DEV_MV78100) {
+	    dev_id == MV_DEV_MV78100 ||
+	    dev_id == MV_DEV_MV78100_Z0 ) {
 		sc->pin_num = 32;
 		sc->irq_num = 4;
 		sc->use_high = 0;
@@ -139,7 +140,7 @@ mv_gpio_attach(device_t dev)
 		sc->use_high = 1;
 
 	} else {
-		device_printf(dev, "unknown board id=0x%x\n", dev_id);
+		device_printf(dev, "unknown chip id=0x%x\n", dev_id);
 		return (ENXIO);
 	}
 

Modified: head/sys/arm/mv/ic.c
==============================================================================
--- head/sys/arm/mv/ic.c	Thu Apr 16 11:09:59 2009	(r191139)
+++ head/sys/arm/mv/ic.c	Thu Apr 16 11:20:18 2009	(r191140)
@@ -98,10 +98,11 @@ mv_ic_attach(device_t dev)
 	sc->ic_high_regs = 0;
 	sc->ic_error_regs = 0;
 
-	if (dev_id == MV_DEV_88F6281 || dev_id == MV_DEV_MV78100)
+	if (dev_id == MV_DEV_88F6281 || dev_id == MV_DEV_MV78100 ||
+	    dev_id == MV_DEV_MV78100_Z0)
 		sc->ic_high_regs = 1;
 
-	if (dev_id == MV_DEV_MV78100)
+	if (dev_id == MV_DEV_MV78100 || dev_id == MV_DEV_MV78100_Z0)
 		sc->ic_error_regs = 1;
 
 	error = bus_alloc_resources(dev, mv_ic_spec, sc->ic_res);

Modified: head/sys/arm/mv/mv_pci.c
==============================================================================
--- head/sys/arm/mv/mv_pci.c	Thu Apr 16 11:09:59 2009	(r191139)
+++ head/sys/arm/mv/mv_pci.c	Thu Apr 16 11:20:18 2009	(r191140)
@@ -459,8 +459,18 @@ pcib_mbus_probe(device_t self)
 		id = "88F6281";
 		break;
 	case 0x6381:
+		id = "MV78100 Z0";
+		break;
+	case 0x7810:
 		id = "MV78100";
 		break;
+	case 0x7820:
+		/*
+		 * According to documentation ID 0x7820 is assigned to MV78200.
+		 * However some MV78100 chips also use it.
+		 */
+		id = "MV78100/MV78200";
+		break;
 	default:
 		device_printf(self, "unknown Marvell PCI bridge: %x\n", val);
 		goto out;

Modified: head/sys/arm/mv/mvreg.h
==============================================================================
--- head/sys/arm/mv/mvreg.h	Thu Apr 16 11:09:59 2009	(r191139)
+++ head/sys/arm/mv/mvreg.h	Thu Apr 16 11:20:18 2009	(r191140)
@@ -471,11 +471,12 @@
 /*
  * Chip ID
  */
-#define MV_DEV_88F5181	0x5181
-#define MV_DEV_88F5182	0x5182
-#define MV_DEV_88F5281	0x5281
-#define MV_DEV_88F6281	0x6281
-#define MV_DEV_MV78100	0x6381
+#define MV_DEV_88F5181		0x5181
+#define MV_DEV_88F5182		0x5182
+#define MV_DEV_88F5281		0x5281
+#define MV_DEV_88F6281		0x6281
+#define MV_DEV_MV78100_Z0	0x6381
+#define MV_DEV_MV78100		0x7810
 
 /*
  * Decode windows definitions and macros

Modified: head/sys/dev/mge/if_mge.c
==============================================================================
--- head/sys/dev/mge/if_mge.c	Thu Apr 16 11:09:59 2009	(r191139)
+++ head/sys/dev/mge/if_mge.c	Thu Apr 16 11:20:18 2009	(r191140)
@@ -239,7 +239,8 @@ mge_ver_params(struct mge_softc *sc)
 	uint32_t d, r;
 
 	soc_id(&d, &r);
-	if (d == MV_DEV_88F6281 || d == MV_DEV_MV78100) {
+	if (d == MV_DEV_88F6281 || d == MV_DEV_MV78100 ||
+	    d == MV_DEV_MV78100_Z0) {
 		sc->mge_ver = 2;
 		sc->mge_mtu = 0x4e8;
 		sc->mge_tfut_ipg_max = 0xFFFF;

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 11:21:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 25CA9106567A;
	Thu, 16 Apr 2009 11:21:53 +0000 (UTC) (envelope-from raj@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 137818FC08;
	Thu, 16 Apr 2009 11:21:53 +0000 (UTC) (envelope-from raj@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GBLqhR078784;
	Thu, 16 Apr 2009 11:21:52 GMT (envelope-from raj@svn.freebsd.org)
Received: (from raj@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GBLqXC078782;
	Thu, 16 Apr 2009 11:21:52 GMT (envelope-from raj@svn.freebsd.org)
Message-Id: <200904161121.n3GBLqXC078782@svn.freebsd.org>
From: Rafal Jaworowski 
Date: Thu, 16 Apr 2009 11:21:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191141 - head/sys/arm/arm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 11:21:54 -0000

Author: raj
Date: Thu Apr 16 11:21:52 2009
New Revision: 191141
URL: http://svn.freebsd.org/changeset/base/191141

Log:
  Minor style fixes and better comments.

Modified:
  head/sys/arm/arm/cpufunc_asm_armv5_ec.S
  head/sys/arm/arm/cpufunc_asm_sheeva.S

Modified: head/sys/arm/arm/cpufunc_asm_armv5_ec.S
==============================================================================
--- head/sys/arm/arm/cpufunc_asm_armv5_ec.S	Thu Apr 16 11:20:18 2009	(r191140)
+++ head/sys/arm/arm/cpufunc_asm_armv5_ec.S	Thu Apr 16 11:21:52 2009	(r191141)
@@ -204,3 +204,4 @@ ENTRY(armv5_ec_dcache_wbinv_all)
 	bne	1b			/* More to do? */
 	mcr	p15, 0, r0, c7, c10, 4	/* drain the write buffer */
 	RET
+

Modified: head/sys/arm/arm/cpufunc_asm_sheeva.S
==============================================================================
--- head/sys/arm/arm/cpufunc_asm_sheeva.S	Thu Apr 16 11:20:18 2009	(r191140)
+++ head/sys/arm/arm/cpufunc_asm_sheeva.S	Thu Apr 16 11:21:52 2009	(r191141)
@@ -375,6 +375,14 @@ ENTRY(sheeva_l2cache_wbinv_all)
 	mcr	p15, 0, r0, c7, c10, 4	/* drain the write buffer */
 	RET
 
+/* This function modifies register value as follows:
+ *
+ * arg1  arg		EFFECT (bit value saved into register)
+ *    0     0           not changed
+ *    0     1           negated
+ *    1     0           cleared
+ *    1     1           set
+ */
 ENTRY(sheeva_control_ext)
 	mrc	p15, 1, r3, c15, c1, 0	/* Read the control register */
 	bic	r2, r3, r0		/* Clear bits */

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 11:38:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 67327106566C;
	Thu, 16 Apr 2009 11:38:07 +0000 (UTC) (envelope-from raj@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B4A38FC08;
	Thu, 16 Apr 2009 11:38:07 +0000 (UTC) (envelope-from raj@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GBc7CW079181;
	Thu, 16 Apr 2009 11:38:07 GMT (envelope-from raj@svn.freebsd.org)
Received: (from raj@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GBc7v9079180;
	Thu, 16 Apr 2009 11:38:07 GMT (envelope-from raj@svn.freebsd.org)
Message-Id: <200904161138.n3GBc7v9079180@svn.freebsd.org>
From: Rafal Jaworowski 
Date: Thu, 16 Apr 2009 11:38:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191142 - head/sys/dev/mge
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 11:38:07 -0000

Author: raj
Date: Thu Apr 16 11:38:06 2009
New Revision: 191142
URL: http://svn.freebsd.org/changeset/base/191142

Log:
  mge(4): fix two bugs, which were leading to crash/hang under very heavy
  network load.
  
  1. Leave the RX interrupt routine if there is no mbuf available.
  
  2. Properly initialize and track tx_desc_used_count counter so as not to
  leak mbuf while traversing used descriptors.
  
  Obtained from:	Semihalf

Modified:
  head/sys/dev/mge/if_mge.c

Modified: head/sys/dev/mge/if_mge.c
==============================================================================
--- head/sys/dev/mge/if_mge.c	Thu Apr 16 11:21:52 2009	(r191141)
+++ head/sys/dev/mge/if_mge.c	Thu Apr 16 11:38:06 2009	(r191142)
@@ -642,6 +642,7 @@ mge_attach(device_t dev)
 	sc->tx_desc_curr = 0;
 	sc->rx_desc_curr = 0;
 	sc->tx_desc_used_idx = 0;
+	sc->tx_desc_used_count = 0;
 
 	/* Configure defaults for interrupts coalescing */
 	sc->rx_ic_time = 768;
@@ -899,6 +900,7 @@ mge_init_locked(void *arg)
 	sc->tx_desc_curr = 0;
 	sc->rx_desc_curr = 0;
 	sc->tx_desc_used_idx = 0;
+	sc->tx_desc_used_count = 0;
 
 	/* Enable RX descriptors */
 	for (i = 0; i < MGE_RX_DESC_NUM; i++) {
@@ -1022,7 +1024,7 @@ mge_intr_rx_locked(struct mge_softc *sc,
 
 	MGE_RECEIVE_LOCK_ASSERT(sc);
 
-	while(count != 0) {
+	while (count != 0) {
 		dw = &sc->mge_rx_desc[sc->rx_desc_curr];
 		bus_dmamap_sync(sc->mge_desc_dtag, dw->desc_dmap,
 		    BUS_DMASYNC_POSTREAD);
@@ -1033,7 +1035,6 @@ mge_intr_rx_locked(struct mge_softc *sc,
 		if ((status & MGE_DMA_OWNED) != 0)
 			break;
 
-		sc->rx_desc_curr = (++sc->rx_desc_curr % MGE_RX_DESC_NUM);
 		if (dw->mge_desc->byte_count &&
 		    ~(status & MGE_ERR_SUMMARY)) {
 
@@ -1044,6 +1045,10 @@ mge_intr_rx_locked(struct mge_softc *sc,
 			    dw->mge_desc->byte_count - ETHER_CRC_LEN,
 			    0, ifp, NULL);
 
+			if (mb == NULL)
+				/* Give up if no mbufs */
+				break;
+
 			mb->m_len -= 2;
 			mb->m_pkthdr.len -= 2;
 			mb->m_data += 2;
@@ -1058,6 +1063,7 @@ mge_intr_rx_locked(struct mge_softc *sc,
 
 		dw->mge_desc->byte_count = 0;
 		dw->mge_desc->cmd_status = MGE_RX_ENABLE_INT | MGE_DMA_OWNED;
+		sc->rx_desc_curr = (++sc->rx_desc_curr % MGE_RX_DESC_NUM);
 		bus_dmamap_sync(sc->mge_desc_dtag, dw->desc_dmap,
 		    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 
@@ -1514,7 +1520,8 @@ mge_stop(struct mge_softc *sc)
 	MGE_WRITE(sc, MGE_RX_QUEUE_CMD, MGE_DISABLE_RXQ_ALL);
 
 	/* Remove pending data from TX queue */
-	while (sc->tx_desc_used_idx < sc->tx_desc_curr) {
+	while (sc->tx_desc_used_idx != sc->tx_desc_curr &&
+	    sc->tx_desc_used_count) {
 		/* Get the descriptor */
 		dw = &sc->mge_tx_desc[sc->tx_desc_used_idx];
 		desc = dw->mge_desc;
@@ -1529,6 +1536,7 @@ mge_stop(struct mge_softc *sc)
 
 		sc->tx_desc_used_idx = (++sc->tx_desc_used_idx) %
 		    MGE_TX_DESC_NUM;
+		sc->tx_desc_used_count--;
 
 		bus_dmamap_sync(sc->mge_tx_dtag, dw->buffer_dmap,
 		    BUS_DMASYNC_POSTWRITE);

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 11:57:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 425F61065675;
	Thu, 16 Apr 2009 11:57:17 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2DA158FC1C;
	Thu, 16 Apr 2009 11:57:17 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GBvHNA079616;
	Thu, 16 Apr 2009 11:57:17 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GBvHmU079615;
	Thu, 16 Apr 2009 11:57:17 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200904161157.n3GBvHmU079615@svn.freebsd.org>
From: Robert Watson 
Date: Thu, 16 Apr 2009 11:57:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191143 - head/sys/security/audit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 11:57:18 -0000

Author: rwatson
Date: Thu Apr 16 11:57:16 2009
New Revision: 191143
URL: http://svn.freebsd.org/changeset/base/191143

Log:
  Remove D_NEEDGIANT from audit pipes.  I'm actually not sure why this was
  here, but isn't needed.
  
  MFC after:	2 weeks
  Sponsored by:	Apple, Inc.

Modified:
  head/sys/security/audit/audit_pipe.c

Modified: head/sys/security/audit/audit_pipe.c
==============================================================================
--- head/sys/security/audit/audit_pipe.c	Thu Apr 16 11:38:06 2009	(r191142)
+++ head/sys/security/audit/audit_pipe.c	Thu Apr 16 11:57:16 2009	(r191143)
@@ -231,7 +231,7 @@ static d_kqfilter_t	audit_pipe_kqfilter;
 
 static struct cdevsw	audit_pipe_cdevsw = {
 	.d_version =	D_VERSION,
-	.d_flags =	D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR,
+	.d_flags =	D_PSEUDO | D_NEEDMINOR,
 	.d_open =	audit_pipe_open,
 	.d_close =	audit_pipe_close,
 	.d_read =	audit_pipe_read,

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 14:44:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2EC87106566C;
	Thu, 16 Apr 2009 14:44:00 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1D7668FC17;
	Thu, 16 Apr 2009 14:44:00 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GEi0Ai083425;
	Thu, 16 Apr 2009 14:44:00 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GEi0vx083424;
	Thu, 16 Apr 2009 14:44:00 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200904161444.n3GEi0vx083424@svn.freebsd.org>
From: Robert Watson 
Date: Thu, 16 Apr 2009 14:43:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191144 - in head/usr.sbin: . raycontrol
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 14:44:00 -0000

Author: rwatson
Date: Thu Apr 16 14:43:59 2009
New Revision: 191144
URL: http://svn.freebsd.org/changeset/base/191144

Log:
  Garbage collect raycontrol(8), as ray(4) has been removed.
  
  Pointed out by:	pluknet at gmail.com

Deleted:
  head/usr.sbin/raycontrol/
Modified:
  head/usr.sbin/Makefile

Modified: head/usr.sbin/Makefile
==============================================================================
--- head/usr.sbin/Makefile	Thu Apr 16 11:57:16 2009	(r191143)
+++ head/usr.sbin/Makefile	Thu Apr 16 14:43:59 2009	(r191144)
@@ -138,7 +138,6 @@ SUBDIR=	${_ac} \
 	quot \
 	${_quotaon} \
 	rarpd \
-	${_raycontrol} \
 	${_repquota} \
 	${_rip6query} \
 	rmt \
@@ -405,7 +404,6 @@ _usbconfig=	usbconfig
 
 .if ${MK_WIRELESS} != "no"
 _ancontrol=	ancontrol
-_raycontrol=	raycontrol
 _wlandebug=	wlandebug
 _wpa=		wpa
 .endif

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 16:26:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3324E10656FA;
	Thu, 16 Apr 2009 16:26:36 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 224878FC19;
	Thu, 16 Apr 2009 16:26:36 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GGQaJT085700;
	Thu, 16 Apr 2009 16:26:36 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GGQa8N085699;
	Thu, 16 Apr 2009 16:26:36 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <200904161626.n3GGQa8N085699@svn.freebsd.org>
From: Rick Macklem 
Date: Thu, 16 Apr 2009 16:26:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191145 - head/sys/rpc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 16:26:37 -0000

Author: rmacklem
Date: Thu Apr 16 16:26:35 2009
New Revision: 191145
URL: http://svn.freebsd.org/changeset/base/191145

Log:
  	Added a field to the SVCXPRT structure that the nfsv4 server can
  	use to identify if the socket is the same one that a cached request
  	came in on. It is set by nfsrvd_addsock() to a unique value generated
  	by incrementing an unsigned 64bit static variable for each assignment
  	and then the value of xp_sockref is tested to see if it is equal to
  	the value that was saved with the cached reply.
  
  Submitted by:	rmacklem
  Reviewed by:	dfr
  Approved by:	kib (mentor)

Modified:
  head/sys/rpc/svc.h

Modified: head/sys/rpc/svc.h
==============================================================================
--- head/sys/rpc/svc.h	Thu Apr 16 14:43:59 2009	(r191144)
+++ head/sys/rpc/svc.h	Thu Apr 16 16:26:35 2009	(r191145)
@@ -165,6 +165,7 @@ typedef struct __rpc_svcxprt {
 	int		xp_type;	/* transport type */
 	int		xp_idletimeout; /* idle time before closing */
 	time_t		xp_lastactive;	/* time of last RPC */
+	u_int64_t	xp_sockref;	/* set by nfsv4 to identify socket */
 #else
 	int		xp_fd;
 	u_short		xp_port;	 /* associated port number */

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 16:28:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D19F11065674
	for ; Thu, 16 Apr 2009 16:28:35 +0000 (UTC)
	(envelope-from max@love2party.net)
Received: from moutng.kundenserver.de (moutng.kundenserver.de
	[212.227.126.188])
	by mx1.freebsd.org (Postfix) with ESMTP id 649318FC2C
	for ; Thu, 16 Apr 2009 16:28:35 +0000 (UTC)
	(envelope-from max@love2party.net)
Received: from vampire.homelinux.org (dslb-088-066-019-008.pools.arcor-ip.net
	[88.66.19.8])
	by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis)
	id 0MKuxg-1LuUS20sEu-0001DE; Thu, 16 Apr 2009 18:28:34 +0200
Received: (qmail 91471 invoked from network); 16 Apr 2009 16:28:33 -0000
Received: from fbsd8.laiers.local (192.168.4.200)
	by router.laiers.local with SMTP; 16 Apr 2009 16:28:33 -0000
From: Max Laier 
Organization: FreeBSD
To: Robert Watson 
Date: Thu, 16 Apr 2009 18:28:33 +0200
User-Agent: KMail/1.11.0 (FreeBSD/8.0-CURRENT; KDE/4.2.1; i386; ; )
References: <200904161444.n3GEi0vx083424@svn.freebsd.org>
In-Reply-To: <200904161444.n3GEi0vx083424@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200904161828.33588.max@love2party.net>
X-Provags-ID: V01U2FsdGVkX1/yCJhFNxjEDL6piS/gBUHLblCnJTJoYJHbpTW
	qAWzEw1hMbuOHgmDPe58fyvp50MNubkvP0CWqLcnEQX6GUzH6v
	NwnmTpZqqsmWoKKjZSZZQ==
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191144 - in head/usr.sbin: . raycontrol
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 16:28:37 -0000

On Thursday 16 April 2009 16:43:59 Robert Watson wrote:
> Author: rwatson
> Date: Thu Apr 16 14:43:59 2009
> New Revision: 191144
> URL: http://svn.freebsd.org/changeset/base/191144
>
> Log:
>   Garbage collect raycontrol(8), as ray(4) has been removed.

ObsoleteFiles.inc needs this as well.

>   Pointed out by:	pluknet at gmail.com
>
> Deleted:
>   head/usr.sbin/raycontrol/
> Modified:
>   head/usr.sbin/Makefile
>
> Modified: head/usr.sbin/Makefile
> ===========================================================================
>=== --- head/usr.sbin/Makefile	Thu Apr 16 11:57:16 2009	(r191143)
> +++ head/usr.sbin/Makefile	Thu Apr 16 14:43:59 2009	(r191144)
> @@ -138,7 +138,6 @@ SUBDIR=	${_ac} \
>  	quot \
>  	${_quotaon} \
>  	rarpd \
> -	${_raycontrol} \
>  	${_repquota} \
>  	${_rip6query} \
>  	rmt \
> @@ -405,7 +404,6 @@ _usbconfig=	usbconfig
>
>  .if ${MK_WIRELESS} != "no"
>  _ancontrol=	ancontrol
> -_raycontrol=	raycontrol
>  _wlandebug=	wlandebug
>  _wpa=		wpa
>  .endif
>
>
> !DSPAM:49e7443b903275368818224!

-- 
/"\  Best regards,                      | mlaier@freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier@EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 17:42:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E88A4106567F;
	Thu, 16 Apr 2009 17:42:25 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D56EC8FC29;
	Thu, 16 Apr 2009 17:42:25 +0000 (UTC)
	(envelope-from maxim@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GHgPPf087364;
	Thu, 16 Apr 2009 17:42:25 GMT (envelope-from maxim@svn.freebsd.org)
Received: (from maxim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GHgPF9087361;
	Thu, 16 Apr 2009 17:42:25 GMT (envelope-from maxim@svn.freebsd.org)
Message-Id: <200904161742.n3GHgPF9087361@svn.freebsd.org>
From: Maxim Konovalov 
Date: Thu, 16 Apr 2009 17:42:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191146 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 17:42:27 -0000

Author: maxim
Date: Thu Apr 16 17:42:25 2009
New Revision: 191146
URL: http://svn.freebsd.org/changeset/base/191146

Log:
  o Reflect ar(4), ray(4), sr(4), raycontrol(8) removal.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Thu Apr 16 16:26:35 2009	(r191145)
+++ head/ObsoleteFiles.inc	Thu Apr 16 17:42:25 2009	(r191146)
@@ -14,6 +14,12 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20090416: removal of ar(4), ray(4), sr(4), raycontrol(8)
+OLD_FILES+=usr/sbin/raycontrol
+OLD_FILES+=usr/share/man/man4/i386/ar.4.gz
+OLD_FILES+=usr/share/man/man4/i386/ray.4.gz
+OLD_FILES+=usr/share/man/man4/i386/sr.4.gz
+OLD_FILES+=usr/share/man/man8/raycontrol.8.gz
 # 20090410: VOP_LEASE.9 removed
 OLD_FILES+=usr/share/man/man9/VOP_LEASE.9.gz
 # 20090405: removal of if_ppp(4) and if_sl(4)

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 17:42:46 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.ORG
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0A889106568F;
	Thu, 16 Apr 2009 17:42:46 +0000 (UTC)
	(envelope-from maxim@macomnet.ru)
Received: from mp2.macomnet.net (cl-2958.ham-01.de.sixxs.net
	[IPv6:2001:6f8:900:b8d::2])
	by mx1.freebsd.org (Postfix) with ESMTP id 67EC58FC17;
	Thu, 16 Apr 2009 17:42:45 +0000 (UTC)
	(envelope-from maxim@macomnet.ru)
Received: from localhost (localhost [127.0.0.1])
	by mp2.macomnet.net (8.14.3/8.14.3) with ESMTP id n3GHghVO091490;
	Thu, 16 Apr 2009 21:42:43 +0400 (MSD)
	(envelope-from maxim@macomnet.ru)
Date: Thu, 16 Apr 2009 21:42:43 +0400 (MSD)
From: Maxim Konovalov 
To: Max Laier 
In-Reply-To: <200904161828.33588.max@love2party.net>
Message-ID: <20090416214234.R14430@mp2.macomnet.net>
References: <200904161444.n3GEi0vx083424@svn.freebsd.org>
	<200904161828.33588.max@love2party.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG,
	src-committers@FreeBSD.ORG, Robert Watson 
Subject: Re: svn commit: r191144 - in head/usr.sbin: . raycontrol
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 17:42:47 -0000

On Thu, 16 Apr 2009, 18:28+0200, Max Laier wrote:

> On Thursday 16 April 2009 16:43:59 Robert Watson wrote:
> > Author: rwatson
> > Date: Thu Apr 16 14:43:59 2009
> > New Revision: 191144
> > URL: http://svn.freebsd.org/changeset/base/191144
> >
> > Log:
> >   Garbage collect raycontrol(8), as ray(4) has been removed.
>
> ObsoleteFiles.inc needs this as well.
>
Added.

-- 
Maxim Konovalov

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 20:17:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9F71E1065845;
	Thu, 16 Apr 2009 20:17:32 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 888D58FC13;
	Thu, 16 Apr 2009 20:17:32 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GKHWYg090623;
	Thu, 16 Apr 2009 20:17:32 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GKHWVh090621;
	Thu, 16 Apr 2009 20:17:32 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200904162017.n3GKHWVh090621@svn.freebsd.org>
From: Robert Watson 
Date: Thu, 16 Apr 2009 20:17:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191147 - in head/sys: bsm security/audit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 20:17:35 -0000

Author: rwatson
Date: Thu Apr 16 20:17:32 2009
New Revision: 191147
URL: http://svn.freebsd.org/changeset/base/191147

Log:
  Merge new kernel files from OpenBSM 1.1: audit_fcntl.h and
  audit_bsm_fcntl.c contain utility routines to map local fcntl
  commands into BSM constants.  Adaptation to the FreeBSD kernel
  environment will follow in a future commit.
  
  Sponsored by:	Apple, Inc.
  Obtained from:	TrustedBSD Project
  MFC after:	2 weeks

Added:
  head/sys/bsm/audit_fcntl.h   (contents, props changed)
  head/sys/security/audit/audit_bsm_fcntl.c   (contents, props changed)

Added: head/sys/bsm/audit_fcntl.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/bsm/audit_fcntl.h	Thu Apr 16 20:17:32 2009	(r191147)
@@ -0,0 +1,141 @@
+/*-
+ * Copyright (c) 2009 Apple Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. 
+ *
+ * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_fcntl.h#2
+ * $FreeBSD$
+ */
+
+#ifndef	_BSM_AUDIT_FCNTL_H_
+#define	_BSM_AUDIT_FCNTL_H_
+
+/*
+ * Shared and Solaris-specific: (0-99).
+ */
+#define	BSM_F_DUPFD		0
+#define	BSM_F_GETFD		1
+#define	BSM_F_SETFD		2
+#define	BSM_F_GETFL		3
+#define	BSM_F_SETFL		4
+#define	BSM_F_O_GETLK		5	/* Solaris-specific. */
+#define	BSM_F_SETLK		6
+#define	BSM_F_SETLKW		7
+#define	BSM_F_CHKFL		8	/* Solaris-specific. */
+#define	BSM_F_DUP2FD		9	/* FreeBSD/Solaris-specific. */
+#define	BSM_F_ALLOCSP		10	/* Solaris-specific. */
+#define	BSM_F_FREESP		11	/* Solaris-specific. */
+
+#define	BSM_F_ISSTREAM		13	/* Solaris-specific. */
+#define	BSM_F_GETLK		14	
+#define	BSM_F_PRIV		15	/* Solaris-specific. */
+#define	BSM_F_NPRIV		16	/* Solaris-specific. */
+#define	BSM_F_QUOTACTL		17	/* Solaris-specific. */
+#define	BSM_F_BLOCKS		18	/* Solaris-specific. */
+#define	BSM_F_BLKSIZE		19	/* Solaris-specific. */
+
+#define	BSM_F_GETOWN		23
+#define	BSM_F_SETOWN		24
+#define	BSM_F_REVOKE		25	/* Solaris-specific. */
+#define	BSM_F_HASREMOTELOCKS	26	/* Solaris-specific. */
+#define	BSM_F_FREESP64		27	/* Solaris-specific. */
+#define	BSM_F_ALLOCSP64		28	/* Solaris-specific. */
+
+#define	BSM_F_GETLK64		33	/* Solaris-specific. */
+#define	BSM_F_SETLK64		34	/* Solaris-specific. */
+#define	BSM_F_SETLKW64		35	/* Solaris-specific. */
+
+#define	BSM_F_SHARE		40	/* Solaris-specific. */
+#define	BSM_F_UNSHARE		41 	/* Solaris-specific. */
+#define	BSM_F_SETLK_NBMAND	42	/* Solaris-specific. */
+#define	BSM_F_SHARE_NBMAND	43	/* Solaris-specific. */
+#define	BSM_F_SETLK64_NBMAND	44 	/* Solaris-specific. */
+#define	BSM_F_GETXFL		45	/* Solaris-specific. */
+#define	BSM_F_BADFD		46	/* Solaris-specific. */
+
+/*
+ * FreeBSD-specific (100-199).
+ */
+#define	BSM_F_OGETLK		107	/* FreeBSD-specific. */
+#define	BSM_F_OSETLK		108	/* FreeBSD-specific. */
+#define	BSM_F_OSETLKW		109	/* FreeBSD-specific. */
+
+#define	BSM_F_SETLK_REMOTE	114	/* FreeBSD-specific. */
+
+/*
+ * Linux-specific (200-299).
+ */
+#define	BSM_F_SETSIG		210	/* Linux-specific. */
+#define	BSM_F_GETSIG		211	/* Linux-specific. */
+
+/*
+ * Darwin-specific (300-399).
+ */
+#define	BSM_F_CHKCLEAN 		341	/* Darwin-specific. */
+#define	BSM_F_PREALLOCATE	342	/* Darwin-specific. */
+#define	BSM_F_SETSIZE		343	/* Darwin-specific. */
+#define	BSM_F_RDADVISE		344	/* Darwin-specific. */
+#define	BSM_F_RDAHEAD		345	/* Darwin-specific. */
+#define	BSM_F_READBOOTSTRAP	346	/* Darwin-specific. */
+#define	BSM_F_WRITEBOOTSTRAP	347	/* Darwin-specific. */
+#define	BSM_F_NOCACHE		348	/* Darwin-specific. */
+#define	BSM_F_LOG2PHYS		349	/* Darwin-specific. */
+#define	BSM_F_GETPATH		350	/* Darwin-specific. */
+#define	BSM_F_FULLFSYNC		351	/* Darwin-specific. */
+#define	BSM_F_PATHPKG_CHECK	352	/* Darwin-specific. */
+#define	BSM_F_FREEZE_FS		353	/* Darwin-specific. */
+#define	BSM_F_THAW_FS		354	/* Darwin-specific. */
+#define	BSM_F_GLOBAL_NOCACHE	355	/* Darwin-specific. */
+#define	BSM_F_OPENFROM		356	/* Darwin-specific. */
+#define	BSM_F_UNLINKFROM	357	/* Darwin-specific. */
+#define	BSM_F_CHECK_OPENEVT	358	/* Darwin-specific. */
+#define	BSM_F_ADDSIGS		359	/* Darwin-specific. */
+#define	BSM_F_MARKDEPENDENCY	360	/* Darwin-specific. */
+
+/*
+ * Darwin file system specific (400-499).
+ */
+#define	BSM_F_FS_SPECIFIC_0	400	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_1	401	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_2	402	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_3	403	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_4	404	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_5	405	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_6	406	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_7	407	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_8	408	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_9	409	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_10	410	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_11	411	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_12	412	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_13	413	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_14	414	/* Darwin-fs-specific. */
+#define	BSM_F_FS_SPECIFIC_15	415	/* Darwin-fs-specific. */
+
+
+#define	BSM_F_UNKNOWN		0xFFFF	
+
+#endif /* !_BSM_AUDIT_FCNTL_H_ */

Added: head/sys/security/audit/audit_bsm_fcntl.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/security/audit/audit_bsm_fcntl.c	Thu Apr 16 20:17:32 2009	(r191147)
@@ -0,0 +1,290 @@
+/*-
+ * Copyright (c) 2008-2009 Apple Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_fcntl.c#2
+ * $FreeBSD$
+ */
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+struct bsm_fcntl_cmd {
+	u_short	bfc_bsm_fcntl_cmd;
+	int	bfc_local_fcntl_cmd;
+};
+typedef struct bsm_fcntl_cmd	bsm_fcntl_cmd_t;
+
+static const bsm_fcntl_cmd_t bsm_fcntl_cmdtab[] = {
+	{ BSM_F_DUPFD, 		F_DUPFD },
+	{ BSM_F_GETFD,		F_GETFD },
+	{ BSM_F_SETFD,		F_SETFD	},
+	{ BSM_F_GETFL,		F_GETFL },
+	{ BSM_F_SETFL,		F_SETFL },
+#ifdef	F_O_GETLK
+	{ BSM_F_O_GETLK,	F_O_GETLK },
+#endif
+	{ BSM_F_SETLK,		F_SETLK },
+	{ BSM_F_SETLKW,		F_SETLK },
+#ifdef	F_CHFL
+	{ BSM_F_CHKFL,		F_CHKFL },
+#endif
+#ifdef 	F_DUP2FD
+	{ BSM_F_DUP2FD,		F_DUP2FD },
+#endif
+#ifdef	F_ALLOCSP
+	{ BSM_F_ALLOCSP,	F_ALLOCSP },
+#endif
+#ifdef	F_FREESP
+	{ BSM_F_FREESP,		F_FREESP },
+#endif
+#ifdef	F_ISSTREAM
+	{ BSM_F_ISSTREAM,	F_ISSTREAM},
+#endif
+	{ BSM_F_GETLK,		F_GETLK },
+#ifdef 	F_PRIV
+	{ BSM_F_PRIV,		F_PRIV },
+#endif
+#ifdef	F_NPRIV
+	{ BSM_F_NPRIV,		F_NPRIV },
+#endif
+#ifdef 	F_QUOTACTL
+	{ BSM_F_QUOTACTL,	F_QUOTACTL },
+#endif
+#ifdef	F_BLOCKS
+	{ BSM_F_BLOCKS,		F_BLOCKS },
+#endif
+#ifdef	F_BLKSIZE
+	{ BSM_F_BLKSIZE,	F_BLKSIZE },
+#endif
+	{ BSM_F_GETOWN,		F_GETOWN },
+	{ BSM_F_SETOWN,		F_SETOWN },
+#ifdef	F_REVOKE
+	{ BSM_F_REVOKE,		F_REVOKE },
+#endif
+#ifdef 	F_HASREMOTEBLOCKS
+	{ BSM_F_HASREMOTEBLOCKS,
+				F_HASREMOTEBLOCKS },
+#endif
+#ifdef 	F_FREESP
+	{ BSM_F_FREESP,		F_FREESP },
+#endif
+#ifdef 	F_ALLOCSP
+	{ BSM_F_ALLOCSP,	F_ALLOCSP },
+#endif
+#ifdef	F_FREESP64
+	{ BSM_F_FREESP64,	F_FREESP64 },
+#endif
+#ifdef 	F_ALLOCSP64
+	{ BSM_F_ALLOCSP64,	F_ALLOCSP64 },
+#endif
+#ifdef	F_GETLK64
+	{ BSM_F_GETLK64, 	F_GETLK64 },
+#endif
+#ifdef	F_SETLK64
+	{ BSM_F_SETLK64, 	F_SETLK64 },
+#endif
+#ifdef	F_SETLKW64
+	{ BSM_F_SETLKW64, 	F_SETLKW64 },
+#endif
+#ifdef	F_SHARE
+	{ BSM_F_SHARE,		F_SHARE },
+#endif
+#ifdef	F_UNSHARE
+	{ BSM_F_UNSHARE,	F_UNSHARE },
+#endif
+#ifdef	F_SETLK_NBMAND
+	{ BSM_F_SETLK_NBMAND,	F_SETLK_NBMAND },
+#endif
+#ifdef	F_SHARE_NBMAND
+	{ BSM_F_SHARE_NBMAND,	F_SHARE_NBMAND },
+#endif
+#ifdef	F_SETLK64_NBMAND
+	{ BSM_F_SETLK64_NBMAND,	F_SETLK64_NBMAND },
+#endif
+#ifdef	F_GETXFL
+	{ BSM_F_GETXFL,		F_GETXFL },
+#endif
+#ifdef	F_BADFD
+	{ BSM_F_BADFD,		F_BADFD },
+#endif
+#ifdef	F_OGETLK
+	{ BSM_F_OGETLK,		F_OGETLK },
+#endif
+#ifdef	F_OSETLK
+	{ BSM_F_OSETLK,		F_OSETLK },
+#endif
+#ifdef	F_OSETLKW
+	{ BSM_F_OSETLKW,	F_OSETLKW },
+#endif
+#ifdef	F_SETLK_REMOTE
+	{ BSM_F_SETLK_REMOTE,	F_SETLK_REMOTE },
+#endif
+
+#ifdef	F_SETSIG
+	{ BSM_F_SETSIG,		F_SETSIG },
+#endif
+#ifdef	F_GETSIG
+	{ BSM_F_GETSIG,		F_GETSIG },
+#endif
+
+#ifdef	F_CHKCLEAN
+	{ BSM_F_CHKCLEAN,	F_CHKCLEAN },
+#endif
+#ifdef	F_PREALLOCATE
+	{ BSM_F_PREALLOCATE,	F_PREALLOCATE },
+#endif
+#ifdef	F_SETSIZE
+	{ BSM_F_SETSIZE,	F_SETSIZE },
+#endif
+#ifdef	F_RDADVISE
+	{ BSM_F_RDADVISE,	F_RDADVISE },
+#endif
+#ifdef	F_RDAHEAD
+	{ BSM_F_RDAHEAD,	F_RDAHEAD },
+#endif
+#ifdef	F_READBOOTSTRAP
+	{ BSM_F_READBOOTSTRAP,	F_READBOOTSTRAP },
+#endif
+#ifdef	F_WRITEBOOTSTRAP
+	{ BSM_F_WRITEBOOTSTRAP,	F_WRITEBOOTSTRAP },
+#endif
+#ifdef	F_NOCACHE
+	{ BSM_F_NOCACHE,	F_NOCACHE },
+#endif
+#ifdef	F_LOG2PHYS
+	{ BSM_F_LOG2PHYS,	F_LOG2PHYS },
+#endif
+#ifdef	F_GETPATH
+	{ BSM_F_GETPATH,	F_GETPATH },
+#endif
+#ifdef	F_FULLFSYNC
+	{ BSM_F_FULLFSYNC,	F_FULLFSYNC },
+#endif
+#ifdef	F_PATHPKG_CHECK
+	{ BSM_F_PATHPKG_CHECK,	F_PATHPKG_CHECK },
+#endif
+#ifdef	F_FREEZE_FS
+	{ BSM_F_FREEZE_FS,	F_FREEZE_FS },
+#endif
+#ifdef	F_THAW_FS
+	{ BSM_F_THAW_FS,	F_THAW_FS },
+#endif
+#ifdef	F_GLOBAL_NOCACHE
+	{ BSM_F_GLOBAL_NOCACHE,	F_GLOBAL_NOCACHE },
+#endif
+#ifdef	F_OPENFROM
+	{ BSM_F_OPENFROM,	F_OPENFROM },
+#endif
+#ifdef	F_UNLINKFROM
+	{ BSM_F_UNLINKFROM,	F_UNLINKFROM },
+#endif
+#ifdef	F_CHECK_OPENEVT
+	{ BSM_F_CHECK_OPENEVT,	F_CHECK_OPENEVT },
+#endif
+#ifdef	F_ADDSIGS
+	{ BSM_F_ADDSIGS,	F_ADDSIGS },
+#endif
+#ifdef	F_MARKDEPENDENCY
+	{ BSM_F_MARKDEPENDENCY,	F_MARKDEPENDENCY },
+#endif
+
+#ifdef	FCNTL_FS_SPECIFIC_BASE
+	{ BSM_F_FS_SPECIFIC_0,	FCNTL_FS_SPECIFIC_BASE},
+	{ BSM_F_FS_SPECIFIC_1,	FCNTL_FS_SPECIFIC_BASE + 1},
+	{ BSM_F_FS_SPECIFIC_2,	FCNTL_FS_SPECIFIC_BASE + 2},
+	{ BSM_F_FS_SPECIFIC_3,	FCNTL_FS_SPECIFIC_BASE + 3},
+	{ BSM_F_FS_SPECIFIC_4,	FCNTL_FS_SPECIFIC_BASE + 4},
+	{ BSM_F_FS_SPECIFIC_5,	FCNTL_FS_SPECIFIC_BASE + 5},
+	{ BSM_F_FS_SPECIFIC_6,	FCNTL_FS_SPECIFIC_BASE + 6},
+	{ BSM_F_FS_SPECIFIC_7,	FCNTL_FS_SPECIFIC_BASE + 7},
+	{ BSM_F_FS_SPECIFIC_8,	FCNTL_FS_SPECIFIC_BASE + 8},
+	{ BSM_F_FS_SPECIFIC_9,	FCNTL_FS_SPECIFIC_BASE + 9},
+	{ BSM_F_FS_SPECIFIC_10,	FCNTL_FS_SPECIFIC_BASE + 10},
+	{ BSM_F_FS_SPECIFIC_11,	FCNTL_FS_SPECIFIC_BASE + 11},
+	{ BSM_F_FS_SPECIFIC_12,	FCNTL_FS_SPECIFIC_BASE + 12},
+	{ BSM_F_FS_SPECIFIC_13,	FCNTL_FS_SPECIFIC_BASE + 13},
+	{ BSM_F_FS_SPECIFIC_14,	FCNTL_FS_SPECIFIC_BASE + 14},
+	{ BSM_F_FS_SPECIFIC_15,	FCNTL_FS_SPECIFIC_BASE + 15},
+#endif	/* FCNTL_FS_SPECIFIC_BASE */
+};
+static const int bsm_fcntl_cmd_count = sizeof(bsm_fcntl_cmdtab) /
+	    sizeof(bsm_fcntl_cmdtab[0]);
+
+static const bsm_fcntl_cmd_t *
+bsm_lookup_local_fcntl_cmd(int local_fcntl_cmd)
+{
+	int i;
+
+	for (i = 0; i < bsm_fcntl_cmd_count; i++) {
+		if (bsm_fcntl_cmdtab[i].bfc_local_fcntl_cmd ==
+		    local_fcntl_cmd)
+			return (&bsm_fcntl_cmdtab[i]);
+	}
+	return (NULL);
+}
+
+u_short
+au_fcntl_cmd_to_bsm(int local_fcntl_cmd)
+{
+	const bsm_fcntl_cmd_t *bfcp;
+
+	bfcp = bsm_lookup_local_fcntl_cmd(local_fcntl_cmd);
+	if (bfcp == NULL)
+		return (BSM_F_UNKNOWN);
+	return (bfcp->bfc_bsm_fcntl_cmd);
+}
+
+static const bsm_fcntl_cmd_t *
+bsm_lookup_bsm_fcntl_cmd(u_short bsm_fcntl_cmd)
+{
+	int i;
+
+	for (i = 0; i < bsm_fcntl_cmd_count; i++) {
+		if (bsm_fcntl_cmdtab[i].bfc_bsm_fcntl_cmd ==
+		    bsm_fcntl_cmd)
+			return (&bsm_fcntl_cmdtab[i]);
+	}
+	return (NULL);
+}
+
+int
+au_bsm_to_fcntl_cmd(u_short bsm_fcntl_cmd, int *local_fcntl_cmdp)
+{
+	const bsm_fcntl_cmd_t *bfcp;
+
+	bfcp = bsm_lookup_bsm_fcntl_cmd(bsm_fcntl_cmd);
+	if (bfcp == NULL || bfcp->bfc_local_fcntl_cmd)
+		return (-1);
+	*local_fcntl_cmdp = bfcp->bfc_local_fcntl_cmd;
+	return (0);
+}

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 20:30:30 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 72F7D106580B;
	Thu, 16 Apr 2009 20:30:30 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 56C698FC08;
	Thu, 16 Apr 2009 20:30:30 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GKUUP8090963;
	Thu, 16 Apr 2009 20:30:30 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GKUSm6090918;
	Thu, 16 Apr 2009 20:30:28 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904162030.n3GKUSm6090918@svn.freebsd.org>
From: Kip Macy 
Date: Thu, 16 Apr 2009 20:30:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191148 - in head/sys: contrib/ipfilter/netinet
	contrib/pf/net dev/iicbus dev/lmc dev/ppbus net net80211
	netgraph netinet netinet6 netipx
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 20:30:35 -0000

Author: kmacy
Date: Thu Apr 16 20:30:28 2009
New Revision: 191148
URL: http://svn.freebsd.org/changeset/base/191148

Log:
  Change if_output to take a struct route as its fourth argument in order
  to allow passing a cached struct llentry * down to L2
  
  Reviewed by:	rwatson

Modified:
  head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
  head/sys/contrib/pf/net/if_pflog.c
  head/sys/contrib/pf/net/if_pfsync.c
  head/sys/contrib/pf/net/pf.c
  head/sys/dev/iicbus/if_ic.c
  head/sys/dev/lmc/if_lmc.c
  head/sys/dev/lmc/if_lmc.h
  head/sys/dev/ppbus/if_plip.c
  head/sys/net/ethernet.h
  head/sys/net/if_arc.h
  head/sys/net/if_arcsubr.c
  head/sys/net/if_atm.h
  head/sys/net/if_atmsubr.c
  head/sys/net/if_disc.c
  head/sys/net/if_enc.c
  head/sys/net/if_ethersubr.c
  head/sys/net/if_faith.c
  head/sys/net/if_fddisubr.c
  head/sys/net/if_fwsubr.c
  head/sys/net/if_gif.c
  head/sys/net/if_gif.h
  head/sys/net/if_gre.c
  head/sys/net/if_iso88025subr.c
  head/sys/net/if_lagg.c
  head/sys/net/if_lagg.h
  head/sys/net/if_loop.c
  head/sys/net/if_spppsubr.c
  head/sys/net/if_stf.c
  head/sys/net/if_tun.c
  head/sys/net/if_var.h
  head/sys/net/iso88025.h
  head/sys/net/route.h
  head/sys/net80211/ieee80211.c
  head/sys/net80211/ieee80211_output.c
  head/sys/net80211/ieee80211_proto.h
  head/sys/net80211/ieee80211_var.h
  head/sys/netgraph/ng_fec.c
  head/sys/netgraph/ng_iface.c
  head/sys/netinet/if_ether.c
  head/sys/netinet/ip_carp.c
  head/sys/netinet/ip_fastfwd.c
  head/sys/netinet/ip_output.c
  head/sys/netinet6/nd6.c
  head/sys/netinet6/nd6.h
  head/sys/netipx/ipx_outputfl.c

Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
==============================================================================
--- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -1046,7 +1046,7 @@ frdest_t *fdp;
 		if (!ip->ip_sum)
 			ip->ip_sum = in_cksum(m, hlen);
 		error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst,
-					  ro->ro_rt);
+					  ro);
 		goto done;
 	}
 	/*
@@ -1127,7 +1127,7 @@ sendorfree:
 		m->m_act = 0;
 		if (error == 0)
 			error = (*ifp->if_output)(ifp, m,
-			    (struct sockaddr *)dst, ro->ro_rt);
+			    (struct sockaddr *)dst, ro);
 		else
 			FREE_MB_T(m);
 	}

Modified: head/sys/contrib/pf/net/if_pflog.c
==============================================================================
--- head/sys/contrib/pf/net/if_pflog.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/contrib/pf/net/if_pflog.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -113,7 +113,7 @@ __FBSDID("$FreeBSD$");
 
 void	pflogattach(int);
 int	pflogoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
-	    	       struct rtentry *);
+    		       struct route *);
 int	pflogioctl(struct ifnet *, u_long, caddr_t);
 void	pflogstart(struct ifnet *);
 #ifdef __FreeBSD__
@@ -287,7 +287,7 @@ pflogstart(struct ifnet *ifp)
 
 int
 pflogoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
-	struct rtentry *rt)
+       struct route *ro)
 {
 	m_freem(m);
 	return (0);

Modified: head/sys/contrib/pf/net/if_pfsync.c
==============================================================================
--- head/sys/contrib/pf/net/if_pfsync.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/contrib/pf/net/if_pfsync.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -152,7 +152,7 @@ int	pfsync_insert_net_state(struct pfsyn
 void	pfsync_update_net_tdb(struct pfsync_tdb *);
 #endif
 int	pfsyncoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
-	    struct rtentry *);
+	    struct route *);
 int	pfsyncioctl(struct ifnet *, u_long, caddr_t);
 void	pfsyncstart(struct ifnet *);
 
@@ -1083,7 +1083,7 @@ done:
 
 int
 pfsyncoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
-	struct rtentry *rt)
+	struct route *ro)
 {
 	m_freem(m);
 	return (0);

Modified: head/sys/contrib/pf/net/pf.c
==============================================================================
--- head/sys/contrib/pf/net/pf.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/contrib/pf/net/pf.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -6245,7 +6245,7 @@ pf_route(struct mbuf **m, struct pf_rule
 			}
 		}
 		PF_UNLOCK();
-		error = (*ifp->if_output)(ifp, m0, sintosa(dst), ro->ro_rt);
+		error = (*ifp->if_output)(ifp, m0, sintosa(dst), ro);
 		PF_LOCK();
 		goto done;
 	}

Modified: head/sys/dev/iicbus/if_ic.c
==============================================================================
--- head/sys/dev/iicbus/if_ic.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/dev/iicbus/if_ic.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -103,7 +103,7 @@ static int icattach(device_t);
 
 static int icioctl(struct ifnet *, u_long, caddr_t);
 static int icoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
-		struct rtentry *);
+               struct route *);
 
 static int icintr(device_t, int, char *);
 
@@ -354,7 +354,7 @@ icintr(device_t dev, int event, char *pt
  */
 static int
 icoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
-    struct rtentry *rt)
+    struct route *ro)
 {
 	struct ic_softc *sc = ifp->if_softc;
 	device_t icdev = sc->ic_dev;

Modified: head/sys/dev/lmc/if_lmc.c
==============================================================================
--- head/sys/dev/lmc/if_lmc.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/dev/lmc/if_lmc.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -114,6 +114,7 @@
 # include 
 # include 
 # include 
+# include 
 # include 
 # include 
 # include 
@@ -4583,7 +4584,7 @@ lmc_ifnet_start(struct ifnet *ifp)
 /* Called from a syscall (user context; no spinlocks). */
 static int
 lmc_raw_output(struct ifnet *ifp, struct mbuf *m,
- struct sockaddr *dst, struct rtentry *rt)
+ struct sockaddr *dst, struct route *ro)
   {
   softc_t *sc = IFP2SC(ifp);
   int error = 0;

Modified: head/sys/dev/lmc/if_lmc.h
==============================================================================
--- head/sys/dev/lmc/if_lmc.h	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/dev/lmc/if_lmc.h	Thu Apr 16 20:30:28 2009	(r191148)
@@ -1595,7 +1595,7 @@ static int lmc_raw_ioctl(struct ifnet *,
 static int lmc_ifnet_ioctl(struct ifnet *, u_long, caddr_t);
 static void lmc_ifnet_start(struct ifnet *);
 static int lmc_raw_output(struct ifnet *, struct mbuf *,
- struct sockaddr *, struct rtentry *);
+ struct sockaddr *, struct route *);
 static void lmc_ifnet_watchdog(struct ifnet *);
 # ifdef __OpenBSD__
 static int ifmedia_change(struct ifnet *);

Modified: head/sys/dev/ppbus/if_plip.c
==============================================================================
--- head/sys/dev/ppbus/if_plip.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/dev/ppbus/if_plip.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -99,6 +99,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -173,7 +174,7 @@ static u_char *ctxmith;
 static int lpinittables(void);
 static int lpioctl(struct ifnet *, u_long, caddr_t);
 static int lpoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
-	struct rtentry *);
+       struct route *);
 static void lpstop(struct lp_data *);
 static void lp_intr(void *);
 static int lp_module_handler(module_t, int, void *);
@@ -678,7 +679,7 @@ lpoutbyte(u_char byte, int spin, device_
 
 static int
 lpoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
-    struct rtentry *rt)
+    struct route *ro)
 {
 	struct lp_data *sc = ifp->if_softc;
 	device_t dev = sc->sc_dev;

Modified: head/sys/net/ethernet.h
==============================================================================
--- head/sys/net/ethernet.h	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/ethernet.h	Thu Apr 16 20:30:28 2009	(r191148)
@@ -365,7 +365,7 @@ struct ether_addr {
 
 struct ifnet;
 struct mbuf;
-struct rtentry;
+struct route;
 struct sockaddr;
 struct bpf_if;
 
@@ -376,7 +376,7 @@ extern	void ether_ifattach(struct ifnet 
 extern	void ether_ifdetach(struct ifnet *);
 extern	int  ether_ioctl(struct ifnet *, u_long, caddr_t);
 extern	int  ether_output(struct ifnet *,
-		   struct mbuf *, struct sockaddr *, struct rtentry *);
+		   struct mbuf *, struct sockaddr *, struct route *);
 extern	int  ether_output_frame(struct ifnet *, struct mbuf *);
 extern	char *ether_sprintf(const u_int8_t *);
 void	ether_vlan_mtap(struct bpf_if *, struct mbuf *,

Modified: head/sys/net/if_arc.h
==============================================================================
--- head/sys/net/if_arc.h	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_arc.h	Thu Apr 16 20:30:28 2009	(r191148)
@@ -133,7 +133,7 @@ void	arc_storelladdr(struct ifnet *, u_i
 int	arc_isphds(u_int8_t);
 void	arc_input(struct ifnet *, struct mbuf *);
 int	arc_output(struct ifnet *, struct mbuf *,
-	    struct sockaddr *, struct rtentry *);
+	    struct sockaddr *, struct route *);
 int	arc_ioctl(struct ifnet *, int, caddr_t);
 
 void		arc_frag_init(struct ifnet *);

Modified: head/sys/net/if_arcsubr.c
==============================================================================
--- head/sys/net/if_arcsubr.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_arcsubr.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -102,7 +102,7 @@ u_int8_t  arcbroadcastaddr = 0;
  */
 int
 arc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
-    struct rtentry *rt0)
+    struct route *ro)
 {
 	struct arc_header	*ah;
 	int			error;
@@ -129,7 +129,8 @@ arc_output(struct ifnet *ifp, struct mbu
 		else if (ifp->if_flags & IFF_NOARP)
 			adst = ntohl(SIN(dst)->sin_addr.s_addr) & 0xFF;
 		else {
-			error = arpresolve(ifp, rt0, m, dst, &adst, &lle);
+			error = arpresolve(ifp, ro ? ro->ro_rt : NULL,
+			                   m, dst, &adst, &lle);
 			if (error)
 				return (error == EWOULDBLOCK ? 0 : error);
 		}

Modified: head/sys/net/if_atm.h
==============================================================================
--- head/sys/net/if_atm.h	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_atm.h	Thu Apr 16 20:30:28 2009	(r191148)
@@ -293,7 +293,7 @@ void	atm_ifdetach(struct ifnet *);
 void	atm_input(struct ifnet *, struct atm_pseudohdr *,
 	    struct mbuf *, void *);
 int	atm_output(struct ifnet *, struct mbuf *, struct sockaddr *, 
-	    struct rtentry *);
+	    struct route *);
 struct atmio_vcctable *atm_getvccs(struct atmio_vcc **, u_int, u_int,
 	    struct mtx *, int);
 

Modified: head/sys/net/if_atmsubr.c
==============================================================================
--- head/sys/net/if_atmsubr.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_atmsubr.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -113,17 +113,17 @@ MALLOC_DEFINE(M_IFATM, "ifatm", "atm int
  *     "ifp" = ATM interface to output to
  *     "m0" = the packet to output
  *     "dst" = the sockaddr to send to (either IP addr, or raw VPI/VCI)
- *     "rt0" = the route to use
+ *     "ro" = the route to use
  *   returns: error code   [0 == ok]
  *
  *   note: special semantic: if (dst == NULL) then we assume "m" already
  *		has an atm_pseudohdr on it and just send it directly.
  *		[for native mode ATM output]   if dst is null, then
- *		rt0 must also be NULL.
+ *		ro->ro_rt must also be NULL.
  */
 int
 atm_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
-    struct rtentry *rt0)
+    struct route *ro)
 {
 	u_int16_t etype = 0;			/* if using LLC/SNAP */
 	int error = 0, sz;
@@ -157,7 +157,7 @@ atm_output(struct ifnet *ifp, struct mbu
 			        etype = ETHERTYPE_IPV6;
 			else
 			        etype = ETHERTYPE_IP;
-			if (!atmresolve(rt0, m, dst, &atmdst)) {
+			if (!atmresolve(ro->ro_rt, m, dst, &atmdst)) {
 				m = NULL; 
 				/* XXX: atmresolve already free'd it */
 				senderr(EHOSTUNREACH);

Modified: head/sys/net/if_disc.c
==============================================================================
--- head/sys/net/if_disc.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_disc.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -66,7 +66,7 @@ struct disc_softc {
 };
 
 static int	discoutput(struct ifnet *, struct mbuf *,
-		    struct sockaddr *, struct rtentry *);
+		    struct sockaddr *, struct route *);
 static void	discrtrequest(int, struct rtentry *, struct rt_addrinfo *);
 static int	discioctl(struct ifnet *, u_long, caddr_t);
 static int	disc_clone_create(struct if_clone *, int, caddr_t);
@@ -156,7 +156,7 @@ DECLARE_MODULE(if_disc, disc_mod, SI_SUB
 
 static int
 discoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
-    struct rtentry *rt)
+    struct route *ro)
 {
 	u_int32_t af;
 

Modified: head/sys/net/if_enc.c
==============================================================================
--- head/sys/net/if_enc.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_enc.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -85,7 +85,7 @@ struct enc_softc {
 
 static int	enc_ioctl(struct ifnet *, u_long, caddr_t);
 static int	enc_output(struct ifnet *ifp, struct mbuf *m,
-		    struct sockaddr *dst, struct rtentry *rt);
+		    struct sockaddr *dst, struct route *ro);
 static int	enc_clone_create(struct if_clone *, int, caddr_t);
 static void	enc_clone_destroy(struct ifnet *);
 
@@ -185,7 +185,7 @@ DECLARE_MODULE(enc, enc_mod, SI_SUB_PROT
 
 static int
 enc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
-    struct rtentry *rt)
+    struct route *ro)
 {
 	m_freem(m);
 	return (0);

Modified: head/sys/net/if_ethersubr.c
==============================================================================
--- head/sys/net/if_ethersubr.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_ethersubr.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -163,17 +163,22 @@ static int ether_ipfw;
  */
 int
 ether_output(struct ifnet *ifp, struct mbuf *m,
-	struct sockaddr *dst, struct rtentry *rt0)
+	struct sockaddr *dst, struct route *ro)
 {
 	short type;
-	int error, hdrcmplt = 0;
+	int error = 0, hdrcmplt = 0;
 	u_char esrc[ETHER_ADDR_LEN], edst[ETHER_ADDR_LEN];
 	struct llentry *lle = NULL;
+	struct rtentry *rt0 = NULL;
 	struct ether_header *eh;
 	struct pf_mtag *t;
 	int loop_copy = 1;
 	int hlen;	/* link layer header length */
 
+	if (ro != NULL) {
+		lle = ro->ro_lle;
+		rt0 = ro->ro_rt;
+	}
 #ifdef MAC
 	error = mac_ifnet_check_transmit(ifp, m);
 	if (error)
@@ -191,7 +196,10 @@ ether_output(struct ifnet *ifp, struct m
 	switch (dst->sa_family) {
 #ifdef INET
 	case AF_INET:
-		error = arpresolve(ifp, rt0, m, dst, edst, &lle);
+		if (lle != NULL && (lle->la_flags & LLE_VALID))
+			memcpy(edst, &lle->ll_addr.mac16, sizeof(edst));
+		else
+			error = arpresolve(ifp, rt0, m, dst, edst, &lle);
 		if (error)
 			return (error == EWOULDBLOCK ? 0 : error);
 		type = htons(ETHERTYPE_IP);
@@ -226,7 +234,10 @@ ether_output(struct ifnet *ifp, struct m
 #endif
 #ifdef INET6
 	case AF_INET6:
-		error = nd6_storelladdr(ifp, m, dst, (u_char *)edst, &lle);
+		if (lle != NULL && (lle->la_flags & LLE_VALID))
+			memcpy(edst, &lle->ll_addr.mac16, sizeof(edst));
+		else
+			error = nd6_storelladdr(ifp, m, dst, (u_char *)edst, &lle);
 		if (error)
 			return error;
 		type = htons(ETHERTYPE_IPV6);

Modified: head/sys/net/if_faith.c
==============================================================================
--- head/sys/net/if_faith.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_faith.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -88,7 +88,7 @@ struct faith_softc {
 
 static int faithioctl(struct ifnet *, u_long, caddr_t);
 int faithoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
-	struct rtentry *);
+	struct route *);
 static void faithrtrequest(int, struct rtentry *, struct rt_addrinfo *);
 #ifdef INET6
 static int faithprefix(struct in6_addr *);
@@ -188,17 +188,20 @@ faith_clone_destroy(ifp)
 }
 
 int
-faithoutput(ifp, m, dst, rt)
+faithoutput(ifp, m, dst, ro)
 	struct ifnet *ifp;
 	struct mbuf *m;
 	struct sockaddr *dst;
-	struct rtentry *rt;
+	struct route *ro;
 {
 	int isr;
 	u_int32_t af;
+	struct rtentry *rt = NULL;
 
 	M_ASSERTPKTHDR(m);
 
+	if (ro != NULL)
+		rt = ro->ro_rt;
 	/* BPF writes need to be handled specially. */
 	if (dst->sa_family == AF_UNSPEC) {
 		bcopy(dst->sa_data, &af, sizeof(af));

Modified: head/sys/net/if_fddisubr.c
==============================================================================
--- head/sys/net/if_fddisubr.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_fddisubr.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -98,7 +98,7 @@ static const u_char fddibroadcastaddr[FD
 static int fddi_resolvemulti(struct ifnet *, struct sockaddr **,
 			      struct sockaddr *);
 static int fddi_output(struct ifnet *, struct mbuf *, struct sockaddr *,
-		       struct rtentry *); 
+		       struct route *); 
 static void fddi_input(struct ifnet *ifp, struct mbuf *m);
 
 #define	senderr(e)	do { error = (e); goto bad; } while (0)
@@ -111,18 +111,21 @@ static void fddi_input(struct ifnet *ifp
  * Assumes that ifp is actually pointer to arpcom structure.
  */
 static int
-fddi_output(ifp, m, dst, rt0)
+fddi_output(ifp, m, dst, ro)
 	struct ifnet *ifp;
 	struct mbuf *m;
 	struct sockaddr *dst;
-	struct rtentry *rt0;
+	struct route *ro;
 {
 	u_int16_t type;
 	int loop_copy = 0, error = 0, hdrcmplt = 0;
  	u_char esrc[FDDI_ADDR_LEN], edst[FDDI_ADDR_LEN];
 	struct fddi_header *fh;
 	struct llentry *lle;
+	struct rtentry *rt0 = NULL;
 
+	if (ro != NULL)
+		rt0 = ro->ro_rt;
 #ifdef MAC
 	error = mac_ifnet_check_transmit(ifp, m);
 	if (error)

Modified: head/sys/net/if_fwsubr.c
==============================================================================
--- head/sys/net/if_fwsubr.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_fwsubr.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -77,7 +77,7 @@ struct fw_hwaddr firewire_broadcastaddr 
 
 static int
 firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
-    struct rtentry *rt0)
+    struct route *ro)
 {
 	struct fw_com *fc = IFP2FWC(ifp);
 	int error, type;
@@ -138,7 +138,7 @@ firewire_output(struct ifnet *ifp, struc
 		 * doesn't fit into the arp model.
 		 */
 		if (unicast) {
-			error = arpresolve(ifp, rt0, m, dst, (u_char *) destfw, &lle);
+			error = arpresolve(ifp, ro ? ro->ro_rt : NULL, m, dst, (u_char *) destfw, &lle);
 			if (error)
 				return (error == EWOULDBLOCK ? 0 : error);
 		}

Modified: head/sys/net/if_gif.c
==============================================================================
--- head/sys/net/if_gif.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_gif.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -409,11 +409,11 @@ gif_start(struct ifnet *ifp)
 }
 
 int
-gif_output(ifp, m, dst, rt)
+gif_output(ifp, m, dst, ro)
 	struct ifnet *ifp;
 	struct mbuf *m;
 	struct sockaddr *dst;
-	struct rtentry *rt;	/* added in net2 */
+	struct route *ro;
 {
 	INIT_VNET_GIF(ifp->if_vnet);
 	struct gif_softc *sc = ifp->if_softc;

Modified: head/sys/net/if_gif.h
==============================================================================
--- head/sys/net/if_gif.h	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_gif.h	Thu Apr 16 20:30:28 2009	(r191148)
@@ -106,7 +106,7 @@ struct etherip_header {
 /* Prototypes */
 void gif_input(struct mbuf *, int, struct ifnet *);
 int gif_output(struct ifnet *, struct mbuf *, struct sockaddr *,
-	       struct rtentry *);
+	       struct route *);
 int gif_ioctl(struct ifnet *, u_long, caddr_t);
 int gif_set_tunnel(struct ifnet *, struct sockaddr *, struct sockaddr *);
 void gif_delete_tunnel(struct ifnet *);

Modified: head/sys/net/if_gre.c
==============================================================================
--- head/sys/net/if_gre.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_gre.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -110,7 +110,7 @@ static int	gre_clone_create(struct if_cl
 static void	gre_clone_destroy(struct ifnet *);
 static int	gre_ioctl(struct ifnet *, u_long, caddr_t);
 static int	gre_output(struct ifnet *, struct mbuf *, struct sockaddr *,
-		    struct rtentry *rt);
+		    struct route *ro);
 
 IFC_SIMPLE_DECLARE(gre, 0);
 
@@ -240,7 +240,7 @@ gre_clone_destroy(ifp)
  */
 static int
 gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
-	   struct rtentry *rt)
+	   struct route *ro)
 {
 #ifdef INET6
 	INIT_VNET_INET(ifp->if_vnet);

Modified: head/sys/net/if_iso88025subr.c
==============================================================================
--- head/sys/net/if_iso88025subr.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_iso88025subr.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -232,11 +232,11 @@ iso88025_ioctl(struct ifnet *ifp, int co
  * ISO88025 encapsulation
  */
 int
-iso88025_output(ifp, m, dst, rt0)
+iso88025_output(ifp, m, dst, ro)
 	struct ifnet *ifp;
 	struct mbuf *m;
 	struct sockaddr *dst;
-	struct rtentry *rt0;
+	struct route *ro;
 {
 	u_int16_t snap_type = 0;
 	int loop_copy = 0, error = 0, rif_len = 0;
@@ -245,6 +245,10 @@ iso88025_output(ifp, m, dst, rt0)
 	struct iso88025_header gen_th;
 	struct sockaddr_dl *sdl = NULL;
 	struct llentry *lle;
+	struct rtentry *rt0 = NULL;
+
+	if (ro != NULL)
+		rt0 = ro->ro_rt;
 
 #ifdef MAC
 	error = mac_ifnet_check_transmit(ifp, m);

Modified: head/sys/net/if_lagg.c
==============================================================================
--- head/sys/net/if_lagg.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_lagg.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -93,7 +93,7 @@ static void	lagg_linkstate(struct lagg_s
 static void	lagg_port_state(struct ifnet *, int);
 static int	lagg_port_ioctl(struct ifnet *, u_long, caddr_t);
 static int	lagg_port_output(struct ifnet *, struct mbuf *,
-		    struct sockaddr *, struct rtentry *);
+		    struct sockaddr *, struct route *);
 static void	lagg_port_ifdetach(void *arg __unused, struct ifnet *);
 static int	lagg_port_checkstacking(struct lagg_softc *);
 static void	lagg_port2req(struct lagg_port *, struct lagg_reqport *);
@@ -676,7 +676,7 @@ fallback:
 
 static int
 lagg_port_output(struct ifnet *ifp, struct mbuf *m,
-	struct sockaddr *dst, struct rtentry *rt0)
+	struct sockaddr *dst, struct route *ro)
 {
 	struct lagg_port *lp = ifp->if_lagg;
 	struct ether_header *eh;
@@ -696,7 +696,7 @@ lagg_port_output(struct ifnet *ifp, stru
 	 */
 	switch (ntohs(type)) {
 		case ETHERTYPE_PAE:	/* EAPOL PAE/802.1x */
-			return ((*lp->lp_output)(ifp, m, dst, rt0));
+			return ((*lp->lp_output)(ifp, m, dst, ro));
 	}
 
 	/* drop any other frames */

Modified: head/sys/net/if_lagg.h
==============================================================================
--- head/sys/net/if_lagg.h	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_lagg.h	Thu Apr 16 20:30:28 2009	(r191148)
@@ -218,7 +218,7 @@ struct lagg_port {
 	/* Redirected callbacks */
 	int	(*lp_ioctl)(struct ifnet *, u_long, caddr_t);
 	int	(*lp_output)(struct ifnet *, struct mbuf *, struct sockaddr *,
-		     struct rtentry *);
+		     struct route *);
 
 	SLIST_ENTRY(lagg_port)		lp_entries;
 };

Modified: head/sys/net/if_loop.c
==============================================================================
--- head/sys/net/if_loop.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_loop.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -102,7 +102,7 @@
 int		loioctl(struct ifnet *, u_long, caddr_t);
 static void	lortrequest(int, struct rtentry *, struct rt_addrinfo *);
 int		looutput(struct ifnet *ifp, struct mbuf *m,
-		    struct sockaddr *dst, struct rtentry *rt);
+		    struct sockaddr *dst, struct route *ro);
 static int	lo_clone_create(struct if_clone *, int, caddr_t);
 static void	lo_clone_destroy(struct ifnet *);
 static int	vnet_loif_iattach(const void *);
@@ -205,15 +205,18 @@ DECLARE_MODULE(loop, loop_mod, SI_SUB_PR
 
 int
 looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
-    struct rtentry *rt)
+    struct route *ro)
 {
 	u_int32_t af;
+	struct rtentry *rt = NULL;
 #ifdef MAC
 	int error;
 #endif
 
 	M_ASSERTPKTHDR(m); /* check if we have the packet header */
 
+	if (ro != NULL)
+		rt = ro->ro_rt;
 #ifdef MAC
 	error = mac_ifnet_check_transmit(ifp, m);
 	if (error) {

Modified: head/sys/net/if_spppsubr.c
==============================================================================
--- head/sys/net/if_spppsubr.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_spppsubr.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -263,7 +263,7 @@ static const u_short interactive_ports[8
 	int debug = ifp->if_flags & IFF_DEBUG
 
 static int sppp_output(struct ifnet *ifp, struct mbuf *m,
-		       struct sockaddr *dst, struct rtentry *rt);
+		       struct sockaddr *dst, struct route *ro);
 
 static void sppp_cisco_send(struct sppp *sp, int type, long par1, long par2);
 static void sppp_cisco_input(struct sppp *sp, struct mbuf *m);
@@ -786,7 +786,7 @@ sppp_ifstart(struct ifnet *ifp)
  */
 static int
 sppp_output(struct ifnet *ifp, struct mbuf *m,
-	    struct sockaddr *dst, struct rtentry *rt)
+	    struct sockaddr *dst, struct route *ro)
 {
 	struct sppp *sp = IFP2SP(ifp);
 	struct ppp_header *h;

Modified: head/sys/net/if_stf.c
==============================================================================
--- head/sys/net/if_stf.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_stf.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -178,7 +178,7 @@ static int stfmodevent(module_t, int, vo
 static int stf_encapcheck(const struct mbuf *, int, int, void *);
 static struct in6_ifaddr *stf_getsrcifa6(struct ifnet *);
 static int stf_output(struct ifnet *, struct mbuf *, struct sockaddr *,
-	struct rtentry *);
+	struct route *);
 static int isrfc1918addr(struct in_addr *);
 static int stf_checkaddr4(struct stf_softc *, struct in_addr *,
 	struct ifnet *);
@@ -403,11 +403,11 @@ stf_getsrcifa6(ifp)
 }
 
 static int
-stf_output(ifp, m, dst, rt)
+stf_output(ifp, m, dst, ro)
 	struct ifnet *ifp;
 	struct mbuf *m;
 	struct sockaddr *dst;
-	struct rtentry *rt;
+	struct route *ro;
 {
 	struct stf_softc *sc;
 	struct sockaddr_in6 *dst6;

Modified: head/sys/net/if_tun.c
==============================================================================
--- head/sys/net/if_tun.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_tun.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -129,7 +129,7 @@ static int	tunifioctl(struct ifnet *, u_
 static int	tuninit(struct ifnet *);
 static int	tunmodevent(module_t, int, void *);
 static int	tunoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
-		    struct rtentry *rt);
+		    struct route *ro);
 static void	tunstart(struct ifnet *);
 
 static int	tun_clone_create(struct if_clone *, int, caddr_t);
@@ -591,7 +591,7 @@ tunoutput(
 	struct ifnet *ifp,
 	struct mbuf *m0,
 	struct sockaddr *dst,
-	struct rtentry *rt)
+	struct route *ro)
 {
 	struct tun_softc *tp = ifp->if_softc;
 	u_short cached_tun_flags;

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/if_var.h	Thu Apr 16 20:30:28 2009	(r191148)
@@ -70,6 +70,7 @@ struct	socket;
 struct	ether_header;
 struct	carp_if;
 struct  ifvlantrunk;
+struct	route;
 #endif
 
 #include 		/* get TAILQ macros */
@@ -149,7 +150,7 @@ struct ifnet {
 /* procedure handles */
 	int	(*if_output)		/* output routine (enqueue) */
 		(struct ifnet *, struct mbuf *, struct sockaddr *,
-		     struct rtentry *);
+		     struct route *);
 	void	(*if_input)		/* input routine (from h/w driver) */
 		(struct ifnet *, struct mbuf *);
 	void	(*if_start)		/* initiate output routine */

Modified: head/sys/net/iso88025.h
==============================================================================
--- head/sys/net/iso88025.h	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/iso88025.h	Thu Apr 16 20:30:28 2009	(r191148)
@@ -166,7 +166,7 @@ void	iso88025_ifattach	(struct ifnet *, 
 void	iso88025_ifdetach	(struct ifnet *, int);
 int	iso88025_ioctl		(struct ifnet *, int , caddr_t );
 int	iso88025_output		(struct ifnet *, struct mbuf *, struct sockaddr *,
-				 struct rtentry *);
+    				 struct route *);
 void	iso88025_input		(struct ifnet *, struct mbuf *);
 
 #endif

Modified: head/sys/net/route.h
==============================================================================
--- head/sys/net/route.h	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net/route.h	Thu Apr 16 20:30:28 2009	(r191148)
@@ -41,9 +41,10 @@
  */
 
 /*
- * A route consists of a destination address and a reference
- * to a routing entry.  These are often held by protocols
- * in their control blocks, e.g. inpcb.
+ * A route consists of a destination address, a reference
+ * to a routing entry, and a reference to an llentry.  
+ * These are often held by protocols in their control
+ * blocks, e.g. inpcb.
  */
 struct route {
 	struct	rtentry *ro_rt;

Modified: head/sys/net80211/ieee80211.c
==============================================================================
--- head/sys/net80211/ieee80211.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net80211/ieee80211.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -221,7 +221,7 @@ null_update_promisc(struct ifnet *ifp)
 
 static int
 null_output(struct ifnet *ifp, struct mbuf *m,
-	struct sockaddr *dst, struct rtentry *rt0)
+	struct sockaddr *dst, struct route *ro)
 {
 	if_printf(ifp, "discard raw packet\n");
 	m_freem(m);

Modified: head/sys/net80211/ieee80211_output.c
==============================================================================
--- head/sys/net80211/ieee80211_output.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net80211/ieee80211_output.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -294,7 +294,7 @@ ieee80211_start(struct ifnet *ifp)
  */
 int
 ieee80211_output(struct ifnet *ifp, struct mbuf *m,
-	struct sockaddr *dst, struct rtentry *rt0)
+	struct sockaddr *dst, struct route *ro)
 {
 #define senderr(e) do { error = (e); goto bad;} while (0)
 	struct ieee80211_node *ni = NULL;
@@ -320,7 +320,7 @@ ieee80211_output(struct ifnet *ifp, stru
 	 * a raw 802.11 frame.
 	 */
 	if (dst->sa_family != AF_IEEE80211)
-		return vap->iv_output(ifp, m, dst, rt0);
+		return vap->iv_output(ifp, m, dst, ro);
 #ifdef MAC
 	error = mac_check_ifnet_transmit(ifp, m);
 	if (error)

Modified: head/sys/net80211/ieee80211_proto.h
==============================================================================
--- head/sys/net80211/ieee80211_proto.h	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net80211/ieee80211_proto.h	Thu Apr 16 20:30:28 2009	(r191148)
@@ -70,7 +70,7 @@ int	ieee80211_mgmt_output(struct ieee802
 int	ieee80211_raw_xmit(struct ieee80211_node *, struct mbuf *,
 		const struct ieee80211_bpf_params *);
 int	ieee80211_output(struct ifnet *, struct mbuf *,
-		struct sockaddr *, struct rtentry *);
+               struct sockaddr *, struct route *ro);
 void	ieee80211_start(struct ifnet *);
 int	ieee80211_send_nulldata(struct ieee80211_node *);
 int	ieee80211_classify(struct ieee80211_node *, struct mbuf *m);

Modified: head/sys/net80211/ieee80211_var.h
==============================================================================
--- head/sys/net80211/ieee80211_var.h	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/net80211/ieee80211_var.h	Thu Apr 16 20:30:28 2009	(r191148)
@@ -437,7 +437,7 @@ struct ieee80211vap {
 				    enum ieee80211_state, int);
 	/* 802.3 output method for raw frame xmit */
 	int			(*iv_output)(struct ifnet *, struct mbuf *,
-				    struct sockaddr *, struct rtentry *);
+				    struct sockaddr *, struct route *);
 };
 MALLOC_DECLARE(M_80211_VAP);
 

Modified: head/sys/netgraph/ng_fec.c
==============================================================================
--- head/sys/netgraph/ng_fec.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/netgraph/ng_fec.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -107,6 +107,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -165,7 +166,7 @@ struct ng_fec_bundle {
 	int			(*fec_if_output) (struct ifnet *,
 						  struct mbuf *,
 						  struct sockaddr *,
-						  struct rtentry *);
+						  struct route *);
 };
 
 #define FEC_BTYPE_MAC		0x01
@@ -197,7 +198,7 @@ static int	ng_fec_ifmedia_upd(struct ifn
 static void	ng_fec_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr);
 static int	ng_fec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
 static int	ng_fec_output(struct ifnet *ifp, struct mbuf *m0,
-			struct sockaddr *dst, struct rtentry *rt0);
+			struct sockaddr *dst, struct route *ro);
 static void	ng_fec_tick(void *arg);
 static int	ng_fec_addport(struct ng_fec_private *priv, char *iface);
 static int	ng_fec_delport(struct ng_fec_private *priv, char *iface);
@@ -923,7 +924,7 @@ ng_fec_input(struct ifnet *ifp, struct m
 
 static int
 ng_fec_output(struct ifnet *ifp, struct mbuf *m,
-		struct sockaddr *dst, struct rtentry *rt0)
+		struct sockaddr *dst, struct route *ro)
 {
 	const priv_p priv = (priv_p) ifp->if_softc;
 	struct ng_fec_bundle *b;
@@ -977,7 +978,7 @@ ng_fec_output(struct ifnet *ifp, struct 
 	 * for us.
 	 */
 	priv->if_error = 0;
-	error = (*b->fec_if_output)(ifp, m, dst, rt0);
+	error = (*b->fec_if_output)(ifp, m, dst, ro);
 	if (priv->if_error && !error)
 		error = priv->if_error;
 

Modified: head/sys/netgraph/ng_iface.c
==============================================================================
--- head/sys/netgraph/ng_iface.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/netgraph/ng_iface.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -75,6 +75,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -121,7 +122,7 @@ typedef struct ng_iface_private *priv_p;
 static void	ng_iface_start(struct ifnet *ifp);
 static int	ng_iface_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
 static int	ng_iface_output(struct ifnet *ifp, struct mbuf *m0,
-			struct sockaddr *dst, struct rtentry *rt0);
+    			struct sockaddr *dst, struct route *ro);
 static void	ng_iface_bpftap(struct ifnet *ifp,
 			struct mbuf *m, sa_family_t family);
 static int	ng_iface_send(struct ifnet *ifp, struct mbuf *m,
@@ -354,7 +355,7 @@ ng_iface_ioctl(struct ifnet *ifp, u_long
 
 static int
 ng_iface_output(struct ifnet *ifp, struct mbuf *m,
-		struct sockaddr *dst, struct rtentry *rt0)
+    		struct sockaddr *dst, struct route *ro)
 {
 	struct m_tag *mtag;
 	uint32_t af;

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/netinet/if_ether.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -238,7 +238,7 @@ arprequest(struct ifnet *ifp, struct in_
 	sa.sa_family = AF_ARP;
 	sa.sa_len = 2;
 	m->m_flags |= M_BCAST;
-	(*ifp->if_output)(ifp, m, &sa, (struct rtentry *)0);
+	(*ifp->if_output)(ifp, m, &sa, NULL);
 }
 
 /*
@@ -753,7 +753,7 @@ reply:
 	m->m_pkthdr.len = m->m_len;   
 	sa.sa_family = AF_ARP;
 	sa.sa_len = 2;
-	(*ifp->if_output)(ifp, m, &sa, (struct rtentry *)0);
+	(*ifp->if_output)(ifp, m, &sa, NULL);
 	return;
 
 drop:

Modified: head/sys/netinet/ip_carp.c
==============================================================================
--- head/sys/netinet/ip_carp.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/netinet/ip_carp.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -207,7 +207,7 @@ static void	carp_master_down(void *);
 static void	carp_master_down_locked(struct carp_softc *);
 static int	carp_ioctl(struct ifnet *, u_long, caddr_t);
 static int	carp_looutput(struct ifnet *, struct mbuf *, struct sockaddr *,
-		    struct rtentry *);
+    		    struct route *);
 static void	carp_start(struct ifnet *);
 static void	carp_setrun(struct carp_softc *, sa_family_t);
 static void	carp_set_state(struct carp_softc *, int);
@@ -2011,12 +2011,15 @@ carp_ioctl(struct ifnet *ifp, u_long cmd
  */
 static int
 carp_looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
-    struct rtentry *rt)
+    struct route *ro)
 {
 	u_int32_t af;
+	struct rtentry *rt = NULL;
 
 	M_ASSERTPKTHDR(m); /* check if we have the packet header */
 
+	if (ro != NULL)
+		rt = ro->ro_rt;
 	if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
 		m_freem(m);
 		return (rt->rt_flags & RTF_BLACKHOLE ? 0 :

Modified: head/sys/netinet/ip_fastfwd.c
==============================================================================
--- head/sys/netinet/ip_fastfwd.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/netinet/ip_fastfwd.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -183,7 +183,7 @@ ip_fastforward(struct mbuf *m)
 	M_ASSERTVALID(m);
 	M_ASSERTPKTHDR(m);
 
-	ro.ro_rt = NULL;
+	bzero(&ro, sizeof(ro));
 
 	/*
 	 * Step 1: check for packet drop conditions (and sanity checks)
@@ -552,7 +552,7 @@ passout:
 		 * Send off the packet via outgoing interface
 		 */
 		error = (*ifp->if_output)(ifp, m,
-				(struct sockaddr *)dst, ro.ro_rt);
+				(struct sockaddr *)dst, &ro);
 	} else {
 		/*
 		 * Handle EMSGSIZE with icmp reply needfrag for TCP MTU discovery
@@ -585,7 +585,7 @@ passout:
 				m->m_nextpkt = NULL;
 
 				error = (*ifp->if_output)(ifp, m,
-					(struct sockaddr *)dst, ro.ro_rt);
+					(struct sockaddr *)dst, &ro);
 				if (error)
 					break;
 			} while ((m = m0) != NULL);

Modified: head/sys/netinet/ip_output.c
==============================================================================
--- head/sys/netinet/ip_output.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/netinet/ip_output.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -595,7 +595,7 @@ passout:
 		 */
 		m->m_flags &= ~(M_PROTOFLAGS);
 		error = (*ifp->if_output)(ifp, m,
-				(struct sockaddr *)dst, ro->ro_rt);
+		    		(struct sockaddr *)dst, ro);
 		goto done;
 	}
 
@@ -629,7 +629,7 @@ passout:
 			m->m_flags &= ~(M_PROTOFLAGS);
 
 			error = (*ifp->if_output)(ifp, m,
-			    (struct sockaddr *)dst, ro->ro_rt);
+			    (struct sockaddr *)dst, ro);
 		} else
 			m_freem(m);
 	}

Modified: head/sys/netinet6/nd6.c
==============================================================================
--- head/sys/netinet6/nd6.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/netinet6/nd6.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -1939,7 +1939,7 @@ nd6_output_lle(struct ifnet *ifp, struct
 
 int
 nd6_output_flush(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *chain,
-    struct sockaddr_in6 *dst, struct rtentry *rt)
+    struct sockaddr_in6 *dst, struct route *ro)
 {
 	struct mbuf *m, *m_head;
 	struct ifnet *outifp;
@@ -1954,7 +1954,7 @@ nd6_output_flush(struct ifnet *ifp, stru
 	while (m_head) {
 		m = m_head;
 		m_head = m_head->m_nextpkt;
-		error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, rt);			       
+		error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, ro);			       
 	}
 
 	/*

Modified: head/sys/netinet6/nd6.h
==============================================================================
--- head/sys/netinet6/nd6.h	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/netinet6/nd6.h	Thu Apr 16 20:30:28 2009	(r191148)
@@ -395,7 +395,7 @@ int nd6_output_lle __P((struct ifnet *, 
 	struct sockaddr_in6 *, struct rtentry *, struct llentry *,
 	struct mbuf **));
 int nd6_output_flush __P((struct ifnet *, struct ifnet *, struct mbuf *,
-	struct sockaddr_in6 *, struct rtentry *));
+	struct sockaddr_in6 *, struct route *));
 int nd6_need_cache __P((struct ifnet *));
 int nd6_storelladdr __P((struct ifnet *, struct mbuf *,
 	struct sockaddr *, u_char *, struct llentry **));

Modified: head/sys/netipx/ipx_outputfl.c
==============================================================================
--- head/sys/netipx/ipx_outputfl.c	Thu Apr 16 20:17:32 2009	(r191147)
+++ head/sys/netipx/ipx_outputfl.c	Thu Apr 16 20:30:28 2009	(r191148)
@@ -154,7 +154,7 @@ gotif:
 			ipx_watch_output(m0, ifp);
 		}
 		error = (*ifp->if_output)(ifp, m0,
-					(struct sockaddr *)dst, ro->ro_rt);
+					(struct sockaddr *)dst, ro);
 		goto done;
 	} else {
 		ipxstat.ipxs_mtutoosmall++;

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 22:04:07 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E1898106566C;
	Thu, 16 Apr 2009 22:04:07 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CFF6B8FC14;
	Thu, 16 Apr 2009 22:04:07 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GM47Sr093173;
	Thu, 16 Apr 2009 22:04:07 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GM47sG093171;
	Thu, 16 Apr 2009 22:04:07 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904162204.n3GM47sG093171@svn.freebsd.org>
From: Kip Macy 
Date: Thu, 16 Apr 2009 22:04:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191154 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 22:04:08 -0000

Author: kmacy
Date: Thu Apr 16 22:04:07 2009
New Revision: 191154
URL: http://svn.freebsd.org/changeset/base/191154

Log:
  add utility routine for updating an struct llentry *

Modified:
  head/sys/net/if_llatbl.c
  head/sys/net/if_llatbl.h

Modified: head/sys/net/if_llatbl.c
==============================================================================
--- head/sys/net/if_llatbl.c	Thu Apr 16 21:59:45 2009	(r191153)
+++ head/sys/net/if_llatbl.c	Thu Apr 16 22:04:07 2009	(r191154)
@@ -103,6 +103,39 @@ llentry_free(struct llentry *lle)
 	LLE_FREE_LOCKED(lle);
 }
 
+int
+llentry_update(struct llentry **llep, struct lltable *lt,
+    struct sockaddr *dst, struct ifnet *ifp)
+{
+	struct llentry *la;
+
+	IF_AFDATA_RLOCK(ifp);	
+	la = lla_lookup(lt, LLE_EXCLUSIVE,
+	    (struct sockaddr *)dst);
+	IF_AFDATA_RUNLOCK(ifp);
+	if ((la == NULL) && 
+	    (ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0) {
+		IF_AFDATA_WLOCK(ifp);
+		la = lla_lookup(lt,
+		    (LLE_CREATE | LLE_EXCLUSIVE),
+		    (struct sockaddr *)dst);
+		IF_AFDATA_WUNLOCK(ifp);	
+	}
+	if (la != NULL && (*llep != la)) {
+		if (*llep != NULL)
+			LLE_FREE(*llep);
+		LLE_ADDREF(la);
+		LLE_WUNLOCK(la);
+		*llep = la;
+	} else if (la != NULL)
+		LLE_WUNLOCK(la);
+
+	if (la == NULL)
+		return (ENOENT);
+
+	return (0);
+}
+
 /*
  * Free all entries from given table and free itself.
  * Since lltables collects from all of the intefaces,

Modified: head/sys/net/if_llatbl.h
==============================================================================
--- head/sys/net/if_llatbl.h	Thu Apr 16 21:59:45 2009	(r191153)
+++ head/sys/net/if_llatbl.h	Thu Apr 16 22:04:07 2009	(r191154)
@@ -178,6 +178,8 @@ void		lltable_drain(int);
 int		lltable_sysctl_dumparp(int, struct sysctl_req *);
 
 void		llentry_free(struct llentry *);
+int		llentry_update(struct llentry **, struct lltable *,
+                       struct sockaddr *, struct ifnet *);
 
 /*
  * Generic link layer address lookup function.

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 22:47:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 079EB106564A;
	Thu, 16 Apr 2009 22:47:44 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EA02C8FC1A;
	Thu, 16 Apr 2009 22:47:43 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GMlhq6094277;
	Thu, 16 Apr 2009 22:47:43 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GMlhnu094276;
	Thu, 16 Apr 2009 22:47:43 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904162247.n3GMlhnu094276@svn.freebsd.org>
From: Kip Macy 
Date: Thu, 16 Apr 2009 22:47:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191158 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 22:47:44 -0000

Author: kmacy
Date: Thu Apr 16 22:47:43 2009
New Revision: 191158
URL: http://svn.freebsd.org/changeset/base/191158

Log:
  restore spare pointers for MFCing

Modified:
  head/sys/netinet/in_pcb.h

Modified: head/sys/netinet/in_pcb.h
==============================================================================
--- head/sys/netinet/in_pcb.h	Thu Apr 16 22:23:32 2009	(r191157)
+++ head/sys/netinet/in_pcb.h	Thu Apr 16 22:47:43 2009	(r191158)
@@ -170,8 +170,7 @@ struct inpcb {
 	u_char	inp_ip_minttl;		/* (i) minimum TTL or drop */
 	uint32_t inp_flowid;		/* (x) flow id / queue id */
 	u_int	inp_refcount;		/* (i) refcount */
-	struct llentry	*inp_lle;	/* cached L2 information */
-	struct rtentry	*inp_rt;	/* cached L3 information */
+	void	inp_pspare[2];		/* (x) rtentry / general use */
 
 	/* Local and foreign ports, local and foreign addr. */
 	struct	in_conninfo inp_inc;	/* (i/p) list for PCB's local port */
@@ -203,6 +202,8 @@ struct inpcb {
 	struct	inpcbport *inp_phd;	/* (i/p) head of this list */
 #define inp_zero_size offsetof(struct inpcb, inp_gencnt)
 	inp_gen_t	inp_gencnt;	/* (c) generation count */
+	struct llentry	*inp_lle;	/* cached L2 information */
+	struct rtentry	*inp_rt;	/* cached L3 information */
 	struct rwlock	inp_lock;
 };
 #define	inp_fport	inp_inc.inc_fport

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 22:51:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6C24A1065696;
	Thu, 16 Apr 2009 22:51:17 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 3C3B18FC20;
	Thu, 16 Apr 2009 22:51:17 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id D82E146B45;
	Thu, 16 Apr 2009 18:51:16 -0400 (EDT)
Date: Thu, 16 Apr 2009 23:51:16 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Kip Macy 
In-Reply-To: <3c1674c90904141545tc2aa075l512cb76c1f334069@mail.gmail.com>
Message-ID: 
References: <200904140317.n3E3HigF092519@svn.freebsd.org>
	
	<3c1674c90904141545tc2aa075l512cb76c1f334069@mail.gmail.com>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="621616949-9378164-1239922276=:19879"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191037 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 22:51:18 -0000

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--621616949-9378164-1239922276=:19879
Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT

On Tue, 14 Apr 2009, Kip Macy wrote:

>> The commit message should perhaps read:
>>
>>  Call default if_qflush on ifq if there are still packets left in the
>>  default queue after calling the driver's flush method.
>>
>> However, this seems a bit odd: what if the driver uses if_snd as its queue 
>> but implements other differences in the transmit routine?  In that case, we 
>> might impose default queue properties on if_snd even though the driver 
>> doesn't use them.  Could you talk a bit about the circumstances under which 
>> the driver provides an if_qflush that doesn't drain its queues properly?
>
> I'm afraid I don't understand the question. If a driver only uses if_snd for 
> its transmit routine then there is no reason for it to override the default 
> if_qflush implementation.

In the past (and possibly still) device driver and link layers have used 
if_snd plus their own queues for differentiated traffic.  For example, if_slip 
used an additional "fast" queue for interactive traffic, and if_snd for "slow" 
traffic.  It would still need to implement a flush method itself since it 
maintains additional queues.

What I'd like to see is two modes of operation:

(1) Historic mode: the ifnet framework provides all queueing support,
     enqueuing using the standard macros to if_snd, and the default
     implementation of if_qflush in place to flush the queue.  This means
     implementing neither if_transmit nor if_qflush methods on the ifnet.

(2) Modern mode: the driver provides all queueing support, possibly by
     invoking "library"  routines from the stack, and the ifnet queue stays
     entirely out of the way.  This means implementing both if_transmit and
     if_qflush methods on the ifnet.

To support the (1) scenario above, simply calling ifp->if_qflush() does the 
trick fine, since it's pre-initialized to if_qflush().  For the (2) scenario, 
the driver might choose to call if_qflush() to perform some or all flushing, 
but it shouldn't happen by itself unless the device driver author wants that.

Robert N M Watson
Computer Laboratory
University of Cambridge
--621616949-9378164-1239922276=:19879--

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 22:55:59 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6AE5D106566C;
	Thu, 16 Apr 2009 22:55:59 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 595188FC17;
	Thu, 16 Apr 2009 22:55:59 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GMtx2X094510;
	Thu, 16 Apr 2009 22:55:59 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GMtxEh094509;
	Thu, 16 Apr 2009 22:55:59 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904162255.n3GMtxEh094509@svn.freebsd.org>
From: Kip Macy 
Date: Thu, 16 Apr 2009 22:55:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191159 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 22:55:59 -0000

Author: kmacy
Date: Thu Apr 16 22:55:59 2009
New Revision: 191159
URL: http://svn.freebsd.org/changeset/base/191159

Log:
  add comment to llentry_update
  
  Requested by: sam

Modified:
  head/sys/net/if_llatbl.c

Modified: head/sys/net/if_llatbl.c
==============================================================================
--- head/sys/net/if_llatbl.c	Thu Apr 16 22:47:43 2009	(r191158)
+++ head/sys/net/if_llatbl.c	Thu Apr 16 22:55:59 2009	(r191159)
@@ -103,6 +103,10 @@ llentry_free(struct llentry *lle)
 	LLE_FREE_LOCKED(lle);
 }
 
+/*
+ * Update an llentry for address dst (equivalent to rtalloc for new-arp)
+ * Caller must pass in a valid struct llentry *
+ */
 int
 llentry_update(struct llentry **llep, struct lltable *lt,
     struct sockaddr *dst, struct ifnet *ifp)

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 23:02:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E33D41065677;
	Thu, 16 Apr 2009 23:02:56 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D11028FC15;
	Thu, 16 Apr 2009 23:02:56 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GN2uoZ094778;
	Thu, 16 Apr 2009 23:02:56 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GN2uor094777;
	Thu, 16 Apr 2009 23:02:56 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904162302.n3GN2uor094777@svn.freebsd.org>
From: Kip Macy 
Date: Thu, 16 Apr 2009 23:02:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191160 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 23:02:57 -0000

Author: kmacy
Date: Thu Apr 16 23:02:56 2009
New Revision: 191160
URL: http://svn.freebsd.org/changeset/base/191160

Log:
  s/void/void */

Modified:
  head/sys/netinet/in_pcb.h

Modified: head/sys/netinet/in_pcb.h
==============================================================================
--- head/sys/netinet/in_pcb.h	Thu Apr 16 22:55:59 2009	(r191159)
+++ head/sys/netinet/in_pcb.h	Thu Apr 16 23:02:56 2009	(r191160)
@@ -170,7 +170,7 @@ struct inpcb {
 	u_char	inp_ip_minttl;		/* (i) minimum TTL or drop */
 	uint32_t inp_flowid;		/* (x) flow id / queue id */
 	u_int	inp_refcount;		/* (i) refcount */
-	void	inp_pspare[2];		/* (x) rtentry / general use */
+	void	*inp_pspare[2];		/* (x) rtentry / general use */
 
 	/* Local and foreign ports, local and foreign addr. */
 	struct	in_conninfo inp_inc;	/* (i/p) list for PCB's local port */

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 23:05:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A1559106564A;
	Thu, 16 Apr 2009 23:05:10 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7539C8FC16;
	Thu, 16 Apr 2009 23:05:10 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GN5A9n094896;
	Thu, 16 Apr 2009 23:05:10 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GN5ADI094894;
	Thu, 16 Apr 2009 23:05:10 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904162305.n3GN5ADI094894@svn.freebsd.org>
From: Kip Macy 
Date: Thu, 16 Apr 2009 23:05:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191161 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 23:05:11 -0000

Author: kmacy
Date: Thu Apr 16 23:05:10 2009
New Revision: 191161
URL: http://svn.freebsd.org/changeset/base/191161

Log:
  export if_qflush for use by driver if_qflush routines
  only set ifp->if_{transmit, qflush} if not already set
  KASSERT that neither or both are set

Modified:
  head/sys/net/if.c
  head/sys/net/if_var.h

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Thu Apr 16 23:02:56 2009	(r191160)
+++ head/sys/net/if.c	Thu Apr 16 23:05:10 2009	(r191161)
@@ -128,7 +128,6 @@ static void	if_freemulti(struct ifmultia
 static void	if_grow(void);
 static void	if_init(void *);
 static void	if_check(void *);
-static void	if_qflush(struct ifnet *);
 static void	if_route(struct ifnet *, int flag, int fam);
 static int	if_setflag(struct ifnet *, int, int, int *, int);
 static void	if_slowtimo(void *);
@@ -613,8 +612,15 @@ if_attach(struct ifnet *ifp)
 	getmicrotime(&ifp->if_lastchange);
 	ifp->if_data.ifi_epoch = time_uptime;
 	ifp->if_data.ifi_datalen = sizeof(struct if_data);
-	ifp->if_transmit = if_transmit;
-	ifp->if_qflush = if_qflush;
+	KASSERT((ifp->if_transmit == NULL && ifp->if_qflush == NULL) ||
+	    (ifp->if_transmit != NULL && ifp->if_qflush != NULL),
+	    ("transmit and qflush must both either be set or both be NULL"));
+
+	if (ifp->if_transmit == NULL) {
+		ifp->if_transmit = if_transmit;
+		ifp->if_qflush = if_qflush;
+	}
+	
 #ifdef MAC
 	mac_ifnet_init(ifp);
 	mac_ifnet_create(ifp);
@@ -1510,9 +1516,7 @@ if_unroute(struct ifnet *ifp, int flag, 
 		if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family))
 			pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
 	ifp->if_qflush(ifp);
-	if (ifp->if_snd.ifq_head != NULL)
-		if_qflush(ifp);
-	
+
 #ifdef DEV_CARP
 	if (ifp->if_carp)
 		carp_carpdev_state(ifp->if_carp);
@@ -1641,7 +1645,7 @@ if_up(struct ifnet *ifp)
 /*
  * Flush an interface queue.
  */
-static void
+void
 if_qflush(struct ifnet *ifp)
 {
 	struct mbuf *m, *n;

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h	Thu Apr 16 23:02:56 2009	(r191160)
+++ head/sys/net/if_var.h	Thu Apr 16 23:05:10 2009	(r191161)
@@ -757,6 +757,7 @@ void	if_free_type(struct ifnet *, u_char
 void	if_initname(struct ifnet *, const char *, int);
 void	if_link_state_change(struct ifnet *, int);
 int	if_printf(struct ifnet *, const char *, ...) __printflike(2, 3);
+void	if_qflush(struct ifnet *);
 int	if_setlladdr(struct ifnet *, const u_char *, int);
 void	if_up(struct ifnet *);
 /*void	ifinit(void);*/ /* declared in systm.h for main() */

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 23:08:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CA3B2106564A;
	Thu, 16 Apr 2009 23:08:02 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B8C328FC14;
	Thu, 16 Apr 2009 23:08:02 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GN829w095018;
	Thu, 16 Apr 2009 23:08:02 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GN822G095017;
	Thu, 16 Apr 2009 23:08:02 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904162308.n3GN822G095017@svn.freebsd.org>
From: Kip Macy 
Date: Thu, 16 Apr 2009 23:08:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191162 - head/sys/dev/e1000
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 23:08:03 -0000

Author: kmacy
Date: Thu Apr 16 23:08:02 2009
New Revision: 191162
URL: http://svn.freebsd.org/changeset/base/191162

Log:
  call base if_qflush routine to flush if_snd

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==============================================================================
--- head/sys/dev/e1000/if_em.c	Thu Apr 16 23:05:10 2009	(r191161)
+++ head/sys/dev/e1000/if_em.c	Thu Apr 16 23:08:02 2009	(r191162)
@@ -1055,6 +1055,7 @@ em_qflush(struct ifnet *ifp)
 	EM_TX_LOCK(adapter);
 	while ((m = buf_ring_dequeue_sc(adapter->br)) != NULL)
 		m_freem(m);
+	if_qflush(ifp);
 	EM_TX_UNLOCK(adapter);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 23:08:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 76CE41065672;
	Thu, 16 Apr 2009 23:08:54 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.29])
	by mx1.freebsd.org (Postfix) with ESMTP id 990818FC15;
	Thu, 16 Apr 2009 23:08:53 +0000 (UTC)
	(envelope-from mat.macy@gmail.com)
Received: by yw-out-2324.google.com with SMTP id 5so413856ywh.13
	for ; Thu, 16 Apr 2009 16:08:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=QRwIHB0wxt4oFjUL7sxZzzJnwyRCPVPEfSHC2NJg12Q=;
	b=KB1thipQ8wX9/YOA3NrtEJGGQzWaVSk1ayEUhevIZPVZjdvO3Wlo1J079OXHTlNUiH
	NVNjHr8traolNyvP43B2FYZYLB1gFw21BcgtSgAu2HOQCdyiUMIbMwRAClfOkZO27Zyn
	7Cc40wPhkn4VLlRFtZa18BRRblsPOJtCEmi5I=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=U3qO6+r9h+gzuwdEOLqEPlbHuID/e07g2CFtXEnIuFHbCvIzS0YlRwyd5C0LSiFwgs
	aW7se3ZzgieA8jdaBeT4mYNMMDuzAWWlYejkHCibYCCMbDME822t+zis9q6MpHvFdPLh
	f+7MwswksfyTlnqROTwpXPVAON+D8dIQLi3i0=
MIME-Version: 1.0
Sender: mat.macy@gmail.com
Received: by 10.100.153.6 with SMTP id a6mr2706413ane.149.1239923332967; Thu, 
	16 Apr 2009 16:08:52 -0700 (PDT)
In-Reply-To: 
References: <200904140317.n3E3HigF092519@svn.freebsd.org>
	
	<3c1674c90904141545tc2aa075l512cb76c1f334069@mail.gmail.com>
	
Date: Thu, 16 Apr 2009 16:08:52 -0700
X-Google-Sender-Auth: 0e71ab34abc8b5f5
Message-ID: <3c1674c90904161608m290938e9oe973ac2202d4a834@mail.gmail.com>
From: Kip Macy 
To: Robert Watson 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191037 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 23:08:54 -0000

see 191161 - I think it addresses everything

-Kip

On Thu, Apr 16, 2009 at 3:51 PM, Robert Watson  wrote:
> On Tue, 14 Apr 2009, Kip Macy wrote:
>
>>> The commit message should perhaps read:
>>>
>>> =A0Call default if_qflush on ifq if there are still packets left in the
>>> =A0default queue after calling the driver's flush method.
>>>
>>> However, this seems a bit odd: what if the driver uses if_snd as its
>>> queue but implements other differences in the transmit routine? =A0In t=
hat
>>> case, we might impose default queue properties on if_snd even though th=
e
>>> driver doesn't use them. =A0Could you talk a bit about the circumstance=
s under
>>> which the driver provides an if_qflush that doesn't drain its queues
>>> properly?
>>
>> I'm afraid I don't understand the question. If a driver only uses if_snd
>> for its transmit routine then there is no reason for it to override the
>> default if_qflush implementation.
>
> In the past (and possibly still) device driver and link layers have used
> if_snd plus their own queues for differentiated traffic. =A0For example,
> if_slip used an additional "fast" queue for interactive traffic, and if_s=
nd
> for "slow" traffic. =A0It would still need to implement a flush method it=
self
> since it maintains additional queues.
>
> What I'd like to see is two modes of operation:
>
> (1) Historic mode: the ifnet framework provides all queueing support,
> =A0 =A0enqueuing using the standard macros to if_snd, and the default
> =A0 =A0implementation of if_qflush in place to flush the queue. =A0This m=
eans
> =A0 =A0implementing neither if_transmit nor if_qflush methods on the ifne=
t.
>
> (2) Modern mode: the driver provides all queueing support, possibly by
> =A0 =A0invoking "library" =A0routines from the stack, and the ifnet queue=
 stays
> =A0 =A0entirely out of the way. =A0This means implementing both if_transm=
it and
> =A0 =A0if_qflush methods on the ifnet.
>
> To support the (1) scenario above, simply calling ifp->if_qflush() does t=
he
> trick fine, since it's pre-initialized to if_qflush(). =A0For the (2)
> scenario, the driver might choose to call if_qflush() to perform some or =
all
> flushing, but it shouldn't happen by itself unless the device driver auth=
or
> wants that.
>
> Robert N M Watson
> Computer Laboratory
> University of Cambridge



--=20
All that is necessary for the triumph of evil is that good men do nothing.
    Edmund Burke

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 16 23:42:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A9E7B106564A;
	Thu, 16 Apr 2009 23:42:00 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 976C08FC18;
	Thu, 16 Apr 2009 23:42:00 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3GNg0oR096243;
	Thu, 16 Apr 2009 23:42:00 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3GNg0M7096242;
	Thu, 16 Apr 2009 23:42:00 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200904162342.n3GNg0M7096242@svn.freebsd.org>
From: Andrew Thompson 
Date: Thu, 16 Apr 2009 23:42:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191163 - head/sys/dev/if_ndis
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 16 Apr 2009 23:42:01 -0000

Author: thompsa
Date: Thu Apr 16 23:42:00 2009
New Revision: 191163
URL: http://svn.freebsd.org/changeset/base/191163

Log:
  Only call ieee80211_start_all() if its a 80211 device.
  
  Submitted by:	Paul B. Mahol

Modified:
  head/sys/dev/if_ndis/if_ndis.c

Modified: head/sys/dev/if_ndis/if_ndis.c
==============================================================================
--- head/sys/dev/if_ndis/if_ndis.c	Thu Apr 16 23:08:02 2009	(r191162)
+++ head/sys/dev/if_ndis/if_ndis.c	Thu Apr 16 23:42:00 2009	(r191163)
@@ -2083,7 +2083,8 @@ ndis_init(xsc)
 	NDIS_UNLOCK(sc);
 
 	/* XXX force handling */
-	ieee80211_start_all(ic);		/* start all vap's */
+	if (sc->ndis_80211)
+		ieee80211_start_all(ic);	/* start all vap's */
 }
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 00:30:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6AA7D1065675;
	Fri, 17 Apr 2009 00:30:56 +0000 (UTC)
	(envelope-from emax@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 587688FC0A;
	Fri, 17 Apr 2009 00:30:56 +0000 (UTC)
	(envelope-from emax@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H0UuBM098003;
	Fri, 17 Apr 2009 00:30:56 GMT (envelope-from emax@svn.freebsd.org)
Received: (from emax@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H0UuPj098002;
	Fri, 17 Apr 2009 00:30:56 GMT (envelope-from emax@svn.freebsd.org)
Message-Id: <200904170030.n3H0UuPj098002@svn.freebsd.org>
From: Maksim Yevmenkin 
Date: Fri, 17 Apr 2009 00:30:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191164 - head/sys/dev/atkbdc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 00:30:56 -0000

Author: emax
Date: Fri Apr 17 00:30:56 2009
New Revision: 191164
URL: http://svn.freebsd.org/changeset/base/191164

Log:
  Prevent atkbd(4) interrupt handler from calling keyboard callback function
  when polled mode is enabled. This should help with duplicated/missing
  characters problem at mountroot, geli, etc. prompts on multi CPU systems
  while kbdmux(4) is enabled.
  
  Tested by:	Tobias Grosser 
  Tested by:	Fabian Keil 
  MFC after:	3 days

Modified:
  head/sys/dev/atkbdc/atkbd.c

Modified: head/sys/dev/atkbdc/atkbd.c
==============================================================================
--- head/sys/dev/atkbdc/atkbd.c	Thu Apr 16 23:42:00 2009	(r191163)
+++ head/sys/dev/atkbdc/atkbd.c	Fri Apr 17 00:30:56 2009	(r191164)
@@ -476,7 +476,7 @@ atkbd_term(keyboard_t *kbd)
 static int
 atkbd_intr(keyboard_t *kbd, void *arg)
 {
-	atkbd_state_t *state;
+	atkbd_state_t *state = (atkbd_state_t *)kbd->kb_data;
 	int delay[2];
 	int c;
 
@@ -485,7 +485,6 @@ atkbd_intr(keyboard_t *kbd, void *arg)
 		 * The keyboard was not detected before;
 		 * it must have been reconnected!
 		 */
-		state = (atkbd_state_t *)kbd->kb_data;
 		init_keyboard(state->kbdc, &kbd->kb_type,
 			      kbd->kb_config);
 		KBD_FOUND_DEVICE(kbd);
@@ -496,6 +495,9 @@ atkbd_intr(keyboard_t *kbd, void *arg)
 		atkbd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay);
 	}
 
+	if (state->ks_polling)
+		return 0;
+
 	if (KBD_IS_ACTIVE(kbd) && KBD_IS_BUSY(kbd)) {
 		/* let the callback function to process the input */
 		(*kbd->kb_callback.kc_func)(kbd, KBDIO_KEYINPUT,

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 00:39:35 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E51381065672;
	Fri, 17 Apr 2009 00:39:35 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B82B28FC08;
	Fri, 17 Apr 2009 00:39:35 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H0dZTj098375;
	Fri, 17 Apr 2009 00:39:35 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H0dZhQ098374;
	Fri, 17 Apr 2009 00:39:35 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170039.n3H0dZhQ098374@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 00:39:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191165 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 00:39:36 -0000

Author: kientzle
Date: Fri Apr 17 00:39:35 2009
New Revision: 191165
URL: http://svn.freebsd.org/changeset/base/191165

Log:
  Merge from libarchive.googlecode.com:  If we're
  given an empty filename, just invoke write_open_fd()
  instead of re-implementing the code to use stdout.

Modified:
  head/lib/libarchive/archive_write_open_filename.c

Modified: head/lib/libarchive/archive_write_open_filename.c
==============================================================================
--- head/lib/libarchive/archive_write_open_filename.c	Fri Apr 17 00:30:56 2009	(r191164)
+++ head/lib/libarchive/archive_write_open_filename.c	Fri Apr 17 00:39:35 2009	(r191165)
@@ -71,24 +71,18 @@ archive_write_open_filename(struct archi
 {
 	struct write_file_data *mine;
 
-	if (filename == NULL || filename[0] == '\0') {
-		mine = (struct write_file_data *)malloc(sizeof(*mine));
-		if (mine == NULL) {
-			archive_set_error(a, ENOMEM, "No memory");
-			return (ARCHIVE_FATAL);
-		}
-		mine->filename[0] = '\0'; /* Record that we're using stdout. */
-	} else {
-		mine = (struct write_file_data *)malloc(sizeof(*mine) + strlen(filename));
-		if (mine == NULL) {
-			archive_set_error(a, ENOMEM, "No memory");
-			return (ARCHIVE_FATAL);
-		}
-		strcpy(mine->filename, filename);
+	if (filename == NULL || filename[0] == '\0')
+		return (archive_write_open_fd(a, 1));
+
+	mine = (struct write_file_data *)malloc(sizeof(*mine) + strlen(filename));
+	if (mine == NULL) {
+		archive_set_error(a, ENOMEM, "No memory");
+		return (ARCHIVE_FATAL);
 	}
+	strcpy(mine->filename, filename);
 	mine->fd = -1;
 	return (archive_write_open(a, mine,
-		    file_open, file_write, file_close));
+		file_open, file_write, file_close));
 }
 
 static int
@@ -104,21 +98,11 @@ file_open(struct archive *a, void *clien
 	/*
 	 * Open the file.
 	 */
-	if (mine->filename[0] != '\0') {
-		mine->fd = open(mine->filename, flags, 0666);
-		if (mine->fd < 0) {
-			archive_set_error(a, errno, "Failed to open '%s'",
-			    mine->filename);
-			return (ARCHIVE_FATAL);
-		}
-	} else {
-		/*
-		 * NULL filename is stdout.
-		 */
-		mine->fd = 1;
-		/* By default, pad archive when writing to stdout. */
-		if (archive_write_get_bytes_in_last_block(a) < 0)
-			archive_write_set_bytes_in_last_block(a, 0);
+	mine->fd = open(mine->filename, flags, 0666);
+	if (mine->fd < 0) {
+		archive_set_error(a, errno, "Failed to open '%s'",
+		    mine->filename);
+		return (ARCHIVE_FATAL);
 	}
 
 	if (fstat(mine->fd, &st) != 0) {
@@ -172,8 +156,7 @@ file_close(struct archive *a, void *clie
 	struct write_file_data	*mine = (struct write_file_data *)client_data;
 
 	(void)a; /* UNUSED */
-	if (mine->filename[0] != '\0')
-		close(mine->fd);
+	close(mine->fd);
 	free(mine);
 	return (ARCHIVE_OK);
 }

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 00:42:46 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 18BA31065670;
	Fri, 17 Apr 2009 00:42:46 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 03F648FC0C;
	Fri, 17 Apr 2009 00:42:46 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H0gjLd098538;
	Fri, 17 Apr 2009 00:42:45 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H0gjNg098534;
	Fri, 17 Apr 2009 00:42:45 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170042.n3H0gjNg098534@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 00:42:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191166 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 00:42:46 -0000

Author: kientzle
Date: Fri Apr 17 00:42:45 2009
New Revision: 191166
URL: http://svn.freebsd.org/changeset/base/191166

Log:
  Merge from libarchive.googlecode.com:  Numerous fixes to the
  write options handling, including documentation.

Modified:
  head/lib/libarchive/archive_write.3
  head/lib/libarchive/archive_write.c
  head/lib/libarchive/archive_write_set_compression_bzip2.c
  head/lib/libarchive/archive_write_set_compression_gzip.c

Modified: head/lib/libarchive/archive_write.3
==============================================================================
--- head/lib/libarchive/archive_write.3	Fri Apr 17 00:39:35 2009	(r191165)
+++ head/lib/libarchive/archive_write.3	Fri Apr 17 00:42:45 2009	(r191166)
@@ -43,6 +43,9 @@
 .Nm archive_write_set_compression_gzip ,
 .Nm archive_write_set_compression_none ,
 .Nm archive_write_set_compression_program ,
+.Nm archive_write_set_compressor_options ,
+.Nm archive_write_set_format_options ,
+.Nm archive_write_set_options ,
 .Nm archive_write_open ,
 .Nm archive_write_open_fd ,
 .Nm archive_write_open_FILE ,
@@ -73,10 +76,7 @@
 .Ft int
 .Fn archive_write_set_compression_none "struct archive *"
 .Ft int
-.Fo archive_write_set_compression_program
-.Fa "struct archive *"
-.Fa "const char * cmd"
-.Fc
+.Fn archive_write_set_compression_program "struct archive *" "const char * cmd"
 .Ft int
 .Fn archive_write_set_format_cpio "struct archive *"
 .Ft int
@@ -90,6 +90,12 @@
 .Ft int
 .Fn archive_write_set_format_ustar "struct archive *"
 .Ft int
+.Fn archive_write_set_format_options "struct archive *" "const char *"
+.Ft int
+.Fn archive_write_set_compressor_options "struct archive *" "const char *"
+.Ft int
+.Fn archive_write_set_options "struct archive *" "const char *"
+.Ft int
 .Fo archive_write_open
 .Fa "struct archive *"
 .Fa "void *client_data"
@@ -210,6 +216,68 @@ Note that the compressed output is alway
 The archive will be fed into the specified compression program.
 The output of that program is blocked and written to the client
 write callbacks.
+.It Xo
+.Fn archive_write_set_compressor_options ,
+.Fn archive_write_set_format_options ,
+.Fn archive_write_set_options
+.Xc
+Specifies options that will be passed to the currently-enabled
+compressor and/or format writer.
+The argument is a comma-separated list of individual options.
+Individual options have one of the following forms:
+.Bl -tag -compact -width indent
+.It Ar option=value
+The option/value pair will be provided to every module.
+Modules that do not accept an option with this name will ignore it.
+.It Ar option
+The option will be provided to every module with a value of
+.Dq 1 .
+.It Ar !option
+The option will be provided to every module with a NULL value.
+.It Ar module:option=value , Ar module:option , Ar module:!option
+As above, but the corresponding option and value will be provided
+only to modules whose name matches
+.Ar module .
+.El
+The return value will be
+.Cm ARCHIVE_OK
+if any module accepts the option, or
+.Cm ARCHIVE_WARN
+if no module accepted the option, or
+.Cm ARCHIVE_FATAL
+if there was a fatal error while attempting to process the option.
+.Pp
+The currently supported options are:
+.Bl -tag -compact -width indent
+.It Compressor gzip
+.Bl -tag -compact -width indent
+.It Cm compression-level
+The value is interpreted as a decimal integer specifying the
+gzip compression level.
+.El
+.It Compressor xz
+.Bl -tag -compact -width indent
+.It Cm compression-level
+The value is interpreted as a decimal integer specifying the
+compression level.
+.El
+.It Format mtree
+.Bl -tag -compact -width indent
+.It Cm cksum , Cm device , Cm flags , Cm gid , Cm gname , Cm indent , Cm link , Cm md5 , Cm mode , Cm nlink , Cm rmd160 , Cm sha1 , Cm sha256 , Cm sha384 , Cm sha512 , Cm size , Cm time , Cm uid , Cm uname
+Enable a particular keyword in the mtree output.
+Prefix with an exclamation mark to disable the corresponding keyword.
+The default is equivalent to
+.Dq device, flags, gid, gname, link, mode, nlink, size, time, type, uid, uname .
+.It Cm all
+Enables all of the above keywords.
+.It Cm use-set
+Enables generation of
+.Cm /set
+lines that specify default values for the following files and/or directories.
+.It Cm indent
+XXX needs explanation XXX
+.El
+.El
 .It Fn archive_write_open
 Freeze the settings, open the archive, and prepare for writing entries.
 This is the most generic form of this function, which accepts

Modified: head/lib/libarchive/archive_write.c
==============================================================================
--- head/lib/libarchive/archive_write.c	Fri Apr 17 00:39:35 2009	(r191165)
+++ head/lib/libarchive/archive_write.c	Fri Apr 17 00:42:45 2009	(r191166)
@@ -132,8 +132,14 @@ archive_write_set_format_options(struct 
 {
 	struct archive_write *a = (struct archive_write *)_a;
 	char key[64], val[64];
-	int len, r;
+	int len, r, ret = ARCHIVE_OK;
 
+	__archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
+	    ARCHIVE_STATE_NEW, "archive_write_set_format_options");
+	archive_clear_error(&a->archive);
+
+	if (s == NULL || *s == '\0')
+		return (ARCHIVE_OK);
 	if (a->format_options == NULL)
 		/* This format does not support option. */
 		return (ARCHIVE_OK);
@@ -146,14 +152,19 @@ archive_write_set_format_options(struct 
 			r = a->format_options(a, key, val);
 		if (r == ARCHIVE_FATAL)
 			return (r);
+		if (r < ARCHIVE_OK) { /* This key was not handled. */
+			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+			    "Unsupported option ``%s''", key);
+			ret = ARCHIVE_WARN;
+		}
 		s += len;
 	}
 	if (len < 0) {
 		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
-		    "Illegal format options.");
+		    "Malformed options string.");
 		return (ARCHIVE_WARN);
 	}
-	return (ARCHIVE_OK);
+	return (ret);
 }
 
 /*
@@ -165,10 +176,20 @@ archive_write_set_compressor_options(str
 	struct archive_write *a = (struct archive_write *)_a;
 	char key[64], val[64];
 	int len, r;
+	int ret = ARCHIVE_OK;
 
-	if (a->compressor.options == NULL)
-		/* This compressor does not support option. */
+	__archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
+	    ARCHIVE_STATE_NEW, "archive_write_set_compressor_options");
+	archive_clear_error(&a->archive);
+
+	if (s == NULL || *s == '\0')
 		return (ARCHIVE_OK);
+	if (a->compressor.options == NULL) {
+		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+		    "Unsupported option ``%s''", s);
+		/* This compressor does not support option. */
+		return (ARCHIVE_WARN);
+	}
 
 	while ((len = __archive_parse_options(s, a->archive.compression_name,
 	    sizeof(key), key, sizeof(val), val)) > 0) {
@@ -178,6 +199,11 @@ archive_write_set_compressor_options(str
 			r = a->compressor.options(a, key, val);
 		if (r == ARCHIVE_FATAL)
 			return (r);
+		if (r < ARCHIVE_OK) {
+			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+			    "Unsupported option ``%s''", key);
+			ret = ARCHIVE_WARN;
+		}
 		s += len;
 	}
 	if (len < 0) {
@@ -185,7 +211,7 @@ archive_write_set_compressor_options(str
 		    "Illegal format options.");
 		return (ARCHIVE_WARN);
 	}
-	return (ARCHIVE_OK);
+	return (ret);
 }
 
 /*
@@ -194,14 +220,16 @@ archive_write_set_compressor_options(str
 int
 archive_write_set_options(struct archive *_a, const char *s)
 {
-	int r;
+	int r1, r2;
 
-	r = archive_write_set_format_options(_a, s);
-	if (r != ARCHIVE_OK)
-		return (r);
-	r = archive_write_set_compressor_options(_a, s);
-	if (r != ARCHIVE_OK)
-		return (r);
+	r1 = archive_write_set_format_options(_a, s);
+	if (r1 < ARCHIVE_WARN)
+		return (r1);
+	r2 = archive_write_set_compressor_options(_a, s);
+	if (r2 < ARCHIVE_WARN)
+		return (r2);
+	if (r1 == ARCHIVE_WARN && r2 == ARCHIVE_WARN)
+		return (ARCHIVE_WARN);
 	return (ARCHIVE_OK);
 }
 

Modified: head/lib/libarchive/archive_write_set_compression_bzip2.c
==============================================================================
--- head/lib/libarchive/archive_write_set_compression_bzip2.c	Fri Apr 17 00:39:35 2009	(r191165)
+++ head/lib/libarchive/archive_write_set_compression_bzip2.c	Fri Apr 17 00:42:45 2009	(r191166)
@@ -47,9 +47,10 @@ __FBSDID("$FreeBSD$");
 
 #ifndef HAVE_BZLIB_H
 int
-archive_write_set_compression_bzip2(struct archive *_a)
+archive_write_set_compression_bzip2(struct archive *a)
 {
-	/* Unsupported bzip2 compression, we don't have bzlib */
+	archive_set_error(a, ARCHIVE_ERRNO_MISC,
+	    "bzip2 compression not supported on this platform");
 	return (ARCHIVE_FATAL);
 }
 #else
@@ -62,6 +63,9 @@ struct private_data {
 	size_t		 compressed_buffer_size;
 };
 
+struct private_config {
+	int		 compression_level;
+};
 
 /*
  * Yuck.  bzlib.h is not const-correct, so I need this one bit
@@ -72,6 +76,8 @@ struct private_data {
 
 static int	archive_compressor_bzip2_finish(struct archive_write *);
 static int	archive_compressor_bzip2_init(struct archive_write *);
+static int	archive_compressor_bzip2_options(struct archive_write *,
+		    const char *, const char *);
 static int	archive_compressor_bzip2_write(struct archive_write *,
 		    const void *, size_t);
 static int	drive_compressor(struct archive_write *, struct private_data *,
@@ -84,9 +90,21 @@ int
 archive_write_set_compression_bzip2(struct archive *_a)
 {
 	struct archive_write *a = (struct archive_write *)_a;
+	struct private_config *config;
 	__archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
 	    ARCHIVE_STATE_NEW, "archive_write_set_compression_bzip2");
+	config = malloc(sizeof(*config));
+	if (config == NULL) {
+		archive_set_error(&a->archive, ENOMEM, "Out of memory");
+		return (ARCHIVE_FATAL);
+	}
+	a->compressor.config = config;
+	a->compressor.finish = archive_compressor_bzip2_finish;
+	config->compression_level = 9; /* default */
 	a->compressor.init = &archive_compressor_bzip2_init;
+	a->compressor.options = &archive_compressor_bzip2_options;
+	a->archive.compression_code = ARCHIVE_COMPRESSION_BZIP2;
+	a->archive.compression_name = "bzip2";
 	return (ARCHIVE_OK);
 }
 
@@ -98,10 +116,9 @@ archive_compressor_bzip2_init(struct arc
 {
 	int ret;
 	struct private_data *state;
+	struct private_config *config;
 
-	a->archive.compression_code = ARCHIVE_COMPRESSION_BZIP2;
-	a->archive.compression_name = "bzip2";
-
+	config = (struct private_config *)a->compressor.config;
 	if (a->client_opener != NULL) {
 		ret = (a->client_opener)(&a->archive, a->client_data);
 		if (ret != 0)
@@ -129,10 +146,10 @@ archive_compressor_bzip2_init(struct arc
 	state->stream.next_out = state->compressed;
 	state->stream.avail_out = state->compressed_buffer_size;
 	a->compressor.write = archive_compressor_bzip2_write;
-	a->compressor.finish = archive_compressor_bzip2_finish;
 
 	/* Initialize compression library */
-	ret = BZ2_bzCompressInit(&(state->stream), 9, 0, 30);
+	ret = BZ2_bzCompressInit(&(state->stream),
+	    config->compression_level, 0, 30);
 	if (ret == BZ_OK) {
 		a->compressor.data = state;
 		return (ARCHIVE_OK);
@@ -168,6 +185,32 @@ archive_compressor_bzip2_init(struct arc
 }
 
 /*
+ * Set write options.
+ */
+static int
+archive_compressor_bzip2_options(struct archive_write *a, const char *key,
+    const char *value)
+{
+	struct private_config *config;
+
+	config = (struct private_config *)a->compressor.config;
+	if (strcmp(key, "compression-level") == 0) {
+		if (value == NULL || !(value[0] >= '0' && value[0] <= '9') ||
+		    value[1] != '\0')
+			return (ARCHIVE_WARN);
+		config->compression_level = value[0] - '0';
+		/* Make '0' be a synonym for '1'. */
+		/* This way, bzip2 compressor supports the same 0..9
+		 * range of levels as gzip. */
+		if (config->compression_level < 1)
+			config->compression_level = 1;
+		return (ARCHIVE_OK);
+	}
+
+	return (ARCHIVE_WARN);
+}
+
+/*
  * Write data to the compressed stream.
  *
  * Returns ARCHIVE_OK if all data written, error otherwise.
@@ -212,83 +255,88 @@ archive_compressor_bzip2_finish(struct a
 	ssize_t bytes_written;
 	unsigned tocopy;
 
-	state = (struct private_data *)a->compressor.data;
 	ret = ARCHIVE_OK;
-	if (a->client_writer == NULL) {
-		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
-		    "No write callback is registered?\n"
-		    "This is probably an internal programming error.");
-		ret = ARCHIVE_FATAL;
-		goto cleanup;
-	}
+	state = (struct private_data *)a->compressor.data;
+	if (state != NULL) {
+		if (a->client_writer == NULL) {
+			archive_set_error(&a->archive,
+			    ARCHIVE_ERRNO_PROGRAMMER,
+			    "No write callback is registered?\n"
+			    "This is probably an internal programming error.");
+			ret = ARCHIVE_FATAL;
+			goto cleanup;
+		}
 
-	/* By default, always pad the uncompressed data. */
-	if (a->pad_uncompressed) {
-		tocopy = a->bytes_per_block -
-		    (state->total_in % a->bytes_per_block);
-		while (tocopy > 0 && tocopy < (unsigned)a->bytes_per_block) {
-			SET_NEXT_IN(state, a->nulls);
-			state->stream.avail_in = tocopy < a->null_length ?
-			    tocopy : a->null_length;
-			state->total_in += state->stream.avail_in;
-			tocopy -= state->stream.avail_in;
-			ret = drive_compressor(a, state, 0);
-			if (ret != ARCHIVE_OK)
-				goto cleanup;
+		/* By default, always pad the uncompressed data. */
+		if (a->pad_uncompressed) {
+			tocopy = a->bytes_per_block -
+			    (state->total_in % a->bytes_per_block);
+			while (tocopy > 0 && tocopy < (unsigned)a->bytes_per_block) {
+				SET_NEXT_IN(state, a->nulls);
+				state->stream.avail_in = tocopy < a->null_length ?
+				    tocopy : a->null_length;
+				state->total_in += state->stream.avail_in;
+				tocopy -= state->stream.avail_in;
+				ret = drive_compressor(a, state, 0);
+				if (ret != ARCHIVE_OK)
+					goto cleanup;
+			}
 		}
-	}
 
-	/* Finish compression cycle. */
-	if ((ret = drive_compressor(a, state, 1)))
-		goto cleanup;
-
-	/* Optionally, pad the final compressed block. */
-	block_length = state->stream.next_out - state->compressed;
-
-
-	/* Tricky calculation to determine size of last block. */
-	target_block_length = block_length;
-	if (a->bytes_in_last_block <= 0)
-		/* Default or Zero: pad to full block */
-		target_block_length = a->bytes_per_block;
-	else
-		/* Round length to next multiple of bytes_in_last_block. */
-		target_block_length = a->bytes_in_last_block *
-		    ( (block_length + a->bytes_in_last_block - 1) /
-			a->bytes_in_last_block);
-	if (target_block_length > a->bytes_per_block)
-		target_block_length = a->bytes_per_block;
-	if (block_length < target_block_length) {
-		memset(state->stream.next_out, 0,
-		    target_block_length - block_length);
-		block_length = target_block_length;
-	}
+		/* Finish compression cycle. */
+		if ((ret = drive_compressor(a, state, 1)))
+			goto cleanup;
+
+		/* Optionally, pad the final compressed block. */
+		block_length = state->stream.next_out - state->compressed;
+
+		/* Tricky calculation to determine size of last block. */
+		target_block_length = block_length;
+		if (a->bytes_in_last_block <= 0)
+			/* Default or Zero: pad to full block */
+			target_block_length = a->bytes_per_block;
+		else
+			/* Round length to next multiple of bytes_in_last_block. */
+			target_block_length = a->bytes_in_last_block *
+			    ( (block_length + a->bytes_in_last_block - 1) /
+				a->bytes_in_last_block);
+		if (target_block_length > a->bytes_per_block)
+			target_block_length = a->bytes_per_block;
+		if (block_length < target_block_length) {
+			memset(state->stream.next_out, 0,
+			    target_block_length - block_length);
+			block_length = target_block_length;
+		}
 
-	/* Write the last block */
-	bytes_written = (a->client_writer)(&a->archive, a->client_data,
-	    state->compressed, block_length);
-
-	/* TODO: Handle short write of final block. */
-	if (bytes_written <= 0)
-		ret = ARCHIVE_FATAL;
-	else {
-		a->archive.raw_position += ret;
-		ret = ARCHIVE_OK;
-	}
+		/* Write the last block */
+		bytes_written = (a->client_writer)(&a->archive, a->client_data,
+		    state->compressed, block_length);
+
+		/* TODO: Handle short write of final block. */
+		if (bytes_written <= 0)
+			ret = ARCHIVE_FATAL;
+		else {
+			a->archive.raw_position += ret;
+			ret = ARCHIVE_OK;
+		}
 
-	/* Cleanup: shut down compressor, release memory, etc. */
+		/* Cleanup: shut down compressor, release memory, etc. */
 cleanup:
-	switch (BZ2_bzCompressEnd(&(state->stream))) {
-	case BZ_OK:
-		break;
-	default:
-		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
-		    "Failed to clean up compressor");
-		ret = ARCHIVE_FATAL;
-	}
+		switch (BZ2_bzCompressEnd(&(state->stream))) {
+		case BZ_OK:
+			break;
+		default:
+			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
+			    "Failed to clean up compressor");
+			ret = ARCHIVE_FATAL;
+		}
 
-	free(state->compressed);
-	free(state);
+		free(state->compressed);
+		free(state);
+	}
+	/* Free configuration data even if we were never fully initialized. */
+	free(a->compressor.config);
+	a->compressor.config = NULL;
 	return (ret);
 }
 

Modified: head/lib/libarchive/archive_write_set_compression_gzip.c
==============================================================================
--- head/lib/libarchive/archive_write_set_compression_gzip.c	Fri Apr 17 00:39:35 2009	(r191165)
+++ head/lib/libarchive/archive_write_set_compression_gzip.c	Fri Apr 17 00:42:45 2009	(r191166)
@@ -47,9 +47,10 @@ __FBSDID("$FreeBSD$");
 
 #ifndef HAVE_ZLIB_H
 int
-archive_write_set_compression_gzip(struct archive *_a)
+archive_write_set_compression_gzip(struct archive *a)
 {
-	/* Unsupported gzip compression, we don't have zlib */
+	archive_set_error(a, ARCHIVE_ERRNO_MISC,
+	    "gzip compression not supported on this platform");
 	return (ARCHIVE_FATAL);
 }
 #else
@@ -61,7 +62,9 @@ struct private_data {
 	unsigned char	*compressed;
 	size_t		 compressed_buffer_size;
 	unsigned long	 crc;
-	/* Options */
+};
+
+struct private_config {
 	int		 compression_level;
 };
 
@@ -90,9 +93,19 @@ int
 archive_write_set_compression_gzip(struct archive *_a)
 {
 	struct archive_write *a = (struct archive_write *)_a;
+	struct private_config *config;
 	__archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
 	    ARCHIVE_STATE_NEW, "archive_write_set_compression_gzip");
+	config = malloc(sizeof(*config));
+	if (config == NULL) {
+		archive_set_error(&a->archive, ENOMEM, "Out of memory");
+		return (ARCHIVE_FATAL);
+	}
+	a->compressor.config = config;
+	a->compressor.finish = &archive_compressor_gzip_finish;
+	config->compression_level = Z_DEFAULT_COMPRESSION;
 	a->compressor.init = &archive_compressor_gzip_init;
+	a->compressor.options = &archive_compressor_gzip_options;
 	a->archive.compression_code = ARCHIVE_COMPRESSION_GZIP;
 	a->archive.compression_name = "gzip";
 	return (ARCHIVE_OK);
@@ -106,10 +119,10 @@ archive_compressor_gzip_init(struct arch
 {
 	int ret;
 	struct private_data *state;
+	struct private_config *config;
 	time_t t;
 
-	a->archive.compression_code = ARCHIVE_COMPRESSION_GZIP;
-	a->archive.compression_name = "gzip";
+	config = (struct private_config *)a->compressor.config;
 
 	if (a->client_opener != NULL) {
 		ret = (a->client_opener)(&a->archive, a->client_data);
@@ -147,7 +160,6 @@ archive_compressor_gzip_init(struct arch
 	state->compressed_buffer_size = a->bytes_per_block;
 	state->compressed = (unsigned char *)malloc(state->compressed_buffer_size);
 	state->crc = crc32(0L, NULL, 0);
-	state->compression_level = Z_DEFAULT_COMPRESSION;
 
 	if (state->compressed == NULL) {
 		archive_set_error(&a->archive, ENOMEM,
@@ -174,13 +186,11 @@ archive_compressor_gzip_init(struct arch
 	state->stream.next_out += 10;
 	state->stream.avail_out -= 10;
 
-	a->compressor.options = archive_compressor_gzip_options;
 	a->compressor.write = archive_compressor_gzip_write;
-	a->compressor.finish = archive_compressor_gzip_finish;
 
 	/* Initialize compression library. */
 	ret = deflateInit2(&(state->stream),
-	    state->compression_level,
+	    config->compression_level,
 	    Z_DEFLATED,
 	    -15 /* < 0 to suppress zlib header */,
 	    8,
@@ -225,45 +235,15 @@ static int
 archive_compressor_gzip_options(struct archive_write *a, const char *key,
     const char *value)
 {
-	struct private_data *state;
-	int ret;
+	struct private_config *config;
 
-	state = (struct private_data *)a->compressor.data;
+	config = (struct private_config *)a->compressor.config;
 	if (strcmp(key, "compression-level") == 0) {
-		int level;
-
 		if (value == NULL || !(value[0] >= '0' && value[0] <= '9') ||
 		    value[1] != '\0')
 			return (ARCHIVE_WARN);
-		level = value[0] - '0';
-		if (level == state->compression_level)
-			return (ARCHIVE_OK);
-		
-		ret = deflateParams(&(state->stream), level,
-		    Z_DEFAULT_STRATEGY);
-		if (ret == Z_OK) {
-			state->compression_level = level;
-			return (ARCHIVE_OK);
-		}
-		switch (ret) {
-		case Z_STREAM_ERROR:
-			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
-			    "Internal error updating params "
-			    "compression library: state was inconsistent "
-			    "or parameter was invalid");
-			break;
-		case Z_BUF_ERROR:
-			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
-			    "Internal error updating params "
-			    "compression library: out buffer was zero");
-			break;
-		default:
-			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
-			    "Internal error updatng params "
-			    "compression library");
-			break;
-		}
-		return (ARCHIVE_FATAL);
+		config->compression_level = value[0] - '0';
+		return (ARCHIVE_OK);
 	}
 
 	return (ARCHIVE_WARN);
@@ -301,7 +281,6 @@ archive_compressor_gzip_write(struct arc
 	return (ARCHIVE_OK);
 }
 
-
 /*
  * Finish the compression...
  */
@@ -316,113 +295,118 @@ archive_compressor_gzip_finish(struct ar
 
 	state = (struct private_data *)a->compressor.data;
 	ret = 0;
-	if (a->client_writer == NULL) {
-		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
-		    "No write callback is registered?  "
-		    "This is probably an internal programming error.");
-		ret = ARCHIVE_FATAL;
-		goto cleanup;
-	}
+	if (state != NULL) {
+		if (a->client_writer == NULL) {
+			archive_set_error(&a->archive,
+			    ARCHIVE_ERRNO_PROGRAMMER,
+			    "No write callback is registered?  "
+			    "This is probably an internal programming error.");
+			ret = ARCHIVE_FATAL;
+			goto cleanup;
+		}
+
+		/* By default, always pad the uncompressed data. */
+		if (a->pad_uncompressed) {
+			tocopy = a->bytes_per_block -
+			    (state->total_in % a->bytes_per_block);
+			while (tocopy > 0 && tocopy < (unsigned)a->bytes_per_block) {
+				SET_NEXT_IN(state, a->nulls);
+				state->stream.avail_in = tocopy < a->null_length ?
+				    tocopy : a->null_length;
+				state->crc = crc32(state->crc, a->nulls,
+				    state->stream.avail_in);
+				state->total_in += state->stream.avail_in;
+				tocopy -= state->stream.avail_in;
+				ret = drive_compressor(a, state, 0);
+				if (ret != ARCHIVE_OK)
+					goto cleanup;
+			}
+		}
+
+		/* Finish compression cycle */
+		if (((ret = drive_compressor(a, state, 1))) != ARCHIVE_OK)
+			goto cleanup;
 
-	/* By default, always pad the uncompressed data. */
-	if (a->pad_uncompressed) {
-		tocopy = a->bytes_per_block -
-		    (state->total_in % a->bytes_per_block);
-		while (tocopy > 0 && tocopy < (unsigned)a->bytes_per_block) {
-			SET_NEXT_IN(state, a->nulls);
-			state->stream.avail_in = tocopy < a->null_length ?
-			    tocopy : a->null_length;
-			state->crc = crc32(state->crc, a->nulls,
-			    state->stream.avail_in);
-			state->total_in += state->stream.avail_in;
-			tocopy -= state->stream.avail_in;
-			ret = drive_compressor(a, state, 0);
-			if (ret != ARCHIVE_OK)
+		/* Build trailer: 4-byte CRC and 4-byte length. */
+		trailer[0] = (state->crc)&0xff;
+		trailer[1] = (state->crc >> 8)&0xff;
+		trailer[2] = (state->crc >> 16)&0xff;
+		trailer[3] = (state->crc >> 24)&0xff;
+		trailer[4] = (state->total_in)&0xff;
+		trailer[5] = (state->total_in >> 8)&0xff;
+		trailer[6] = (state->total_in >> 16)&0xff;
+		trailer[7] = (state->total_in >> 24)&0xff;
+
+		/* Add trailer to current block. */
+		tocopy = 8;
+		if (tocopy > state->stream.avail_out)
+			tocopy = state->stream.avail_out;
+		memcpy(state->stream.next_out, trailer, tocopy);
+		state->stream.next_out += tocopy;
+		state->stream.avail_out -= tocopy;
+
+		/* If it overflowed, flush and start a new block. */
+		if (tocopy < 8) {
+			bytes_written = (a->client_writer)(&a->archive, a->client_data,
+			    state->compressed, state->compressed_buffer_size);
+			if (bytes_written <= 0) {
+				ret = ARCHIVE_FATAL;
 				goto cleanup;
+			}
+			a->archive.raw_position += bytes_written;
+			state->stream.next_out = state->compressed;
+			state->stream.avail_out = state->compressed_buffer_size;
+			memcpy(state->stream.next_out, trailer + tocopy, 8-tocopy);
+			state->stream.next_out += 8-tocopy;
+			state->stream.avail_out -= 8-tocopy;
 		}
-	}
 
-	/* Finish compression cycle */
-	if (((ret = drive_compressor(a, state, 1))) != ARCHIVE_OK)
-		goto cleanup;
-
-	/* Build trailer: 4-byte CRC and 4-byte length. */
-	trailer[0] = (state->crc)&0xff;
-	trailer[1] = (state->crc >> 8)&0xff;
-	trailer[2] = (state->crc >> 16)&0xff;
-	trailer[3] = (state->crc >> 24)&0xff;
-	trailer[4] = (state->total_in)&0xff;
-	trailer[5] = (state->total_in >> 8)&0xff;
-	trailer[6] = (state->total_in >> 16)&0xff;
-	trailer[7] = (state->total_in >> 24)&0xff;
-
-	/* Add trailer to current block. */
-	tocopy = 8;
-	if (tocopy > state->stream.avail_out)
-		tocopy = state->stream.avail_out;
-	memcpy(state->stream.next_out, trailer, tocopy);
-	state->stream.next_out += tocopy;
-	state->stream.avail_out -= tocopy;
+		/* Optionally, pad the final compressed block. */
+		block_length = state->stream.next_out - state->compressed;
 
-	/* If it overflowed, flush and start a new block. */
-	if (tocopy < 8) {
+		/* Tricky calculation to determine size of last block. */
+		target_block_length = block_length;
+		if (a->bytes_in_last_block <= 0)
+			/* Default or Zero: pad to full block */
+			target_block_length = a->bytes_per_block;
+		else
+			/* Round length to next multiple of bytes_in_last_block. */
+			target_block_length = a->bytes_in_last_block *
+			    ( (block_length + a->bytes_in_last_block - 1) /
+				a->bytes_in_last_block);
+		if (target_block_length > a->bytes_per_block)
+			target_block_length = a->bytes_per_block;
+		if (block_length < target_block_length) {
+			memset(state->stream.next_out, 0,
+			    target_block_length - block_length);
+			block_length = target_block_length;
+		}
+
+		/* Write the last block */
 		bytes_written = (a->client_writer)(&a->archive, a->client_data,
-		    state->compressed, state->compressed_buffer_size);
+		    state->compressed, block_length);
 		if (bytes_written <= 0) {
 			ret = ARCHIVE_FATAL;
 			goto cleanup;
 		}
 		a->archive.raw_position += bytes_written;
-		state->stream.next_out = state->compressed;
-		state->stream.avail_out = state->compressed_buffer_size;
-		memcpy(state->stream.next_out, trailer + tocopy, 8-tocopy);
-		state->stream.next_out += 8-tocopy;
-		state->stream.avail_out -= 8-tocopy;
-	}
-
-	/* Optionally, pad the final compressed block. */
-	block_length = state->stream.next_out - state->compressed;
-
-
-	/* Tricky calculation to determine size of last block. */
-	target_block_length = block_length;
-	if (a->bytes_in_last_block <= 0)
-		/* Default or Zero: pad to full block */
-		target_block_length = a->bytes_per_block;
-	else
-		/* Round length to next multiple of bytes_in_last_block. */
-		target_block_length = a->bytes_in_last_block *
-		    ( (block_length + a->bytes_in_last_block - 1) /
-			a->bytes_in_last_block);
-	if (target_block_length > a->bytes_per_block)
-		target_block_length = a->bytes_per_block;
-	if (block_length < target_block_length) {
-		memset(state->stream.next_out, 0,
-		    target_block_length - block_length);
-		block_length = target_block_length;
-	}
-
-	/* Write the last block */
-	bytes_written = (a->client_writer)(&a->archive, a->client_data,
-	    state->compressed, block_length);
-	if (bytes_written <= 0) {
-		ret = ARCHIVE_FATAL;
-		goto cleanup;
-	}
-	a->archive.raw_position += bytes_written;
-
-	/* Cleanup: shut down compressor, release memory, etc. */
-cleanup:
-	switch (deflateEnd(&(state->stream))) {
-	case Z_OK:
-		break;
-	default:
-		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
-		    "Failed to clean up compressor");
-		ret = ARCHIVE_FATAL;
+
+		/* Cleanup: shut down compressor, release memory, etc. */
+	cleanup:
+		switch (deflateEnd(&(state->stream))) {
+		case Z_OK:
+			break;
+		default:
+			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+			    "Failed to clean up compressor");
+			ret = ARCHIVE_FATAL;
+		}
+		free(state->compressed);
+		free(state);
 	}
-	free(state->compressed);
-	free(state);
+	/* Clean up config area even if we never initialized. */
+	free(a->compressor.config);
+	a->compressor.config = NULL;
 	return (ret);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 00:44:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DA6161065670;
	Fri, 17 Apr 2009 00:44:03 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C83DF8FC08;
	Fri, 17 Apr 2009 00:44:03 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H0i3mA098619;
	Fri, 17 Apr 2009 00:44:03 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H0i3GE098618;
	Fri, 17 Apr 2009 00:44:03 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170044.n3H0i3GE098618@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 00:44:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191167 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 00:44:04 -0000

Author: kientzle
Date: Fri Apr 17 00:44:03 2009
New Revision: 191167
URL: http://svn.freebsd.org/changeset/base/191167

Log:
  Fix a minor memory leak.

Modified:
  head/lib/libarchive/archive_write_disk.c

Modified: head/lib/libarchive/archive_write_disk.c
==============================================================================
--- head/lib/libarchive/archive_write_disk.c	Fri Apr 17 00:42:45 2009	(r191166)
+++ head/lib/libarchive/archive_write_disk.c	Fri Apr 17 00:44:03 2009	(r191167)
@@ -1278,6 +1278,8 @@ _archive_write_finish(struct archive *_a
 		(a->cleanup_gid)(a->lookup_gid_data);
 	if (a->cleanup_uid != NULL && a->lookup_uid_data != NULL)
 		(a->cleanup_uid)(a->lookup_uid_data);
+	if (a->entry)
+		archive_entry_free(a->entry);
 	archive_string_free(&a->_name_data);
 	archive_string_free(&a->archive.error_string);
 	archive_string_free(&a->path_safe);

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 00:44:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F3EA6106564A;
	Fri, 17 Apr 2009 00:44:47 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C77CA8FC14;
	Fri, 17 Apr 2009 00:44:47 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H0ila9098683;
	Fri, 17 Apr 2009 00:44:47 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H0ilHU098682;
	Fri, 17 Apr 2009 00:44:47 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170044.n3H0ilHU098682@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 00:44:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191168 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 00:44:48 -0000

Author: kientzle
Date: Fri Apr 17 00:44:47 2009
New Revision: 191168
URL: http://svn.freebsd.org/changeset/base/191168

Log:
  Use thread-safe getgrnam_r() and getpwnam_r(); dynamically size
  the buffer used by this.

Modified:
  head/lib/libarchive/archive_write_disk_set_standard_lookup.c

Modified: head/lib/libarchive/archive_write_disk_set_standard_lookup.c
==============================================================================
--- head/lib/libarchive/archive_write_disk_set_standard_lookup.c	Fri Apr 17 00:44:03 2009	(r191167)
+++ head/lib/libarchive/archive_write_disk_set_standard_lookup.c	Fri Apr 17 00:44:47 2009	(r191168)
@@ -118,12 +118,34 @@ lookup_gid(void *private_data, const cha
 	b->hash = h;
 #if HAVE_GRP_H
 	{
-		struct group	*grent = getgrnam(gname);
-		if (grent != NULL)
-			gid = grent->gr_gid;
+		char _buffer[128];
+		size_t bufsize = 128;
+		char *buffer = _buffer;
+		struct group	grent, *result;
+		int r;
+
+		for (;;) {
+			r = getgrnam_r(gname, &grent, buffer, bufsize, &result);
+			if (r == 0)
+				break;
+			if (r != ERANGE)
+				break;
+			bufsize *= 2;
+			if (buffer != _buffer)
+				free(buffer);
+			buffer = malloc(bufsize);
+			if (buffer == NULL)
+				break;
+		}
+		if (result != NULL)
+			gid = result->gr_gid;
+		if (buffer != _buffer)
+			free(buffer);
 	}
 #elif defined(_WIN32) && !defined(__CYGWIN__)
 	/* TODO: do a gname->gid lookup for Windows. */
+#else
+	#error No way to perform gid lookups on this platform
 #endif
 	b->id = gid;
 
@@ -155,12 +177,34 @@ lookup_uid(void *private_data, const cha
 	b->hash = h;
 #if HAVE_PWD_H
 	{
-		struct passwd	*pwent = getpwnam(uname);
-		if (pwent != NULL)
-			uid = pwent->pw_uid;
+		char _buffer[128];
+		size_t bufsize = 128;
+		char *buffer = _buffer;
+		struct passwd	pwent, *result;
+		int r;
+
+		for (;;) {
+			r = getpwnam_r(uname, &pwent, buffer, bufsize, &result);
+			if (r == 0)
+				break;
+			if (r != ERANGE)
+				break;
+			bufsize *= 2;
+			if (buffer != _buffer)
+				free(buffer);
+			buffer = malloc(bufsize);
+			if (buffer == NULL)
+				break;
+		}
+		if (result != NULL)
+			uid = result->pw_uid;
+		if (buffer != _buffer)
+			free(buffer);
 	}
 #elif defined(_WIN32) && !defined(__CYGWIN__)
 	/* TODO: do a uname->uid lookup for Windows. */
+#else
+	#error No way to look up uids on this platform
 #endif
 	b->id = uid;
 

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 00:45:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 314B31065673;
	Fri, 17 Apr 2009 00:45:48 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1F10B8FC08;
	Fri, 17 Apr 2009 00:45:48 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H0jmwA098766;
	Fri, 17 Apr 2009 00:45:48 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H0jlQp098765;
	Fri, 17 Apr 2009 00:45:48 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170045.n3H0jlQp098765@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 00:45:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191169 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 00:45:49 -0000

Author: kientzle
Date: Fri Apr 17 00:45:47 2009
New Revision: 191169
URL: http://svn.freebsd.org/changeset/base/191169

Log:
  Properly clone and free the recently-added "sourcepath" field.

Modified:
  head/lib/libarchive/archive_entry.c

Modified: head/lib/libarchive/archive_entry.c
==============================================================================
--- head/lib/libarchive/archive_entry.c	Fri Apr 17 00:44:47 2009	(r191168)
+++ head/lib/libarchive/archive_entry.c	Fri Apr 17 00:45:47 2009	(r191169)
@@ -370,6 +370,7 @@ archive_entry_clear(struct archive_entry
 	aes_clean(&entry->ae_gname);
 	aes_clean(&entry->ae_hardlink);
 	aes_clean(&entry->ae_pathname);
+	aes_clean(&entry->ae_sourcepath);
 	aes_clean(&entry->ae_symlink);
 	aes_clean(&entry->ae_uname);
 	archive_entry_acl_clear(entry);
@@ -399,6 +400,7 @@ archive_entry_clone(struct archive_entry
 	aes_copy(&entry2->ae_gname, &entry->ae_gname);
 	aes_copy(&entry2->ae_hardlink, &entry->ae_hardlink);
 	aes_copy(&entry2->ae_pathname, &entry->ae_pathname);
+	aes_copy(&entry2->ae_sourcepath, &entry->ae_sourcepath);
 	aes_copy(&entry2->ae_symlink, &entry->ae_symlink);
 	entry2->ae_set = entry->ae_set;
 	aes_copy(&entry2->ae_uname, &entry->ae_uname);

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 00:47:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 317101065673;
	Fri, 17 Apr 2009 00:47:17 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 04C908FC18;
	Fri, 17 Apr 2009 00:47:17 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H0lGCx098861;
	Fri, 17 Apr 2009 00:47:16 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H0lGvv098860;
	Fri, 17 Apr 2009 00:47:16 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170047.n3H0lGvv098860@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 00:47:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191170 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 00:47:18 -0000

Author: kientzle
Date: Fri Apr 17 00:47:16 2009
New Revision: 191170
URL: http://svn.freebsd.org/changeset/base/191170

Log:
  Accept empty options, add a new read_next_header2() which is more
  efficient for some uses.

Modified:
  head/lib/libarchive/archive_read.c

Modified: head/lib/libarchive/archive_read.c
==============================================================================
--- head/lib/libarchive/archive_read.c	Fri Apr 17 00:45:47 2009	(r191169)
+++ head/lib/libarchive/archive_read.c	Fri Apr 17 00:47:16 2009	(r191170)
@@ -120,7 +120,11 @@ archive_read_set_format_options(struct a
 	size_t i;
 	int len, r;
 
+	if (s == NULL || *s == '\0')
+		return (ARCHIVE_OK);
 	a = (struct archive_read *)_a;
+	__archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC,
+	    ARCHIVE_STATE_NEW, "archive_read_set_format_options");
 	len = 0;
 	for (i = 0; i < sizeof(a->formats)/sizeof(a->formats[0]); i++) {
 		format = &a->formats[i];
@@ -160,7 +164,11 @@ archive_read_set_filter_options(struct a
 	char key[64], val[64];
 	int len, r;
 
+	if (s == NULL || *s == '\0')
+		return (ARCHIVE_OK);
 	a = (struct archive_read *)_a;
+	__archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC,
+	    ARCHIVE_STATE_NEW, "archive_read_set_filter_options");
 	filter = a->filter;
 	len = 0;
 	for (filter = a->filter; filter != NULL; filter = filter->upstream) {
@@ -368,18 +376,15 @@ build_stream(struct archive_read *a)
  * Read header of next entry.
  */
 int
-archive_read_next_header(struct archive *_a, struct archive_entry **entryp)
+archive_read_next_header2(struct archive *_a, struct archive_entry *entry)
 {
 	struct archive_read *a = (struct archive_read *)_a;
-	struct archive_entry *entry;
 	int slot, ret;
 
 	__archive_check_magic(_a, ARCHIVE_READ_MAGIC,
 	    ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA,
 	    "archive_read_next_header");
 
-	*entryp = NULL;
-	entry = a->entry;
 	archive_entry_clear(entry);
 	archive_clear_error(&a->archive);
 
@@ -437,12 +442,22 @@ archive_read_next_header(struct archive 
 		break;
 	}
 
-	*entryp = entry;
 	a->read_data_output_offset = 0;
 	a->read_data_remaining = 0;
 	return (ret);
 }
 
+int
+archive_read_next_header(struct archive *_a, struct archive_entry **entryp)
+{
+	int ret;
+	struct archive_read *a = (struct archive_read *)_a;
+	*entryp = NULL;
+	ret = archive_read_next_header2(_a, a->entry);
+	*entryp = a->entry;
+	return ret;
+}
+
 /*
  * Allow each registered format to bid on whether it wants to handle
  * the next entry.  Return index of winning bidder.
@@ -680,8 +695,10 @@ _archive_read_close(struct archive *_a)
 
 	__archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC,
 	    ARCHIVE_STATE_ANY, "archive_read_close");
+	archive_clear_error(&a->archive);
 	a->archive.state = ARCHIVE_STATE_CLOSED;
 
+
 	/* Call cleanup functions registered by optional components. */
 	if (a->cleanup_archive_extract != NULL)
 		r = (a->cleanup_archive_extract)(a);

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 00:50:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AEE55106564A;
	Fri, 17 Apr 2009 00:50:00 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9A60A8FC08;
	Fri, 17 Apr 2009 00:50:00 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H0o0mF098972;
	Fri, 17 Apr 2009 00:50:00 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H0o0fS098969;
	Fri, 17 Apr 2009 00:50:00 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170050.n3H0o0fS098969@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 00:50:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191171 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 00:50:01 -0000

Author: kientzle
Date: Fri Apr 17 00:50:00 2009
New Revision: 191171
URL: http://svn.freebsd.org/changeset/base/191171

Log:
  Don't use the open callback, which is deprecated (because it's
  never necessary).  Also, simplify just a tad by delegating
  to read_open_fd() when we know the file descriptor, instead
  of duplicating that logic.

Modified:
  head/lib/libarchive/archive_read_open_fd.c
  head/lib/libarchive/archive_read_open_file.c
  head/lib/libarchive/archive_read_open_filename.c

Modified: head/lib/libarchive/archive_read_open_fd.c
==============================================================================
--- head/lib/libarchive/archive_read_open_fd.c	Fri Apr 17 00:47:16 2009	(r191170)
+++ head/lib/libarchive/archive_read_open_fd.c	Fri Apr 17 00:50:00 2009	(r191171)
@@ -52,7 +52,6 @@ struct read_fd_data {
 };
 
 static int	file_close(struct archive *, void *);
-static int	file_open(struct archive *, void *);
 static ssize_t	file_read(struct archive *, void *, const void **buff);
 #if ARCHIVE_API_VERSION < 2
 static ssize_t	file_skip(struct archive *, void *, size_t request);
@@ -63,50 +62,41 @@ static off_t	file_skip(struct archive *,
 int
 archive_read_open_fd(struct archive *a, int fd, size_t block_size)
 {
+	struct stat st;
 	struct read_fd_data *mine;
+	void *b;
 
-	mine = (struct read_fd_data *)malloc(sizeof(*mine));
-	if (mine == NULL) {
-		archive_set_error(a, ENOMEM, "No memory");
+	if (fstat(fd, &st) != 0) {
+		archive_set_error(a, errno, "Can't stat fd %d", fd);
 		return (ARCHIVE_FATAL);
 	}
-	mine->block_size = block_size;
-	mine->buffer = malloc(mine->block_size);
-	if (mine->buffer == NULL) {
+
+	mine = (struct read_fd_data *)malloc(sizeof(*mine));
+	b = malloc(block_size);
+	if (mine == NULL || b == NULL) {
 		archive_set_error(a, ENOMEM, "No memory");
 		free(mine);
+		free(b);
 		return (ARCHIVE_FATAL);
 	}
+	mine->block_size = block_size;
+	mine->buffer = b;
 	mine->fd = fd;
-	/* lseek() hardly ever works, so disable it by default.  See below. */
-	mine->can_skip = 0;
-	return (archive_read_open2(a, mine, file_open, file_read, file_skip, file_close));
-}
-
-static int
-file_open(struct archive *a, void *client_data)
-{
-	struct read_fd_data *mine = (struct read_fd_data *)client_data;
-	struct stat st;
-
-	if (fstat(mine->fd, &st) != 0) {
-		archive_set_error(a, errno, "Can't stat fd %d", mine->fd);
-		return (ARCHIVE_FATAL);
-	}
-
+	/*
+	 * Skip support is a performance optimization for anything
+	 * that supports lseek().  On FreeBSD, only regular files and
+	 * raw disk devices support lseek() and there's no portable
+	 * way to determine if a device is a raw disk device, so we
+	 * only enable this optimization for regular files.
+	 */
 	if (S_ISREG(st.st_mode)) {
 		archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
-		/*
-		 * Enabling skip here is a performance optimization for
-		 * anything that supports lseek().  On FreeBSD, only
-		 * regular files and raw disk devices support lseek() and
-		 * there's no portable way to determine if a device is
-		 * a raw disk device, so we only enable this optimization
-		 * for regular files.
-		 */
 		mine->can_skip = 1;
-	}
-	return (ARCHIVE_OK);
+	} else
+		mine->can_skip = 0;
+
+	return (archive_read_open2(a, mine,
+		NULL, file_read, file_skip, file_close));
 }
 
 static ssize_t
@@ -180,8 +170,7 @@ file_close(struct archive *a, void *clie
 	struct read_fd_data *mine = (struct read_fd_data *)client_data;
 
 	(void)a; /* UNUSED */
-	if (mine->buffer != NULL)
-		free(mine->buffer);
+	free(mine->buffer);
 	free(mine);
 	return (ARCHIVE_OK);
 }

Modified: head/lib/libarchive/archive_read_open_file.c
==============================================================================
--- head/lib/libarchive/archive_read_open_file.c	Fri Apr 17 00:47:16 2009	(r191170)
+++ head/lib/libarchive/archive_read_open_file.c	Fri Apr 17 00:50:00 2009	(r191171)
@@ -55,7 +55,6 @@ struct read_FILE_data {
 };
 
 static int	file_close(struct archive *, void *);
-static int	file_open(struct archive *, void *);
 static ssize_t	file_read(struct archive *, void *, const void **buff);
 #if ARCHIVE_API_VERSION < 2
 static ssize_t	file_skip(struct archive *, void *, size_t request);
@@ -66,45 +65,36 @@ static off_t	file_skip(struct archive *,
 int
 archive_read_open_FILE(struct archive *a, FILE *f)
 {
+	struct stat st;
 	struct read_FILE_data *mine;
+	size_t block_size = 128 * 1024;
+	void *b;
 
 	mine = (struct read_FILE_data *)malloc(sizeof(*mine));
-	if (mine == NULL) {
-		archive_set_error(a, ENOMEM, "No memory");
-		return (ARCHIVE_FATAL);
-	}
-	mine->block_size = 128 * 1024;
-	mine->buffer = malloc(mine->block_size);
-	if (mine->buffer == NULL) {
+	b = malloc(block_size);
+	if (mine == NULL || b == NULL) {
 		archive_set_error(a, ENOMEM, "No memory");
 		free(mine);
+		free(b);
 		return (ARCHIVE_FATAL);
 	}
+	mine->block_size = block_size;
+	mine->buffer = b;
 	mine->f = f;
-	/* Suppress skip by default. See below. */
-	mine->can_skip = 0;
-	return (archive_read_open2(a, mine, file_open, file_read,
-		    file_skip, file_close));
-}
-
-static int
-file_open(struct archive *a, void *client_data)
-{
-	struct read_FILE_data *mine = (struct read_FILE_data *)client_data;
-	struct stat st;
-
 	/*
-	 * If we can't fstat() the file, it may just be that
-	 * it's not a file.  (FILE * objects can wrap many kinds
-	 * of I/O streams.)
+	 * If we can't fstat() the file, it may just be that it's not
+	 * a file.  (FILE * objects can wrap many kinds of I/O
+	 * streams, some of which don't support fileno()).)
 	 */
 	if (fstat(fileno(mine->f), &st) == 0 && S_ISREG(st.st_mode)) {
 		archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
-		/* Enable the seek optimization for regular files. */
+		/* Enable the seek optimization only for regular files. */
 		mine->can_skip = 1;
-	}
+	} else
+		mine->can_skip = 0;
 
-	return (ARCHIVE_OK);
+	return (archive_read_open2(a, mine, NULL, file_read,
+		    file_skip, file_close));
 }
 
 static ssize_t

Modified: head/lib/libarchive/archive_read_open_filename.c
==============================================================================
--- head/lib/libarchive/archive_read_open_filename.c	Fri Apr 17 00:47:16 2009	(r191170)
+++ head/lib/libarchive/archive_read_open_filename.c	Fri Apr 17 00:50:00 2009	(r191171)
@@ -61,7 +61,6 @@ struct read_file_data {
 };
 
 static int	file_close(struct archive *, void *);
-static int	file_open(struct archive *, void *);
 static ssize_t	file_read(struct archive *, void *, const void **buff);
 #if ARCHIVE_API_VERSION < 2
 static ssize_t	file_skip(struct archive *, void *, size_t request);
@@ -80,78 +79,54 @@ int
 archive_read_open_filename(struct archive *a, const char *filename,
     size_t block_size)
 {
+	struct stat st;
 	struct read_file_data *mine;
+	void *b;
+	int fd;
 
-	if (filename == NULL || filename[0] == '\0') {
-		mine = (struct read_file_data *)malloc(sizeof(*mine));
-		if (mine == NULL) {
-			archive_set_error(a, ENOMEM, "No memory");
-			return (ARCHIVE_FATAL);
-		}
-		mine->filename[0] = '\0';
-	} else {
-		mine = (struct read_file_data *)malloc(sizeof(*mine) + strlen(filename));
-		if (mine == NULL) {
-			archive_set_error(a, ENOMEM, "No memory");
-			return (ARCHIVE_FATAL);
-		}
-		strcpy(mine->filename, filename);
-	}
-	mine->block_size = block_size;
-	mine->buffer = NULL;
-	mine->fd = -1;
-	/* lseek() almost never works; disable it by default.  See below. */
-	mine->can_skip = 0;
-	return (archive_read_open2(a, mine, file_open, file_read, file_skip, file_close));
-}
+	if (filename == NULL || filename[0] == '\0')
+		return (archive_read_open_fd(a, 0, block_size));
 
-static int
-file_open(struct archive *a, void *client_data)
-{
-	struct read_file_data *mine = (struct read_file_data *)client_data;
-	struct stat st;
-
-	mine->buffer = malloc(mine->block_size);
-	if (mine->buffer == NULL) {
-		archive_set_error(a, ENOMEM, "No memory");
+	fd = open(filename, O_RDONLY | O_BINARY);
+	if (fd < 0) {
+		archive_set_error(a, errno, "Failed to open '%s'", filename);
 		return (ARCHIVE_FATAL);
 	}
-	if (mine->filename[0] != '\0')
-		mine->fd = open(mine->filename, O_RDONLY | O_BINARY);
-	else
-		mine->fd = 0; /* Fake "open" for stdin. */
-	if (mine->fd < 0) {
-		archive_set_error(a, errno, "Failed to open '%s'",
-		    mine->filename);
+	if (fstat(fd, &st) != 0) {
+		archive_set_error(a, errno, "Can't stat '%s'", filename);
 		return (ARCHIVE_FATAL);
 	}
-	if (fstat(mine->fd, &st) == 0) {
-		/* If we're reading a file from disk, ensure that we don't
-		   overwrite it with an extracted file. */
-		if (S_ISREG(st.st_mode)) {
-			archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
-			/*
-			 * Enabling skip here is a performance
-			 * optimization for anything that supports
-			 * lseek().  On FreeBSD, only regular files
-			 * and raw disk devices support lseek() and
-			 * there's no portable way to determine if a
-			 * device is a raw disk device, so we only
-			 * enable this optimization for regular files.
-			 */
-			mine->can_skip = 1;
-		}
-		/* Remember mode so close can decide whether to flush. */
-		mine->st_mode = st.st_mode;
-	} else {
-		if (mine->filename[0] == '\0')
-			archive_set_error(a, errno, "Can't stat stdin");
-		else
-			archive_set_error(a, errno, "Can't stat '%s'",
-			    mine->filename);
+
+	mine = (struct read_file_data *)malloc(sizeof(*mine) + strlen(filename));
+	b = malloc(block_size);
+	if (mine == NULL || b == NULL) {
+		archive_set_error(a, ENOMEM, "No memory");
+		free(mine);
+		free(b);
 		return (ARCHIVE_FATAL);
 	}
-	return (0);
+	strcpy(mine->filename, filename);
+	mine->block_size = block_size;
+	mine->buffer = b;
+	mine->fd = fd;
+	/* Remember mode so close can decide whether to flush. */
+	mine->st_mode = st.st_mode;
+	/* If we're reading a file from disk, ensure that we don't
+	   overwrite it with an extracted file. */
+	if (S_ISREG(st.st_mode)) {
+		archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
+		/*
+		 * Skip is a performance optimization for anything
+		 * that supports lseek().  Generally, that only
+		 * includes regular files and possibly raw disk
+		 * devices, but there's no good portable way to detect
+		 * raw disks.
+		 */
+		mine->can_skip = 1;
+	} else
+		mine->can_skip = 0;
+	return (archive_read_open2(a, mine,
+		NULL, file_read, file_skip, file_close));
 }
 
 static ssize_t
@@ -163,11 +138,8 @@ file_read(struct archive *a, void *clien
 	*buff = mine->buffer;
 	bytes_read = read(mine->fd, mine->buffer, mine->block_size);
 	if (bytes_read < 0) {
-		if (mine->filename[0] == '\0')
-			archive_set_error(a, errno, "Error reading stdin");
-		else
-			archive_set_error(a, errno, "Error reading '%s'",
-			    mine->filename);
+		archive_set_error(a, errno, "Error reading '%s'",
+		    mine->filename);
 	}
 	return (bytes_read);
 }
@@ -217,15 +189,8 @@ file_skip(struct archive *a, void *clien
 		 * likely caused by a programmer error (too large request)
 		 * or a corrupted archive file.
 		 */
-		if (mine->filename[0] == '\0')
-			/*
-			 * Should never get here, since lseek() on stdin ought
-			 * to return an ESPIPE error.
-			 */
-			archive_set_error(a, errno, "Error seeking in stdin");
-		else
-			archive_set_error(a, errno, "Error seeking in '%s'",
-			    mine->filename);
+		archive_set_error(a, errno, "Error seeking in '%s'",
+		    mine->filename);
 		return (-1);
 	}
 	return (new_offset - old_offset);
@@ -259,9 +224,7 @@ file_close(struct archive *a, void *clie
 				    mine->block_size);
 			} while (bytesRead > 0);
 		}
-		/* If a named file was opened, then it needs to be closed. */
-		if (mine->filename[0] != '\0')
-			close(mine->fd);
+		close(mine->fd);
 	}
 	free(mine->buffer);
 	free(mine);

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 00:54:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F2403106566C;
	Fri, 17 Apr 2009 00:54:35 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DDDE78FC0A;
	Fri, 17 Apr 2009 00:54:35 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H0sZfb099173;
	Fri, 17 Apr 2009 00:54:35 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H0sZo9099170;
	Fri, 17 Apr 2009 00:54:35 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170054.n3H0sZo9099170@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 00:54:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191172 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 00:54:37 -0000

Author: kientzle
Date: Fri Apr 17 00:54:35 2009
New Revision: 191172
URL: http://svn.freebsd.org/changeset/base/191172

Log:
  Merge new xz/lzma support from libarchive.googlecode.com.
  Since FreeBSD doesn't have liblzma in the base system, the
  read side will always fall back to the unxz/unlzma commands for now.
  (Which will in turn fail if those commands are not currently
  installed.)  The write side does not yet have a fallback, so
  that will just fail.

Added:
  head/lib/libarchive/archive_read_support_compression_xz.c   (contents, props changed)
  head/lib/libarchive/archive_write_set_compression_xz.c   (contents, props changed)
Modified:
  head/lib/libarchive/Makefile

Modified: head/lib/libarchive/Makefile
==============================================================================
--- head/lib/libarchive/Makefile	Fri Apr 17 00:50:00 2009	(r191171)
+++ head/lib/libarchive/Makefile	Fri Apr 17 00:54:35 2009	(r191172)
@@ -39,6 +39,7 @@ SRCS=	archive_check_magic.c				\
 	archive_read_support_compression_gzip.c		\
 	archive_read_support_compression_none.c		\
 	archive_read_support_compression_program.c	\
+	archive_read_support_compression_xz.c		\
 	archive_read_support_format_all.c		\
 	archive_read_support_format_ar.c		\
 	archive_read_support_format_cpio.c		\
@@ -63,6 +64,7 @@ SRCS=	archive_check_magic.c				\
 	archive_write_set_compression_gzip.c		\
 	archive_write_set_compression_none.c		\
 	archive_write_set_compression_program.c		\
+	archive_write_set_compression_xz.c		\
 	archive_write_set_format.c			\
 	archive_write_set_format_ar.c			\
 	archive_write_set_format_by_name.c		\

Added: head/lib/libarchive/archive_read_support_compression_xz.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libarchive/archive_read_support_compression_xz.c	Fri Apr 17 00:54:35 2009	(r191172)
@@ -0,0 +1,642 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * Copyright (c) 2003-2008 Tim Kientzle and Miklos Vajna
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+
+__FBSDID("$FreeBSD$");
+
+#ifdef HAVE_ERRNO_H
+#include 
+#endif
+#include 
+#ifdef HAVE_STDLIB_H
+#include 
+#endif
+#ifdef HAVE_STRING_H
+#include 
+#endif
+#ifdef HAVE_UNISTD_H
+#include 
+#endif
+#if HAVE_LZMA_H
+#include 
+#elif HAVE_LZMADEC_H
+#include 
+#endif
+
+#include "archive.h"
+#include "archive_private.h"
+#include "archive_read_private.h"
+
+#if HAVE_LZMA_H && HAVE_LIBLZMA
+
+struct private_data {
+	lzma_stream	 stream;
+	unsigned char	*out_block;
+	size_t		 out_block_size;
+	int64_t		 total_out;
+	char		 eof; /* True = found end of compressed data. */
+};
+
+/* Combined lzma/xz filter */
+static ssize_t	xz_filter_read(struct archive_read_filter *, const void **);
+static int	xz_filter_close(struct archive_read_filter *);
+static int	xz_lzma_bidder_init(struct archive_read_filter *);
+
+#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC
+
+struct private_data {
+	lzmadec_stream	 stream;
+	unsigned char	*out_block;
+	size_t		 out_block_size;
+	int64_t		 total_out;
+	char		 eof; /* True = found end of compressed data. */
+};
+
+/* Lzma-only filter */
+static ssize_t	lzma_filter_read(struct archive_read_filter *, const void **);
+static int	lzma_filter_close(struct archive_read_filter *);
+#endif
+
+/*
+ * Note that we can detect xz and lzma compressed files even if we
+ * can't decompress them.  (In fact, we like detecting them because we
+ * can give better error messages.)  So the bid framework here gets
+ * compiled even if no lzma library is available.
+ */
+static int	xz_bidder_bid(struct archive_read_filter_bidder *,
+		    struct archive_read_filter *);
+static int	xz_bidder_init(struct archive_read_filter *);
+static int	lzma_bidder_bid(struct archive_read_filter_bidder *,
+		    struct archive_read_filter *);
+static int	lzma_bidder_init(struct archive_read_filter *);
+
+int
+archive_read_support_compression_xz(struct archive *_a)
+{
+	struct archive_read *a = (struct archive_read *)_a;
+	struct archive_read_filter_bidder *bidder = __archive_read_get_bidder(a);
+
+	if (bidder == NULL)
+		return (ARCHIVE_FATAL);
+
+	bidder->data = NULL;
+	bidder->bid = xz_bidder_bid;
+	bidder->init = xz_bidder_init;
+	bidder->options = NULL;
+	bidder->free = NULL;
+#if HAVE_LZMA_H && HAVE_LIBLZMA
+	return (ARCHIVE_OK);
+#else
+	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
+	    "Using external unxz program for xz decompression");
+	return (ARCHIVE_WARN);
+#endif
+}
+
+int
+archive_read_support_compression_lzma(struct archive *_a)
+{
+	struct archive_read *a = (struct archive_read *)_a;
+	struct archive_read_filter_bidder *bidder = __archive_read_get_bidder(a);
+
+	if (bidder == NULL)
+		return (ARCHIVE_FATAL);
+
+	bidder->data = NULL;
+	bidder->bid = lzma_bidder_bid;
+	bidder->init = lzma_bidder_init;
+	bidder->options = NULL;
+	bidder->free = NULL;
+#if HAVE_LZMA_H && HAVE_LIBLZMA
+	return (ARCHIVE_OK);
+#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC
+	return (ARCHIVE_OK);
+#else
+	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
+	    "Using external unlzma program for lzma decompression");
+	return (ARCHIVE_WARN);
+#endif
+}
+
+/*
+ * Test whether we can handle this data.
+ */
+static int
+xz_bidder_bid(struct archive_read_filter_bidder *self,
+    struct archive_read_filter *filter)
+{
+	const unsigned char *buffer;
+	ssize_t avail;
+	int bits_checked;
+
+	(void)self; /* UNUSED */
+
+	buffer = __archive_read_filter_ahead(filter, 6, &avail);
+	if (buffer == NULL)
+		return (0);
+
+	/*
+	 * Verify Header Magic Bytes : FD 37 7A 58 5A 00
+	 */
+	bits_checked = 0;
+	if (buffer[0] != 0xFD)
+		return (0);
+	bits_checked += 8;
+	if (buffer[1] != 0x37)
+		return (0);
+	bits_checked += 8;
+	if (buffer[2] != 0x7A)
+		return (0);
+	bits_checked += 8;
+	if (buffer[3] != 0x58)
+		return (0);
+	bits_checked += 8;
+	if (buffer[4] != 0x5A)
+		return (0);
+	bits_checked += 8;
+	if (buffer[5] != 0x00)
+		return (0);
+	bits_checked += 8;
+
+	return (bits_checked);
+}
+
+/*
+ * Test whether we can handle this data.
+ *
+ *  LZMA has a rather poor file signature.  Zeros do not
+ * make good signature bytes as a rule, and the only non-zero byte
+ * here is an ASCII character.  For example, an uncompressed tar
+ * archive whose first file is ']' would satisfy this check.  It may
+ * be necessary to exclude LZMA from compression_all() because of
+ * this.  Clients of libarchive would then have to explicitly enable
+ * LZMA checking instead of (or in addition to) compression_all() when
+ * they have other evidence (file name, command-line option) to go on.
+ */
+static int
+lzma_bidder_bid(struct archive_read_filter_bidder *self,
+    struct archive_read_filter *filter)
+{
+	const unsigned char *buffer;
+	ssize_t avail;
+	int bits_checked;
+
+	(void)self; /* UNUSED */
+
+	buffer = __archive_read_filter_ahead(filter, 6, &avail);
+	if (buffer == NULL)
+		return (0);
+
+	/* First byte of raw LZMA stream is always 0x5d. */
+	bits_checked = 0;
+	if (buffer[0] != 0x5d)
+		return (0);
+	bits_checked += 8;
+
+	/* Second through fifth bytes are dictionary code, stored in
+	 * little-endian order.  The two least-significant bytes are
+	 * always zero. */
+	if (buffer[1] != 0 || buffer[2] != 0)
+		return (0);
+	bits_checked += 16;
+
+	/* ??? TODO:  Fix this. ??? */
+	/* NSIS format check uses this, but I've seen tar.lzma
+	 * archives where this byte is 0xff, not 0.  Can it
+	 * ever be anything other than 0 or 0xff?
+	 */
+#if 0
+	if (buffer[5] != 0)
+		return (0);
+	bits_checked += 8;
+#endif
+
+	/* TODO: The above test is still very weak.  It would be
+	 * good to do better. */
+
+	return (bits_checked);
+}
+
+#if HAVE_LZMA_H && HAVE_LIBLZMA
+
+/*
+ * liblzma 4.999.7 and later support both lzma and xz streams.
+ */
+static int
+xz_bidder_init(struct archive_read_filter *self)
+{
+	self->code = ARCHIVE_COMPRESSION_XZ;
+	self->name = "xz";
+	return (xz_lzma_bidder_init(self));
+}
+
+static int
+lzma_bidder_init(struct archive_read_filter *self)
+{
+	self->code = ARCHIVE_COMPRESSION_LZMA;
+	self->name = "lzma";
+	return (xz_lzma_bidder_init(self));
+}
+
+/*
+ * Setup the callbacks.
+ */
+static int
+xz_lzma_bidder_init(struct archive_read_filter *self)
+{
+	static const size_t out_block_size = 64 * 1024;
+	void *out_block;
+	struct private_data *state;
+	int ret;
+
+	state = (struct private_data *)calloc(sizeof(*state), 1);
+	out_block = (unsigned char *)malloc(out_block_size);
+	if (state == NULL || out_block == NULL) {
+		archive_set_error(&self->archive->archive, ENOMEM,
+		    "Can't allocate data for xz decompression");
+		free(out_block);
+		free(state);
+		return (ARCHIVE_FATAL);
+	}
+
+	self->data = state;
+	state->out_block_size = out_block_size;
+	state->out_block = out_block;
+	self->read = xz_filter_read;
+	self->skip = NULL; /* not supported */
+	self->close = xz_filter_close;
+
+	state->stream.avail_in = 0;
+
+	state->stream.next_out = state->out_block;
+	state->stream.avail_out = state->out_block_size;
+
+	/* Initialize compression library.
+	 * TODO: I don't know what value is best for memlimit.
+	 *       maybe, it needs to check memory size which
+	 *       running system has.
+	 */
+	if (self->code == ARCHIVE_COMPRESSION_XZ)
+		ret = lzma_stream_decoder(&(state->stream),
+		    (1U << 23) + (1U << 21),/* memlimit */
+		    LZMA_CONCATENATED);
+	else
+		ret = lzma_alone_decoder(&(state->stream),
+		    (1U << 23) + (1U << 21));/* memlimit */
+
+	if (ret == LZMA_OK)
+		return (ARCHIVE_OK);
+
+	/* Library setup failed: Choose an error message and clean up. */
+	switch (ret) {
+	case LZMA_MEM_ERROR:
+		archive_set_error(&self->archive->archive, ENOMEM,
+		    "Internal error initializing compression library: "
+		    "Cannot allocate memory");
+		break;
+	case LZMA_OPTIONS_ERROR:
+		archive_set_error(&self->archive->archive,
+		    ARCHIVE_ERRNO_MISC,
+		    "Internal error initializing compression library: "
+		    "Invalid or unsupported options");
+		break;
+	default:
+		archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
+		    "Internal error initializing lzma library");
+		break;
+	}
+
+	free(state->out_block);
+	free(state);
+	self->data = NULL;
+	return (ARCHIVE_FATAL);
+}
+
+/*
+ * Return the next block of decompressed data.
+ */
+static ssize_t
+xz_filter_read(struct archive_read_filter *self, const void **p)
+{
+	struct private_data *state;
+	size_t decompressed;
+	ssize_t avail_in;
+	int ret;
+
+	state = (struct private_data *)self->data;
+
+	/* Empty our output buffer. */
+	state->stream.next_out = state->out_block;
+	state->stream.avail_out = state->out_block_size;
+
+	/* Try to fill the output buffer. */
+	while (state->stream.avail_out > 0 && !state->eof) {
+		state->stream.next_in =
+		    __archive_read_filter_ahead(self->upstream, 1, &avail_in);
+		if (state->stream.next_in == NULL && avail_in < 0)
+			return (ARCHIVE_FATAL);
+		state->stream.avail_in = avail_in;
+
+		/* Decompress as much as we can in one pass. */
+		ret = lzma_code(&(state->stream),
+		    (state->stream.avail_in == 0)? LZMA_FINISH: LZMA_RUN);
+		switch (ret) {
+		case LZMA_STREAM_END: /* Found end of stream. */
+			state->eof = 1;
+			/* FALL THROUGH */
+		case LZMA_OK: /* Decompressor made some progress. */
+			__archive_read_filter_consume(self->upstream,
+			    avail_in - state->stream.avail_in);
+			break;
+		case LZMA_MEM_ERROR:
+			archive_set_error(&self->archive->archive, ENOMEM,
+			    "Lzma library error: Cannot allocate memory");
+			return (ARCHIVE_FATAL);
+		case LZMA_MEMLIMIT_ERROR:
+			archive_set_error(&self->archive->archive, ENOMEM,
+			    "Lzma library error: Out of memory");
+			return (ARCHIVE_FATAL);
+		case LZMA_FORMAT_ERROR:
+			archive_set_error(&self->archive->archive,
+			    ARCHIVE_ERRNO_MISC,
+			    "Lzma library error: format not recognized");
+			return (ARCHIVE_FATAL);
+		case LZMA_OPTIONS_ERROR:
+			archive_set_error(&self->archive->archive,
+			    ARCHIVE_ERRNO_MISC,
+			    "Lzma library error: Invalid options");
+			return (ARCHIVE_FATAL);
+		case LZMA_DATA_ERROR:
+			archive_set_error(&self->archive->archive,
+			    ARCHIVE_ERRNO_MISC,
+			    "Lzma library error: Corrupted input data");
+			return (ARCHIVE_FATAL);
+		case LZMA_BUF_ERROR:
+			archive_set_error(&self->archive->archive,
+			    ARCHIVE_ERRNO_MISC,
+			    "Lzma library error:  No progress is possible");
+			return (ARCHIVE_FATAL);
+		default:
+			/* Return an error. */
+			archive_set_error(&self->archive->archive,
+			    ARCHIVE_ERRNO_MISC,
+			    "Lzma decompression failed:  Unknown error");
+			return (ARCHIVE_FATAL);
+		}
+	}
+
+	decompressed = state->stream.next_out - state->out_block;
+	state->total_out += decompressed;
+	if (decompressed == 0)
+		*p = NULL;
+	else
+		*p = state->out_block;
+	return (decompressed);
+}
+
+/*
+ * Clean up the decompressor.
+ */
+static int
+xz_filter_close(struct archive_read_filter *self)
+{
+	struct private_data *state;
+
+	state = (struct private_data *)self->data;
+	lzma_end(&(state->stream));
+	free(state->out_block);
+	free(state);
+	return (ARCHIVE_OK);
+}
+
+#else
+
+#if HAVE_LZMADEC_H && HAVE_LIBLZMADEC
+
+/*
+ * If we have the older liblzmadec library, then we can handle
+ * LZMA streams but not XZ streams.
+ */
+
+/*
+ * Setup the callbacks.
+ */
+static int
+lzma_bidder_init(struct archive_read_filter *self)
+{
+	static const size_t out_block_size = 64 * 1024;
+	void *out_block;
+	struct private_data *state;
+	ssize_t ret, avail_in;
+
+	self->code = ARCHIVE_COMPRESSION_LZMA;
+	self->name = "lzma";
+
+	state = (struct private_data *)calloc(sizeof(*state), 1);
+	out_block = (unsigned char *)malloc(out_block_size);
+	if (state == NULL || out_block == NULL) {
+		archive_set_error(&self->archive->archive, ENOMEM,
+		    "Can't allocate data for lzma decompression");
+		free(out_block);
+		free(state);
+		return (ARCHIVE_FATAL);
+	}
+
+	self->data = state;
+	state->out_block_size = out_block_size;
+	state->out_block = out_block;
+	self->read = lzma_filter_read;
+	self->skip = NULL; /* not supported */
+	self->close = lzma_filter_close;
+
+	/* Prime the lzma library with 18 bytes of input. */
+	state->stream.next_in = (unsigned char *)(uintptr_t)
+	    __archive_read_filter_ahead(self->upstream, 18, &avail_in);
+	if (state->stream.next_in == NULL)
+		return (ARCHIVE_FATAL);
+	state->stream.avail_in = avail_in;
+	state->stream.next_out = state->out_block;
+	state->stream.avail_out = state->out_block_size;
+
+	/* Initialize compression library. */
+	ret = lzmadec_init(&(state->stream));
+	__archive_read_filter_consume(self->upstream,
+	    avail_in - state->stream.avail_in);
+	if (ret == LZMADEC_OK)
+		return (ARCHIVE_OK);
+
+	/* Library setup failed: Clean up. */
+	archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
+	    "Internal error initializing lzma library");
+
+	/* Override the error message if we know what really went wrong. */
+	switch (ret) {
+	case LZMADEC_HEADER_ERROR:
+		archive_set_error(&self->archive->archive,
+		    ARCHIVE_ERRNO_MISC,
+		    "Internal error initializing compression library: "
+		    "invalid header");
+		break;
+	case LZMADEC_MEM_ERROR:
+		archive_set_error(&self->archive->archive, ENOMEM,
+		    "Internal error initializing compression library: "
+		    "out of memory");
+		break;
+	}
+
+	free(state->out_block);
+	free(state);
+	self->data = NULL;
+	return (ARCHIVE_FATAL);
+}
+
+/*
+ * Return the next block of decompressed data.
+ */
+static ssize_t
+lzma_filter_read(struct archive_read_filter *self, const void **p)
+{
+	struct private_data *state;
+	size_t decompressed;
+	ssize_t avail_in, ret;
+
+	state = (struct private_data *)self->data;
+
+	/* Empty our output buffer. */
+	state->stream.next_out = state->out_block;
+	state->stream.avail_out = state->out_block_size;
+
+	/* Try to fill the output buffer. */
+	while (state->stream.avail_out > 0 && !state->eof) {
+		state->stream.next_in = (unsigned char *)(uintptr_t)
+		    __archive_read_filter_ahead(self->upstream, 1, &avail_in);
+		if (state->stream.next_in == NULL && avail_in < 0)
+			return (ARCHIVE_FATAL);
+		state->stream.avail_in = avail_in;
+
+		/* Decompress as much as we can in one pass. */
+		ret = lzmadec_decode(&(state->stream), avail_in == 0);
+		switch (ret) {
+		case LZMADEC_STREAM_END: /* Found end of stream. */
+			state->eof = 1;
+			/* FALL THROUGH */
+		case LZMADEC_OK: /* Decompressor made some progress. */
+			__archive_read_filter_consume(self->upstream,
+			    avail_in - state->stream.avail_in);
+			break;
+		case LZMADEC_BUF_ERROR: /* Insufficient input data? */
+			archive_set_error(&self->archive->archive,
+			    ARCHIVE_ERRNO_MISC,
+			    "Insufficient compressed data");
+			return (ARCHIVE_FATAL);
+		default:
+			/* Return an error. */
+			archive_set_error(&self->archive->archive,
+			    ARCHIVE_ERRNO_MISC,
+			    "Lzma decompression failed");
+			return (ARCHIVE_FATAL);
+		}
+	}
+
+	decompressed = state->stream.next_out - state->out_block;
+	state->total_out += decompressed;
+	if (decompressed == 0)
+		*p = NULL;
+	else
+		*p = state->out_block;
+	return (decompressed);
+}
+
+/*
+ * Clean up the decompressor.
+ */
+static int
+lzma_filter_close(struct archive_read_filter *self)
+{
+	struct private_data *state;
+	int ret;
+
+	state = (struct private_data *)self->data;
+	ret = ARCHIVE_OK;
+	switch (lzmadec_end(&(state->stream))) {
+	case LZMADEC_OK:
+		break;
+	default:
+		archive_set_error(&(self->archive->archive),
+		    ARCHIVE_ERRNO_MISC,
+		    "Failed to clean up %s compressor",
+		    self->archive->archive.compression_name);
+		ret = ARCHIVE_FATAL;
+	}
+
+	free(state->out_block);
+	free(state);
+	return (ret);
+}
+
+#else
+
+/*
+ *
+ * If we have no suitable library on this system, we can't actually do
+ * the decompression.  We can, however, still detect compressed
+ * archives and emit a useful message.
+ *
+ */
+static int
+lzma_bidder_init(struct archive_read_filter *self)
+{
+	int r;
+
+	r = __archive_read_program(self, "unlzma");
+	/* Note: We set the format here even if __archive_read_program()
+	 * above fails.  We do, after all, know what the format is
+	 * even if we weren't able to read it. */
+	self->code = ARCHIVE_COMPRESSION_LZMA;
+	self->name = "lzma";
+	return (r);
+}
+
+#endif /* HAVE_LZMADEC_H */
+
+
+static int
+xz_bidder_init(struct archive_read_filter *self)
+{
+	int r;
+
+	r = __archive_read_program(self, "unxz");
+	/* Note: We set the format here even if __archive_read_program()
+	 * above fails.  We do, after all, know what the format is
+	 * even if we weren't able to read it. */
+	self->code = ARCHIVE_COMPRESSION_XZ;
+	self->name = "xz";
+	return (r);
+}
+
+
+#endif /* HAVE_LZMA_H */

Added: head/lib/libarchive/archive_write_set_compression_xz.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libarchive/archive_write_set_compression_xz.c	Fri Apr 17 00:54:35 2009	(r191172)
@@ -0,0 +1,439 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+
+__FBSDID("$FreeBSD$");
+
+#ifdef HAVE_ERRNO_H
+#include 
+#endif
+#ifdef HAVE_STDLIB_H
+#include 
+#endif
+#ifdef HAVE_STRING_H
+#include 
+#endif
+#include 
+#ifdef HAVE_LZMA_H
+#include 
+#endif
+
+#include "archive.h"
+#include "archive_private.h"
+#include "archive_write_private.h"
+
+#ifndef HAVE_LZMA_H
+int
+archive_write_set_compression_xz(struct archive *a)
+{
+	archive_set_error(a, ARCHIVE_ERRNO_MISC,
+	    "xz compression not supported on this platform");
+	return (ARCHIVE_FATAL);
+}
+
+int
+archive_write_set_compression_lzma(struct archive *a)
+{
+	archive_set_error(a, ARCHIVE_ERRNO_MISC,
+	    "lzma compression not supported on this platform");
+	return (ARCHIVE_FATAL);
+}
+#else
+/* Don't compile this if we don't have liblzma. */
+
+struct private_data {
+	lzma_stream	 stream;
+	lzma_filter	 lzmafilters[2];
+	lzma_options_lzma lzma_opt;
+	int64_t		 total_in;
+	unsigned char	*compressed;
+	size_t		 compressed_buffer_size;
+};
+
+struct private_config {
+	int		 compression_level;
+};
+
+static int	archive_compressor_xz_init(struct archive_write *);
+static int	archive_compressor_xz_options(struct archive_write *,
+		    const char *, const char *);
+static int	archive_compressor_xz_finish(struct archive_write *);
+static int	archive_compressor_xz_write(struct archive_write *,
+		    const void *, size_t);
+static int	drive_compressor(struct archive_write *, struct private_data *,
+		    int finishing);
+
+
+/*
+ * Allocate, initialize and return a archive object.
+ */
+int
+archive_write_set_compression_xz(struct archive *_a)
+{
+	struct private_config *config;
+	struct archive_write *a = (struct archive_write *)_a;
+	__archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
+	    ARCHIVE_STATE_NEW, "archive_write_set_compression_xz");
+	config = calloc(1, sizeof(*config));
+	if (config == NULL) {
+		archive_set_error(&a->archive, ENOMEM, "Out of memory");
+		return (ARCHIVE_FATAL);
+	}
+	a->compressor.config = config;
+	a->compressor.finish = archive_compressor_xz_finish;
+	config->compression_level = LZMA_PRESET_DEFAULT;
+	a->compressor.init = &archive_compressor_xz_init;
+	a->compressor.options = &archive_compressor_xz_options;
+	a->archive.compression_code = ARCHIVE_COMPRESSION_XZ;
+	a->archive.compression_name = "xz";
+	return (ARCHIVE_OK);
+}
+
+/* LZMA is handled identically, we just need a different compression
+ * code set.  (The liblzma setup looks at the code to determine
+ * the one place that XZ and LZMA require different handling.) */
+int
+archive_write_set_compression_lzma(struct archive *_a)
+{
+	struct archive_write *a = (struct archive_write *)_a;
+	int r = archive_write_set_compression_xz(_a);
+	if (r != ARCHIVE_OK)
+		return (r);
+	a->archive.compression_code = ARCHIVE_COMPRESSION_LZMA;
+	a->archive.compression_name = "lzma";
+	return (ARCHIVE_OK);
+}
+
+static int
+archive_compressor_xz_init_stream(struct archive_write *a,
+    struct private_data *state)
+{
+	int ret;
+
+	state->stream = (lzma_stream)LZMA_STREAM_INIT;
+	state->stream.next_out = state->compressed;
+	state->stream.avail_out = state->compressed_buffer_size;
+	if (a->archive.compression_code == ARCHIVE_COMPRESSION_XZ)
+		ret = lzma_stream_encoder(&(state->stream),
+		    state->lzmafilters, LZMA_CHECK_CRC64);
+	else
+		ret = lzma_alone_encoder(&(state->stream), &state->lzma_opt);
+	if (ret == LZMA_OK)
+		return (ARCHIVE_OK);
+
+	switch (ret) {
+	case LZMA_MEM_ERROR:
+		archive_set_error(&a->archive, ENOMEM,
+		    "Internal error initializing compression library: "
+		    "Cannot allocate memory");
+		break;
+	default:
+		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+		    "Internal error initializing compression library: "
+		    "It's a bug in liblzma");
+		break;
+	}
+	return (ARCHIVE_FATAL);
+}
+
+/*
+ * Setup callback.
+ */
+static int
+archive_compressor_xz_init(struct archive_write *a)
+{
+	int ret;
+	struct private_data *state;
+	struct private_config *config;
+
+	if (a->client_opener != NULL) {
+		ret = (a->client_opener)(&a->archive, a->client_data);
+		if (ret != ARCHIVE_OK)
+			return (ret);
+	}
+
+	state = (struct private_data *)malloc(sizeof(*state));
+	if (state == NULL) {
+		archive_set_error(&a->archive, ENOMEM,
+		    "Can't allocate data for compression");
+		return (ARCHIVE_FATAL);
+	}
+	memset(state, 0, sizeof(*state));
+	config = a->compressor.config;
+
+	/*
+	 * See comment above.  We should set compressed_buffer_size to
+	 * max(bytes_per_block, 65536), but the code can't handle that yet.
+	 */
+	state->compressed_buffer_size = a->bytes_per_block;
+	state->compressed = (unsigned char *)malloc(state->compressed_buffer_size);
+	if (state->compressed == NULL) {
+		archive_set_error(&a->archive, ENOMEM,
+		    "Can't allocate data for compression buffer");
+		free(state);
+		return (ARCHIVE_FATAL);
+	}
+	a->compressor.write = archive_compressor_xz_write;
+
+	/* Initialize compression library. */
+	if (lzma_lzma_preset(&state->lzma_opt, config->compression_level)) {
+		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+		    "Internal error initializing compression library");
+		free(state->compressed);
+		free(state);
+	}
+	state->lzmafilters[0].id = LZMA_FILTER_LZMA2;
+	state->lzmafilters[0].options = &state->lzma_opt;
+	state->lzmafilters[1].id = LZMA_VLI_UNKNOWN;/* Terminate */
+	ret = archive_compressor_xz_init_stream(a, state);
+	if (ret == LZMA_OK) {
+		a->compressor.data = state;
+		return (0);
+	}
+	/* Library setup failed: clean up. */
+	free(state->compressed);
+	free(state);
+
+	return (ARCHIVE_FATAL);
+}
+
+/*
+ * Set write options.
+ */
+static int
+archive_compressor_xz_options(struct archive_write *a, const char *key,
+    const char *value)
+{
+	struct private_config *config;
+
+	config = (struct private_config *)a->compressor.config;
+	if (strcmp(key, "compression-level") == 0) {
+		if (value == NULL || !(value[0] >= '0' && value[0] <= '9') ||
+		    value[1] != '\0')
+			return (ARCHIVE_WARN);
+		config->compression_level = value[0] - '0';
+		if (config->compression_level > 6)
+			config->compression_level = 6;
+		return (ARCHIVE_OK);
+	}
+
+	return (ARCHIVE_WARN);
+}
+
+/*
+ * Write data to the compressed stream.
+ */
+static int
+archive_compressor_xz_write(struct archive_write *a, const void *buff,
+    size_t length)
+{
+	struct private_data *state;
+	int ret;
+
+	state = (struct private_data *)a->compressor.data;
+	if (a->client_writer == NULL) {
+		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
+		    "No write callback is registered?  "
+		    "This is probably an internal programming error.");
+		return (ARCHIVE_FATAL);
+	}
+
+	/* Update statistics */
+	state->total_in += length;
+
+	/* Compress input data to output buffer */
+	state->stream.next_in = buff;
+	state->stream.avail_in = length;
+	if ((ret = drive_compressor(a, state, 0)) != ARCHIVE_OK)
+		return (ret);
+
+	a->archive.file_position += length;
+	return (ARCHIVE_OK);
+}
+
+
+/*
+ * Finish the compression...
+ */
+static int
+archive_compressor_xz_finish(struct archive_write *a)
+{
+	ssize_t block_length, target_block_length, bytes_written;
+	int ret;
+	struct private_data *state;
+	unsigned tocopy;
+
+	ret = ARCHIVE_OK;
+	state = (struct private_data *)a->compressor.data;
+	if (state != NULL) {
+		if (a->client_writer == NULL) {
+			archive_set_error(&a->archive,
+			    ARCHIVE_ERRNO_PROGRAMMER,
+			    "No write callback is registered?  "
+			    "This is probably an internal programming error.");
+			ret = ARCHIVE_FATAL;
+			goto cleanup;
+		}
+
+		/* By default, always pad the uncompressed data. */
+		if (a->pad_uncompressed) {
+			tocopy = a->bytes_per_block -
+			    (state->total_in % a->bytes_per_block);
+			while (tocopy > 0 && tocopy < (unsigned)a->bytes_per_block) {
+				state->stream.next_in = a->nulls;
+				state->stream.avail_in = tocopy < a->null_length ?
+				    tocopy : a->null_length;
+				state->total_in += state->stream.avail_in;
+				tocopy -= state->stream.avail_in;
+				ret = drive_compressor(a, state, 0);
+				if (ret != ARCHIVE_OK)
+					goto cleanup;
+			}
+		}
+
+		/* Finish compression cycle */
+		if (((ret = drive_compressor(a, state, 1))) != ARCHIVE_OK)
+			goto cleanup;
+
+		/* Optionally, pad the final compressed block. */
+		block_length = state->stream.next_out - state->compressed;
+
+		/* Tricky calculation to determine size of last block. */
+		target_block_length = block_length;
+		if (a->bytes_in_last_block <= 0)
+			/* Default or Zero: pad to full block */
+			target_block_length = a->bytes_per_block;
+		else
+			/* Round length to next multiple of bytes_in_last_block. */
+			target_block_length = a->bytes_in_last_block *
+			    ( (block_length + a->bytes_in_last_block - 1) /
+				a->bytes_in_last_block);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 00:55:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 084421065672;
	Fri, 17 Apr 2009 00:55:53 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E98CA8FC16;
	Fri, 17 Apr 2009 00:55:52 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H0tqPV099281;
	Fri, 17 Apr 2009 00:55:52 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H0tqmA099278;
	Fri, 17 Apr 2009 00:55:52 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170055.n3H0tqmA099278@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 00:55:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191173 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 00:55:53 -0000

Author: kientzle
Date: Fri Apr 17 00:55:52 2009
New Revision: 191173
URL: http://svn.freebsd.org/changeset/base/191173

Log:
  Implement command-line fallbacks for gzip and bzip2 decompression as well.
  Not an issue for FreeBSD, since the base system has the necessary libraries.
  Since all decompressors are always available now, we can unconditionally
  enable them in archive_read_support_compression_all().

Modified:
  head/lib/libarchive/archive_read_support_compression_all.c
  head/lib/libarchive/archive_read_support_compression_bzip2.c
  head/lib/libarchive/archive_read_support_compression_gzip.c

Modified: head/lib/libarchive/archive_read_support_compression_all.c
==============================================================================
--- head/lib/libarchive/archive_read_support_compression_all.c	Fri Apr 17 00:54:35 2009	(r191172)
+++ head/lib/libarchive/archive_read_support_compression_all.c	Fri Apr 17 00:55:52 2009	(r191173)
@@ -31,18 +31,24 @@ __FBSDID("$FreeBSD$");
 int
 archive_read_support_compression_all(struct archive *a)
 {
-#if HAVE_BZLIB_H
+	/* Bzip falls back to "bunzip2" command-line */
 	archive_read_support_compression_bzip2(a);
-#endif
 	/* The decompress code doesn't use an outside library. */
 	archive_read_support_compression_compress(a);
 	/* Gzip decompress falls back to "gunzip" command-line. */
 	archive_read_support_compression_gzip(a);
-#if HAVE_LZMADEC_H
-	/* LZMA bidding is subject to false positives because
-	 * the LZMA file format has a very weak signature.  It
-	 * may not be feasible to include LZMA detection here. */
-	/* archive_read_support_compression_lzma(a); */
-#endif
+	/* The LZMA file format has a very weak signature, so it
+	 * may not be feasible to keep this here, but we'll try.
+	 * This will come back out if there are problems. */
+	/* Lzma falls back to "unlzma" command-line program. */
+	archive_read_support_compression_lzma(a);
+	/* Xz falls back to "unxz" command-line program. */
+	archive_read_support_compression_xz(a);
+
+	/* Note: We always return ARCHIVE_OK here, even if some of the
+	 * above return ARCHIVE_WARN.  The intent here is to enable
+	 * "as much as possible."  Clients who need specific
+	 * compression should enable those individually so they can
+	 * verify the level of support. */
 	return (ARCHIVE_OK);
 }

Modified: head/lib/libarchive/archive_read_support_compression_bzip2.c
==============================================================================
--- head/lib/libarchive/archive_read_support_compression_bzip2.c	Fri Apr 17 00:54:35 2009	(r191172)
+++ head/lib/libarchive/archive_read_support_compression_bzip2.c	Fri Apr 17 00:55:52 2009	(r191173)
@@ -86,7 +86,13 @@ archive_read_support_compression_bzip2(s
 	reader->init = bzip2_reader_init;
 	reader->options = NULL;
 	reader->free = bzip2_reader_free;
+#if HAVE_BZLIB_H
 	return (ARCHIVE_OK);
+#else
+	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
+	    "Using external bunzip2 program");
+	return (ARCHIVE_WARN);
+#endif
 }
 
 static int
@@ -150,10 +156,15 @@ bzip2_reader_bid(struct archive_read_fil
 static int
 bzip2_reader_init(struct archive_read_filter *self)
 {
+	int r;
 
-	archive_set_error(&self->archive->archive, -1,
-	    "This version of libarchive was compiled without bzip2 support");
-	return (ARCHIVE_FATAL);
+	r = __archive_read_program(self, "bunzip2");
+	/* Note: We set the format here even if __archive_read_program()
+	 * above fails.  We do, after all, know what the format is
+	 * even if we weren't able to read it. */
+	self->code = ARCHIVE_COMPRESSION_BZIP2;
+	self->name = "bzip2";
+	return (r);
 }
 
 

Modified: head/lib/libarchive/archive_read_support_compression_gzip.c
==============================================================================
--- head/lib/libarchive/archive_read_support_compression_gzip.c	Fri Apr 17 00:54:35 2009	(r191172)
+++ head/lib/libarchive/archive_read_support_compression_gzip.c	Fri Apr 17 00:55:52 2009	(r191173)
@@ -92,7 +92,14 @@ archive_read_support_compression_gzip(st
 	bidder->init = gzip_bidder_init;
 	bidder->options = NULL;
 	bidder->free = NULL; /* No data, so no cleanup necessary. */
+	/* Signal the extent of gzip support with the return value here. */
+#if HAVE_ZLIB_H
 	return (ARCHIVE_OK);
+#else
+	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
+	    "Using external gunzip program");
+	return (ARCHIVE_WARN);
+#endif
 }
 
 /*
@@ -207,9 +214,9 @@ gzip_bidder_bid(struct archive_read_filt
 #ifndef HAVE_ZLIB_H
 
 /*
- * If we don't have the library on this system, we can't actually do the
- * decompression.  We can, however, still detect compressed archives
- * and emit a useful message.
+ * If we don't have the library on this system, we can't do the
+ * decompression directly.  We can, however, try to run gunzip
+ * in case that's available.
  */
 static int
 gzip_bidder_init(struct archive_read_filter *self)
@@ -217,6 +224,9 @@ gzip_bidder_init(struct archive_read_fil
 	int r;
 
 	r = __archive_read_program(self, "gunzip");
+	/* Note: We set the format here even if __archive_read_program()
+	 * above fails.  We do, after all, know what the format is
+	 * even if we weren't able to read it. */
 	self->code = ARCHIVE_COMPRESSION_GZIP;
 	self->name = "gzip";
 	return (r);

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 00:57:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 65A021065672;
	Fri, 17 Apr 2009 00:57:12 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0D79C8FC13;
	Fri, 17 Apr 2009 00:57:12 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H0vBBP099346;
	Fri, 17 Apr 2009 00:57:11 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H0vBGN099345;
	Fri, 17 Apr 2009 00:57:11 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170057.n3H0vBGN099345@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 00:57:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191174 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 00:57:13 -0000

Author: kientzle
Date: Fri Apr 17 00:57:11 2009
New Revision: 191174
URL: http://svn.freebsd.org/changeset/base/191174

Log:
  Minor fix: some platforms require both inttypes.h and stdint.h.

Modified:
  head/lib/libarchive/archive_platform.h

Modified: head/lib/libarchive/archive_platform.h
==============================================================================
--- head/lib/libarchive/archive_platform.h	Fri Apr 17 00:55:52 2009	(r191173)
+++ head/lib/libarchive/archive_platform.h	Fri Apr 17 00:57:11 2009	(r191174)
@@ -67,7 +67,8 @@
 /* Try to get standard C99-style integer type definitions. */
 #if HAVE_INTTYPES_H
 #include 
-#elif HAVE_STDINT_H
+#endif
+#if HAVE_STDINT_H
 #include 
 #endif
 

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 00:58:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 781F6106566C;
	Fri, 17 Apr 2009 00:58:45 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6537F8FC24;
	Fri, 17 Apr 2009 00:58:45 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H0wicE099427;
	Fri, 17 Apr 2009 00:58:44 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H0wi8q099426;
	Fri, 17 Apr 2009 00:58:44 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170058.n3H0wi8q099426@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 00:58:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191175 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 00:58:46 -0000

Author: kientzle
Date: Fri Apr 17 00:58:44 2009
New Revision: 191175
URL: http://svn.freebsd.org/changeset/base/191175

Log:
  LZW bugfix:  when we hit end-of-file, return an invalid code.

Modified:
  head/lib/libarchive/archive_read_support_compression_compress.c

Modified: head/lib/libarchive/archive_read_support_compression_compress.c
==============================================================================
--- head/lib/libarchive/archive_read_support_compression_compress.c	Fri Apr 17 00:57:11 2009	(r191174)
+++ head/lib/libarchive/archive_read_support_compression_compress.c	Fri Apr 17 00:58:44 2009	(r191175)
@@ -278,7 +278,7 @@ compress_filter_read(struct archive_read
 			*p++ = *--state->stackp;
 		} else {
 			ret = next_code(self);
-			if (ret == ARCHIVE_EOF)
+			if (ret == -1)
 				state->end_of_stream = ret;
 			else if (ret != ARCHIVE_OK)
 				return (ret);
@@ -424,7 +424,7 @@ getbits(struct archive_read_filter *self
 			    = __archive_read_filter_ahead(self->upstream,
 				1, &ret);
 			if (ret == 0)
-				return (ARCHIVE_EOF);
+				return (-1);
 			if (ret < 0 || state->next_in == NULL)
 				return (ARCHIVE_FATAL);
 			state->avail_in = ret;

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 00:59:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 62C981065672;
	Fri, 17 Apr 2009 00:59:34 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5026A8FC20;
	Fri, 17 Apr 2009 00:59:34 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H0xYj1099491;
	Fri, 17 Apr 2009 00:59:34 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H0xYUX099490;
	Fri, 17 Apr 2009 00:59:34 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170059.n3H0xYUX099490@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 00:59:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191176 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 00:59:35 -0000

Author: kientzle
Date: Fri Apr 17 00:59:34 2009
New Revision: 191176
URL: http://svn.freebsd.org/changeset/base/191176

Log:
  When pulling metadata from disk, lookup the user and group name at the same time.

Modified:
  head/lib/libarchive/archive_read_disk_entry_from_file.c

Modified: head/lib/libarchive/archive_read_disk_entry_from_file.c
==============================================================================
--- head/lib/libarchive/archive_read_disk_entry_from_file.c	Fri Apr 17 00:58:44 2009	(r191175)
+++ head/lib/libarchive/archive_read_disk_entry_from_file.c	Fri Apr 17 00:59:34 2009	(r191176)
@@ -42,6 +42,9 @@ __FBSDID("$FreeBSD$");
 #ifdef HAVE_SYS_STAT_H
 #include 
 #endif
+#ifdef HAVE_SYS_XATTR_H
+#include 
+#endif
 #ifdef HAVE_ACL_LIBACL_H
 #include 
 #endif
@@ -84,7 +87,7 @@ archive_read_disk_entry_from_file(struct
     int fd, const struct stat *st)
 {
 	struct archive_read_disk *a = (struct archive_read_disk *)_a;
-	const char *path;
+	const char *path, *name;
 	struct stat s;
 	int initial_fd = fd;
 	int r, r1;
@@ -128,6 +131,14 @@ archive_read_disk_entry_from_file(struct
 	}
 	archive_entry_copy_stat(entry, st);
 
+	/* Lookup uname/gname */
+	name = archive_read_disk_uname(_a, archive_entry_uid(entry));
+	if (name != NULL)
+		archive_entry_copy_uname(entry, name);
+	name = archive_read_disk_gname(_a, archive_entry_gid(entry));
+	if (name != NULL)
+		archive_entry_copy_gname(entry, name);
+
 #ifdef HAVE_STRUCT_STAT_ST_FLAGS
 	/* On FreeBSD, we get flags for free with the stat. */
 	/* TODO: Does this belong in copy_stat()? */

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 01:00:11 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A79C9106564A;
	Fri, 17 Apr 2009 01:00:11 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 955338FC0C;
	Fri, 17 Apr 2009 01:00:11 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H10Bb6099581;
	Fri, 17 Apr 2009 01:00:11 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H10BQX099580;
	Fri, 17 Apr 2009 01:00:11 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170100.n3H10BQX099580@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 01:00:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191177 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 01:00:12 -0000

Author: kientzle
Date: Fri Apr 17 01:00:11 2009
New Revision: 191177
URL: http://svn.freebsd.org/changeset/base/191177

Log:
  Don't match an empty file on a read error.

Modified:
  head/lib/libarchive/archive_read_support_format_empty.c

Modified: head/lib/libarchive/archive_read_support_format_empty.c
==============================================================================
--- head/lib/libarchive/archive_read_support_format_empty.c	Fri Apr 17 00:59:34 2009	(r191176)
+++ head/lib/libarchive/archive_read_support_format_empty.c	Fri Apr 17 01:00:11 2009	(r191177)
@@ -59,14 +59,13 @@ archive_read_support_format_empty(struct
 static int
 archive_read_format_empty_bid(struct archive_read *a)
 {
+	const void *h;
 	ssize_t avail;
 
-	(void)__archive_read_ahead(a, 1, &avail);
-	/* Bid 1 if we successfully read exactly zero bytes. */
-	if (avail == 0)
-		return (1);
-	/* Otherwise, we don't bid on this. */
-	return (-1);
+	h = __archive_read_ahead(a, 1, &avail);
+	if (avail != 0)
+		return (-1);
+	return (1);
 }
 
 static int

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 01:01:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 198E9106566C;
	Fri, 17 Apr 2009 01:01:16 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 06BAF8FC12;
	Fri, 17 Apr 2009 01:01:16 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H11Fwm099653;
	Fri, 17 Apr 2009 01:01:15 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H11FYi099652;
	Fri, 17 Apr 2009 01:01:15 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170101.n3H11FYi099652@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 01:01:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191178 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 01:01:17 -0000

Author: kientzle
Date: Fri Apr 17 01:01:15 2009
New Revision: 191178
URL: http://svn.freebsd.org/changeset/base/191178

Log:
  Dynamically size the buffer we pass to getgrgid_r() and getpwuid_r().
  Keep the buffer in the cache object so we don't have to keep doing this.

Modified:
  head/lib/libarchive/archive_read_disk_set_standard_lookup.c

Modified: head/lib/libarchive/archive_read_disk_set_standard_lookup.c
==============================================================================
--- head/lib/libarchive/archive_read_disk_set_standard_lookup.c	Fri Apr 17 01:00:11 2009	(r191177)
+++ head/lib/libarchive/archive_read_disk_set_standard_lookup.c	Fri Apr 17 01:01:15 2009	(r191178)
@@ -61,6 +61,8 @@ static const char * const NO_NAME = "(no
 
 struct name_cache {
 	struct archive *archive;
+	char   *buff;
+	size_t  buff_size;
 	int	probes;
 	int	hits;
 	size_t	size;
@@ -73,8 +75,8 @@ struct name_cache {
 static const char *	lookup_gname(void *, gid_t);
 static const char *	lookup_uname(void *, uid_t);
 static void	cleanup(void *);
-static const char *	lookup_gname_helper(struct archive *, id_t gid);
-static const char *	lookup_uname_helper(struct archive *, id_t uid);
+static const char *	lookup_gname_helper(struct name_cache *, id_t gid);
+static const char *	lookup_uname_helper(struct name_cache *, id_t uid);
 
 /*
  * Installs functions that use getpwuid()/getgrgid()---along with
@@ -128,6 +130,7 @@ cleanup(void *data)
 			    cache->cache[i].name != NO_NAME)
 				free((void *)(uintptr_t)cache->cache[i].name);
 		}
+		free(cache->buff);
 		free(cache);
 	}
 }
@@ -137,7 +140,7 @@ cleanup(void *data)
  */
 static const char *
 lookup_name(struct name_cache *cache,
-    const char * (*lookup_fn)(struct archive *, id_t), id_t id)
+    const char * (*lookup_fn)(struct name_cache *, id_t), id_t id)
 {
 	const char *name;
 	int slot;
@@ -158,7 +161,7 @@ lookup_name(struct name_cache *cache,
 		cache->cache[slot].name = NULL;
 	}
 
-	name = (lookup_fn)(cache->archive, id);
+	name = (lookup_fn)(cache, id);
 	if (name == NULL) {
 		/* Cache and return the negative response. */
 		cache->cache[slot].name = NO_NAME;
@@ -180,23 +183,43 @@ lookup_uname(void *data, uid_t uid)
 }
 
 static const char *
-lookup_uname_helper(struct archive *a, id_t id)
+lookup_uname_helper(struct name_cache *cache, id_t id)
 {
-	char buffer[512];
 	struct passwd	pwent, *result;
 	int r;
 
-	errno = 0;
-	r = getpwuid_r((uid_t)id, &pwent, buffer, sizeof(buffer), &result);
+	if (cache->buff_size == 0) {
+		cache->buff_size = 256;
+		cache->buff = malloc(cache->buff_size);
+	}
+	if (cache->buff == NULL)
+		return (NULL);
+	for (;;) {
+		r = getpwuid_r((uid_t)id, &pwent,
+			       cache->buff, cache->buff_size, &result);
+		if (r == 0)
+			break;
+		if (r != ERANGE)
+			break;
+		/* ERANGE means our buffer was too small, but POSIX
+		 * doesn't tell us how big the buffer should be, so
+		 * we just double it and try again.  Because the buffer
+		 * is kept around in the cache object, we shouldn't
+		 * have to do this very often. */
+		cache->buff_size *= 2;
+		cache->buff = realloc(cache->buff, cache->buff_size);
+		if (cache->buff == NULL)
+			break;
+	}
 	if (r != 0) {
-		archive_set_error(a, errno,
+		archive_set_error(cache->archive, errno,
 		    "Can't lookup user for id %d", (int)id);
 		return (NULL);
 	}
 	if (result == NULL)
 		return (NULL);
 
-	return strdup(pwent.pw_name);
+	return strdup(result->pw_name);
 }
 
 static const char *
@@ -208,22 +231,40 @@ lookup_gname(void *data, gid_t gid)
 }
 
 static const char *
-lookup_gname_helper(struct archive *a, id_t id)
+lookup_gname_helper(struct name_cache *cache, id_t id)
 {
-	char buffer[512];
 	struct group	grent, *result;
 	int r;
 
-	errno = 0;
-	r = getgrgid_r((gid_t)id, &grent, buffer, sizeof(buffer), &result);
+	if (cache->buff_size == 0) {
+		cache->buff_size = 256;
+		cache->buff = malloc(cache->buff_size);
+	}
+	if (cache->buff == NULL)
+		return (NULL);
+	for (;;) {
+		r = getgrgid_r((gid_t)id, &grent,
+			       cache->buff, cache->buff_size, &result);
+		if (r == 0)
+			break;
+		if (r != ERANGE)
+			break;
+		/* ERANGE means our buffer was too small, but POSIX
+		 * doesn't tell us how big the buffer should be, so
+		 * we just double it and try again. */
+		cache->buff_size *= 2;
+		cache->buff = realloc(cache->buff, cache->buff_size);
+		if (cache->buff == NULL)
+			break;
+	}
 	if (r != 0) {
-		archive_set_error(a, errno,
+		archive_set_error(cache->archive, errno,
 		    "Can't lookup group for id %d", (int)id);
 		return (NULL);
 	}
 	if (result == NULL)
 		return (NULL);
 
-	return strdup(grent.gr_name);
+	return strdup(result->gr_name);
 }
 #endif /* ! (_WIN32 && !__CYGWIN__) */

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 01:02:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ACEB2106566C;
	Fri, 17 Apr 2009 01:02:12 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9A4A98FC08;
	Fri, 17 Apr 2009 01:02:12 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H12Cu1099725;
	Fri, 17 Apr 2009 01:02:12 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H12CkK099724;
	Fri, 17 Apr 2009 01:02:12 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170102.n3H12CkK099724@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 01:02:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191179 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 01:02:13 -0000

Author: kientzle
Date: Fri Apr 17 01:02:12 2009
New Revision: 191179
URL: http://svn.freebsd.org/changeset/base/191179

Log:
  Document the new read options interface and the new read_header2() call.

Modified:
  head/lib/libarchive/archive_read.3

Modified: head/lib/libarchive/archive_read.3
==============================================================================
--- head/lib/libarchive/archive_read.3	Fri Apr 17 01:01:15 2009	(r191178)
+++ head/lib/libarchive/archive_read.3	Fri Apr 17 01:02:12 2009	(r191179)
@@ -29,6 +29,9 @@
 .Os
 .Sh NAME
 .Nm archive_read_new ,
+.Nm archive_read_set_filter_options ,
+.Nm archive_read_set_format_options ,
+.Nm archive_read_set_options ,
 .Nm archive_read_support_compression_all ,
 .Nm archive_read_support_compression_bzip2 ,
 .Nm archive_read_support_compression_compress ,
@@ -48,6 +51,7 @@
 .Nm archive_read_open_filename ,
 .Nm archive_read_open_memory ,
 .Nm archive_read_next_header ,
+.Nm archive_read_next_header2 ,
 .Nm archive_read_data ,
 .Nm archive_read_data_block ,
 .Nm archive_read_data_skip ,
@@ -93,6 +97,12 @@
 .Ft int
 .Fn archive_read_support_format_zip "struct archive *"
 .Ft int
+.Fn archive_read_set_filter_options "struct archive *" "const char *"
+.Ft int
+.Fn archive_read_set_format_options "struct archive *" "const char *"
+.Ft int
+.Fn archive_read_set_options "struct archive *" "const char *"
+.Ft int
 .Fo archive_read_open
 .Fa "struct archive *"
 .Fa "void *client_data"
@@ -123,6 +133,8 @@
 .Fn archive_read_open_memory "struct archive *" "void *buff" "size_t size"
 .Ft int
 .Fn archive_read_next_header "struct archive *" "struct archive_entry **"
+.Ft int
+.Fn archive_read_next_header2 "struct archive *" "struct archive_entry *"
 .Ft ssize_t
 .Fn archive_read_data "struct archive *" "void *buff" "size_t len"
 .Ft int
@@ -214,6 +226,48 @@ For convenience,
 .Fn archive_read_support_format_all
 enables support for all available formats.
 Only empty archives are supported by default.
+.It Xo
+.Fn archive_read_set_filter_options ,
+.Fn archive_read_set_format_options ,
+.Fn archive_read_set_options
+.Xc
+Specifies options that will be passed to currently-registered
+filters (including decompression filters) and/or format readers.
+The argument is a comma-separated list of individual options.
+Individual options have one of the following forms:
+.Bl -tag -compact -width indent
+.It Ar option=value
+The option/value pair will be provided to every module.
+Modules that do not accept an option with this name will ignore it.
+.It Ar option
+The option will be provided to every module with a value of
+.Dq 1 .
+.It Ar !option
+The option will be provided to every module with a NULL value.
+.It Ar module:option=value , Ar module:option , Ar module:!option
+As above, but the corresponding option and value will be provided
+only to modules whose name matches
+.Ar module .
+.El
+The return value will be
+.Cm ARCHIVE_OK
+if any module accepts the option, or
+.Cm ARCHIVE_WARN
+if no module accepted the option, or
+.Cm ARCHIVE_FATAL
+if there was a fatal error while attempting to process the option.
+.Pp
+The currently supported options are:
+.Bl -tag -compact -width indent
+.It Format iso9660
+.Bl -tag -compact -width indent
+.It Cm joliet
+Support Joliet extensions.
+Defaults to enabled, use
+.Cm !joliet
+to disable.
+.El
+.El
 .It Fn archive_read_open
 The same as
 .Fn archive_read_open2 ,
@@ -266,6 +320,14 @@ memory containing the archive data.
 Read the header for the next entry and return a pointer to
 a
 .Tn struct archive_entry .
+This is a convenience wrapper around
+.Fn archive_read_next_header2
+that uses an internal
+.Tn struct archive_entry
+object.
+.It Fn archive_read_next_header2
+Read the header for the next entry and populate the provided
+.Tn struct archive_entry .
 .It Fn archive_read_data
 Read data associated with the header just read.
 Internally, this is a convenience function that calls

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 01:02:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E7B6106566C;
	Fri, 17 Apr 2009 01:02:57 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3C4958FC08;
	Fri, 17 Apr 2009 01:02:57 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H12vda099790;
	Fri, 17 Apr 2009 01:02:57 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H12vUQ099789;
	Fri, 17 Apr 2009 01:02:57 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170102.n3H12vUQ099789@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 01:02:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191180 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 01:02:58 -0000

Author: kientzle
Date: Fri Apr 17 01:02:56 2009
New Revision: 191180
URL: http://svn.freebsd.org/changeset/base/191180

Log:
  Fix a memory leak:  Release the current list of /set keywords
  even when we exit on an error.

Modified:
  head/lib/libarchive/archive_read_support_format_mtree.c

Modified: head/lib/libarchive/archive_read_support_format_mtree.c
==============================================================================
--- head/lib/libarchive/archive_read_support_format_mtree.c	Fri Apr 17 01:02:12 2009	(r191179)
+++ head/lib/libarchive/archive_read_support_format_mtree.c	Fri Apr 17 01:02:56 2009	(r191180)
@@ -404,10 +404,13 @@ read_mtree(struct archive_read *a, struc
 		len = readline(a, mtree, &p, 256);
 		if (len == 0) {
 			mtree->this_entry = mtree->entries;
+			free_options(global);
 			return (ARCHIVE_OK);
 		}
-		if (len < 0)
+		if (len < 0) {
+			free_options(global);
 			return (len);
+		}
 		/* Leading whitespace is never significant, ignore it. */
 		while (*p == ' ' || *p == '\t') {
 			++p;
@@ -432,13 +435,16 @@ read_mtree(struct archive_read *a, struc
 		} else
 			break;
 
-		if (r != ARCHIVE_OK)
+		if (r != ARCHIVE_OK) {
+			free_options(global);
 			return r;
+		}
 	}
 
 	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 	    "Can't parse line %ju", counter);
-	return ARCHIVE_FATAL;
+	free_options(global);
+	return (ARCHIVE_FATAL);
 }
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 01:03:52 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6C00E106566B;
	Fri, 17 Apr 2009 01:03:52 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 593918FC12;
	Fri, 17 Apr 2009 01:03:52 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H13qwN099847;
	Fri, 17 Apr 2009 01:03:52 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H13qUZ099846;
	Fri, 17 Apr 2009 01:03:52 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170103.n3H13qUZ099846@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 01:03:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191181 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 01:03:52 -0000

Author: kientzle
Date: Fri Apr 17 01:03:52 2009
New Revision: 191181
URL: http://svn.freebsd.org/changeset/base/191181

Log:
  Ensure that the option setters return OK (option used) even
  for options that don't change the list of keywords.

Modified:
  head/lib/libarchive/archive_write_set_format_mtree.c

Modified: head/lib/libarchive/archive_write_set_format_mtree.c
==============================================================================
--- head/lib/libarchive/archive_write_set_format_mtree.c	Fri Apr 17 01:02:56 2009	(r191180)
+++ head/lib/libarchive/archive_write_set_format_mtree.c	Fri Apr 17 01:03:52 2009	(r191181)
@@ -962,8 +962,10 @@ archive_write_mtree_options(struct archi
 	case 'd':
 		if (strcmp(key, "device") == 0)
 			keybit = F_DEV;
-		else if (strcmp(key, "dironly") == 0)
+		else if (strcmp(key, "dironly") == 0) {
 			mtree->dironly = (value != NULL)? 1: 0;
+			return (ARCHIVE_OK);
+		}
 		break;
 	case 'f':
 		if (strcmp(key, "flags") == 0)
@@ -976,8 +978,10 @@ archive_write_mtree_options(struct archi
 			keybit = F_GNAME;
 		break;
 	case 'i':
-		if (strcmp(key, "indent") == 0)
+		if (strcmp(key, "indent") == 0) {
 			mtree->indent = (value != NULL)? 1: 0;
+			return (ARCHIVE_OK);
+		}
 		break;
 	case 'l':
 		if (strcmp(key, "link") == 0)
@@ -1039,8 +1043,10 @@ archive_write_mtree_options(struct archi
 			keybit = F_UID;
 		else if (strcmp(key, "uname") == 0)
 			keybit = F_UNAME;
-		else if (strcmp(key, "use-set") == 0)
+		else if (strcmp(key, "use-set") == 0) {
 			mtree->set.output = (value != NULL)? 1: 0;
+			return (ARCHIVE_OK);
+		}
 		break;
 	}
 	if (keybit != 0) {

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 01:04:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC8E11065672;
	Fri, 17 Apr 2009 01:04:23 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AA5308FC08;
	Fri, 17 Apr 2009 01:04:23 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H14NRi099898;
	Fri, 17 Apr 2009 01:04:23 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H14NYc099897;
	Fri, 17 Apr 2009 01:04:23 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170104.n3H14NYc099897@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 01:04:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191182 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 01:04:24 -0000

Author: kientzle
Date: Fri Apr 17 01:04:23 2009
New Revision: 191182
URL: http://svn.freebsd.org/changeset/base/191182

Log:
  FreeBSD has a lot of crypto functions used by the recent mtree writer updates.

Modified:
  head/lib/libarchive/config_freebsd.h

Modified: head/lib/libarchive/config_freebsd.h
==============================================================================
--- head/lib/libarchive/config_freebsd.h	Fri Apr 17 01:03:52 2009	(r191181)
+++ head/lib/libarchive/config_freebsd.h	Fri Apr 17 01:04:23 2009	(r191182)
@@ -75,6 +75,7 @@
 #define	HAVE_LIMITS_H 1
 #define	HAVE_LUTIMES 1
 #define	HAVE_MALLOC 1
+#define	HAVE_MD5 1
 #define	HAVE_MD5_H 1
 #define	HAVE_MEMMOVE 1
 #define	HAVE_MEMSET 1
@@ -89,11 +90,16 @@
 #define	HAVE_POLL_H 1
 #define	HAVE_PWD_H 1
 #define	HAVE_READLINK 1
-#define	HAVE_RIPEMD_H 1
+#define	HAVE_RMD160 1
 #define	HAVE_SELECT 1
 #define	HAVE_SETENV 1
 #define	HAVE_SHA_H 1
+#define	HAVE_SHA1 1
+#define	HAVE_SHA256 1
 #define	HAVE_SHA256_H 1
+#define	HAVE_SHA384 1
+#define	HAVE_SHA512 1
+#define	HAVE_SIGNAL_H 1
 #define	HAVE_STDINT_H 1
 #define	HAVE_STDLIB_H 1
 #define	HAVE_STRCHR 1

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 01:06:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A5F4810656C5;
	Fri, 17 Apr 2009 01:06:32 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 914128FC17;
	Fri, 17 Apr 2009 01:06:32 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H16Wn6000147;
	Fri, 17 Apr 2009 01:06:32 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H16W29000134;
	Fri, 17 Apr 2009 01:06:32 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170106.n3H16W29000134@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 01:06:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191183 - head/lib/libarchive/test
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 01:06:33 -0000

Author: kientzle
Date: Fri Apr 17 01:06:31 2009
New Revision: 191183
URL: http://svn.freebsd.org/changeset/base/191183

Log:
  Merge lots of test suite updates from libarchive.googlecode.com.

Added:
  head/lib/libarchive/test/test_compat_xz.c   (contents, props changed)
  head/lib/libarchive/test/test_compat_xz_1.txz.uu   (contents, props changed)
  head/lib/libarchive/test/test_open_fd.c   (contents, props changed)
  head/lib/libarchive/test/test_open_file.c   (contents, props changed)
  head/lib/libarchive/test/test_open_filename.c   (contents, props changed)
  head/lib/libarchive/test/test_read_disk_entry_from_file.c   (contents, props changed)
  head/lib/libarchive/test/test_read_format_cpio_bin_xz.c   (contents, props changed)
  head/lib/libarchive/test/test_read_format_gtar_lzma.c   (contents, props changed)
  head/lib/libarchive/test/test_read_format_iso_gz.iso.gz.uu   (contents, props changed)
  head/lib/libarchive/test/test_read_format_txz.c   (contents, props changed)
  head/lib/libarchive/test/test_write_compress_bzip2.c   (contents, props changed)
  head/lib/libarchive/test/test_write_compress_gzip.c   (contents, props changed)
  head/lib/libarchive/test/test_write_compress_lzma.c   (contents, props changed)
  head/lib/libarchive/test/test_write_compress_xz.c   (contents, props changed)
  head/lib/libarchive/test/test_write_format_mtree.c   (contents, props changed)
Modified:
  head/lib/libarchive/test/Makefile
  head/lib/libarchive/test/main.c
  head/lib/libarchive/test/read_open_memory.c
  head/lib/libarchive/test/test_compat_bzip2.c
  head/lib/libarchive/test/test_compat_gzip.c
  head/lib/libarchive/test/test_entry.c
  head/lib/libarchive/test/test_entry_strmode.c
  head/lib/libarchive/test/test_extattr_freebsd.c
  head/lib/libarchive/test/test_pax_filename_encoding.c
  head/lib/libarchive/test/test_pax_filename_encoding.tar.uu
  head/lib/libarchive/test/test_read_compress_program.c
  head/lib/libarchive/test/test_read_disk.c
  head/lib/libarchive/test/test_read_format_cpio_bin_bz2.c
  head/lib/libarchive/test/test_read_format_cpio_bin_gz.c
  head/lib/libarchive/test/test_read_format_cpio_svr4_gzip.c
  head/lib/libarchive/test/test_read_format_gtar_gz.c
  head/lib/libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu
  head/lib/libarchive/test/test_read_format_iso_gz.c
  head/lib/libarchive/test/test_read_format_isojoliet_bz2.c
  head/lib/libarchive/test/test_read_format_isorr_bz2.c
  head/lib/libarchive/test/test_read_format_mtree.c
  head/lib/libarchive/test/test_read_format_pax_bz2.c
  head/lib/libarchive/test/test_read_format_tbz.c
  head/lib/libarchive/test/test_read_format_tgz.c
  head/lib/libarchive/test/test_write_compress_program.c
  head/lib/libarchive/test/test_write_disk_failures.c
  head/lib/libarchive/test/test_write_disk_sparse.c

Modified: head/lib/libarchive/test/Makefile
==============================================================================
--- head/lib/libarchive/test/Makefile	Fri Apr 17 01:04:23 2009	(r191182)
+++ head/lib/libarchive/test/Makefile	Fri Apr 17 01:06:31 2009	(r191183)
@@ -17,6 +17,7 @@ TESTS= \
 	test_compat_gtar.c			\
 	test_compat_gzip.c			\
 	test_compat_tar_hardlink.c		\
+	test_compat_xz.c			\
 	test_compat_zip.c			\
 	test_empty_write.c			\
 	test_entry.c				\
@@ -24,10 +25,14 @@ TESTS= \
 	test_extattr_freebsd.c			\
 	test_fuzz.c				\
 	test_link_resolver.c			\
+	test_open_fd.c				\
+	test_open_file.c			\
+	test_open_filename.c			\
 	test_pax_filename_encoding.c		\
 	test_read_compress_program.c		\
 	test_read_data_large.c			\
 	test_read_disk.c			\
+	test_read_disk_entry_from_file.c	\
 	test_read_extract.c			\
 	test_read_file_nonexistent.c		\
 	test_read_format_ar.c			\
@@ -35,13 +40,16 @@ TESTS= \
 	test_read_format_cpio_bin_Z.c		\
 	test_read_format_cpio_bin_bz2.c		\
 	test_read_format_cpio_bin_gz.c		\
+	test_read_format_cpio_bin_xz.c		\
 	test_read_format_cpio_odc.c		\
 	test_read_format_cpio_svr4_gzip.c	\
 	test_read_format_cpio_svr4c_Z.c		\
 	test_read_format_empty.c		\
 	test_read_format_gtar_gz.c		\
+	test_read_format_gtar_lzma.c		\
 	test_read_format_gtar_sparse.c		\
 	test_read_format_iso_gz.c		\
+	test_read_format_isojoliet_bz2.c	\
 	test_read_format_isorr_bz2.c		\
 	test_read_format_mtree.c		\
 	test_read_format_pax_bz2.c		\
@@ -49,6 +57,7 @@ TESTS= \
 	test_read_format_tar_empty_filename.c	\
 	test_read_format_tbz.c			\
 	test_read_format_tgz.c			\
+	test_read_format_txz.c			\
 	test_read_format_tz.c			\
 	test_read_format_zip.c			\
 	test_read_large.c			\
@@ -59,7 +68,11 @@ TESTS= \
 	test_tar_large.c			\
 	test_ustar_filenames.c			\
 	test_write_compress.c			\
+	test_write_compress_bzip2.c		\
+	test_write_compress_gzip.c		\
+	test_write_compress_lzma.c		\
 	test_write_compress_program.c		\
+	test_write_compress_xz.c		\
 	test_write_disk.c			\
 	test_write_disk_failures.c		\
 	test_write_disk_hardlink.c		\
@@ -72,6 +85,7 @@ TESTS= \
 	test_write_format_cpio_empty.c		\
 	test_write_format_cpio_newc.c		\
 	test_write_format_cpio_odc.c		\
+	test_write_format_mtree.c		\
 	test_write_format_pax.c			\
 	test_write_format_shar_empty.c		\
 	test_write_format_tar.c			\
@@ -93,10 +107,18 @@ PROG=libarchive_test
 INTERNALPROG=yes  # Don't install this; it's just for testing
 DPADD=${LIBBZ2} ${LIBZ}
 CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\"
-LDADD= -lz -lbz2
-CFLAGS+= -static -g
+LDADD= -lz -lbz2 -lmd -lcrypto
+CFLAGS+= -g
 CFLAGS+= -I${LA_SRCDIR} -I.
 
+# Uncomment to build and test lzma support via liblzmadec
+#CFLAGS+= -I/usr/local/include -DHAVE_LIBLZMADEC=1 -DHAVE_LZMADEC_H=1
+#LDADD+= -L/usr/local/lib -llzmadec
+
+# Uncomment to build and test lzma and xz support via liblzma
+CFLAGS+= -I/usr/local/include -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
+LDADD+= -L/usr/local/lib -llzma
+
 # Uncomment to link against dmalloc
 #LDADD+= -L/usr/local/lib -ldmalloc
 #CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
@@ -108,9 +130,10 @@ check test: libarchive_test
 
 # list.h is just a list of all tests, as indicated by DEFINE_TEST macro lines
 list.h: ${TESTS} Makefile
-	(cd ${.CURDIR}; cat ${TESTS}) | grep DEFINE_TEST > list.h
+	(cd ${.CURDIR}; cat test_*.c) | grep DEFINE_TEST > list.h
 
-CLEANFILES += *.out *.o *.core *~ list.h
+CLEANFILES += *.out *.o *.core *~ list.h .dirstamp .depend
+CLEANDIRS += .deps .libs
 
 cleantest:
 	-chmod -R +w /tmp/libarchive_test.*

Modified: head/lib/libarchive/test/main.c
==============================================================================
--- head/lib/libarchive/test/main.c	Fri Apr 17 01:04:23 2009	(r191182)
+++ head/lib/libarchive/test/main.c	Fri Apr 17 01:06:31 2009	(r191183)
@@ -62,11 +62,7 @@ __FBSDID("$FreeBSD$");
  */
 #undef DEFINE_TEST
 #define	DEFINE_TEST(name) void name(void);
-#ifdef LIST_H
-#include LIST_H
-#else
 #include "list.h"
-#endif
 
 /* Interix doesn't define these in a standard header. */
 #if __INTERIX__
@@ -128,13 +124,28 @@ static const char *failed_filename = NUL
 static struct line {
 	int line;
 	int count;
+	int critical;
 }  failed_lines[1000];
 
 /*
+ * Called at the beginning of each assert() function.
+ */
+static void
+count_assertion(const char *file, int line)
+{
+	(void)file; /* UNUSED */
+	(void)line; /* UNUSED */
+	++assertions;
+	/* Uncomment to print file:line after every assertion.
+	 * Verbose, but occasionally useful in tracking down crashes. */
+	/* printf("Checked %s:%d\n", file, line); */
+}
+
+/*
  * Count this failure; return the number of previous failures.
  */
 static int
-previous_failures(const char *filename, int line)
+previous_failures(const char *filename, int line, int critical)
 {
 	unsigned int i;
 	int count;
@@ -152,6 +163,7 @@ previous_failures(const char *filename, 
 		if (failed_lines[i].line == 0) {
 			failed_lines[i].line = line;
 			failed_lines[i].count = 1;
+			failed_lines[i].critical = critical;
 			return (0);
 		}
 	}
@@ -178,7 +190,7 @@ test_skipping(const char *fmt, ...)
 {
 	va_list ap;
 
-	if (previous_failures(test_filename, test_line))
+	if (previous_failures(test_filename, test_line, 0))
 		return;
 
 	va_start(ap, fmt);
@@ -241,7 +253,7 @@ summarize(void)
 	for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
 		if (failed_lines[i].line == 0)
 			break;
-		if (failed_lines[i].count > 1)
+		if (failed_lines[i].count > 1 && failed_lines[i].critical)
 			fprintf(stderr, "%s:%d: Failed %d times\n",
 			    failed_filename, failed_lines[i].line,
 			    failed_lines[i].count);
@@ -264,13 +276,13 @@ failure(const char *fmt, ...)
 int
 test_assert(const char *file, int line, int value, const char *condition, void *extra)
 {
-	++assertions;
+	count_assertion(file, line);
 	if (value) {
 		msg[0] = '\0';
 		return (value);
 	}
 	failures ++;
-	if (!verbose && previous_failures(file, line))
+	if (!verbose && previous_failures(file, line, 1))
 		return (value);
 	fprintf(stderr, "%s:%d: Assertion failed\n", file, line);
 	fprintf(stderr, "   Condition: %s\n", condition);
@@ -283,13 +295,13 @@ int
 test_assert_equal_int(const char *file, int line,
     int v1, const char *e1, int v2, const char *e2, void *extra)
 {
-	++assertions;
+	count_assertion(file, line);
 	if (v1 == v2) {
 		msg[0] = '\0';
 		return (1);
 	}
 	failures ++;
-	if (!verbose && previous_failures(file, line))
+	if (!verbose && previous_failures(file, line, 1))
 		return (0);
 	fprintf(stderr, "%s:%d: Assertion failed: Ints not equal\n",
 	    file, line);
@@ -330,7 +342,7 @@ test_assert_equal_string(const char *fil
     const char *v2, const char *e2,
     void *extra)
 {
-	++assertions;
+	count_assertion(file, line);
 	if (v1 == NULL || v2 == NULL) {
 		if (v1 == v2) {
 			msg[0] = '\0';
@@ -341,7 +353,7 @@ test_assert_equal_string(const char *fil
 		return (1);
 	}
 	failures ++;
-	if (!verbose && previous_failures(file, line))
+	if (!verbose && previous_failures(file, line, 1))
 		return (0);
 	fprintf(stderr, "%s:%d: Assertion failed: Strings not equal\n",
 	    file, line);
@@ -383,7 +395,7 @@ test_assert_equal_wstring(const char *fi
     const wchar_t *v2, const char *e2,
     void *extra)
 {
-	++assertions;
+	count_assertion(file, line);
 	if (v1 == NULL) {
 		if (v2 == NULL) {
 			msg[0] = '\0';
@@ -399,7 +411,7 @@ test_assert_equal_wstring(const char *fi
 		return (1);
 	}
 	failures ++;
-	if (!verbose && previous_failures(file, line))
+	if (!verbose && previous_failures(file, line, 1))
 		return (0);
 	fprintf(stderr, "%s:%d: Assertion failed: Unicode strings not equal\n",
 	    file, line);
@@ -458,7 +470,7 @@ test_assert_equal_mem(const char *file, 
     const char *v2, const char *e2,
     size_t l, const char *ld, void *extra)
 {
-	++assertions;
+	count_assertion(file, line);
 	if (v1 == NULL || v2 == NULL) {
 		if (v1 == v2) {
 			msg[0] = '\0';
@@ -469,7 +481,7 @@ test_assert_equal_mem(const char *file, 
 		return (1);
 	}
 	failures ++;
-	if (!verbose && previous_failures(file, line))
+	if (!verbose && previous_failures(file, line, 1))
 		return (0);
 	fprintf(stderr, "%s:%d: Assertion failed: memory not equal\n",
 	    file, line);
@@ -507,7 +519,7 @@ test_assert_empty_file(const char *f1fmt
 		return (1);
 
 	failures ++;
-	if (!verbose && previous_failures(test_filename, test_line))
+	if (!verbose && previous_failures(test_filename, test_line, 1))
 		return (0);
 
 	fprintf(stderr, "%s:%d: File not empty: %s\n", test_filename, test_line, f1);
@@ -554,7 +566,7 @@ test_assert_equal_file(const char *f1, c
 			break;
 	}
 	failures ++;
-	if (!verbose && previous_failures(test_filename, test_line))
+	if (!verbose && previous_failures(test_filename, test_line, 1))
 		return (0);
 	fprintf(stderr, "%s:%d: Files are not identical\n",
 	    test_filename, test_line);
@@ -576,7 +588,7 @@ test_assert_file_exists(const char *fpat
 
 	if (!access(f, F_OK))
 		return (1);
-	if (!previous_failures(test_filename, test_line)) {
+	if (!previous_failures(test_filename, test_line, 1)) {
 		fprintf(stderr, "%s:%d: File doesn't exist\n",
 		    test_filename, test_line);
 		fprintf(stderr, "  file=\"%s\"\n", f);
@@ -597,7 +609,7 @@ test_assert_file_not_exists(const char *
 
 	if (access(f, F_OK))
 		return (1);
-	if (!previous_failures(test_filename, test_line)) {
+	if (!previous_failures(test_filename, test_line, 1)) {
 		fprintf(stderr, "%s:%d: File exists and shouldn't\n",
 		    test_filename, test_line);
 		fprintf(stderr, "  file=\"%s\"\n", f);
@@ -628,7 +640,7 @@ test_assert_file_contents(const void *bu
 		return (1);
 	}
 	failures ++;
-	if (!previous_failures(test_filename, test_line)) {
+	if (!previous_failures(test_filename, test_line, 1)) {
 		fprintf(stderr, "%s:%d: File contents don't match\n",
 		    test_filename, test_line);
 		fprintf(stderr, "  file=\"%s\"\n", f);
@@ -722,13 +734,19 @@ slurpfile(size_t * sizep, const char *fm
 #undef DEFINE_TEST
 #define	DEFINE_TEST(n) { n, #n },
 struct { void (*func)(void); const char *name; } tests[] = {
-#ifdef LIST_H
-	#include LIST_H
-#else
 	#include "list.h"
-#endif
 };
 
+/*
+ * This is well-intentioned, but sometimes the standard libraries
+ * leave open file descriptors and expect to be able to come back to
+ * them (e.g., for username lookups or logging).  Closing these
+ * descriptors out from under those libraries creates havoc.
+ *
+ * Maybe there's some reasonably portable way to tell if a descriptor
+ * is open without using close()?
+ */
+#if 0
 static void
 close_descriptors(int warn)
 {
@@ -745,6 +763,7 @@ close_descriptors(int warn)
 		report_failure(NULL);
 	}
 }
+#endif
 
 /*
  * Each test is run in a private work dir.  Those work dirs
@@ -788,11 +807,12 @@ static int test_run(int i, const char *t
 	/* Explicitly reset the locale before each test. */
 	setlocale(LC_ALL, "C");
 	/* Make sure there are no stray descriptors going into the test. */
-	close_descriptors(0);
+	/* TODO: Find a better way to identify file descriptor leaks. */
+	//close_descriptors(0);
 	/* Run the actual test. */
 	(*tests[i].func)();
 	/* Close stray descriptors, record as errors against this test. */
-	close_descriptors(1);
+	//close_descriptors(1);
 	/* Summarize the results of this test. */
 	summarize();
 	/* If there were no failures, we can remove the work dir. */
@@ -894,30 +914,34 @@ extract_reference_file(const char *name)
 	fclose(in);
 }
 
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#define DEV_NULL "NUL"
-#else
-#define DEV_NULL "/dev/null"
-#endif
 
+/* Since gzip is by far the most popular external compression program
+ * available, we try to use it in the read_program and write_program
+ * tests.  But if it's not available, then we can't use it.  This
+ * function just tries to run gzip/gunzip to see if they're available.
+ * If not, some of the external compression program tests will be
+ * skipped. */
 const char *
 external_gzip_program(int un)
 {
-	const char *extprog;
+	static int tested = 0;
+	static const char *compress_prog = NULL;
+	static const char *decompress_prog = NULL;
+	/* Args vary depending on the command interpreter we're using. */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+	static const char *args = "-V >NUL 2>NUL"; /* Win32 cmd.exe */
+#else
+	static const char *args = "-V >/dev/null 2>/dev/null"; /* POSIX 'sh' */
+#endif
 
-	if (un) {
-		extprog = "gunzip";
-		if (systemf("%s -V >" DEV_NULL " 2>" DEV_NULL, extprog) == 0)
-			return (extprog);
-		extprog = "gzip -d";
-		if (systemf("%s -V >" DEV_NULL " 2>" DEV_NULL, extprog) == 0)
-			return (extprog);
-	} else {
-		extprog = "gzip";
-		if (systemf("%s -V >" DEV_NULL " 2>" DEV_NULL, extprog) == 0)
-			return (extprog);
+	if (!tested) {
+		if (systemf("gunzip %s", args) == 0)
+			decompress_prog = "gunzip";
+		if (systemf("gzip %s", args) == 0)
+			compress_prog = "gzip";
+		tested = 1;
 	}
-	return (NULL);
+	return (un ? decompress_prog : compress_prog);
 }
 
 static char *
@@ -1144,16 +1168,30 @@ int main(int argc, char **argv)
 		}
 	} else {
 		while (*(argv) != NULL) {
-			i = atoi(*argv);
-			if (**argv < '0' || **argv > '9' || i < 0 || i >= limit) {
-				printf("*** INVALID Test %s\n", *argv);
-				free(refdir_alloc);
-				usage(progname);
+			if (**argv >= '0' && **argv <= '9') {
+				i = atoi(*argv);
+				if (i < 0 || i >= limit) {
+					printf("*** INVALID Test %s\n", *argv);
+					free(refdir_alloc);
+					usage(progname);
+					/* usage() never returns */
+				}
 			} else {
-				if (test_run(i, tmpdir))
-					tests_failed++;
-				tests_run++;
+				for (i = 0; i < limit; ++i) {
+					if (strcmp(*argv, tests[i].name) == 0)
+						break;
+				}
+				if (i >= limit) {
+					printf("*** INVALID Test ``%s''\n",
+					       *argv);
+					free(refdir_alloc);
+					usage(progname);
+					/* usage() never returns */
+				}
 			}
+			if (test_run(i, tmpdir))
+				tests_failed++;
+			tests_run++;
 			argv++;
 		}
 	}

Modified: head/lib/libarchive/test/read_open_memory.c
==============================================================================
--- head/lib/libarchive/test/read_open_memory.c	Fri Apr 17 01:04:23 2009	(r191182)
+++ head/lib/libarchive/test/read_open_memory.c	Fri Apr 17 01:06:31 2009	(r191183)
@@ -96,7 +96,7 @@ read_open_memory_internal(struct archive
 			    memory_read, memory_read_skip, memory_read_close));
 	else
 		return (archive_read_open2(a, mine, NULL,
-			    memory_read, NULL, NULL));
+			    memory_read, NULL, memory_read_close));
 }
 
 /*

Modified: head/lib/libarchive/test/test_compat_bzip2.c
==============================================================================
--- head/lib/libarchive/test/test_compat_bzip2.c	Fri Apr 17 01:04:23 2009	(r191182)
+++ head/lib/libarchive/test/test_compat_bzip2.c	Fri Apr 17 01:06:31 2009	(r191183)
@@ -44,7 +44,7 @@ compat_bzip2(const char *name)
 	const char *n[7] = { "f1", "f2", "f3", "d1/f1", "d1/f2", "d1/f3", NULL };
 	struct archive_entry *ae;
 	struct archive *a;
-	int i,r;
+	int i;
 
 	assert((a = archive_read_new()) != NULL);
 	assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
@@ -54,19 +54,9 @@ compat_bzip2(const char *name)
 
 	/* Read entries, match up names with list above. */
 	for (i = 0; i < 6; ++i) {
-		r = archive_read_next_header(a, &ae);
-		if (UnsupportedCompress(r, a)) {
-			skipping("Skipping BZIP2 compression check: "
-				"This version of libarchive was compiled "
-			    "without bzip2 support");
-			goto finish;
-		}
 		failure("Could not read file %d (%s) from %s", i, n[i], name);
-		assertEqualIntA(a, ARCHIVE_OK, r);
-		if (r != ARCHIVE_OK) {
-			archive_read_finish(a);
-			return;
-		}
+		assertEqualIntA(a, ARCHIVE_OK,
+		    archive_read_next_header(a, &ae));
 		assertEqualString(n[i], archive_entry_pathname(ae));
 	}
 
@@ -79,12 +69,7 @@ compat_bzip2(const char *name)
 	assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
 
 	assertEqualInt(ARCHIVE_OK, archive_read_close(a));
-finish:
-#if ARCHIVE_VERSION_NUMBER < 2000000
-	archive_read_finish(a);
-#else
 	assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
-#endif
 }
 
 

Modified: head/lib/libarchive/test/test_compat_gzip.c
==============================================================================
--- head/lib/libarchive/test/test_compat_gzip.c	Fri Apr 17 01:04:23 2009	(r191182)
+++ head/lib/libarchive/test/test_compat_gzip.c	Fri Apr 17 01:06:31 2009	(r191183)
@@ -47,22 +47,22 @@ verify(const char *name)
 	int i,r;
 
 	assert((a = archive_read_new()) != NULL);
-	assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+	r = archive_read_support_compression_gzip(a);
+	if (r == ARCHIVE_WARN) {
+		skipping("gzip reading not fully supported on this platform");
+		assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+		return;
+	}
+	assertEqualIntA(a, ARCHIVE_OK, r);
 	assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
 	extract_reference_file(name);
 	assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 200));
 
 	/* Read entries, match up names with list above. */
 	for (i = 0; i < 6; ++i) {
-		r = archive_read_next_header(a, &ae);
-		if (UnsupportedCompress(r, a)) {
-			skipping("Skipping GZIP compression check: "
-				"This version of libarchive was compiled "
-			    "without gzip support");
-			goto finish;
-		}
 		failure("Could not read file %d (%s) from %s", i, n[i], name);
-		assertEqualIntA(a, ARCHIVE_OK, r);
+		assertEqualIntA(a, ARCHIVE_OK,
+		    archive_read_next_header(a, &ae));
 		if (r != ARCHIVE_OK) {
 			archive_read_finish(a);
 			return;
@@ -79,12 +79,7 @@ verify(const char *name)
 	assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
 
 	assertEqualInt(ARCHIVE_OK, archive_read_close(a));
-finish:
-#if ARCHIVE_VERSION_NUMBER < 2000000
-	archive_read_finish(a);
-#else
 	assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
-#endif
 }
 
 

Added: head/lib/libarchive/test/test_compat_xz.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libarchive/test/test_compat_xz.c	Fri Apr 17 01:06:31 2009	(r191183)
@@ -0,0 +1,84 @@
+/*-
+ * Copyright (c) 2009 Michihiro NAKAJIMA
+ * Copyright (c) 2003-2008 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Verify our ability to read sample files compatibly with unxz.
+ *
+ * In particular:
+ *  * unxz will read multiple xz streams, concatenating the output
+ */
+
+/*
+ * All of the sample files have the same contents; they're just
+ * compressed in different ways.
+ */
+static void
+compat_xz(const char *name)
+{
+	const char *n[7] = { "f1", "f2", "f3", "d1/f1", "d1/f2", "d1/f3", NULL };
+	struct archive_entry *ae;
+	struct archive *a;
+	int i, r;
+
+	assert((a = archive_read_new()) != NULL);
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+	r = archive_read_support_compression_xz(a);
+	if (r == ARCHIVE_WARN) {
+		skipping("xz reading not fully supported on this platform");
+		assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+		return;
+	}
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+	extract_reference_file(name);
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 2));
+
+	/* Read entries, match up names with list above. */
+	for (i = 0; i < 6; ++i) {
+		failure("Could not read file %d (%s) from %s", i, n[i], name);
+		assertEqualIntA(a, ARCHIVE_OK,
+		    archive_read_next_header(a, &ae));
+		assertEqualString(n[i], archive_entry_pathname(ae));
+	}
+
+	/* Verify the end-of-archive. */
+	assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+	/* Verify that the format detection worked. */
+	assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_XZ);
+	assertEqualString(archive_compression_name(a), "xz");
+	assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+
+	assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+	assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}
+
+
+DEFINE_TEST(test_compat_xz)
+{
+	compat_xz("test_compat_xz_1.txz");
+}

Added: head/lib/libarchive/test/test_compat_xz_1.txz.uu
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libarchive/test/test_compat_xz_1.txz.uu	Fri Apr 17 01:06:31 2009	(r191183)
@@ -0,0 +1,13 @@
+$FreeBSD$
+begin 644 test_compat_gzip_1.txz
+M_3=Z6%H```3FUK1&`@`A`18```!T+^6CX`^?`(-=`#,,/!NGC#0&C6L"2_R2
+M/O9*^(7KX=WM^(=KA(RH"\09$$)!Q_+JUHQ*`]R;ITL_F3/I6:^Q0550A&)B
+MHS@=K]7@K1-9FOIP#PU!I?E5&IHH&Q=N>_C&G
+M-$G]+L[\,B<7%8&$NO5K31*Y>"D^*ZG,Z=H```"KU50H$1^1S``!GP&@'P``
+MLZ042+'$9_L"``````196OTW>EA:```$YM:T1@(`(0$6````="_EH^`,7P!I
+M70``;IBIKOMK%/A?-TZV0266G?2,[/?\,JE6`
+M__C/SA[W1?*2= 1009000
 	/* ino */
 	archive_entry_set_ino(e, 8593);
@@ -233,6 +239,10 @@ DEFINE_TEST(test_entry)
 	assertEqualInt(archive_entry_size(e), 0);
 	assert(!archive_entry_size_is_set(e));
 
+	/* sourcepath */
+	archive_entry_copy_sourcepath(e, "path1");
+	assertEqualString(archive_entry_sourcepath(e), "path1");
+
 	/* symlink */
 	archive_entry_set_symlink(e, "symlinkname");
 	assertEqualString(archive_entry_symlink(e), "symlinkname");
@@ -243,8 +253,14 @@ DEFINE_TEST(test_entry)
 	memset(buff, 0, sizeof(buff));
 	assertEqualString(archive_entry_symlink(e), "symlinkname2");
 #endif
+	archive_entry_copy_symlink_w(e, NULL);
+	assertEqualWString(archive_entry_symlink_w(e), NULL);
+	assertEqualString(archive_entry_symlink(e), NULL);
 	archive_entry_copy_symlink_w(e, L"wsymlink");
 	assertEqualWString(archive_entry_symlink_w(e), L"wsymlink");
+	archive_entry_copy_symlink(e, NULL);
+	assertEqualWString(archive_entry_symlink_w(e), NULL);
+	assertEqualString(archive_entry_symlink(e), NULL);
 
 	/* uid */
 	archive_entry_set_uid(e, 83);
@@ -271,9 +287,13 @@ DEFINE_TEST(test_entry)
 	/* TODO: Make this system-independent. */
 	assertEqualString(archive_entry_fflags_text(e),
 	    "uappnd,nouchg,nodump,noopaque,uunlnk");
-	/* TODO: Test archive_entry_copy_fflags_text_w() */
+	/* Test archive_entry_copy_fflags_text_w() */
+	archive_entry_copy_fflags_text_w(e, L" ,nouappnd, nouchg, dump,uunlnk");
+	archive_entry_fflags(e, &set, &clear);
+	assertEqualInt(16, set);
+	assertEqualInt(7, clear);
 	/* Test archive_entry_copy_fflags_text() */
-	archive_entry_copy_fflags_text(e, "nouappnd, nouchg, dump,uunlnk");
+	archive_entry_copy_fflags_text(e, " ,nouappnd, nouchg, dump,uunlnk");
 	archive_entry_fflags(e, &set, &clear);
 	assertEqualInt(16, set);
 	assertEqualInt(7, clear);
@@ -343,6 +363,7 @@ DEFINE_TEST(test_entry)
 	archive_entry_set_rdev(e, 532);
 #endif
 	archive_entry_set_size(e, 987654321);
+	archive_entry_copy_sourcepath(e, "source");
 	archive_entry_set_symlink(e, "symlinkname");
 	archive_entry_set_uid(e, 83);
 	archive_entry_set_uname(e, "user");
@@ -385,6 +406,7 @@ DEFINE_TEST(test_entry)
 	assertEqualInt(archive_entry_rdev(e2), 532);
 #endif
 	assertEqualInt(archive_entry_size(e2), 987654321);
+	assertEqualString(archive_entry_sourcepath(e2), "source");
 	assertEqualString(archive_entry_symlink(e2), "symlinkname");
 	assertEqualInt(archive_entry_uid(e2), 83);
 	assertEqualString(archive_entry_uname(e2), "user");
@@ -472,6 +494,7 @@ DEFINE_TEST(test_entry)
 	archive_entry_set_rdev(e, 132);
 #endif
 	archive_entry_set_size(e, 987456321);
+	archive_entry_copy_sourcepath(e, "source2");
 	archive_entry_set_symlink(e, "symlinkpath");
 	archive_entry_set_uid(e, 93);
 	archive_entry_set_uname(e, "username");
@@ -508,6 +531,7 @@ DEFINE_TEST(test_entry)
 	assertEqualInt(archive_entry_rdev(e2), 532);
 #endif
 	assertEqualInt(archive_entry_size(e2), 987654321);
+	assertEqualString(archive_entry_sourcepath(e2), "source");
 	assertEqualString(archive_entry_symlink(e2), "symlinkname");
 	assertEqualInt(archive_entry_uid(e2), 83);
 	assertEqualString(archive_entry_uname(e2), "user");

Modified: head/lib/libarchive/test/test_entry_strmode.c
==============================================================================
--- head/lib/libarchive/test/test_entry_strmode.c	Fri Apr 17 01:04:23 2009	(r191182)
+++ head/lib/libarchive/test/test_entry_strmode.c	Fri Apr 17 01:06:31 2009	(r191183)
@@ -34,15 +34,38 @@ DEFINE_TEST(test_entry_strmode)
 	archive_entry_set_mode(entry, S_IFREG | 0642);
 	assertEqualString(archive_entry_strmode(entry), "-rw-r---w- ");
 
+	/* Regular file + hardlink still shows as regular file. */
+	archive_entry_set_mode(entry, S_IFREG | 0644);
+	archive_entry_set_hardlink(entry, "link");
+	assertEqualString(archive_entry_strmode(entry), "-rw-r--r-- ");
+
+	archive_entry_set_mode(entry, 0640);
+	archive_entry_set_hardlink(entry, "link");
+	assertEqualString(archive_entry_strmode(entry), "hrw-r----- ");
+	archive_entry_set_hardlink(entry, NULL);
+
+	archive_entry_set_mode(entry, S_IFDIR | 0777);
+	assertEqualString(archive_entry_strmode(entry), "drwxrwxrwx ");
+
 	archive_entry_set_mode(entry, S_IFBLK | 03642);
 	assertEqualString(archive_entry_strmode(entry), "brw-r-S-wT ");
 
 	archive_entry_set_mode(entry, S_IFCHR | 05777);
 	assertEqualString(archive_entry_strmode(entry), "crwsrwxrwt ");
 
+	archive_entry_set_mode(entry, S_IFSOCK | 0222);
+	assertEqualString(archive_entry_strmode(entry), "s-w--w--w- ");
+
+	archive_entry_set_mode(entry, S_IFIFO | 0444);
+	assertEqualString(archive_entry_strmode(entry), "pr--r--r-- ");
+
 	archive_entry_set_mode(entry, S_IFLNK | 04000);
 	assertEqualString(archive_entry_strmode(entry), "l--S------ ");
 
+	archive_entry_acl_add_entry(entry, ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+	    0007, ARCHIVE_ENTRY_ACL_GROUP, 78, "group78");
+	assertEqualString(archive_entry_strmode(entry), "l--S------+");
+
 	/* Release the experimental entry. */
 	archive_entry_free(entry);
 }

Modified: head/lib/libarchive/test/test_extattr_freebsd.c
==============================================================================
--- head/lib/libarchive/test/test_extattr_freebsd.c	Fri Apr 17 01:04:23 2009	(r191182)
+++ head/lib/libarchive/test/test_extattr_freebsd.c	Fri Apr 17 01:06:31 2009	(r191183)
@@ -169,5 +169,6 @@ DEFINE_TEST(test_extattr_freebsd)
 	assertEqualMem(xval, "12345", xsize);
 	assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
 	assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+	archive_entry_free(ae);
 #endif
 }

Added: head/lib/libarchive/test/test_open_fd.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libarchive/test/test_open_fd.c	Fri Apr 17 01:06:31 2009	(r191183)
@@ -0,0 +1,117 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+
+DEFINE_TEST(test_open_fd)
+{
+	char buff[64];
+	struct archive_entry *ae;
+	struct archive *a;
+	int fd;
+
+	fd = open("test.tar", O_RDWR | O_CREAT, 0777);
+	assert(fd >= 0);
+	if (fd < 0)
+		return;
+
+	/* Write an archive through this fd. */
+	assert((a = archive_write_new()) != NULL);
+	assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
+	assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a));
+	assertEqualIntA(a, ARCHIVE_OK, archive_write_open_fd(a, fd));
+
+	/*
+	 * Write a file to it.
+	 */
+	assert((ae = archive_entry_new()) != NULL);
+	archive_entry_set_mtime(ae, 1, 0);
+	archive_entry_copy_pathname(ae, "file");
+	archive_entry_set_mode(ae, S_IFREG | 0755);
+	archive_entry_set_size(ae, 8);
+	assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+	archive_entry_free(ae);
+	assertEqualIntA(a, 8, archive_write_data(a, "12345678", 9));
+
+	/*
+	 * Write a second file to it.
+	 */
+	assert((ae = archive_entry_new()) != NULL);
+	archive_entry_copy_pathname(ae, "file2");
+	archive_entry_set_mode(ae, S_IFREG | 0755);
+	archive_entry_set_size(ae, 819200);
+	assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+	archive_entry_free(ae);
+
+	/* Close out the archive. */
+	assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
+	assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+
+	/*
+	 * Now, read the data back.
+	 */
+	assert(lseek(fd, 0, SEEK_SET) == 0);
+	assert((a = archive_read_new()) != NULL);
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_open_fd(a, fd, 512));
+
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+	assertEqualInt(1, archive_entry_mtime(ae));
+	assertEqualInt(0, archive_entry_mtime_nsec(ae));
+	assertEqualInt(0, archive_entry_atime(ae));
+	assertEqualInt(0, archive_entry_ctime(ae));
+	assertEqualString("file", archive_entry_pathname(ae));
+	assert((S_IFREG | 0755) == archive_entry_mode(ae));
+	assertEqualInt(8, archive_entry_size(ae));
+	assertEqualIntA(a, 8, archive_read_data(a, buff, 10));
+	assertEqualMem(buff, "12345678", 8);
+
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+	assertEqualString("file2", archive_entry_pathname(ae));
+	assert((S_IFREG | 0755) == archive_entry_mode(ae));
+	assertEqualInt(819200, archive_entry_size(ae));
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_data_skip(a));
+
+	/* Verify the end of the archive. */
+	assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+	assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+	close(fd);
+
+
+	/*
+	 * Verify some of the error handling.
+	 */
+	assert((a = archive_read_new()) != NULL);
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));
+	/* FD 100 shouldn't be open. */
+	assertEqualIntA(a, ARCHIVE_FATAL,
+	    archive_read_open_fd(a, 100, 512));
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+	assertEqualInt(ARCHIVE_OK, archive_read_finish(a));
+}

Added: head/lib/libarchive/test/test_open_file.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libarchive/test/test_open_file.c	Fri Apr 17 01:06:31 2009	(r191183)
@@ -0,0 +1,108 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "test.h"
+__FBSDID("$FreeBSD$");
+
+DEFINE_TEST(test_open_file)
+{
+	char buff[64];
+	struct archive_entry *ae;
+	struct archive *a;
+	FILE *f;
+
+	f = fopen("test.tar", "w");
+	assert(f != NULL);
+	if (f == NULL)
+		return;
+
+	/* Write an archive through this FILE *. */
+	assert((a = archive_write_new()) != NULL);
+	assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
+	assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a));
+	assertEqualIntA(a, ARCHIVE_OK, archive_write_open_FILE(a, f));
+
+	/*
+	 * Write a file to it.
+	 */
+	assert((ae = archive_entry_new()) != NULL);
+	archive_entry_set_mtime(ae, 1, 0);
+	archive_entry_copy_pathname(ae, "file");
+	archive_entry_set_mode(ae, S_IFREG | 0755);
+	archive_entry_set_size(ae, 8);
+	assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+	archive_entry_free(ae);
+	assertEqualIntA(a, 8, archive_write_data(a, "12345678", 9));
+
+	/*
+	 * Write a second file to it.
+	 */
+	assert((ae = archive_entry_new()) != NULL);
+	archive_entry_copy_pathname(ae, "file2");
+	archive_entry_set_mode(ae, S_IFREG | 0755);
+	archive_entry_set_size(ae, 819200);
+	assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+	archive_entry_free(ae);
+
+	/* Close out the archive. */
+	assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
+	assertEqualInt(ARCHIVE_OK, archive_write_finish(a));
+	fclose(f);
+
+	/*
+	 * Now, read the data back.
+	 */
+	f = fopen("test.tar", "r");
+	assert(f != NULL);
+	if (f == NULL)
+		return;
+	assert((a = archive_read_new()) != NULL);
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+	assertEqualIntA(a, ARCHIVE_OK, archive_read_support_compression_all(a));

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 01:07:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9471B1065749;
	Fri, 17 Apr 2009 01:07:37 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 820168FC20;
	Fri, 17 Apr 2009 01:07:37 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H17bPM000230;
	Fri, 17 Apr 2009 01:07:37 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H17bwq000229;
	Fri, 17 Apr 2009 01:07:37 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170107.n3H17bwq000229@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 01:07:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191184 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 01:07:38 -0000

Author: kientzle
Date: Fri Apr 17 01:07:37 2009
New Revision: 191184
URL: http://svn.freebsd.org/changeset/base/191184

Log:
  Publicize a handful of new functions and bump the version number
  to indicate that this is synchronized with the recent libarchive 2.7.0
  release.

Modified:
  head/lib/libarchive/archive.h

Modified: head/lib/libarchive/archive.h
==============================================================================
--- head/lib/libarchive/archive.h	Fri Apr 17 01:06:31 2009	(r191183)
+++ head/lib/libarchive/archive.h	Fri Apr 17 01:07:37 2009	(r191184)
@@ -118,13 +118,13 @@ extern "C" {
  *             (ARCHIVE_API_VERSION * 1000000 + ARCHIVE_API_FEATURE * 1000)
  * #endif
  */
-#define	ARCHIVE_VERSION_NUMBER 2006901
+#define	ARCHIVE_VERSION_NUMBER 2007000
 __LA_DECL int		archive_version_number(void);
 
 /*
  * Textual name/version of the library, useful for version displays.
  */
-#define	ARCHIVE_VERSION_STRING "libarchive 2.6.901a"
+#define	ARCHIVE_VERSION_STRING "libarchive 2.7.0"
 __LA_DECL const char *	archive_version_string(void);
 
 #if ARCHIVE_VERSION_NUMBER < 3000000
@@ -298,6 +298,7 @@ __LA_DECL int		 archive_read_support_com
 __LA_DECL int		 archive_read_support_compression_bzip2(struct archive *);
 __LA_DECL int		 archive_read_support_compression_compress(struct archive *);
 __LA_DECL int		 archive_read_support_compression_gzip(struct archive *);
+__LA_DECL int		 archive_read_support_compression_lzma(struct archive *);
 __LA_DECL int		 archive_read_support_compression_none(struct archive *);
 __LA_DECL int		 archive_read_support_compression_program(struct archive *,
 		     const char *command);
@@ -305,6 +306,8 @@ __LA_DECL int		 archive_read_support_com
 				(struct archive *, const char *,
 				    const void * /* match */, size_t);
 
+__LA_DECL int		 archive_read_support_compression_xz(struct archive *);
+
 __LA_DECL int		 archive_read_support_format_all(struct archive *);
 __LA_DECL int		 archive_read_support_format_ar(struct archive *);
 __LA_DECL int		 archive_read_support_format_cpio(struct archive *);
@@ -352,6 +355,10 @@ __LA_DECL int		 archive_read_open_FILE(s
 __LA_DECL int		 archive_read_next_header(struct archive *,
 		     struct archive_entry **);
 
+/* Parses and returns next entry header using the archive_entry passed in */
+__LA_DECL int		 archive_read_next_header2(struct archive *,
+		     struct archive_entry *);
+
 /*
  * Retrieve the byte offset in UNCOMPRESSED data where last-read
  * header started.
@@ -499,9 +506,11 @@ __LA_DECL int		 archive_write_set_skip_f
 __LA_DECL int		 archive_write_set_compression_bzip2(struct archive *);
 __LA_DECL int		 archive_write_set_compression_compress(struct archive *);
 __LA_DECL int		 archive_write_set_compression_gzip(struct archive *);
+__LA_DECL int		 archive_write_set_compression_lzma(struct archive *);
 __LA_DECL int		 archive_write_set_compression_none(struct archive *);
 __LA_DECL int		 archive_write_set_compression_program(struct archive *,
 		     const char *cmd);
+__LA_DECL int		 archive_write_set_compression_xz(struct archive *);
 /* A convenience function to set the format based on the code or name. */
 __LA_DECL int		 archive_write_set_format(struct archive *, int format_code);
 __LA_DECL int		 archive_write_set_format_by_name(struct archive *,
@@ -584,10 +593,12 @@ __LA_DECL int		archive_write_set_options
 
 
 /*-
+ * ARCHIVE_WRITE_DISK API
+ *
  * To create objects on disk:
  *   1) Ask archive_write_disk_new for a new archive_write_disk object.
- *   2) Set any global properties.  In particular, you should set
- *      the compression and format to use.
+ *   2) Set any global properties.  In particular, you probably
+ *      want to set the options.
  *   3) For each entry:
  *      - construct an appropriate struct archive_entry structure
  *      - archive_write_header to create the file/dir/etc on disk
@@ -601,7 +612,8 @@ __LA_DECL struct archive	*archive_write_
 /* This file will not be overwritten. */
 __LA_DECL int		 archive_write_disk_set_skip_file(struct archive *,
 		     dev_t, ino_t);
-/* Set flags to control how the next item gets created. */
+/* Set flags to control how the next item gets created.
+ * This accepts a bitmask of ARCHIVE_EXTRACT_XXX flags defined above. */
 __LA_DECL int		 archive_write_disk_set_options(struct archive *,
 		     int flags);
 /*

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 02:20:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 91381106564A;
	Fri, 17 Apr 2009 02:20:03 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226])
	by mx1.freebsd.org (Postfix) with ESMTP id 490578FC0A;
	Fri, 17 Apr 2009 02:20:03 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from localhost (localhost [127.0.0.1])
	by pele.citylink.co.nz (Postfix) with ESMTP id 87D32FFEF;
	Fri, 17 Apr 2009 14:20:02 +1200 (NZST)
X-Virus-Scanned: Debian amavisd-new at citylink.co.nz
Received: from pele.citylink.co.nz ([127.0.0.1])
	by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id Isg6ctcKVB+X; Fri, 17 Apr 2009 14:19:59 +1200 (NZST)
Received: from citylink.fud.org.nz (unknown [202.8.44.45])
	by pele.citylink.co.nz (Postfix) with ESMTP;
	Fri, 17 Apr 2009 14:19:59 +1200 (NZST)
Received: by citylink.fud.org.nz (Postfix, from userid 1001)
	id 29F8E11432; Fri, 17 Apr 2009 14:19:59 +1200 (NZST)
Date: Thu, 16 Apr 2009 19:19:58 -0700
From: Andrew Thompson 
To: Rick Macklem 
Message-ID: <20090417021958.GC33466@citylink.fud.org.nz>
References: <200904161626.n3GGQa8N085699@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200904161626.n3GGQa8N085699@svn.freebsd.org>
User-Agent: Mutt/1.5.17 (2007-11-01)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191145 - head/sys/rpc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 02:20:04 -0000

On Thu, Apr 16, 2009 at 04:26:36PM +0000, Rick Macklem wrote:
> Author: rmacklem
> Date: Thu Apr 16 16:26:35 2009
> New Revision: 191145
> URL: http://svn.freebsd.org/changeset/base/191145
> 
> Log:
>   	Added a field to the SVCXPRT structure that the nfsv4 server can
>   	use to identify if the socket is the same one that a cached request
>   	came in on. It is set by nfsrvd_addsock() to a unique value generated
>   	by incrementing an unsigned 64bit static variable for each assignment
>   	and then the value of xp_sockref is tested to see if it is equal to
>   	the value that was saved with the cached reply.
>   
>   Submitted by:	rmacklem

Great work and welcome. To save yourself a bit of typing, unless you
attribute the submission/testing its implied that it came from
yourself. :)

Andrew

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 03:36:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5213E106566C;
	Fri, 17 Apr 2009 03:36:08 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F94A8FC08;
	Fri, 17 Apr 2009 03:36:08 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H3a86q006147;
	Fri, 17 Apr 2009 03:36:08 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H3a72i006136;
	Fri, 17 Apr 2009 03:36:07 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170336.n3H3a72i006136@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 03:36:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191187 - in head/usr.bin/tar: . test
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 03:36:08 -0000

Author: kientzle
Date: Fri Apr 17 03:36:07 2009
New Revision: 191187
URL: http://svn.freebsd.org/changeset/base/191187

Log:
  Merge from libarchive.googlecode.com: Numerous Windows-specific build tweaks.

Modified:
  head/usr.bin/tar/bsdtar_platform.h
  head/usr.bin/tar/test/main.c
  head/usr.bin/tar/test/test.h
  head/usr.bin/tar/test/test_0.c
  head/usr.bin/tar/test/test_basic.c
  head/usr.bin/tar/test/test_copy.c
  head/usr.bin/tar/test/test_patterns.c
  head/usr.bin/tar/test/test_strip_components.c
  head/usr.bin/tar/test/test_symlink_dir.c
  head/usr.bin/tar/tree.c

Modified: head/usr.bin/tar/bsdtar_platform.h
==============================================================================
--- head/usr.bin/tar/bsdtar_platform.h	Fri Apr 17 02:52:23 2009	(r191186)
+++ head/usr.bin/tar/bsdtar_platform.h	Fri Apr 17 03:36:07 2009	(r191187)
@@ -164,7 +164,9 @@
 #define	__LA_DEAD
 #endif
 
-#ifdef _WIN32
+#if defined(__CYGWIN__)
+#include "bsdtar_cygwin.h"
+#elif defined(_WIN32) /* && !__CYGWIN__ */
 #include "bsdtar_windows.h"
 #else
 #define bsdtar_is_privileged(bsdtar)	(bsdtar->user_uid == 0)

Modified: head/usr.bin/tar/test/main.c
==============================================================================
--- head/usr.bin/tar/test/main.c	Fri Apr 17 02:52:23 2009	(r191186)
+++ head/usr.bin/tar/test/main.c	Fri Apr 17 03:36:07 2009	(r191187)
@@ -56,11 +56,7 @@ __FBSDID("$FreeBSD$");
  */
 #undef DEFINE_TEST
 #define	DEFINE_TEST(name) void name(void);
-#ifdef LIST_H
-#include LIST_H
-#else
 #include "list.h"
-#endif
 
 /* Interix doesn't define these in a standard header. */
 #if __INTERIX__
@@ -754,11 +750,7 @@ slurpfile(size_t * sizep, const char *fm
 #undef DEFINE_TEST
 #define	DEFINE_TEST(n) { n, #n },
 struct { void (*func)(void); const char *name; } tests[] = {
-#ifdef LIST_H
-	#include LIST_H
-#else
 	#include "list.h"
-#endif
 };
 
 /*
@@ -809,7 +801,7 @@ static int test_run(int i, const char *t
 	/* If there were no failures, we can remove the work dir. */
 	if (failures == failures_before) {
 		if (!keep_temp_files && chdir(tmpdir) == 0) {
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN__)
 			systemf("rmdir /S /Q %s", tests[i].name);
 #else
 			systemf("rm -rf %s", tests[i].name);
@@ -912,7 +904,7 @@ int main(int argc, char **argv)
 	int i, tests_run = 0, tests_failed = 0, opt;
 	time_t now;
 	char *refdir_alloc = NULL;
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN__)
 	char *testprg;
 #endif
 	const char *opt_arg, *progname, *p;
@@ -921,8 +913,10 @@ int main(int argc, char **argv)
 
 	(void)argc; /* UNUSED */
 
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN__)
 	/* Make sure open() function will be used with a binary mode. */
+	/* on cygwin, we need something similar, but instead link against */
+	/* a special startup object, binmode.o */
 	_set_fmode(_O_BINARY);
 #endif
 	/*
@@ -1014,7 +1008,7 @@ int main(int argc, char **argv)
 	if (testprog == NULL)
 		usage(progname);
 #endif
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN__)
 	/*
 	 * command.com cannot accept the command used '/' with drive
 	 * name such as c:/xxx/command.exe when use '|' pipe handling.

Modified: head/usr.bin/tar/test/test.h
==============================================================================
--- head/usr.bin/tar/test/test.h	Fri Apr 17 02:52:23 2009	(r191186)
+++ head/usr.bin/tar/test/test.h	Fri Apr 17 03:36:07 2009	(r191187)
@@ -37,7 +37,7 @@
 #elif defined(__FreeBSD__)
 /* Building as part of FreeBSD system requires a pre-built config.h. */
 #include "config_freebsd.h"
-#elif defined(_WIN32)
+#elif defined(_WIN32) && !defined(__CYGWIN__)
 /* Win32 can't run the 'configure' script. */
 #include "config_windows.h"
 #else
@@ -45,7 +45,7 @@
 #error Oops: No config.h and no pre-built configuration in test.h.
 #endif
 
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 #include 
 #else
 #define dirent direct
@@ -58,7 +58,7 @@
 #include 
 #include 
 #include 
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 #include 
 #endif
 #include 
@@ -67,12 +67,16 @@
 #include 
 #endif
 
-/* No non-FreeBSD platform will have __FBSDID, so just define it here. */
 #ifdef __FreeBSD__
 #include   /* For __FBSDID */
 #else
+/* Some non-FreeBSD platforms such as newlib-derived ones like
+ * cygwin, have __FBSDID, so this definition must be guarded.
+ */
+#ifndef __FBSDID
 #define	__FBSDID(a)     /* null */
 #endif
+#endif
 
 /*
  * Redefine DEFINE_TEST for use in defining the test functions.

Modified: head/usr.bin/tar/test/test_0.c
==============================================================================
--- head/usr.bin/tar/test/test_0.c	Fri Apr 17 02:52:23 2009	(r191186)
+++ head/usr.bin/tar/test/test_0.c	Fri Apr 17 03:36:07 2009	(r191187)
@@ -29,7 +29,7 @@ __FBSDID("$FreeBSD$");
  * This first test does basic sanity checks on the environment.  For
  * most of these, we just exit on failure.
  */
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 #define DEV_NULL "/dev/null"
 #else
 #define DEV_NULL "NUL"

Modified: head/usr.bin/tar/test/test_basic.c
==============================================================================
--- head/usr.bin/tar/test/test_basic.c	Fri Apr 17 02:52:23 2009	(r191186)
+++ head/usr.bin/tar/test/test_basic.c	Fri Apr 17 03:36:07 2009	(r191187)
@@ -31,7 +31,7 @@ basic_tar(const char *target, const char
     const char *unpack_options, const char *flist)
 {
 	struct stat st, st2;
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 	char buff[128];
 #endif
 	int r;
@@ -39,7 +39,7 @@ basic_tar(const char *target, const char
 	assertEqualInt(0, mkdir(target, 0775));
 
 	/* Use the tar program to create an archive. */
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 	r = systemf("%s cf - %s `cat %s` >%s/archive 2>%s/pack.err", testprog, pack_options, flist, target, target);
 #else
 	r = systemf("%s cf - %s %s >%s/archive 2>%s/pack.err", testprog, pack_options, flist, target, target);
@@ -72,7 +72,7 @@ basic_tar(const char *target, const char
 	assertEqualInt(r, 0);
 	if (r == 0) {
 		assert(S_ISREG(st.st_mode));
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 		assertEqualInt(0644, st.st_mode & 0777);
 #else
 		assertEqualInt(0600, st.st_mode & 0700);
@@ -88,7 +88,7 @@ basic_tar(const char *target, const char
 	assertEqualInt(r, 0);
 	if (r == 0) {
 		assert(S_ISREG(st2.st_mode));
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 		assertEqualInt(0644, st2.st_mode & 0777);
 #else
 		assertEqualInt(0600, st2.st_mode & 0700);
@@ -102,7 +102,7 @@ basic_tar(const char *target, const char
 		assertEqualInt(st.st_ino, st2.st_ino);
 	}
 
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 	/* Symlink */
 	r = lstat("symlink", &st);
 	failure("Failed to stat file %s/symlink, errno=%d", target, errno);
@@ -125,7 +125,7 @@ basic_tar(const char *target, const char
 	if (r == 0) {
 		assertEqualInt(r, 0);
 		assert(S_ISDIR(st.st_mode));
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 		assertEqualInt(0775, st.st_mode & 0777);
 #else
 		assertEqualInt(0700, st.st_mode & 0700);
@@ -170,7 +170,7 @@ DEFINE_TEST(test_basic)
 	/* All done. */
 	close(filelist);
 
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 	flist = "filelist";
 #else
 	flist = "file linkfile symlink dir";

Modified: head/usr.bin/tar/test/test_copy.c
==============================================================================
--- head/usr.bin/tar/test/test_copy.c	Fri Apr 17 02:52:23 2009	(r191186)
+++ head/usr.bin/tar/test/test_copy.c	Fri Apr 17 03:36:07 2009	(r191187)
@@ -64,7 +64,7 @@ create_tree(void)
 		buff2[0] = 'm';
 		assertEqualInt(0, link(buff, buff2));
 
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 		/* Create a symlink named "s/abcdef..." to the above. */
 		strcpy(buff2 + 3, buff);
 		buff[0] = 's';
@@ -156,7 +156,7 @@ verify_tree(int limit)
 			}
 		}
 
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 		/*
 		 * Symlink text doesn't include the 'original/' prefix,
 		 * so the limit here is 100 characters.

Modified: head/usr.bin/tar/test/test_patterns.c
==============================================================================
--- head/usr.bin/tar/test/test_patterns.c	Fri Apr 17 02:52:23 2009	(r191186)
+++ head/usr.bin/tar/test/test_patterns.c	Fri Apr 17 03:36:07 2009	(r191187)
@@ -61,7 +61,7 @@ DEFINE_TEST(test_patterns)
 	r = systemf("%s tf %s /tmp/foo/bar > tar2a.out 2> tar2a.err",
 	    testprog, reffile2);
 	assertEqualInt(r, 0);
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 	p = "/tmp/foo/bar/\n/tmp/foo/bar/baz\n";
 #else
 	p = "/tmp/foo/bar/\r\n/tmp/foo/bar/baz\r\n";

Modified: head/usr.bin/tar/test/test_strip_components.c
==============================================================================
--- head/usr.bin/tar/test/test_strip_components.c	Fri Apr 17 02:52:23 2009	(r191186)
+++ head/usr.bin/tar/test/test_strip_components.c	Fri Apr 17 03:36:07 2009	(r191187)
@@ -64,7 +64,7 @@ DEFINE_TEST(test_strip_components)
 	failure("d0/d1/ is too short and should not get restored");
 	assertEqualInt(-1, lstat("target/d1", &st));
 	failure("d0/d1/s2 is a symlink to something that won't be extracted");
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 	assertEqualInt(-1, stat("target/s2", &st));
 #else
 	skipping("symlink with stat()");

Modified: head/usr.bin/tar/test/test_symlink_dir.c
==============================================================================
--- head/usr.bin/tar/test/test_symlink_dir.c	Fri Apr 17 02:52:23 2009	(r191186)
+++ head/usr.bin/tar/test/test_symlink_dir.c	Fri Apr 17 03:36:07 2009	(r191187)
@@ -48,7 +48,7 @@ mkfile(const char *name, int mode, const
 DEFINE_TEST(test_symlink_dir)
 {
 	struct stat st;
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 	struct stat st2;
 #endif
 	int oldumask;
@@ -78,7 +78,7 @@ DEFINE_TEST(test_symlink_dir)
 	assertEqualInt(0, mkdir("dest1", 0755));
 	/* "dir" is a symlink to an existing "real_dir" */
 	assertEqualInt(0, mkdir("dest1/real_dir", 0755));
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 	assertEqualInt(0, symlink("real_dir", "dest1/dir"));
 	/* "dir2" is a symlink to a non-existing "real_dir2" */
 	assertEqualInt(0, symlink("real_dir2", "dest1/dir2"));
@@ -91,7 +91,7 @@ DEFINE_TEST(test_symlink_dir)
 	/* "file" is a symlink to existing "real_file" */
 	assertEqualInt(0, mkfile("dest1/real_file", 0755, "abcdefg", 7));
 	assertEqualInt(0, symlink("real_file", "dest1/file"));
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 	/* "file2" is a symlink to non-existing "real_file2" */
 	assertEqualInt(0, symlink("real_file2", "dest1/file2"));
 #else
@@ -126,7 +126,7 @@ DEFINE_TEST(test_symlink_dir)
 	assertEqualInt(0, mkdir("dest2", 0755));
 	/* "dir" is a symlink to existing "real_dir" */
 	assertEqualInt(0, mkdir("dest2/real_dir", 0755));
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 	assertEqualInt(0, symlink("real_dir", "dest2/dir"));
 	/* "dir2" is a symlink to a non-existing "real_dir2" */
 	assertEqualInt(0, symlink("real_dir2", "dest2/dir2"));
@@ -139,7 +139,7 @@ DEFINE_TEST(test_symlink_dir)
 	/* "file" is a symlink to existing "real_file" */
 	assertEqualInt(0, mkfile("dest2/real_file", 0755, "abcdefghi", 9));
 	assertEqualInt(0, symlink("real_file", "dest2/file"));
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 	/* "file2" is a symlink to non-existing "real_file2" */
 	assertEqualInt(0, symlink("real_file2", "dest2/file2"));
 #else
@@ -150,7 +150,7 @@ DEFINE_TEST(test_symlink_dir)
 	/* dest2/dir symlink should be followed */
 	assertEqualInt(0, lstat("dest2/dir", &st));
 	failure("tar -xP removed symlink instead of following it");
-#ifndef _WIN32
+#if !defined(_WIN32) || defined(__CYGWIN__)
 	if (assert(S_ISLNK(st.st_mode))) {
 		/* Only verify what the symlink points to if it
 		 * really is a symlink. */

Modified: head/usr.bin/tar/tree.c
==============================================================================
--- head/usr.bin/tar/tree.c	Fri Apr 17 02:52:23 2009	(r191186)
+++ head/usr.bin/tar/tree.c	Fri Apr 17 03:36:07 2009	(r191187)
@@ -82,9 +82,12 @@ struct tree_entry {
 	size_t dirname_length;
 	dev_t dev;
 	ino_t ino;
+#ifdef HAVE_FCHDIR
 	int fd;
-#ifdef _WIN32
+#elif defined(_WIN32) && !defined(__CYGWIN__)
 	char *fullpath;
+#else
+#error fchdir function required.
 #endif
 	int flags;
 };
@@ -102,8 +105,9 @@ struct tree {
 	struct tree_entry	*stack;
 	struct tree_entry	*current;
 	DIR	*d;
+#ifdef HAVE_FCHDIR
 	int	 initialDirFd;
-#ifdef _WIN32
+#elif defined(_WIN32) && !defined(__CYGWIN__)
 	char	*initialDir;
 #endif
 	int	 flags;
@@ -169,8 +173,9 @@ tree_push(struct tree *t, const char *pa
 	memset(te, 0, sizeof(*te));
 	te->next = t->stack;
 	t->stack = te;
+#ifdef HAVE_FCHDIR
 	te->fd = -1;
-#ifdef _WIN32
+#elif defined(_WIN32) && !defined(__CYGWIN__)
 	te->fullpath = NULL;
 #endif
 	te->name = strdup(path);
@@ -222,10 +227,10 @@ tree_open(const char *path)
 	t = malloc(sizeof(*t));
 	memset(t, 0, sizeof(*t));
 	tree_append(t, path, strlen(path));
+#ifdef HAVE_FCHDIR
 	t->initialDirFd = open(".", O_RDONLY);
-#ifdef _WIN32
-	if (t->initialDirFd >= 0)
-		t->initialDir = getcwd(NULL, 0);
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+	t->initialDir = getcwd(NULL, 0);
 #endif
 	/*
 	 * During most of the traversal, items are set up and then
@@ -254,16 +259,15 @@ tree_ascend(struct tree *t)
 			t->tree_errno = errno;
 			r = TREE_ERROR_FATAL;
 		}
-#endif
-#ifdef _WIN32
-		if (te->fullpath != NULL && chdir(te->fullpath) != 0) {
+		close(te->fd);
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+		if (chdir(te->fullpath) != 0) {
 			t->tree_errno = errno;
 			r = TREE_ERROR_FATAL;
 		}
 		free(te->fullpath);
 		te->fullpath = NULL;
 #endif
-		close(te->fd);
 		t->openCount--;
 	} else {
 		if (chdir("..") != 0) {
@@ -354,8 +358,9 @@ tree_next(struct tree *t)
 			t->stack->flags &= ~needsPreVisit;
 			/* If it is a link, set up fd for the ascent. */
 			if (t->stack->flags & isDirLink) {
+#ifdef HAVE_FCHDIR
 				t->stack->fd = open(".", O_RDONLY);
-#ifdef _WIN32
+#elif defined(_WIN32) && !defined(__CYGWIN__)
 				t->stack->fullpath = getcwd(NULL, 0);
 #endif
 				t->openCount++;
@@ -580,17 +585,18 @@ tree_close(struct tree *t)
 	if (t->buff)
 		free(t->buff);
 	/* chdir() back to where we started. */
-	if (t->initialDirFd >= 0) {
 #ifdef HAVE_FCHDIR
+	if (t->initialDirFd >= 0) {
 		fchdir(t->initialDirFd);
-#endif
-#ifdef _WIN32
+		close(t->initialDirFd);
+		t->initialDirFd = -1;
+	}
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+	if (t->initialDir != NULL) {
 		chdir(t->initialDir);
 		free(t->initialDir);
 		t->initialDir = NULL;
-#endif
-		close(t->initialDirFd);
-		t->initialDirFd = -1;
 	}
+#endif
 	free(t);
 }

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 03:37:09 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7F4C0106566B;
	Fri, 17 Apr 2009 03:37:09 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6ECE28FC1A;
	Fri, 17 Apr 2009 03:37:09 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H3b9QW006230;
	Fri, 17 Apr 2009 03:37:09 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H3b9Og006229;
	Fri, 17 Apr 2009 03:37:09 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170337.n3H3b9Og006229@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 03:37:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191188 - head/usr.bin/tar
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 03:37:10 -0000

Author: kientzle
Date: Fri Apr 17 03:37:09 2009
New Revision: 191188
URL: http://svn.freebsd.org/changeset/base/191188

Log:
  Minor portability improvement in calls to ctype.h macros.

Modified:
  head/usr.bin/tar/util.c

Modified: head/usr.bin/tar/util.c
==============================================================================
--- head/usr.bin/tar/util.c	Fri Apr 17 03:36:07 2009	(r191187)
+++ head/usr.bin/tar/util.c	Fri Apr 17 03:37:09 2009	(r191188)
@@ -178,7 +178,7 @@ bsdtar_expand_char(char *buff, size_t of
 {
 	size_t i = offset;
 
-	if (isprint(c) && c != '\\')
+	if (isprint((unsigned char)c) && c != '\\')
 		buff[i++] = c;
 	else {
 		buff[i++] = '\\';
@@ -254,7 +254,7 @@ yes(const char *fmt, ...)
 	buff[l] = 0;
 
 	for (p = buff; *p != '\0'; p++) {
-		if (isspace(0xff & (int)*p))
+		if (isspace((unsigned char)*p))
 			continue;
 		switch(*p) {
 		case 'y': case 'Y':

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 03:40:40 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BAAB8106564A;
	Fri, 17 Apr 2009 03:40:40 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A9D9B8FC1B;
	Fri, 17 Apr 2009 03:40:40 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H3eek9006413;
	Fri, 17 Apr 2009 03:40:40 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H3eeUt006412;
	Fri, 17 Apr 2009 03:40:40 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170340.n3H3eeUt006412@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 03:40:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191189 - head/usr.bin/tar
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 03:40:41 -0000

Author: kientzle
Date: Fri Apr 17 03:40:40 2009
New Revision: 191189
URL: http://svn.freebsd.org/changeset/base/191189

Log:
  Set options before opening the archive.
  Catch and report close-time errors.

Modified:
  head/usr.bin/tar/read.c

Modified: head/usr.bin/tar/read.c
==============================================================================
--- head/usr.bin/tar/read.c	Fri Apr 17 03:37:09 2009	(r191188)
+++ head/usr.bin/tar/read.c	Fri Apr 17 03:40:40 2009	(r191189)
@@ -127,17 +127,13 @@ read_archive(struct bsdtar *bsdtar, char
 	else
 		archive_read_support_compression_all(a);
 	archive_read_support_format_all(a);
+	if (ARCHIVE_OK != archive_read_set_options(a, bsdtar->option_options))
+		bsdtar_errc(bsdtar, 1, 0, archive_error_string(a));
 	if (archive_read_open_file(a, bsdtar->filename,
 	    bsdtar->bytes_per_block != 0 ? bsdtar->bytes_per_block :
 	    DEFAULT_BYTES_PER_BLOCK))
 		bsdtar_errc(bsdtar, 1, 0, "Error opening archive: %s",
 		    archive_error_string(a));
-	if (bsdtar->option_format_options != NULL) {
-		r = archive_read_set_options(a, bsdtar->option_format_options);
-		if (r != ARCHIVE_OK)
-			bsdtar_errc(bsdtar, 1, 0, "Error archive options: %s",
-			    archive_error_string(a));
-	}
 
 	do_chdir(bsdtar);
 
@@ -298,6 +294,13 @@ read_archive(struct bsdtar *bsdtar, char
 		}
 	}
 
+
+	r = archive_read_close(a);
+	if (r != ARCHIVE_OK)
+		bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a));
+	if (r <= ARCHIVE_WARN)
+		bsdtar->return_value = 1;
+
 	if (bsdtar->verbose > 2)
 		fprintf(stdout, "Archive Format: %s,  Compression: %s\n",
 		    archive_format_name(a), archive_compression_name(a));
@@ -390,7 +393,7 @@ list_item_verbose(struct bsdtar *bsdtar,
 
 	/* Format the time using 'ls -l' conventions. */
 	tim = (time_t)st->st_mtime;
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN__)
 	/* Windows' strftime function does not support %e format. */
 	if (abs(tim - now) > (365/2)*86400)
 		fmt = bsdtar->day_first ? "%d %b  %Y" : "%b %d  %Y";

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 03:45:16 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 50DC31065670;
	Fri, 17 Apr 2009 03:45:16 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F07D8FC18;
	Fri, 17 Apr 2009 03:45:16 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H3jGGf006644;
	Fri, 17 Apr 2009 03:45:16 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H3jG7n006638;
	Fri, 17 Apr 2009 03:45:16 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170345.n3H3jG7n006638@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 03:45:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191190 - head/usr.bin/tar
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 03:45:16 -0000

Author: kientzle
Date: Fri Apr 17 03:45:15 2009
New Revision: 191190
URL: http://svn.freebsd.org/changeset/base/191190

Log:
  Merge remaining changes from libarchive.googlecode.com:
   * Add xz and lzma compression options
   * Rename --format-options to simply --options
   * Add --same-owner for GNU tar compat
   * Add -lmd and -lcrypto to fix link
   * Documentation

Modified:
  head/usr.bin/tar/Makefile
  head/usr.bin/tar/bsdtar.1
  head/usr.bin/tar/bsdtar.c
  head/usr.bin/tar/bsdtar.h
  head/usr.bin/tar/cmdline.c
  head/usr.bin/tar/write.c

Modified: head/usr.bin/tar/Makefile
==============================================================================
--- head/usr.bin/tar/Makefile	Fri Apr 17 03:40:40 2009	(r191189)
+++ head/usr.bin/tar/Makefile	Fri Apr 17 03:45:15 2009	(r191190)
@@ -1,11 +1,11 @@
 # $FreeBSD$
 
 PROG=	bsdtar
-BSDTAR_VERSION_STRING=2.6.901a
+BSDTAR_VERSION_STRING=2.7.0
 SRCS=	bsdtar.c cmdline.c getdate.c matching.c read.c siginfo.c subst.c tree.c util.c write.c
 WARNS?=	5
 DPADD=	${LIBARCHIVE} ${LIBBZ2} ${LIBZ}
-LDADD=	-larchive -lbz2 -lz
+LDADD=	-larchive -lbz2 -lz -lmd -lcrypto
 CFLAGS+=	-DBSDTAR_VERSION_STRING=\"${BSDTAR_VERSION_STRING}\"
 CFLAGS+=	-DPLATFORM_CONFIG_H=\"config_freebsd.h\"
 CFLAGS+=	-I${.CURDIR}

Modified: head/usr.bin/tar/bsdtar.1
==============================================================================
--- head/usr.bin/tar/bsdtar.1	Fri Apr 17 03:40:40 2009	(r191189)
+++ head/usr.bin/tar/bsdtar.1	Fri Apr 17 03:45:15 2009	(r191190)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 15, 2008
+.Dd March 25, 2009
 .Dt BSDTAR 1
 .Os
 .Sh NAME
@@ -37,12 +37,12 @@
 .Nm
 .Brq Fl c
 .Op Ar options
-.Op Ar files | directories
+.Op Ar files | Ar directories
 .Nm
 .Brq Fl r | Fl u
 .Fl f Ar archive-file
 .Op Ar options
-.Op Ar files | directories
+.Op Ar files | Ar directories
 .Nm
 .Brq Fl t | Fl x
 .Op Ar options
@@ -305,6 +305,64 @@ A synonym for
 .It Fl -one-file-system
 (c, r, and u modes)
 Do not cross mount points.
+.It Fl -options Ar options
+Select optional behaviors for particular modules.
+The argument is a text string containing comma-separated
+keywords and values.
+These are passed to the modules that handle particular
+formats to control how those formats will behave.
+Each option has one of the following forms:
+.Bl -tag -compact -width indent
+.It Ar key=value
+The key will be set to the specified value in every module that supports it.
+Modules that do not support this key will ignore it.
+.It Ar key
+The key will be enabled in every module that supports it.
+This is equivalent to
+.Ar key Ns Cm =1 .
+.It Ar !key
+The key will be disabled in every module that supports it.
+.It Ar module:key=value , Ar module:key , Ar module:!key
+As above, but the corresponding key and value will be provided
+only to modules whose name matches
+.Ar module .
+.El
+The currently supported modules and keys are:
+.Bl -tag -compact -width indent
+.It Cm iso9660:joliet
+Support Joliet extensions.
+This is enabled by default, use
+.Cm !joliet
+or
+.Cm iso9660:!joliet
+to disable.
+.It Cm gzip:compression-level
+A decimal integer from 0 to 9 specifying the gzip compression level.
+.It Cm xz:compression-level
+A decimal integer from 0 to 9 specifying the xz compression level.
+.It Cm mtree: Ns Ar keyword
+The mtree writer module allows you to specify which mtree keywords
+will be included in the output.
+Supported keywords include:
+.Cm cksum , Cm device , Cm flags , Cm gid , Cm gname , Cm indent ,
+.Cm link , Cm md5 , Cm mode , Cm nlink , Cm rmd160 , Cm sha1 , Cm sha256 ,
+.Cm sha384 , Cm sha512 , Cm size , Cm time , Cm uid , Cm uname .
+The default is equivalent to:
+.Dq device, flags, gid, gname, link, mode, nlink, size, time, type, uid, uname .
+.It Cm mtree:all
+Enables all of the above keywords.
+You can also use
+.Cm mtree:!all
+to disable all keywords.
+.It Cm mtree:use-set
+Enable generation of
+.Cm /set
+lines in the output.
+.It Cm mtree:indent
+XXX need explanation XXX
+.El
+If a provided option is not supported by any module, that
+is a fatal error.
 .It Fl P
 Preserve pathnames.
 By default, absolute pathnames (those that begin with a /
@@ -555,6 +613,27 @@ switches accept a variety of common date
 .Dq 5 minutes ago ,
 and
 .Dq 19:14 PST May 1 .
+.Pp
+The
+.Fl -options
+argument can be used to control various details of archive generation
+or reading.
+For example, you can generate mtree output which only contains
+.Cm type , Cm time ,
+and
+.Cm uid
+keywords:
+.Dl Nm Fl cf Pa file.tar Fl -format=mtree Fl -options='!all,type,time,uid' Pa dir
+or you can set the compression level used by gzip or xz compression:
+.Dl Nm Fl czf Pa file.tar Fl -options='compression-level=9' .
+For more details, see the explanation of the
+.Fn archive_read_set_options
+and
+.Fn archive_write_set_options
+API calls that are described in
+.Xr archive_read 3
+and
+.Xr archive_write 3 .
 .Sh COMPATIBILITY
 The bundled-arguments format is supported for compatibility
 with historic implementations.

Modified: head/usr.bin/tar/bsdtar.c
==============================================================================
--- head/usr.bin/tar/bsdtar.c	Fri Apr 17 03:40:40 2009	(r191189)
+++ head/usr.bin/tar/bsdtar.c	Fri Apr 17 03:45:15 2009	(r191190)
@@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$");
 #ifdef __linux
 #define	_PATH_DEFTAPE "/dev/st0"
 #endif
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN__)
 #define	_PATH_DEFTAPE "\\\\.\\tape0"
 #endif
 
@@ -113,8 +113,10 @@ main(int argc, char **argv)
 	memset(bsdtar, 0, sizeof(*bsdtar));
 	bsdtar->fd = -1; /* Mark as "unused" */
 	option_o = 0;
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN__)
 	/* Make sure open() function will be used with a binary mode. */
+	/* on cygwin, we need something similar, but instead link against */
+	/* a special startup object, binmode.o */
 	_set_fmode(_O_BINARY);
 #endif
 
@@ -122,7 +124,7 @@ main(int argc, char **argv)
 	if (*argv == NULL)
 		bsdtar->progname = "bsdtar";
 	else {
-#if _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN__)
 		bsdtar->progname = strrchr(*argv, '\\');
 #else
 		bsdtar->progname = strrchr(*argv, '/');
@@ -166,10 +168,6 @@ main(int argc, char **argv)
 		bsdtar->extract_flags |= ARCHIVE_EXTRACT_XATTR;
 		bsdtar->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
 	}
-#ifdef _WIN32
-	/* Windows cannot set UNIX like uid/gid. */
-	bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_OWNER;
-#endif
 
 	bsdtar->argv = argv;
 	bsdtar->argc = argc;
@@ -212,8 +210,8 @@ main(int argc, char **argv)
 		case OPTION_FORMAT: /* GNU tar, others */
 			bsdtar->create_format = bsdtar->optarg;
 			break;
-		case OPTION_FORMAT_OPTIONS:
-			bsdtar->option_format_options = bsdtar->optarg;
+		case OPTION_OPTIONS:
+			bsdtar->option_options = bsdtar->optarg;
 			break;
 		case 'f': /* SUSv2 */
 			bsdtar->filename = bsdtar->optarg;
@@ -269,6 +267,19 @@ main(int argc, char **argv)
 			usage(bsdtar);
 #endif
 			break;
+		case 'J': /* GNU tar 1.21 and later */
+#if HAVE_LIBLZMA
+			if (bsdtar->create_compression != '\0')
+				bsdtar_errc(bsdtar, 1, 0,
+				    "Can't specify both -%c and -%c", opt,
+				    bsdtar->create_compression);
+			bsdtar->create_compression = opt;
+#else
+			bsdtar_warnc(bsdtar, 0,
+			    "xz compression not supported by this version of bsdtar");
+			usage(bsdtar);
+#endif
+			break;
 		case 'k': /* GNU tar */
 			bsdtar->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE;
 			break;
@@ -282,6 +293,19 @@ main(int argc, char **argv)
 			/* GNU tar 1.13  used -l for --one-file-system */
 			bsdtar->option_warn_links = 1;
 			break;
+		case OPTION_LZMA:
+#if HAVE_LIBLZMA
+			if (bsdtar->create_compression != '\0')
+				bsdtar_errc(bsdtar, 1, 0,
+				    "Can't specify both -%c and -%c", opt,
+				    bsdtar->create_compression);
+			bsdtar->create_compression = opt;
+#else
+			bsdtar_warnc(bsdtar, 0,
+			    "lzma compression not supported by this version of bsdtar");
+			usage(bsdtar);
+#endif
+			break;
 		case 'm': /* SUSv2 */
 			bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_TIME;
 			break;
@@ -392,6 +416,9 @@ main(int argc, char **argv)
 			usage(bsdtar);
 #endif
 			break;
+		case OPTION_SAME_OWNER: /* GNU tar */
+			bsdtar->extract_flags |= ARCHIVE_EXTRACT_OWNER;
+			break;
 		case OPTION_STRIP_COMPONENTS: /* GNU tar 1.15 */
 			bsdtar->strip_components = atoi(bsdtar->optarg);
 			break;
@@ -632,7 +659,7 @@ static const char *long_help_msg =
 	"  -w    Interactive\n"
 	"Create: %p -c [options] [ |  | @ | -C  ]\n"
 	"  ,   add these items to archive\n"
-	"  -z, -j  Compress archive with gzip/bzip2\n"
+	"  -z, -j, -J, --lzma  Compress archive with gzip/bzip2/xz/lzma\n"
 	"  --format {ustar|pax|cpio|shar}  Select archive format\n"
 	"  --exclude   Skip files that match pattern\n"
 	"  -C   Change to  before processing remaining files\n"

Modified: head/usr.bin/tar/bsdtar.h
==============================================================================
--- head/usr.bin/tar/bsdtar.h	Fri Apr 17 03:40:40 2009	(r191189)
+++ head/usr.bin/tar/bsdtar.h	Fri Apr 17 03:45:15 2009	(r191190)
@@ -60,7 +60,7 @@ struct bsdtar {
 	char		  option_chroot; /* --chroot */
 	char		  option_dont_traverse_mounts; /* --one-file-system */
 	char		  option_fast_read; /* --fast-read */
-	const char	 *option_format_options; /* --format-options */
+	const char	 *option_options; /* --options */
 	char		  option_honor_nodump; /* --nodump */
 	char		  option_interactive; /* -w */
 	char		  option_no_owner; /* -o */
@@ -111,10 +111,11 @@ enum {
 	OPTION_CHROOT,
 	OPTION_EXCLUDE,
 	OPTION_FORMAT,
-	OPTION_FORMAT_OPTIONS,
+	OPTION_OPTIONS,
 	OPTION_HELP,
 	OPTION_INCLUDE,
 	OPTION_KEEP_NEWER_FILES,
+	OPTION_LZMA,
 	OPTION_NEWER_CTIME,
 	OPTION_NEWER_CTIME_THAN,
 	OPTION_NEWER_MTIME,
@@ -126,6 +127,7 @@ enum {
 	OPTION_NUMERIC_OWNER,
 	OPTION_ONE_FILE_SYSTEM,
 	OPTION_POSIX,
+	OPTION_SAME_OWNER,
 	OPTION_STRIP_COMPONENTS,
 	OPTION_TOTALS,
 	OPTION_USE_COMPRESS_PROGRAM,

Modified: head/usr.bin/tar/cmdline.c
==============================================================================
--- head/usr.bin/tar/cmdline.c	Fri Apr 17 03:40:40 2009	(r191189)
+++ head/usr.bin/tar/cmdline.c	Fri Apr 17 03:45:15 2009	(r191190)
@@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
  * Short options for tar.  Please keep this sorted.
  */
 static const char *short_options
-	= "Bb:C:cf:HhI:jkLlmnOoPpqrSs:T:tUuvW:wX:xyZz";
+	= "Bb:C:cf:HhI:JjkLlmnOoPpqrSs:T:tUuvW:wX:xyZz";
 
 /*
  * Long options for tar.  Please keep this list sorted.
@@ -83,7 +83,7 @@ static struct option {
 	{ "file",                 1, 'f' },
 	{ "files-from",           1, 'T' },
 	{ "format",               1, OPTION_FORMAT },
-	{ "format-options",       1, OPTION_FORMAT_OPTIONS },
+	{ "options",              1, OPTION_OPTIONS },
 	{ "gunzip",               0, 'z' },
 	{ "gzip",                 0, 'z' },
 	{ "help",                 0, OPTION_HELP },
@@ -93,6 +93,7 @@ static struct option {
 	{ "keep-newer-files",     0, OPTION_KEEP_NEWER_FILES },
 	{ "keep-old-files",       0, 'k' },
 	{ "list",                 0, 't' },
+	{ "lzma",                 0, OPTION_LZMA },
 	{ "modification-time",    0, 'm' },
 	{ "newer",		  1, OPTION_NEWER_CTIME },
 	{ "newer-ctime",	  1, OPTION_NEWER_CTIME },
@@ -111,6 +112,7 @@ static struct option {
 	{ "posix",		  0, OPTION_POSIX },
 	{ "preserve-permissions", 0, 'p' },
 	{ "read-full-blocks",	  0, 'B' },
+	{ "same-owner",	          0, OPTION_SAME_OWNER },
 	{ "same-permissions",     0, 'p' },
 	{ "strip-components",	  1, OPTION_STRIP_COMPONENTS },
 	{ "to-stdout",            0, 'O' },
@@ -122,6 +124,7 @@ static struct option {
 	{ "use-compress-program", 1, OPTION_USE_COMPRESS_PROGRAM },
 	{ "verbose",              0, 'v' },
 	{ "version",              0, OPTION_VERSION },
+	{ "xz",                   0, 'J' },
 	{ NULL, 0, 0 }
 };
 

Modified: head/usr.bin/tar/write.c
==============================================================================
--- head/usr.bin/tar/write.c	Fri Apr 17 03:40:40 2009	(r191189)
+++ head/usr.bin/tar/write.c	Fri Apr 17 03:45:15 2009	(r191190)
@@ -189,6 +189,14 @@ tar_mode_c(struct bsdtar *bsdtar)
 			archive_write_set_compression_bzip2(a);
 			break;
 #endif
+#ifdef HAVE_LIBLZMA
+		case 'J':
+			archive_write_set_compression_xz(a);
+			break;
+		case OPTION_LZMA:
+			archive_write_set_compression_lzma(a);
+			break;
+#endif
 #ifdef HAVE_LIBZ
 		case 'z':
 			archive_write_set_compression_gzip(a);
@@ -204,16 +212,10 @@ tar_mode_c(struct bsdtar *bsdtar)
 		}
 	}
 
-	r = archive_write_open_file(a, bsdtar->filename);
-	if (r != ARCHIVE_OK)
+	if (ARCHIVE_OK != archive_write_set_options(a, bsdtar->option_options))
+		bsdtar_errc(bsdtar, 1, 0, archive_error_string(a));
+	if (ARCHIVE_OK != archive_write_open_file(a, bsdtar->filename))
 		bsdtar_errc(bsdtar, 1, 0, archive_error_string(a));
-
-	if (bsdtar->option_format_options != NULL) {
-		r = archive_write_set_options(a, bsdtar->option_format_options);
-		if (r != ARCHIVE_OK)
-			bsdtar_errc(bsdtar, 1, 0, archive_error_string(a));
-	}
-
 	write_archive(a, bsdtar);
 }
 
@@ -299,12 +301,10 @@ tar_mode_r(struct bsdtar *bsdtar)
 		archive_write_set_format(a, format);
 	}
 	lseek(bsdtar->fd, end_offset, SEEK_SET); /* XXX check return val XXX */
-	archive_write_open_fd(a, bsdtar->fd); /* XXX check return val XXX */
-	if (bsdtar->option_format_options != NULL) {
-		r = archive_write_set_options(a, bsdtar->option_format_options);
-		if (r != ARCHIVE_OK)
-			bsdtar_errc(bsdtar, 1, 0, archive_error_string(a));
-	}
+	if (ARCHIVE_OK != archive_write_set_options(a, bsdtar->option_options))
+		bsdtar_errc(bsdtar, 1, 0, archive_error_string(a));
+	if (ARCHIVE_OK != archive_write_open_fd(a, bsdtar->fd))
+		bsdtar_errc(bsdtar, 1, 0, archive_error_string(a));
 
 	write_archive(a, bsdtar); /* XXX check return val XXX */
 
@@ -321,7 +321,6 @@ tar_mode_u(struct bsdtar *bsdtar)
 	int			 format;
 	struct archive_dir_entry	*p;
 	struct archive_dir	 archive_dir;
-	int			 r;
 
 	bsdtar->archive_dir = &archive_dir;
 	memset(&archive_dir, 0, sizeof(archive_dir));
@@ -385,12 +384,10 @@ tar_mode_u(struct bsdtar *bsdtar)
 		archive_write_set_bytes_per_block(a, DEFAULT_BYTES_PER_BLOCK);
 	lseek(bsdtar->fd, end_offset, SEEK_SET);
 	ftruncate(bsdtar->fd, end_offset);
-	archive_write_open_fd(a, bsdtar->fd);
-	if (bsdtar->option_format_options != NULL) {
-		r = archive_write_set_options(a, bsdtar->option_format_options);
-		if (r != ARCHIVE_OK)
-			bsdtar_errc(bsdtar, 1, 0, archive_error_string(a));
-	}
+	if (ARCHIVE_OK != archive_write_set_options(a, bsdtar->option_options))
+		bsdtar_errc(bsdtar, 1, 0, archive_error_string(a));
+	if (ARCHIVE_OK != archive_write_open_fd(a, bsdtar->fd))
+		bsdtar_errc(bsdtar, 1, 0, archive_error_string(a));
 
 	write_archive(a, bsdtar);
 
@@ -457,7 +454,7 @@ write_archive(struct archive *a, struct 
 				    arg + 1) != 0)
 					break;
 			} else
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN__)
 				write_hierarchy_win(bsdtar, a, arg,
 				    write_hierarchy);
 #else

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 04:04:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BA7721065677;
	Fri, 17 Apr 2009 04:04:57 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A7FB98FC08;
	Fri, 17 Apr 2009 04:04:57 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H44vaa007550;
	Fri, 17 Apr 2009 04:04:57 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H44vIV007538;
	Fri, 17 Apr 2009 04:04:57 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170404.n3H44vIV007538@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 04:04:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191192 - in head/usr.bin/cpio: . test
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 04:04:58 -0000

Author: kientzle
Date: Fri Apr 17 04:04:57 2009
New Revision: 191192
URL: http://svn.freebsd.org/changeset/base/191192

Log:
  Merge from libarchive.googlecode.com:
   * Lots of new tests.
   * New -n / --numeric-uid-gid option
   * More sanity-checking of arguments
   * Various Windows portability improvements
   * Sync up version number to 2.7.0

Modified:
  head/usr.bin/cpio/Makefile
  head/usr.bin/cpio/bsdcpio.1
  head/usr.bin/cpio/cmdline.c
  head/usr.bin/cpio/cpio.c
  head/usr.bin/cpio/cpio.h
  head/usr.bin/cpio/cpio_platform.h
  head/usr.bin/cpio/pathmatch.c
  head/usr.bin/cpio/pathmatch.h
  head/usr.bin/cpio/test/main.c
  head/usr.bin/cpio/test/test.h
  head/usr.bin/cpio/test/test_0.c
  head/usr.bin/cpio/test/test_basic.c
  head/usr.bin/cpio/test/test_format_newc.c
  head/usr.bin/cpio/test/test_gcpio_compat.c
  head/usr.bin/cpio/test/test_option_a.c
  head/usr.bin/cpio/test/test_option_c.c
  head/usr.bin/cpio/test/test_option_d.c
  head/usr.bin/cpio/test/test_option_f.c
  head/usr.bin/cpio/test/test_option_m.c
  head/usr.bin/cpio/test/test_option_t.c
  head/usr.bin/cpio/test/test_option_u.c
  head/usr.bin/cpio/test/test_option_version.c
  head/usr.bin/cpio/test/test_option_y.c
  head/usr.bin/cpio/test/test_option_z.c
  head/usr.bin/cpio/test/test_owner_parse.c
  head/usr.bin/cpio/test/test_passthrough_dotdot.c
  head/usr.bin/cpio/test/test_passthrough_reverse.c
  head/usr.bin/cpio/test/test_pathmatch.c

Modified: head/usr.bin/cpio/Makefile
==============================================================================
--- head/usr.bin/cpio/Makefile	Fri Apr 17 03:49:26 2009	(r191191)
+++ head/usr.bin/cpio/Makefile	Fri Apr 17 04:04:57 2009	(r191192)
@@ -3,13 +3,13 @@
 .include 
 
 PROG=	bsdcpio
-BSDCPIO_VERSION_STRING=1.1.0
+BSDCPIO_VERSION_STRING=2.7.0
 SRCS=	cpio.c cmdline.c err.c matching.c pathmatch.c
 WARNS?=	6
 DPADD=	${LIBARCHIVE} ${LIBZ} ${LIBBZ2}
 CFLAGS+= -DBSDCPIO_VERSION_STRING=\"${BSDCPIO_VERSION_STRING}\"
 CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\"
-LDADD+=	-larchive -lz -lbz2
+LDADD+=	-larchive -lz -lbz2 -lmd -lcrypto
 
 .if ${MK_GNU_CPIO} != "yes"
 SYMLINKS=bsdcpio ${BINDIR}/cpio

Modified: head/usr.bin/cpio/bsdcpio.1
==============================================================================
--- head/usr.bin/cpio/bsdcpio.1	Fri Apr 17 03:49:26 2009	(r191191)
+++ head/usr.bin/cpio/bsdcpio.1	Fri Apr 17 04:04:57 2009	(r191192)
@@ -167,6 +167,15 @@ instead of copying.
 (i and p modes)
 Set file modification time on created files to match
 those in the source.
+.It Fl n
+(i mode, only with
+.Fl t )
+Display numeric uid and gid.
+By default,
+.Nm
+displays the user and group names when they are provided in the
+archive, or looks up the user and group names in the system
+password database.
 .It Fl O Ar file
 Write archive to
 .Ar file .

Modified: head/usr.bin/cpio/cmdline.c
==============================================================================
--- head/usr.bin/cpio/cmdline.c	Fri Apr 17 03:49:26 2009	(r191191)
+++ head/usr.bin/cpio/cmdline.c	Fri Apr 17 04:04:57 2009	(r191192)
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
 /*
  * Short options for cpio.  Please keep this sorted.
  */
-static const char *short_options = "0AaBC:F:O:cdE:f:H:hijLlmopR:rtuvW:yZz";
+static const char *short_options = "0AaBC:F:O:cdE:f:H:hijLlmnopR:rtuvW:yZz";
 
 /*
  * Long options for cpio.  Please keep this sorted.
@@ -71,6 +71,7 @@ static const struct option {
 	{ "make-directories",		0, 'd' },
 	{ "no-preserve-owner",		0, OPTION_NO_PRESERVE_OWNER },
 	{ "null",			0, '0' },
+	{ "numeric-uid-gid",		0, 'n' },
 	{ "owner",			1, 'R' },
 	{ "pass-through",		0, 'p' },
 	{ "preserve-modification-time", 0, 'm' },

Modified: head/usr.bin/cpio/cpio.c
==============================================================================
--- head/usr.bin/cpio/cpio.c	Fri Apr 17 03:49:26 2009	(r191191)
+++ head/usr.bin/cpio/cpio.c	Fri Apr 17 04:04:57 2009	(r191192)
@@ -32,9 +32,15 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef HAVE_SYS_MKDEV_H
+#include 
+#endif
 #ifdef HAVE_SYS_STAT_H
 #include 
 #endif
+#ifdef HAVE_SYS_TIME_H
+#include 
+#endif
 #ifdef HAVE_ERRNO_H
 #include 
 #endif
@@ -60,6 +66,12 @@ __FBSDID("$FreeBSD$");
 #ifdef HAVE_UNISTD_H
 #include 
 #endif
+#ifdef HAVE_SYS_TIME_H
+#include 
+#endif
+#ifdef HAVE_TIME_H
+#include 
+#endif
 
 #include "cpio.h"
 #include "matching.h"
@@ -94,7 +106,7 @@ static void	mode_in(struct cpio *);
 static void	mode_list(struct cpio *);
 static void	mode_out(struct cpio *);
 static void	mode_pass(struct cpio *, const char *);
-static void	restore_time(struct cpio *, struct archive_entry *,
+static int	restore_time(struct cpio *, struct archive_entry *,
 		    const char *, int fd);
 static void	usage(void);
 static void	version(void);
@@ -112,12 +124,22 @@ main(int argc, char *argv[])
 	memset(cpio, 0, sizeof(*cpio));
 	cpio->buff = buff;
 	cpio->buff_size = sizeof(buff);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+	/* Make sure open() function will be used with a binary mode. */
+	/* on cygwin, we need something similar, but instead link against */
+	/* a special startup object, binmode.o */
+	_set_fmode(_O_BINARY);
+#endif
 
 	/* Need cpio_progname before calling cpio_warnc. */
 	if (*argv == NULL)
 		cpio_progname = "bsdcpio";
 	else {
+#if defined(_WIN32) && !defined(__CYGWIN__)
+		cpio_progname = strrchr(*argv, '\\');
+#else
 		cpio_progname = strrchr(*argv, '/');
+#endif
 		if (cpio_progname != NULL)
 			cpio_progname++;
 		else
@@ -132,8 +154,6 @@ main(int argc, char *argv[])
 	cpio->mode = '\0';
 	cpio->verbose = 0;
 	cpio->compress = '\0';
-	/* TODO: Implement old binary format in libarchive, use that here. */
-	cpio->format = "odc"; /* Default format */
 	cpio->extract_flags = ARCHIVE_EXTRACT_NO_AUTODIR;
 	cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER;
 	cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS;
@@ -141,7 +161,11 @@ main(int argc, char *argv[])
 	cpio->extract_flags |= ARCHIVE_EXTRACT_PERM;
 	cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
 	cpio->extract_flags |= ARCHIVE_EXTRACT_ACL;
+#if defined(_WIN32) || defined(__CYGWIN__)
+	if (bsdcpio_is_privileged())
+#else
 	if (geteuid() == 0)
+#endif
 		cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER;
 	cpio->bytes_per_block = 512;
 	cpio->filename = NULL;
@@ -190,6 +214,9 @@ main(int argc, char *argv[])
 			cpio->filename = cpio->optarg;
 			break;
 		case 'i': /* POSIX 1997 */
+			if (cpio->mode != '\0')
+				cpio_errc(1, 0,
+				    "Cannot use both -i and -%c", cpio->mode);
 			cpio->mode = opt;
 			break;
 		case OPTION_INSECURE:
@@ -205,6 +232,9 @@ main(int argc, char *argv[])
 		case 'm': /* POSIX 1997 */
 			cpio->extract_flags |= ARCHIVE_EXTRACT_TIME;
 			break;
+		case 'n': /* GNU cpio */
+			cpio->option_numeric_uid_gid = 1;
+			break;
 		case OPTION_NO_PRESERVE_OWNER: /* GNU cpio */
 			cpio->extract_flags &= ~ARCHIVE_EXTRACT_OWNER;
 			break;
@@ -212,9 +242,15 @@ main(int argc, char *argv[])
 			cpio->filename = cpio->optarg;
 			break;
 		case 'o': /* POSIX 1997 */
+			if (cpio->mode != '\0')
+				cpio_errc(1, 0,
+				    "Cannot use both -o and -%c", cpio->mode);
 			cpio->mode = opt;
 			break;
 		case 'p': /* POSIX 1997 */
+			if (cpio->mode != '\0')
+				cpio_errc(1, 0,
+				    "Cannot use both -p and -%c", cpio->mode);
 			cpio->mode = opt;
 			cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
 			break;
@@ -254,23 +290,56 @@ main(int argc, char *argv[])
 			break;
 #endif
 		case 'y': /* tar convention */
+#if HAVE_LIBBZ2
 			cpio->compress = opt;
+#else
+			cpio_warnc(0, "bzip2 compression not supported by "
+			    "this version of bsdcpio");
+#endif
 			break;
 		case 'Z': /* tar convention */
 			cpio->compress = opt;
 			break;
 		case 'z': /* tar convention */
+#if HAVE_LIBZ
 			cpio->compress = opt;
+#else
+			cpio_warnc(0, "gzip compression not supported by "
+			    "this version of bsdcpio");
+#endif
 			break;
 		default:
 			usage();
 		}
 	}
 
-	/* TODO: Sanity-check args, error out on nonsensical combinations. */
+	/*
+	 * Sanity-check args, error out on nonsensical combinations.
+	 */
+	/* -t implies -i if no mode was specified. */
+	if (cpio->option_list && cpio->mode == '\0')
+		cpio->mode = 'i';
+	/* -t requires -i */
+	if (cpio->option_list && cpio->mode != 'i')
+		cpio_errc(1, 0, "Option -t requires -i", cpio->mode);
+	/* -n requires -it */
+	if (cpio->option_numeric_uid_gid && !cpio->option_list)
+		cpio_errc(1, 0, "Option -n requires -it");
+	/* Can only specify format when writing */
+	if (cpio->format != NULL && cpio->mode != 'o')
+		cpio_errc(1, 0, "Option --format requires -o");
+	/* -l requires -p */
+	if (cpio->option_link && cpio->mode != 'p')
+		cpio_errc(1, 0, "Option -l requires -p");
+	/* TODO: Flag other nonsensical combinations. */
 
 	switch (cpio->mode) {
 	case 'o':
+		/* TODO: Implement old binary format in libarchive,
+		   use that here. */
+		if (cpio->format == NULL)
+			cpio->format = "odc"; /* Default format */
+
 		mode_out(cpio);
 		break;
 	case 'i':
@@ -321,7 +390,12 @@ static const char *long_help_msg =
 	"Common Options:\n"
 	"  -v    Verbose\n"
 	"Create: %p -o [options]  < [list of files] > [archive]\n"
-	"  -z, -y  Compress archive with gzip/bzip2\n"
+#ifdef HAVE_BZLIB_H
+	"  -y  Compress archive with bzip2\n"
+#endif
+#ifdef HAVE_ZLIB_H
+	"  -z  Compress archive with gzip\n"
+#endif
 	"  --format {odc|newc|ustar}  Select archive format\n"
 	"List: %p -it < [archive]\n"
 	"Extract: %p -i [options] < [archive]\n";
@@ -387,12 +461,16 @@ mode_out(struct cpio *cpio)
 	if (cpio->archive == NULL)
 		cpio_errc(1, 0, "Failed to allocate archive object");
 	switch (cpio->compress) {
+#ifdef HAVE_BZLIB_H
 	case 'j': case 'y':
 		archive_write_set_compression_bzip2(cpio->archive);
 		break;
+#endif
+#ifdef HAVE_ZLIB_H
 	case 'z':
 		archive_write_set_compression_gzip(cpio->archive);
 		break;
+#endif
 	case 'Z':
 		archive_write_set_compression_compress(cpio->archive);
 		break;
@@ -455,11 +533,15 @@ file_to_archive(struct cpio *cpio, const
 	struct archive_entry *entry, *spare;
 	size_t len;
 	const char *p;
+#if !defined(_WIN32) || defined(__CYGWIN__)
 	int lnklen;
+#endif
 	int r;
 
 	/*
 	 * Create an archive_entry describing the source file.
+	 *
+	 * XXX TODO: rework to use archive_read_disk_entry_from_file()
 	 */
 	entry = archive_entry_new();
 	if (entry == NULL)
@@ -483,6 +565,7 @@ file_to_archive(struct cpio *cpio, const
 		st.st_gid = cpio->uid_override;
 	archive_entry_copy_stat(entry, &st);
 
+#if !defined(_WIN32) || defined(__CYGWIN__)
 	/* If its a symlink, pull the target. */
 	if (S_ISLNK(st.st_mode)) {
 		lnklen = readlink(srcpath, cpio->buff, cpio->buff_size);
@@ -495,6 +578,7 @@ file_to_archive(struct cpio *cpio, const
 		cpio->buff[lnklen] = 0;
 		archive_entry_set_symlink(entry, cpio->buff);
 	}
+#endif
 
 	/*
 	 * Generate a destination path for this entry.
@@ -625,7 +709,7 @@ entry_to_archive(struct cpio *cpio, stru
 	if (r != ARCHIVE_OK)
 		cpio_warnc(archive_errno(cpio->archive),
 		    "%s: %s",
-		    destpath,
+		    srcpath,
 		    archive_error_string(cpio->archive));
 
 	if (r == ARCHIVE_FATAL)
@@ -647,7 +731,7 @@ entry_to_archive(struct cpio *cpio, stru
 		}
 	}
 
-	restore_time(cpio, entry, srcpath, fd);
+	fd = restore_time(cpio, entry, srcpath, fd);
 
 cleanup:
 	if (cpio->verbose)
@@ -657,7 +741,7 @@ cleanup:
 	return (0);
 }
 
-static void
+static int
 restore_time(struct cpio *cpio, struct archive_entry *entry,
     const char *name, int fd)
 {
@@ -667,17 +751,20 @@ restore_time(struct cpio *cpio, struct a
 	(void)cpio; /* UNUSED */
 	(void)entry; /* UNUSED */
 	(void)name; /* UNUSED */
-	(void)fd; /* UNUSED */
 
 	if (!warned)
 		cpio_warnc(0, "Can't restore access times on this platform");
 	warned = 1;
-	return;
+	return (fd);
+#else
+#if defined(_WIN32) && !defined(__CYGWIN__)
+	struct __timeval times[2];
 #else
 	struct timeval times[2];
+#endif
 
 	if (!cpio->option_atime_restore)
-		return;
+		return (fd);
 
         times[1].tv_sec = archive_entry_mtime(entry);
         times[1].tv_usec = archive_entry_mtime_nsec(entry) / 1000;
@@ -687,8 +774,16 @@ restore_time(struct cpio *cpio, struct a
 
 #ifdef HAVE_FUTIMES
         if (fd >= 0 && futimes(fd, times) == 0)
-		return;
+		return (fd);
 #endif
+	/*
+	 * Some platform cannot restore access times if the file descriptor
+	 * is still opened.
+	 */
+	if (fd >= 0) {
+		close(fd);
+		fd = -1;
+	}
 
 #ifdef HAVE_LUTIMES
         if (lutimes(name, times) != 0)
@@ -697,6 +792,7 @@ restore_time(struct cpio *cpio, struct a
 #endif
                 cpio_warnc(errno, "Can't update time for %s", name);
 #endif
+	return (fd);
 }
 
 
@@ -858,6 +954,7 @@ list_item_verbose(struct cpio *cpio, str
 {
 	char			 size[32];
 	char			 date[32];
+	char			 uids[16], gids[16];
 	const char 		*uname, *gname;
 	FILE			*out = stdout;
 	const struct stat	*st;
@@ -870,15 +967,24 @@ list_item_verbose(struct cpio *cpio, str
 	if (!now)
 		time(&now);
 
-	/* Use uname if it's present, else uid. */
-	uname = archive_entry_uname(entry);
-	if (uname == NULL)
-		uname = lookup_uname(cpio, archive_entry_uid(entry));
-
-	/* Use gname if it's present, else gid. */
-	gname = archive_entry_gname(entry);
-	if (gname == NULL)
-		gname = lookup_gname(cpio, archive_entry_gid(entry));
+	if (cpio->option_numeric_uid_gid) {
+		/* Format numeric uid/gid for display. */
+		snprintf(uids, sizeof(uids), "%jd",
+		    (intmax_t)archive_entry_uid(entry));
+		uname = uids;
+		snprintf(gids, sizeof(gids), "%jd",
+		    (intmax_t)archive_entry_gid(entry));
+		gname = gids;
+	} else {
+		/* Use uname if it's present, else lookup name from uid. */
+		uname = archive_entry_uname(entry);
+		if (uname == NULL)
+			uname = lookup_uname(cpio, archive_entry_uid(entry));
+		/* Use gname if it's present, else lookup name from gid. */
+		gname = archive_entry_gname(entry);
+		if (gname == NULL)
+			gname = lookup_gname(cpio, archive_entry_gid(entry));
+	}
 
 	/* Print device number or file size. */
 	if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) {
@@ -892,10 +998,18 @@ list_item_verbose(struct cpio *cpio, str
 
 	/* Format the time using 'ls -l' conventions. */
 	tim = (time_t)st->st_mtime;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+	/* Windows' strftime function does not support %e format. */
+	if (abs(tim - now) > (365/2)*86400)
+		fmt = cpio->day_first ? "%d %b  %Y" : "%b %d  %Y";
+	else
+		fmt = cpio->day_first ? "%d %b %H:%M" : "%b %d %H:%M";
+#else
 	if (abs(tim - now) > (365/2)*86400)
 		fmt = cpio->day_first ? "%e %b  %Y" : "%b %e  %Y";
 	else
 		fmt = cpio->day_first ? "%e %b %H:%M" : "%b %e %H:%M";
+#endif
 	strftime(date, sizeof(date), fmt, localtime(&tim));
 
 	fprintf(out, "%s%3d %-8s %-8s %8s %12s %s",

Modified: head/usr.bin/cpio/cpio.h
==============================================================================
--- head/usr.bin/cpio/cpio.h	Fri Apr 17 03:49:26 2009	(r191191)
+++ head/usr.bin/cpio/cpio.h	Fri Apr 17 04:04:57 2009	(r191192)
@@ -62,6 +62,7 @@ struct cpio {
 	int		  option_follow_links; /* -L */
 	int		  option_link; /* -l */
 	int		  option_list; /* -t */
+	int		  option_numeric_uid_gid; /* -n */
 	int		  option_rename; /* -r */
 	char		 *destdir;
 	size_t		  pass_destpath_alloc;

Modified: head/usr.bin/cpio/cpio_platform.h
==============================================================================
--- head/usr.bin/cpio/cpio_platform.h	Fri Apr 17 03:49:26 2009	(r191191)
+++ head/usr.bin/cpio/cpio_platform.h	Fri Apr 17 04:04:57 2009	(r191192)
@@ -39,7 +39,7 @@
 #include PLATFORM_CONFIG_H
 #elif defined(HAVE_CONFIG_H)
 /* Most POSIX platforms use the 'configure' script to build config.h */
-#include "../config.h"
+#include "config.h"
 #else
 /* Warn if cpio hasn't been (automatically or manually) configured. */
 #error Oops: No config.h and no built-in configuration in cpio_platform.h.
@@ -48,7 +48,7 @@
 /* No non-FreeBSD platform will have __FBSDID, so just define it here. */
 #ifdef __FreeBSD__
 #include   /* For __FBSDID */
-#else
+#elif !defined(__FBSDID)
 /* Just leaving this macro replacement empty leads to a dangling semicolon. */
 #define	__FBSDID(a)     struct _undefined_hack
 #endif
@@ -89,4 +89,10 @@
 #define __LA_DEAD
 #endif
 
+#if defined(__CYGWIN__)
+#include "cpio_cygwin.h"
+#elif defined(_WIN32)	/* && !__CYGWIN__ */
+#include "cpio_windows.h"
+#endif
+
 #endif /* !CPIO_PLATFORM_H_INCLUDED */

Modified: head/usr.bin/cpio/pathmatch.c
==============================================================================
--- head/usr.bin/cpio/pathmatch.c	Fri Apr 17 03:49:26 2009	(r191191)
+++ head/usr.bin/cpio/pathmatch.c	Fri Apr 17 04:04:57 2009	(r191192)
@@ -101,11 +101,10 @@ pm_list(const char *start, const char *e
  */
 static const char *
 pm_slashskip(const char *s) {
-	while (*s == '.' || *s == '/') {
-		if (s[0] != '/' && s[1] != '/')
-			break;
+	while ((*s == '/')
+	    || (s[0] == '.' && s[1] == '/')
+	    || (s[0] == '.' && s[1] == '\0'))
 		++s;
-	}
 	return (s);
 }
 
@@ -130,8 +129,6 @@ pm(const char *p, const char *s, int fla
 					return (1);
 				/* "dir" == "dir/" == "dir/." */
 				s = pm_slashskip(s);
-				if (s[0] == '.' && s[1] == '\0')
-					return (1);
 			}
 			return (*s == '\0');
 			break;
@@ -176,19 +173,6 @@ pm(const char *p, const char *s, int fla
 				if (*p != *s)
 					return (0);
 			break;
-		default:
-			if (*p == *s)
-				break;
-			if ((*s == '\0') && (*p == '/')) {
-				p = pm_slashskip(p);
-				if (*p == '\0')
-					return (1);
-				if (p[0] == '.' && p[1] == '\0')
-					return (1);
-				return (0);
-			}
-			return (0);
-			break;
 		case '\\':
 			/* Trailing '\\' matches itself. */
 			if (p[1] == '\0') {
@@ -200,19 +184,34 @@ pm(const char *p, const char *s, int fla
 					return (0);
 			}
 			break;
-		}
-		/*
-		 * TODO: pattern of "\/\.\/" should not match plain "/",
-		 * it should only match explicit "/./".
-		 */
-		if (*p == '/')
+		case '/':
+			if (*s != '/' && *s != '\0')
+				return (0);
+			/* Note: pattern "/\./" won't match "/";
+			 * pm_slashskip() correctly stops at backslash. */
 			p = pm_slashskip(p);
-		else
-			++p;
-		if (*s == '/')
 			s = pm_slashskip(s);
-		else
-			++s;
+			if (*p == '\0' && (flags & PATHMATCH_NO_ANCHOR_END))
+				return (1);
+			--p; /* Counteract the increment below. */
+			--s;
+			break;
+		case '$':
+			/* '$' is special only at end of pattern and only
+			 * if PATHMATCH_NO_ANCHOR_END is specified. */
+			if (p[1] == '\0' && (flags & PATHMATCH_NO_ANCHOR_END)){
+				/* "dir" == "dir/" == "dir/." */
+				return (*pm_slashskip(s) == '\0');
+			}
+			/* Otherwise, '$' is not special. */
+			/* FALL THROUGH */
+		default:
+			if (*p != *s)
+				return (0);
+			break;
+		}
+		++p;
+		++s;
 	}
 }
 
@@ -236,9 +235,9 @@ pathmatch(const char *p, const char *s, 
 
 	/* If start is unanchored, try to match start of each path element. */
 	if (flags & PATHMATCH_NO_ANCHOR_START) {
-		for ( ; p != NULL; p = strchr(p, '/')) {
-			if (*p == '/')
-				p++;
+		for ( ; s != NULL; s = strchr(s, '/')) {
+			if (*s == '/')
+				s++;
 			if (pm(p, s, flags))
 				return (1);
 		}

Modified: head/usr.bin/cpio/pathmatch.h
==============================================================================
--- head/usr.bin/cpio/pathmatch.h	Fri Apr 17 03:49:26 2009	(r191191)
+++ head/usr.bin/cpio/pathmatch.h	Fri Apr 17 04:04:57 2009	(r191192)
@@ -29,9 +29,14 @@
 #ifndef PATHMATCH_H
 #define PATHMATCH_H
 
+/* Don't anchor at beginning unless the pattern starts with "^" */
 #define PATHMATCH_NO_ANCHOR_START	1
+/* Don't anchor at end unless the pattern ends with "$" */
 #define PATHMATCH_NO_ANCHOR_END	2
 
+/* Note that "^" and "$" are not special unless you set the corresponding
+ * flag above. */
+
 int pathmatch(const char *p, const char *s, int flags);
 
 #endif

Modified: head/usr.bin/cpio/test/main.c
==============================================================================
--- head/usr.bin/cpio/test/main.c	Fri Apr 17 03:49:26 2009	(r191191)
+++ head/usr.bin/cpio/test/main.c	Fri Apr 17 04:04:57 2009	(r191192)
@@ -44,6 +44,7 @@
 #undef	EXTRA_DUMP	     /* How to dump extra data */
 /* How to generate extra version info. */
 #define	EXTRA_VERSION    (systemf("%s --version", testprog) ? "" : "")
+#define KNOWNREF	"test_option_f.cpio.uu"
 __FBSDID("$FreeBSD$");
 
 /*
@@ -80,7 +81,7 @@ static int skips = 0;
 static int assertions = 0;
 
 /* Directory where uuencoded reference files can be found. */
-static char *refdir;
+static const char *refdir;
 
 /*
  * My own implementation of the standard assert() macro emits the
@@ -324,10 +325,10 @@ test_assert_equal_string(const char *fil
 	    file, line);
 	fprintf(stderr, "      %s = ", e1);
 	strdump(v1);
-	fprintf(stderr, " (length %d)\n", v1 == NULL ? 0 : strlen(v1));
+	fprintf(stderr, " (length %d)\n", v1 == NULL ? 0 : (int)strlen(v1));
 	fprintf(stderr, "      %s = ", e2);
 	strdump(v2);
-	fprintf(stderr, " (length %d)\n", v2 == NULL ? 0 : strlen(v2));
+	fprintf(stderr, " (length %d)\n", v2 == NULL ? 0 : (int)strlen(v2));
 	report_failure(extra);
 	return (0);
 }
@@ -402,7 +403,7 @@ hexdump(const char *p, const char *ref, 
 	char sep;
 
 	for(i=0; i < l; i+=16) {
-		fprintf(stderr, "%04x", i + offset);
+		fprintf(stderr, "%04x", (unsigned)(i + offset));
 		sep = ' ';
 		for (j = 0; j < 16 && i + j < l; j++) {
 			if (ref != NULL && p[i + j] != ref[i + j])
@@ -497,6 +498,7 @@ test_assert_empty_file(const char *f1fmt
 		s = sizeof(buff) < st.st_size ? sizeof(buff) : st.st_size;
 		s = read(fd, buff, s);
 		hexdump(buff, NULL, s, 0);
+		close(fd);
 	}
 	report_failure(NULL);
 	return (0);
@@ -525,11 +527,16 @@ test_assert_equal_file(const char *f1, c
 		n2 = read(fd2, buff2, sizeof(buff2));
 		if (n1 != n2)
 			break;
-		if (n1 == 0 && n2 == 0)
+		if (n1 == 0 && n2 == 0) {
+			close(fd1);
+			close(fd2);
 			return (1);
+		}
 		if (memcmp(buff1, buff2, n1) != 0)
 			break;
 	}
+	close(fd1);
+	close(fd2);
 	failures ++;
 	if (!verbose && previous_failures(test_filename, test_line))
 		return (0);
@@ -600,6 +607,7 @@ test_assert_file_contents(const void *bu
 	fd = open(f, O_RDONLY);
 	contents = malloc(s * 2 + 128);
 	n = read(fd, contents, s * 2 + 128);
+	close(fd);
 	if (n == s && memcmp(buff, contents, s) == 0) {
 		free(contents);
 		return (1);
@@ -621,6 +629,60 @@ test_assert_file_contents(const void *bu
 	return (0);
 }
 
+/* assertTextFileContents() asserts the contents of a text file. */
+int
+test_assert_text_file_contents(const char *buff, const char *f)
+{
+	char *contents;
+	const char *btxt, *ftxt;
+	int fd;
+	int n, s;
+
+	fd = open(f, O_RDONLY);
+	s = strlen(buff);
+	contents = malloc(s * 2 + 128);
+	n = read(fd, contents, s * 2 + 128 -1);
+	if (n >= 0)
+		contents[n] = '\0';
+	close(fd);
+	/* Compare texts. */
+	btxt = buff;
+	ftxt = (const char *)contents;
+	while (*btxt != '\0' && *ftxt != '\0') {
+		if (*btxt == *ftxt) {
+			++btxt;
+			++ftxt;
+			continue;
+		}
+		if (btxt[0] == '\n' && ftxt[0] == '\r' && ftxt[1] == '\n') {
+			/* Pass over different new line characters. */
+			++btxt;
+			ftxt += 2;
+			continue;
+		}
+		break;
+	}
+	if (*btxt == '\0' && *ftxt == '\0') {
+		free(contents);
+		return (1);
+	}
+	failures ++;
+	if (!previous_failures(test_filename, test_line)) {
+		fprintf(stderr, "%s:%d: File contents don't match\n",
+		    test_filename, test_line);
+		fprintf(stderr, "  file=\"%s\"\n", f);
+		if (n > 0)
+			hexdump(contents, buff, n, 0);
+		else {
+			fprintf(stderr, "  File empty, contents should be:\n");
+			hexdump(buff, NULL, s, 0);
+		}
+		report_failure(test_extra);
+	}
+	free(contents);
+	return (0);
+}
+
 /*
  * Call standard system() call, but build up the command line using
  * sprintf() conventions.
@@ -750,7 +812,11 @@ static int test_run(int i, const char *t
 	/* If there were no failures, we can remove the work dir. */
 	if (failures == failures_before) {
 		if (!keep_temp_files && chdir(tmpdir) == 0) {
+#if defined(_WIN32) && !defined(__CYGWIN__)
+			systemf("rmdir /S /Q %s", tests[i].name);
+#else
 			systemf("rm -rf %s", tests[i].name);
+#endif
 		}
 	}
 	/* Return appropriate status. */
@@ -843,23 +909,94 @@ extract_reference_file(const char *name)
 }
 
 
+static char *
+get_refdir(void)
+{
+	char tried[512] = { '\0' };
+	char buff[128];
+	char *pwd, *p;
+
+	/* Get the current dir. */
+	pwd = getcwd(NULL, 0);
+	while (pwd[strlen(pwd) - 1] == '\n')
+		pwd[strlen(pwd) - 1] = '\0';
+	printf("PWD: %s\n", pwd);
+
+	/* Look for a known file. */
+	snprintf(buff, sizeof(buff), "%s", pwd);
+	p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+	if (p != NULL) goto success;
+	strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+	strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+	snprintf(buff, sizeof(buff), "%s/test", pwd);
+	p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+	if (p != NULL) goto success;
+	strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+	strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+	snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM);
+	p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+	if (p != NULL) goto success;
+	strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+	strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+	if (memcmp(pwd, "/usr/obj", 8) == 0) {
+		snprintf(buff, sizeof(buff), "%s", pwd + 8);
+		p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+		if (p != NULL) goto success;
+		strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+		strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+
+		snprintf(buff, sizeof(buff), "%s/test", pwd + 8);
+		p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+		if (p != NULL) goto success;
+		strncat(tried, buff, sizeof(tried) - strlen(tried) - 1);
+		strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1);
+	}
+
+#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
+	DebugBreak();
+#endif
+	printf("Unable to locate known reference file %s\n", KNOWNREF);
+	printf("  Checked following directories:\n%s\n", tried);
+	exit(1);
+
+success:
+	free(p);
+	free(pwd);
+	return strdup(buff);
+}
+
 int main(int argc, char **argv)
 {
 	static const int limit = sizeof(tests) / sizeof(tests[0]);
 	int i, tests_run = 0, tests_failed = 0, opt;
 	time_t now;
 	char *refdir_alloc = NULL;
-	char *progname, *p;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+	char *testprg;
+#endif
+	const char *opt_arg, *progname, *p;
 	char tmpdir[256];
 	char tmpdir_timestamp[256];
 
+	(void)argc; /* UNUSED */
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+	/* Make sure open() function will be used with a binary mode. */
+	/* on cygwin, we need something similar, but instead link against */
+	/* a special startup object, binmode.o */
+	_set_fmode(_O_BINARY);
+#endif
 	/*
 	 * Name of this program, used to build root of our temp directory
 	 * tree.
 	 */
 	progname = p = argv[0];
 	while (*p != '\0') {
-		if (*p == '/')
+		/* Support \ or / dir separators for Windows compat. */
+		if (*p == '/' || *p == '\\')
 			progname = p + 1;
 		++p;
 	}
@@ -877,39 +1014,61 @@ int main(int argc, char **argv)
 	refdir = getenv(ENVBASE "_TEST_FILES");
 
 	/*
-	 * Parse options.
+	 * Parse options, without using getopt(), which isn't available
+	 * on all platforms.
 	 */
-	while ((opt = getopt(argc, argv, "dkp:qr:v")) != -1) {
-		switch (opt) {
-		case 'd':
-			dump_on_failure = 1;
-			break;
-		case 'k':
-			keep_temp_files = 1;
+	++argv; /* Skip program name */
+	while (*argv != NULL) {
+		if (**argv != '-')
 			break;
-		case 'p':
+		p = *argv++;
+		++p; /* Skip '-' */
+		while (*p != '\0') {
+			opt = *p++;
+			opt_arg = NULL;
+			/* If 'opt' takes an argument, parse that. */
+			if (opt == 'p' || opt == 'r') {
+				if (*p != '\0')
+					opt_arg = p;
+				else if (*argv == NULL) {
+					fprintf(stderr,
+					    "Option -%c requires argument.\n",
+					    opt);
+					usage(progname);
+				} else
+					opt_arg = *argv++;
+				p = ""; /* End of this option word. */
+			}
+
+			switch (opt) {
+			case 'd':
+				dump_on_failure = 1;
+				break;
+			case 'k':
+				keep_temp_files = 1;
+				break;
+			case 'p':
 #ifdef PROGRAM
-			testprog = optarg;
+				testprog = opt_arg;
 #else
-			usage(progname);
+				usage(progname);
 #endif
-			break;
-		case 'q':
-			quiet_flag++;
-			break;
-		case 'r':
-			refdir = optarg;
-			break;
-		case 'v':
-			verbose = 1;
-			break;
-		case '?':
-		default:
-			usage(progname);
+				break;
+			case 'q':
+				quiet_flag++;
+				break;
+			case 'r':
+				refdir = opt_arg;
+				break;
+			case 'v':
+				verbose = 1;
+				break;
+			case '?':
+			default:
+				usage(progname);
+			}
 		}
 	}
-	argc -= optind;
-	argv += optind;
 
 	/*
 	 * Sanity-check that our options make sense.
@@ -918,6 +1077,18 @@ int main(int argc, char **argv)
 	if (testprog == NULL)
 		usage(progname);
 #endif
+#if defined(_WIN32) && !defined(__CYGWIN__)
+	/*
+	 * Command.exe cannot accept the command used '/' with drive
+	 * name such as c:/xxx/command.exe when use '|' pipe handling.
+	 */
+	testprg = strdup(testprog);
+	for (i = 0; testprg[i] != '\0'; i++) {
+		if (testprg[i] == '/')
+			testprg[i] = '\\';
+	}
+	testprog = testprg;
+#endif
 
 	/*
 	 * Create a temp directory for the following tests.
@@ -943,16 +1114,8 @@ int main(int argc, char **argv)
 	 * If the user didn't specify a directory for locating
 	 * reference files, use the current directory for that.
 	 */
-	if (refdir == NULL) {
-		systemf("/bin/pwd > %s/refdir", tmpdir);
-		refdir = refdir_alloc = slurpfile(NULL, "%s/refdir", tmpdir);
-		p = refdir + strlen(refdir);
-		while (p[-1] == '\n') {
-			--p;
-			*p = '\0';
-		}
-		systemf("rm %s/refdir", tmpdir);
-	}
+	if (refdir == NULL)
+		refdir = refdir_alloc = get_refdir();
 
 	/*
 	 * Banner with basic information.
@@ -971,7 +1134,7 @@ int main(int argc, char **argv)
 	/*
 	 * Run some or all of the individual tests.
 	 */
-	if (argc == 0) {
+	if (*argv == NULL) {
 		/* Default: Run all tests. */
 		for (i = 0; i < limit; i++) {
 			if (test_run(i, tmpdir))

Modified: head/usr.bin/cpio/test/test.h
==============================================================================
--- head/usr.bin/cpio/test/test.h	Fri Apr 17 03:49:26 2009	(r191191)
+++ head/usr.bin/cpio/test/test.h	Fri Apr 17 04:04:57 2009	(r191192)
@@ -33,28 +33,45 @@
  */
 #if defined(HAVE_CONFIG_H)
 /* Most POSIX platforms use the 'configure' script to build config.h */
-#include "../../config.h"
+#include "config.h"
 #elif defined(__FreeBSD__)
 /* Building as part of FreeBSD system requires a pre-built config.h. */
-#include "../config_freebsd.h"
-#elif defined(_WIN32)
+#include "config_freebsd.h"
+#elif defined(_WIN32) && !defined(__CYGWIN__)
 /* Win32 can't run the 'configure' script. */
-#include "../config_windows.h"
+#include "config_windows.h"
 #else
 /* Warn if the library hasn't been (automatically or manually) configured. */
 #error Oops: No config.h and no pre-built configuration in test.h.
 #endif
 
+#if !defined(_WIN32) || defined(__CYGWIN__)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 07:28:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4063F106564A;
	Fri, 17 Apr 2009 07:28:50 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2E7778FC15;
	Fri, 17 Apr 2009 07:28:50 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H7Sn25015415;
	Fri, 17 Apr 2009 07:28:49 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H7SnhQ015414;
	Fri, 17 Apr 2009 07:28:49 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904170728.n3H7SnhQ015414@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 07:28:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191196 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 07:28:50 -0000

Author: kientzle
Date: Fri Apr 17 07:28:49 2009
New Revision: 191196
URL: http://svn.freebsd.org/changeset/base/191196

Log:
  Disabling the crypto bits should quiet tinderbox while I
  track down the library dependencies that are screwing up the /rescue build.

Modified:
  head/lib/libarchive/config_freebsd.h

Modified: head/lib/libarchive/config_freebsd.h
==============================================================================
--- head/lib/libarchive/config_freebsd.h	Fri Apr 17 05:37:31 2009	(r191195)
+++ head/lib/libarchive/config_freebsd.h	Fri Apr 17 07:28:49 2009	(r191196)
@@ -75,30 +75,38 @@
 #define	HAVE_LIMITS_H 1
 #define	HAVE_LUTIMES 1
 #define	HAVE_MALLOC 1
+#if 0
 #define	HAVE_MD5 1
 #define	HAVE_MD5_H 1
+#endif
 #define	HAVE_MEMMOVE 1
 #define	HAVE_MEMSET 1
 #define	HAVE_MKDIR 1
 #define	HAVE_MKFIFO 1
 #define	HAVE_MKNOD 1
+#if 0
 #define	HAVE_OPENSSL_MD5_H 1
 #define	HAVE_OPENSSL_RIPEMD_H 1
 #define	HAVE_OPENSSL_SHA_H 1
+#endif
 #define	HAVE_PIPE 1
 #define	HAVE_POLL 1
 #define	HAVE_POLL_H 1
 #define	HAVE_PWD_H 1
 #define	HAVE_READLINK 1
+#if 0
 #define	HAVE_RMD160 1
+#endif
 #define	HAVE_SELECT 1
 #define	HAVE_SETENV 1
+#if 0
 #define	HAVE_SHA_H 1
 #define	HAVE_SHA1 1
 #define	HAVE_SHA256 1
 #define	HAVE_SHA256_H 1
 #define	HAVE_SHA384 1
 #define	HAVE_SHA512 1
+#endif
 #define	HAVE_SIGNAL_H 1
 #define	HAVE_STDINT_H 1
 #define	HAVE_STDLIB_H 1

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 08:01:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A09521065674;
	Fri, 17 Apr 2009 08:01:18 +0000 (UTC)
	(envelope-from kevlo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8E9698FC1C;
	Fri, 17 Apr 2009 08:01:18 +0000 (UTC)
	(envelope-from kevlo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H81IE9016112;
	Fri, 17 Apr 2009 08:01:18 GMT (envelope-from kevlo@svn.freebsd.org)
Received: (from kevlo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H81Iho016111;
	Fri, 17 Apr 2009 08:01:18 GMT (envelope-from kevlo@svn.freebsd.org)
Message-Id: <200904170801.n3H81Iho016111@svn.freebsd.org>
From: Kevin Lo 
Date: Fri, 17 Apr 2009 08:01:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191197 - head/share/misc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 08:01:19 -0000

Author: kevlo
Date: Fri Apr 17 08:01:18 2009
New Revision: 191197
URL: http://svn.freebsd.org/changeset/base/191197

Log:
  Change Taiwan, Province of China to Taiwan, Republic of China

Modified:
  head/share/misc/iso3166

Modified: head/share/misc/iso3166
==============================================================================
--- head/share/misc/iso3166	Fri Apr 17 07:28:49 2009	(r191196)
+++ head/share/misc/iso3166	Fri Apr 17 08:01:18 2009	(r191197)
@@ -230,7 +230,7 @@ SZ	SWZ	748	Swaziland
 SE	SWE	752	Sweden
 CH	CHE	756	Switzerland
 SY	SYR	760	Syrian Arab Republic
-TW	TWN	158	Taiwan, Province of China
+TW	TWN	158	Taiwan, Republic of China
 TJ	TJK	762	Tajikistan
 TZ	TZA	834	Tanzania, United Republic of
 TH	THA	764	Thailand

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 08:36:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C0965106564A;
	Fri, 17 Apr 2009 08:36:18 +0000 (UTC)
	(envelope-from juli@clockworksquid.com)
Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.171])
	by mx1.freebsd.org (Postfix) with ESMTP id 8C7C78FC13;
	Fri, 17 Apr 2009 08:36:18 +0000 (UTC)
	(envelope-from juli@clockworksquid.com)
Received: by wf-out-1314.google.com with SMTP id 24so705772wfg.7
	for ; Fri, 17 Apr 2009 01:36:18 -0700 (PDT)
MIME-Version: 1.0
Sender: juli@clockworksquid.com
Received: by 10.142.177.13 with SMTP id z13mr3227928wfe.184.1239955714059; 
	Fri, 17 Apr 2009 01:08:34 -0700 (PDT)
In-Reply-To: <200904170801.n3H81Iho016111@svn.freebsd.org>
References: <200904170801.n3H81Iho016111@svn.freebsd.org>
From: Juli Mallett 
Date: Fri, 17 Apr 2009 01:08:19 -0700
X-Google-Sender-Auth: 568dbb56c8e1c56b
Message-ID: 
To: Kevin Lo 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191197 - head/share/misc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 08:36:19 -0000

On Fri, Apr 17, 2009 at 1:01 AM, Kevin Lo  wrote:
> Log:
>  Change Taiwan, Province of China to Taiwan, Republic of China
>
> Modified:
>  head/share/misc/iso3166

Do you have a source for this change?  The ISO sites I've checked
don't support it.  For example:

http://www.iso.org/iso/iso-3166-1_decoding_table

And no obvious recent name change item on the "What's new?" page:

http://www.iso.org/iso/country_codes/check_what_s_new.htm

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 09:22:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8EADD106566B;
	Fri, 17 Apr 2009 09:22:08 +0000 (UTC)
	(envelope-from juli@clockworksquid.com)
Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.234])
	by mx1.freebsd.org (Postfix) with ESMTP id 597938FC18;
	Fri, 17 Apr 2009 09:22:08 +0000 (UTC)
	(envelope-from juli@clockworksquid.com)
Received: by rv-out-0506.google.com with SMTP id l9so775018rvb.43
	for ; Fri, 17 Apr 2009 02:22:08 -0700 (PDT)
MIME-Version: 1.0
Sender: juli@clockworksquid.com
Received: by 10.142.251.15 with SMTP id y15mr31497wfh.213.1239960128052; Fri, 
	17 Apr 2009 02:22:08 -0700 (PDT)
In-Reply-To: <1239959410.10096.0.camel@srg.kevlo.org>
References: <200904170801.n3H81Iho016111@svn.freebsd.org>
	 
	<1239959410.10096.0.camel@srg.kevlo.org>
From: Juli Mallett 
Date: Fri, 17 Apr 2009 02:21:53 -0700
X-Google-Sender-Auth: a9d0b50b2b1ddc4f
Message-ID: 
To: Kevin Lo 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191197 - head/share/misc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 09:22:09 -0000

On Fri, Apr 17, 2009 at 2:10 AM, Kevin Lo  wrote:
> Juli Mallett wrote:
>> On Fri, Apr 17, 2009 at 1:01 AM, Kevin Lo  wrote:
>> > Log:
>> >  Change Taiwan, Province of China to Taiwan, Republic of China
>> >
>> > Modified:
>> >  head/share/misc/iso3166
>>
>> Do you have a source for this change?  The ISO sites I've checked
>> don't support it.  For example:
>>
>> http://www.iso.org/iso/iso-3166-1_decoding_table
>>
>> And no obvious recent name change item on the "What's new?" page:
>>
>> http://www.iso.org/iso/country_codes/check_what_s_new.htm
>
> This is a highly political issue. You wouldn't like the US to be
> referred to as "United States, province of Britain.".

Indeed.  However politics have no place in accurate representation of
standards.  The place to create such a change is at the ISO, rather
than making FreeBSD inaccurate.  Likewise, please do not change any
standards-defined references to Mongolia to imply that it is a part of
the Republic of China unless the standard involved says it is.  If
something isn't defined by a standards body, arguments of a political
nature about the merit of the change might be relevant.  In this case,
the file's contents are to reflect ISO reality, not any other reality.

Juli.

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 09:29:37 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 79BD3106573E;
	Fri, 17 Apr 2009 09:29:37 +0000 (UTC)
	(envelope-from kevlo@FreeBSD.org)
Received: from ns.kevlo.org (kevlo.org [220.128.136.52])
	by mx1.freebsd.org (Postfix) with ESMTP id 0FA2A8FC08;
	Fri, 17 Apr 2009 09:29:36 +0000 (UTC)
	(envelope-from kevlo@FreeBSD.org)
Received: from [127.0.0.1] (kevlo@kevlo.org [220.128.136.52])
	by ns.kevlo.org (8.14.3/8.14.3) with ESMTP id n3H95fkg012977;
	Fri, 17 Apr 2009 17:05:41 +0800 (CST)
From: Kevin Lo 
To: Juli Mallett 
In-Reply-To: 
References: <200904170801.n3H81Iho016111@svn.freebsd.org>
	
Content-Type: text/plain
Date: Fri, 17 Apr 2009 17:10:10 +0800
Message-Id: <1239959410.10096.0.camel@srg.kevlo.org>
Mime-Version: 1.0
X-Mailer: Evolution 2.24.5 OpenBSD/Ports 
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r191197 - head/share/misc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 09:29:40 -0000

Juli Mallett wrote: 
> On Fri, Apr 17, 2009 at 1:01 AM, Kevin Lo  wrote:
> > Log:
> >  Change Taiwan, Province of China to Taiwan, Republic of China
> >
> > Modified:
> >  head/share/misc/iso3166
> 
> Do you have a source for this change?  The ISO sites I've checked
> don't support it.  For example:
> 
> http://www.iso.org/iso/iso-3166-1_decoding_table
> 
> And no obvious recent name change item on the "What's new?" page:
> 
> http://www.iso.org/iso/country_codes/check_what_s_new.htm

This is a highly political issue. You wouldn't like the US to be
referred to as "United States, province of Britain.".

	Kevin


From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 09:39:56 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35])
	by hub.freebsd.org (Postfix) with ESMTP id 383AC1065676
	for ; Fri, 17 Apr 2009 09:39:56 +0000 (UTC)
	(envelope-from cperciva@freebsd.org)
Received: from xps.daemonology.net (freefall.freebsd.org
	[IPv6:2001:4f8:fff6::28])
	by mx2.freebsd.org (Postfix) with SMTP id 421A714E3C5
	for ; Fri, 17 Apr 2009 09:39:55 +0000 (UTC)
	(envelope-from cperciva@freebsd.org)
Received: (qmail 4647 invoked from network); 17 Apr 2009 09:39:54 -0000
Received: from unknown (HELO xps.daemonology.net) (127.0.0.1)
	by localhost with SMTP; 17 Apr 2009 09:39:54 -0000
Message-ID: <49E84E69.5080009@freebsd.org>
Date: Fri, 17 Apr 2009 02:39:53 -0700
From: Colin Percival 
User-Agent: Thunderbird 2.0.0.21 (X11/20090405)
MIME-Version: 1.0
To: Kevin Lo 
References: <200904170801.n3H81Iho016111@svn.freebsd.org>	
	
	<1239959410.10096.0.camel@srg.kevlo.org>
In-Reply-To: <1239959410.10096.0.camel@srg.kevlo.org>
X-Enigmail-Version: 0.95.6
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: Juli Mallett , svn-src-head@FreeBSD.org,
	svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject: Re: svn commit: r191197 - head/share/misc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 09:39:56 -0000

Kevin Lo wrote:
>> On Fri, Apr 17, 2009 at 1:01 AM, Kevin Lo  wrote:
>>>  Change Taiwan, Province of China to Taiwan, Republic of China
> 
> This is a highly political issue.

It seems to me that this is exactly why FreeBSD should stick with whatever
ISO says instead of taking an independent position.  I personally happen to
agree that calling Taiwan a province of China is an exercise in ignoring
reality -- but I don't think it's a good idea for us to impose our personal
political beliefs on the project.

> You wouldn't like the US to be
> referred to as "United States, province of Britain.".

If that's what ISO decided to call it, then that's what I'd expect a file
named "iso3166" to call it.

-- 
Colin Percival
Security Officer, FreeBSD | freebsd.org | The power to serve
Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 09:42:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E46D4106564A;
	Fri, 17 Apr 2009 09:42:26 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D24868FC12;
	Fri, 17 Apr 2009 09:42:26 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H9gQuP018269;
	Fri, 17 Apr 2009 09:42:26 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H9gQjh018268;
	Fri, 17 Apr 2009 09:42:26 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200904170942.n3H9gQjh018268@svn.freebsd.org>
From: Robert Watson 
Date: Fri, 17 Apr 2009 09:42:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191198 - in head/sys: conf legacy/dev/usb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 09:42:27 -0000

Author: rwatson
Date: Fri Apr 17 09:42:26 2009
New Revision: 191198
URL: http://svn.freebsd.org/changeset/base/191198

Log:
  Remove legacy versions of USB network interface drivers relying on
  IFF_NEEDSGIANT, as that is no longer supported.

Deleted:
  head/sys/legacy/dev/usb/if_aue.c
  head/sys/legacy/dev/usb/if_auereg.h
  head/sys/legacy/dev/usb/if_axe.c
  head/sys/legacy/dev/usb/if_axereg.h
  head/sys/legacy/dev/usb/if_cdce.c
  head/sys/legacy/dev/usb/if_cdcereg.h
  head/sys/legacy/dev/usb/if_cue.c
  head/sys/legacy/dev/usb/if_cuereg.h
  head/sys/legacy/dev/usb/if_kue.c
  head/sys/legacy/dev/usb/if_kuereg.h
  head/sys/legacy/dev/usb/if_rue.c
  head/sys/legacy/dev/usb/if_ruereg.h
  head/sys/legacy/dev/usb/if_rum.c
  head/sys/legacy/dev/usb/if_rumreg.h
  head/sys/legacy/dev/usb/if_rumvar.h
  head/sys/legacy/dev/usb/if_udav.c
  head/sys/legacy/dev/usb/if_udavreg.h
  head/sys/legacy/dev/usb/if_ural.c
  head/sys/legacy/dev/usb/if_uralreg.h
  head/sys/legacy/dev/usb/if_uralvar.h
  head/sys/legacy/dev/usb/if_zyd.c
  head/sys/legacy/dev/usb/if_zydfw.h
  head/sys/legacy/dev/usb/if_zydreg.h
Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Fri Apr 17 08:01:18 2009	(r191197)
+++ head/sys/conf/files	Fri Apr 17 09:42:26 2009	(r191198)
@@ -1501,7 +1501,6 @@ legacy/dev/usb/ehci.c		optional oehci
 legacy/dev/usb/ehci_ddb.c	optional oehci
 legacy/dev/usb/ehci_pci.c	optional oehci pci
 legacy/dev/usb/hid.c		optional ousb
-legacy/dev/usb/if_aue.c		optional oaue
 legacy/dev/usb/ohci.c		optional oohci
 legacy/dev/usb/ohci_pci.c	optional oohci pci
 legacy/dev/usb/sl811hs.c	optional oslhci

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 09:48:21 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2FC7F106564A;
	Fri, 17 Apr 2009 09:48:21 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0364E8FC0A;
	Fri, 17 Apr 2009 09:48:21 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3H9mKF5018452;
	Fri, 17 Apr 2009 09:48:20 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3H9mKdE018451;
	Fri, 17 Apr 2009 09:48:20 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200904170948.n3H9mKdE018451@svn.freebsd.org>
From: Robert Watson 
Date: Fri, 17 Apr 2009 09:48:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191199 - head/sys/legacy/dev/usb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 09:48:21 -0000

Author: rwatson
Date: Fri Apr 17 09:48:20 2009
New Revision: 191199
URL: http://svn.freebsd.org/changeset/base/191199

Log:
  Remove kue_fw.h, missed in previous IFF_NEEDSGIANT USB driver garbage
  collection.

Deleted:
  head/sys/legacy/dev/usb/kue_fw.h

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 09:49:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8C7361065674;
	Fri, 17 Apr 2009 09:49:51 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 67DB28FC1A;
	Fri, 17 Apr 2009 09:49:51 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id EA20C46B09;
	Fri, 17 Apr 2009 05:49:50 -0400 (EDT)
Date: Fri, 17 Apr 2009 10:49:50 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Maxim Konovalov 
In-Reply-To: <200904161742.n3GHgPF9087361@svn.freebsd.org>
Message-ID: 
References: <200904161742.n3GHgPF9087361@svn.freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191146 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 09:49:52 -0000


On Thu, 16 Apr 2009, Maxim Konovalov wrote:

> Log:
>  o Reflect ar(4), ray(4), sr(4), raycontrol(8) removal.

Thanks!

Robert N M Watson
Computer Laboratory
University of Cambridge

>
> Modified:
>  head/ObsoleteFiles.inc
>
> Modified: head/ObsoleteFiles.inc
> ==============================================================================
> --- head/ObsoleteFiles.inc	Thu Apr 16 16:26:35 2009	(r191145)
> +++ head/ObsoleteFiles.inc	Thu Apr 16 17:42:25 2009	(r191146)
> @@ -14,6 +14,12 @@
> # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
> #
>
> +# 20090416: removal of ar(4), ray(4), sr(4), raycontrol(8)
> +OLD_FILES+=usr/sbin/raycontrol
> +OLD_FILES+=usr/share/man/man4/i386/ar.4.gz
> +OLD_FILES+=usr/share/man/man4/i386/ray.4.gz
> +OLD_FILES+=usr/share/man/man4/i386/sr.4.gz
> +OLD_FILES+=usr/share/man/man8/raycontrol.8.gz
> # 20090410: VOP_LEASE.9 removed
> OLD_FILES+=usr/share/man/man9/VOP_LEASE.9.gz
> # 20090405: removal of if_ppp(4) and if_sl(4)
>

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 11:30:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D2FAF106564A;
	Fri, 17 Apr 2009 11:30:32 +0000 (UTC)
	(envelope-from roberto@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C0A8C8FC16;
	Fri, 17 Apr 2009 11:30:32 +0000 (UTC)
	(envelope-from roberto@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HBUWNt021115;
	Fri, 17 Apr 2009 11:30:32 GMT (envelope-from roberto@svn.freebsd.org)
Received: (from roberto@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HBUWFb021114;
	Fri, 17 Apr 2009 11:30:32 GMT (envelope-from roberto@svn.freebsd.org)
Message-Id: <200904171130.n3HBUWFb021114@svn.freebsd.org>
From: Ollivier Robert 
Date: Fri, 17 Apr 2009 11:30:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191200 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 11:30:33 -0000

Author: roberto
Date: Fri Apr 17 11:30:32 2009
New Revision: 191200
URL: http://svn.freebsd.org/changeset/base/191200

Log:
  Add an entry for the French macbook keyboard layout.

Modified:
  head/usr.sbin/sysinstall/menus.c

Modified: head/usr.sbin/sysinstall/menus.c
==============================================================================
--- head/usr.sbin/sysinstall/menus.c	Fri Apr 17 09:48:20 2009	(r191199)
+++ head/usr.sbin/sysinstall/menus.c	Fri Apr 17 11:30:32 2009	(r191200)
@@ -1824,6 +1824,7 @@ DMenu MenuSysconsKeymap = {
       { " Finnish ISO",  "Finnish ISO keymap",	dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=finnish.iso" },
       { " French ISO (accent)", "French ISO keymap (accent keys)",	dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=fr.iso.acc" },
       { " French ISO",	"French ISO keymap",	dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=fr.iso" },
+      { " French ISO/Macbook",	"French ISO keymap on macbook",	dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=fr.macbook.acc" },
       { "German CP850",	"German Code Page 850 keymap",	dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=german.cp850"	},
       { " German ISO",	"German ISO keymap",	dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=german.iso" },
       { " Greek 101",	"Greek ISO keymap (101 keys)",	dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=gr.us101.acc" },

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 13:21:29 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 96819106567B;
	Fri, 17 Apr 2009 13:21:29 +0000 (UTC)
	(envelope-from remko@elvandar.org)
Received: from websrv01.jr-hosting.nl (websrv01.jr-hosting.nl [78.47.69.233])
	by mx1.freebsd.org (Postfix) with ESMTP id 4FEBA8FC13;
	Fri, 17 Apr 2009 13:21:29 +0000 (UTC)
	(envelope-from remko@elvandar.org)
Received: from a83-163-38-147.adsl.xs4all.nl ([83.163.38.147] helo=[10.0.2.66])
	by websrv01.jr-hosting.nl with esmtpsa (TLSv1:AES128-SHA:128)
	(Exim 4.69 (FreeBSD)) (envelope-from )
	id 1Luo0W-00046e-3w; Fri, 17 Apr 2009 15:21:28 +0200
Message-Id: 
From: Remko Lodder 
To: Colin Percival 
In-Reply-To: <49E84E69.5080009@freebsd.org>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v930.3)
Date: Fri, 17 Apr 2009 15:21:24 +0200
References: <200904170801.n3H81Iho016111@svn.freebsd.org>	
	
	<1239959410.10096.0.camel@srg.kevlo.org>
	<49E84E69.5080009@freebsd.org>
X-Mailer: Apple Mail (2.930.3)
Cc: Juli Mallett , Kevin Lo ,
	svn-src-all@FreeBSD.org, src-committers@FreeBSD.org,
	svn-src-head@FreeBSD.org
Subject: Re: svn commit: r191197 - head/share/misc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 13:21:30 -0000




On Apr 17, 2009, at 11:39 AM, Colin Percival wrote:

> Kevin Lo wrote:
>>> On Fri, Apr 17, 2009 at 1:01 AM, Kevin Lo  wrote:
>>>> Change Taiwan, Province of China to Taiwan, Republic of China
>> This is a highly political issue.
>
> It seems to me that this is exactly why FreeBSD should stick with  
> whatever
> ISO says instead of taking an independent position.  I personally  
> happen to
> agree that calling Taiwan a province of China is an exercise in  
> ignoring
> reality -- but I don't think it's a good idea for us to impose our  
> personal
> political beliefs on the project.


+1;

-- 
/"\   Best regards,                        | remko@FreeBSD.org
\ /   Remko Lodder                      | remko@EFnet
X    http://www.evilcoder.org/    |
/ \   ASCII Ribbon Campaign    | Against HTML Mail and News


From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 13:22:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8F9AD106578F;
	Fri, 17 Apr 2009 13:22:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7C6D18FC1A;
	Fri, 17 Apr 2009 13:22:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HDMIea023391;
	Fri, 17 Apr 2009 13:22:18 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HDMING023386;
	Fri, 17 Apr 2009 13:22:18 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200904171322.n3HDMING023386@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 17 Apr 2009 13:22:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191201 - in head/sys: amd64/amd64 arm/arm i386/i386
	ia64/ia64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 13:22:19 -0000

Author: jhb
Date: Fri Apr 17 13:22:18 2009
New Revision: 191201
URL: http://svn.freebsd.org/changeset/base/191201

Log:
  Restore bus DMA bounce pages to an offset of 0 when they are released by
  a tag that has BUS_DMA_KEEP_PG_OFFSET set.  Otherwise the page could be
  reused with a non-zero offset by a tag that doesn't have
  BUS_DMA_KEEP_PG_OFFSET leading to data corruption.
  
  Sleuthing by:	avg
  Reviewed by:	scottl

Modified:
  head/sys/amd64/amd64/busdma_machdep.c
  head/sys/arm/arm/busdma_machdep.c
  head/sys/i386/i386/busdma_machdep.c
  head/sys/ia64/ia64/busdma_machdep.c

Modified: head/sys/amd64/amd64/busdma_machdep.c
==============================================================================
--- head/sys/amd64/amd64/busdma_machdep.c	Fri Apr 17 11:30:32 2009	(r191200)
+++ head/sys/amd64/amd64/busdma_machdep.c	Fri Apr 17 13:22:18 2009	(r191201)
@@ -1137,9 +1137,7 @@ add_bounce_page(bus_dma_tag_t dmat, bus_
 	mtx_unlock(&bounce_lock);
 
 	if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) {
-		/* page offset needs to be preserved */
-		bpage->vaddr &= ~PAGE_MASK;
-		bpage->busaddr &= ~PAGE_MASK;
+		/* Page offset needs to be preserved. */
 		bpage->vaddr |= vaddr & PAGE_MASK;
 		bpage->busaddr |= vaddr & PAGE_MASK;
 	}
@@ -1158,6 +1156,15 @@ free_bounce_page(bus_dma_tag_t dmat, str
 	bz = dmat->bounce_zone;
 	bpage->datavaddr = 0;
 	bpage->datacount = 0;
+	if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) {
+		/*
+		 * Reset the bounce page to start at offset 0.  Other uses
+		 * of this bounce page may need to store a full page of
+		 * data and/or assume it starts on a page boundary.
+		 */
+		bpage->vaddr &= ~PAGE_MASK;
+		bpage->busaddr &= ~PAGE_MASK;
+	}
 
 	mtx_lock(&bounce_lock);
 	STAILQ_INSERT_HEAD(&bz->bounce_page_list, bpage, links);

Modified: head/sys/arm/arm/busdma_machdep.c
==============================================================================
--- head/sys/arm/arm/busdma_machdep.c	Fri Apr 17 11:30:32 2009	(r191200)
+++ head/sys/arm/arm/busdma_machdep.c	Fri Apr 17 13:22:18 2009	(r191201)
@@ -1427,9 +1427,7 @@ add_bounce_page(bus_dma_tag_t dmat, bus_
 	mtx_unlock(&bounce_lock);
 
 	if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) {
-		/* page offset needs to be preserved */
-		bpage->vaddr &= ~PAGE_MASK;
-		bpage->busaddr &= ~PAGE_MASK;
+		/* Page offset needs to be preserved. */
 		bpage->vaddr |= vaddr & PAGE_MASK;
 		bpage->busaddr |= vaddr & PAGE_MASK;
 	}
@@ -1448,6 +1446,15 @@ free_bounce_page(bus_dma_tag_t dmat, str
 	bz = dmat->bounce_zone;
 	bpage->datavaddr = 0;
 	bpage->datacount = 0;
+	if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) {
+		/*
+		 * Reset the bounce page to start at offset 0.  Other uses
+		 * of this bounce page may need to store a full page of
+		 * data and/or assume it starts on a page boundary.
+		 */
+		bpage->vaddr &= ~PAGE_MASK;
+		bpage->busaddr &= ~PAGE_MASK;
+	}
 
 	mtx_lock(&bounce_lock);
 	STAILQ_INSERT_HEAD(&bz->bounce_page_list, bpage, links);

Modified: head/sys/i386/i386/busdma_machdep.c
==============================================================================
--- head/sys/i386/i386/busdma_machdep.c	Fri Apr 17 11:30:32 2009	(r191200)
+++ head/sys/i386/i386/busdma_machdep.c	Fri Apr 17 13:22:18 2009	(r191201)
@@ -1155,9 +1155,7 @@ add_bounce_page(bus_dma_tag_t dmat, bus_
 	mtx_unlock(&bounce_lock);
 
 	if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) {
-		/* page offset needs to be preserved */
-		bpage->vaddr &= ~PAGE_MASK;
-		bpage->busaddr &= ~PAGE_MASK;
+		/* Page offset needs to be preserved. */
 		bpage->vaddr |= vaddr & PAGE_MASK;
 		bpage->busaddr |= vaddr & PAGE_MASK;
 	}
@@ -1176,6 +1174,15 @@ free_bounce_page(bus_dma_tag_t dmat, str
 	bz = dmat->bounce_zone;
 	bpage->datavaddr = 0;
 	bpage->datacount = 0;
+	if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) {
+		/*
+		 * Reset the bounce page to start at offset 0.  Other uses
+		 * of this bounce page may need to store a full page of
+		 * data and/or assume it starts on a page boundary.
+		 */
+		bpage->vaddr &= ~PAGE_MASK;
+		bpage->busaddr &= ~PAGE_MASK;
+	}
 
 	mtx_lock(&bounce_lock);
 	STAILQ_INSERT_HEAD(&bz->bounce_page_list, bpage, links);

Modified: head/sys/ia64/ia64/busdma_machdep.c
==============================================================================
--- head/sys/ia64/ia64/busdma_machdep.c	Fri Apr 17 11:30:32 2009	(r191200)
+++ head/sys/ia64/ia64/busdma_machdep.c	Fri Apr 17 13:22:18 2009	(r191201)
@@ -940,9 +940,7 @@ add_bounce_page(bus_dma_tag_t dmat, bus_
 	mtx_unlock(&bounce_lock);
 
 	if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) {
-		/* page offset needs to be preserved */
-		bpage->vaddr &= ~PAGE_MASK;
-		bpage->busaddr &= ~PAGE_MASK;
+		/* Page offset needs to be preserved. */
 		bpage->vaddr |= vaddr & PAGE_MASK;
 		bpage->busaddr |= vaddr & PAGE_MASK;
 	}
@@ -959,6 +957,15 @@ free_bounce_page(bus_dma_tag_t dmat, str
 
 	bpage->datavaddr = 0;
 	bpage->datacount = 0;
+	if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) {
+		/*
+		 * Reset the bounce page to start at offset 0.  Other uses
+		 * of this bounce page may need to store a full page of
+		 * data and/or assume it starts on a page boundary.
+		 */
+		bpage->vaddr &= ~PAGE_MASK;
+		bpage->busaddr &= ~PAGE_MASK;
+	}
 
 	mtx_lock(&bounce_lock);
 	STAILQ_INSERT_HEAD(&bounce_page_list, bpage, links);

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 14:06:16 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 073F9106566B;
	Fri, 17 Apr 2009 14:06:16 +0000 (UTC)
	(envelope-from rmacklem@uoguelph.ca)
Received: from gigi.cs.uoguelph.ca (gigi.cs.uoguelph.ca [131.104.94.210])
	by mx1.freebsd.org (Postfix) with ESMTP id 9E8038FC15;
	Fri, 17 Apr 2009 14:06:15 +0000 (UTC)
	(envelope-from rmacklem@uoguelph.ca)
Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102])
	by gigi.cs.uoguelph.ca (8.13.1/8.13.1) with ESMTP id n3HDtheU013309;
	Fri, 17 Apr 2009 09:55:43 -0400
Received: from localhost (rmacklem@localhost)
	by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id
	n3HE2Jv10981; Fri, 17 Apr 2009 10:02:19 -0400 (EDT)
X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing
	-bs
Date: Fri, 17 Apr 2009 10:02:19 -0400 (EDT)
From: Rick Macklem 
X-X-Sender: rmacklem@muncher.cs.uoguelph.ca
To: Andrew Thompson 
In-Reply-To: <20090417021958.GC33466@citylink.fud.org.nz>
Message-ID: 
References: <200904161626.n3GGQa8N085699@svn.freebsd.org>
	<20090417021958.GC33466@citylink.fud.org.nz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Scanned-By: MIMEDefang 2.63 on 131.104.94.210
Cc: svn-src-head@FreeBSD.org, Rick Macklem ,
	svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject: Re: svn commit: r191145 - head/sys/rpc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 14:06:16 -0000



On Thu, 16 Apr 2009, Andrew Thompson wrote:

>
> Great work and welcome. To save yourself a bit of typing, unless you
> attribute the submission/testing its implied that it came from
> yourself. :)
>
It's that multiple personality thing. I just can't keep track of who I
really am;-) (Next time, I'll read the comment w.r.t. what the entries
are for.)

rick


From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 14:19:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 77ABB106566B;
	Fri, 17 Apr 2009 14:19:19 +0000 (UTC) (envelope-from das@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 66A728FC0C;
	Fri, 17 Apr 2009 14:19:19 +0000 (UTC) (envelope-from das@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HEJJxg024667;
	Fri, 17 Apr 2009 14:19:19 GMT (envelope-from das@svn.freebsd.org)
Received: (from das@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HEJJ5K024666;
	Fri, 17 Apr 2009 14:19:19 GMT (envelope-from das@svn.freebsd.org)
Message-Id: <200904171419.n3HEJJ5K024666@svn.freebsd.org>
From: David Schultz 
Date: Fri, 17 Apr 2009 14:19:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191202 - head/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 14:19:19 -0000

Author: das
Date: Fri Apr 17 14:19:18 2009
New Revision: 191202
URL: http://svn.freebsd.org/changeset/base/191202

Log:
  Revert r190943, since the problem in ports seems to be fixed now.
  It's amazing how a well-placed eyesore generates more motivation in a
  day than email generates in three weeks.

Modified:
  head/include/signal.h

Modified: head/include/signal.h
==============================================================================
--- head/include/signal.h	Fri Apr 17 13:22:18 2009	(r191201)
+++ head/include/signal.h	Fri Apr 17 14:19:18 2009	(r191202)
@@ -72,10 +72,8 @@ int	raise(int);
 
 #if __POSIX_VISIBLE || __XSI_VISIBLE
 int	kill(__pid_t, int);
-#ifndef _PTH_PTHREAD_H_	/* XXX kludge to work around GNU Pth brokenness */
 int	pthread_kill(__pthread_t, int);
 int	pthread_sigmask(int, const __sigset_t *, __sigset_t *);
-#endif
 int	sigaction(int, const struct sigaction * __restrict,
 	    struct sigaction * __restrict);
 int	sigaddset(sigset_t *, int);

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 15:49:37 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C54FE106566C;
	Fri, 17 Apr 2009 15:49:37 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B39A18FC0C;
	Fri, 17 Apr 2009 15:49:37 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HFnbMe026815;
	Fri, 17 Apr 2009 15:49:37 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HFnbUY026814;
	Fri, 17 Apr 2009 15:49:37 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200904171549.n3HFnbUY026814@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Fri, 17 Apr 2009 15:49:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191205 - head/release/doc/en_US.ISO8859-1/hardware
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 15:49:38 -0000

Author: nyan
Date: Fri Apr 17 15:49:37 2009
New Revision: 191205
URL: http://svn.freebsd.org/changeset/base/191205

Log:
  The ar(4), ray(4) and sr(4) drivers are removed.

Modified:
  head/release/doc/en_US.ISO8859-1/hardware/article.sgml

Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/hardware/article.sgml	Fri Apr 17 15:35:16 2009	(r191204)
+++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml	Fri Apr 17 15:49:37 2009	(r191205)
@@ -853,9 +853,6 @@
 
       &hwlist.ral;
 
-      [&arch.i386;, &arch.pc98;] Raytheon Raylink 2.4GHz
-	wireless adapters (&man.ray.4; driver)
-
       &hwlist.rum;
 
       &hwlist.uath;
@@ -1039,9 +1036,6 @@
       [&arch.amd64;, &arch.i386;] AST 4 port serial card using
 	shared IRQ
 
-      [&arch.i386;] ARNET serial cards (&man.ar.4;
-	driver)
-
       
 	
 	  ARNET 8 port serial card using shared IRQ
@@ -1207,8 +1201,6 @@
 
       &hwlist.rc;
 
-      &hwlist.sr;
-
       [&arch.i386;, &arch.amd64;] Specialix SI/XIO/SX multiport
 	serial cards, with both the older SIHOST2.x and the
 	enhanced (transputer based, aka JET) host cards

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 15:54:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6451D106564A;
	Fri, 17 Apr 2009 15:54:41 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 52FD88FC12;
	Fri, 17 Apr 2009 15:54:41 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HFsfWf026964;
	Fri, 17 Apr 2009 15:54:41 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HFsfmT026963;
	Fri, 17 Apr 2009 15:54:41 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <200904171554.n3HFsfmT026963@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Fri, 17 Apr 2009 15:54:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191206 - head/release/doc/share/misc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 15:54:41 -0000

Author: nyan
Date: Fri Apr 17 15:54:41 2009
New Revision: 191206
URL: http://svn.freebsd.org/changeset/base/191206

Log:
  The sr(4) driver is removed.

Modified:
  head/release/doc/share/misc/dev.archlist.txt

Modified: head/release/doc/share/misc/dev.archlist.txt
==============================================================================
--- head/release/doc/share/misc/dev.archlist.txt	Fri Apr 17 15:49:37 2009	(r191205)
+++ head/release/doc/share/misc/dev.archlist.txt	Fri Apr 17 15:54:41 2009	(r191206)
@@ -140,7 +140,6 @@ snd_t4dwave	i386,amd64
 snd_via8233	i386,amd64
 snd_via82c686	i386,amd64
 snd_vibes	i386,amd64
-sr	i386
 ste	i386,pc98,amd64
 stg	i386,pc98
 stge	i386,amd64,sparc64

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 16:06:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 951F7106567F;
	Fri, 17 Apr 2009 16:06:57 +0000 (UTC) (envelope-from des@des.no)
Received: from tim.des.no (tim.des.no [194.63.250.121])
	by mx1.freebsd.org (Postfix) with ESMTP id 513888FC14;
	Fri, 17 Apr 2009 16:06:57 +0000 (UTC) (envelope-from des@des.no)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 53E0E6D43F;
	Fri, 17 Apr 2009 16:06:56 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 1F982844C4; Fri, 17 Apr 2009 18:06:56 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Jack Vogel 
References: <200904141714.n3EHEZqZ014386@svn.freebsd.org>
	<49E4C927.2080508@freebsd.org>
	<2a41acea0904141044l49e6ef80hc23a740f02f85ce1@mail.gmail.com>
Date: Fri, 17 Apr 2009 18:06:56 +0200
In-Reply-To: <2a41acea0904141044l49e6ef80hc23a740f02f85ce1@mail.gmail.com>
	(Jack Vogel's message of "Tue, 14 Apr 2009 10:44:44 -0700")
Message-ID: <86ljpzmfhb.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: Jack F Vogel , svn-src-head@freebsd.org,
	svn-src-all@freebsd.org, Sam Leffler ,
	src-committers@freebsd.org
Subject: Re: svn commit: r191065 - head/sys/dev/e1000
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 16:06:58 -0000

Jack Vogel  writes:
> 2 SCTP specific bugs, one is a missing shift to correctly identify
> SCTP type in the descriptor, the second was incorrectly assigning
> rather than 'or-ing' the csum_flags, leading to the inability to do
> other types of offload downstream.
>
> The third bug was more subtle, the code to detect a CRC fragment in
> rxeof was being done at the wrong point, resulting in a crash/panic.

This should go in the svn log.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 16:07:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0EE481065679;
	Fri, 17 Apr 2009 16:07:14 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F17CE8FC25;
	Fri, 17 Apr 2009 16:07:13 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HG7D7U027312;
	Fri, 17 Apr 2009 16:07:13 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HG7DrR027311;
	Fri, 17 Apr 2009 16:07:13 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <200904171607.n3HG7DrR027311@svn.freebsd.org>
From: Andrew Thompson 
Date: Fri, 17 Apr 2009 16:07:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191207 - head/sys/dev/ipw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 16:07:14 -0000

Author: thompsa
Date: Fri Apr 17 16:07:13 2009
New Revision: 191207
URL: http://svn.freebsd.org/changeset/base/191207

Log:
  Drain the driver tasks on the same taskqueue in which they were enqueued.

Modified:
  head/sys/dev/ipw/if_ipw.c

Modified: head/sys/dev/ipw/if_ipw.c
==============================================================================
--- head/sys/dev/ipw/if_ipw.c	Fri Apr 17 15:54:41 2009	(r191206)
+++ head/sys/dev/ipw/if_ipw.c	Fri Apr 17 16:07:13 2009	(r191207)
@@ -417,9 +417,9 @@ ipw_detach(device_t dev)
 	ieee80211_ifdetach(ic);
 
 	callout_drain(&sc->sc_wdtimer);
-	taskqueue_drain(taskqueue_fast, &sc->sc_init_task);
-	taskqueue_drain(taskqueue_fast, &sc->sc_scan_task);
-	taskqueue_drain(taskqueue_fast, &sc->sc_bmiss_task);
+	taskqueue_drain(taskqueue_swi, &sc->sc_init_task);
+	taskqueue_drain(taskqueue_swi, &sc->sc_scan_task);
+	taskqueue_drain(taskqueue_swi, &sc->sc_bmiss_task);
 
 	ipw_release(sc);
 

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 17:22:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 27347106575C;
	Fri, 17 Apr 2009 17:22:29 +0000 (UTC) (envelope-from des@des.no)
Received: from tim.des.no (tim.des.no [194.63.250.121])
	by mx1.freebsd.org (Postfix) with ESMTP id D89FC8FC0C;
	Fri, 17 Apr 2009 17:22:28 +0000 (UTC) (envelope-from des@des.no)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 14CC76D43F;
	Fri, 17 Apr 2009 17:22:28 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id ECE00844E2; Fri, 17 Apr 2009 19:22:27 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Konstantin Belousov 
References: <200903300847.n2U8lSGo058512@svn.freebsd.org>
Date: Fri, 17 Apr 2009 19:22:27 +0200
In-Reply-To: <200903300847.n2U8lSGo058512@svn.freebsd.org> (Konstantin
	Belousov's message of "Mon, 30 Mar 2009 08:47:28 +0000 (UTC)")
Message-ID: <86hc0nmbzg.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190543 - in head: include libexec/rtld-elf sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 17:22:31 -0000

Konstantin Belousov  writes:
> Log:
>   Implement support for RTLD_NODELETE flag for dlopen() and -z nodelete
>   static linker option. Do it by incrementing reference count on the load=
ed
>   object and its dependencies.

Where is this documented?

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 17:40:47 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D5B351065688;
	Fri, 17 Apr 2009 17:40:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C45F28FC1A;
	Fri, 17 Apr 2009 17:40:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HHelii029881;
	Fri, 17 Apr 2009 17:40:47 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HHelQT029880;
	Fri, 17 Apr 2009 17:40:47 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200904171740.n3HHelQT029880@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 17 Apr 2009 17:40:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191217 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 17:40:48 -0000

Author: jhb
Date: Fri Apr 17 17:40:47 2009
New Revision: 191217
URL: http://svn.freebsd.org/changeset/base/191217

Log:
  The vlan code has not required the miibus code since 6.0 when
  if_link_state_change() was added and the vlan link-state hook was moved
  out of miibus and into net/if.c.
  
  MFC after:	1 month

Modified:
  head/sys/net/if_vlan.c

Modified: head/sys/net/if_vlan.c
==============================================================================
--- head/sys/net/if_vlan.c	Fri Apr 17 17:24:07 2009	(r191216)
+++ head/sys/net/if_vlan.c	Fri Apr 17 17:40:47 2009	(r191217)
@@ -574,7 +574,6 @@ static moduledata_t vlan_mod = {
 
 DECLARE_MODULE(if_vlan, vlan_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
 MODULE_VERSION(if_vlan, 3);
-MODULE_DEPEND(if_vlan, miibus, 1, 1, 1);
 
 static struct ifnet *
 vlan_clone_match_ethertag(struct if_clone *ifc, const char *name, int *tag)

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 18:11:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 28623106566B;
	Fri, 17 Apr 2009 18:11:12 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 16D708FC12;
	Fri, 17 Apr 2009 18:11:12 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HIBBIg030544;
	Fri, 17 Apr 2009 18:11:11 GMT (envelope-from kan@svn.freebsd.org)
Received: (from kan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HIBBSN030542;
	Fri, 17 Apr 2009 18:11:11 GMT (envelope-from kan@svn.freebsd.org)
Message-Id: <200904171811.n3HIBBSN030542@svn.freebsd.org>
From: Alexander Kabaev 
Date: Fri, 17 Apr 2009 18:11:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191218 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 18:11:12 -0000

Author: kan
Date: Fri Apr 17 18:11:11 2009
New Revision: 191218
URL: http://svn.freebsd.org/changeset/base/191218

Log:
  More fallout from negative dotdot caching. Negative entries should
  be removed from and reinserted to proper ncneg list.
  
  Reported by:  pho
  Submitted by: kib

Modified:
  head/sys/kern/vfs_bio.c
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Fri Apr 17 17:40:47 2009	(r191217)
+++ head/sys/kern/vfs_bio.c	Fri Apr 17 18:11:11 2009	(r191218)
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -754,6 +755,38 @@ bread(struct vnode * vp, daddr_t blkno, 
 }
 
 /*
+ * Same as bread, but also checks that cached indirect block
+ * buffers were not tampered with.
+ */
+int
+breadi(struct vnode * vp, daddr_t blkno, int size, struct ucred * cred,
+    struct buf **bpp)
+{
+	struct buf *bp;
+	int rv = 0;
+
+	CTR3(KTR_BUF, "breadi(%p, %jd, %d)", vp, blkno, size);
+	*bpp = bp = getblk(vp, blkno, size, 0, 0, GB_INDIR);
+
+	/* if not found in cache, do some I/O */
+	if ((bp->b_flags & B_CACHE) == 0) {
+		if (!TD_IS_IDLETHREAD(curthread))
+			curthread->td_ru.ru_inblock++;
+		bp->b_iocmd = BIO_READ;
+		bp->b_flags &= ~B_INVAL;
+		bp->b_ioflags &= ~BIO_ERROR;
+		if (bp->b_rcred == NOCRED && cred != NOCRED)
+			bp->b_rcred = crhold(cred);
+		vfs_busy_pages(bp, 0);
+		bp->b_iooffset = dbtob(bp->b_blkno);
+		bstrategy(bp);
+		rv = bufwait(bp);
+	}
+
+	return (rv);
+}
+
+/*
  * Attempt to initiate asynchronous I/O on read-ahead blocks.  We must
  * clear BIO_ERROR and B_INVAL prior to initiating I/O . If B_CACHE is set,
  * the buffer is valid and we do not have to do anything.
@@ -1218,6 +1251,10 @@ brelse(struct buf *bp)
 		}
 	}
 
+	/* Validate indirect buffer before VMIO buffer rundown. */
+	if ((bp->b_flags & B_INDIR) && !(bp->b_flags & B_INVAL))
+		BO_INDIR_CHECK(bp->b_bufobj, bp);
+
 	/*
 	 * We must clear B_RELBUF if B_DELWRI is set.  If vfs_vmio_release() 
 	 * is called with B_DELWRI set, the underlying pages may wind up
@@ -1441,6 +1478,9 @@ brelse(struct buf *bp)
 	bp->b_flags &= ~(B_ASYNC | B_NOCACHE | B_AGE | B_RELBUF | B_DIRECT);
 	if ((bp->b_flags & B_DELWRI) == 0 && (bp->b_xflags & BX_VNDIRTY))
 		panic("brelse: not dirty");
+
+	if ((bp->b_flags & B_INDIR) && !(bp->b_flags & B_INVAL))
+		BO_INDIR_CHECK(bp->b_bufobj, bp);
 	/* unlock */
 	BUF_UNLOCK(bp);
 }
@@ -1530,6 +1570,10 @@ bqrelse(struct buf *bp)
 	bp->b_flags &= ~(B_ASYNC | B_NOCACHE | B_AGE | B_RELBUF);
 	if ((bp->b_flags & B_DELWRI) == 0 && (bp->b_xflags & BX_VNDIRTY))
 		panic("bqrelse: not dirty");
+
+	if ((bp->b_flags & B_INDIR) && !(bp->b_flags & B_INVAL))
+		BO_INDIR_CHECK(bp->b_bufobj, bp);
+
 	/* unlock */
 	BUF_UNLOCK(bp);
 }
@@ -2658,6 +2702,18 @@ loop:
 			goto loop;
 		}
 		bp->b_flags &= ~B_DONE;
+
+		if (flags & GB_INDIR) {
+			if (bp->b_flags & B_INDIR) {
+				if (bp->b_flags & B_CACHE)
+					BO_INDIR_CHECK(bo, bp);
+			} else {
+				printf("XXKAN: Looking incore indirect buffer "
+					"found non-indirect one");
+				kdb_backtrace();
+				bp->b_flags |= B_INDIR;
+			}
+		}
 	} else {
 		int bsize, maxsize, vmio;
 		off_t offset;
@@ -2742,6 +2798,8 @@ loop:
 
 		allocbuf(bp, size);
 		bp->b_flags &= ~B_DONE;
+		if (flags & GB_INDIR)
+			bp->b_flags |= B_INDIR;
 	}
 	CTR4(KTR_BUF, "getblk(%p, %ld, %d) = %p", vp, (long)blkno, size, bp);
 	BUF_ASSERT_HELD(bp);
@@ -3250,6 +3308,12 @@ bufdone(struct buf *bp)
 	if (bp->b_iodone != NULL) {
 		biodone = bp->b_iodone;
 		bp->b_iodone = NULL;
+		if (bp->b_flags & B_INDIR) {
+			if ((bp->b_flags & B_INVAL) == 0  &&
+			    (bp->b_ioflags & BIO_ERROR) == 0) {
+				BO_INDIR_CHECK(bp->b_bufobj, bp);
+			}
+		}
 		(*biodone) (bp);
 		if (dropobj)
 			bufobj_wdrop(dropobj);
@@ -3393,6 +3457,12 @@ bufdone_finish(struct buf *bp)
 		VM_OBJECT_UNLOCK(obj);
 	}
 
+	if (bp->b_flags & B_INDIR) {
+		if ((bp->b_flags & B_INVAL) == 0  &&
+		    (bp->b_ioflags & BIO_ERROR) == 0) {
+			BO_INDIR_CHECK(bp->b_bufobj, bp);
+		}
+	}
 	/*
 	 * For asynchronous completions, release the buffer now. The brelse
 	 * will do a wakeup there if necessary - so no need to do a wakeup

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Fri Apr 17 17:40:47 2009	(r191217)
+++ head/sys/kern/vfs_cache.c	Fri Apr 17 18:11:11 2009	(r191218)
@@ -630,18 +630,23 @@ cache_enter(dvp, vp, cnp)
 			 * to new parent vnode, otherwise continue with new
 			 * namecache entry allocation.
 			 */
-			if ((ncp = dvp->v_cache_dd) != NULL) {
-				if (ncp->nc_flag & NCF_ISDOTDOT) {
-					KASSERT(ncp->nc_dvp == dvp,
-					    ("wrong isdotdot parent"));
+			if ((ncp = dvp->v_cache_dd) != NULL &&
+			    ncp->nc_flag & NCF_ISDOTDOT) {
+				KASSERT(ncp->nc_dvp == dvp,
+				    ("wrong isdotdot parent"));
+				if (ncp->nc_vp != NULL)
 					TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst,
 					    ncp, nc_dst);
+				else
+					TAILQ_REMOVE(&ncneg, ncp, nc_dst);
+				if (vp != NULL)
 					TAILQ_INSERT_HEAD(&vp->v_cache_dst,
 					    ncp, nc_dst);
-					ncp->nc_vp = vp;
-					CACHE_WUNLOCK();
-					return;
-				}
+				else
+					TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst);
+				ncp->nc_vp = vp;
+				CACHE_WUNLOCK();
+				return;
 			}
 			dvp->v_cache_dd = NULL;
 			SDT_PROBE(vfs, namecache, enter, done, dvp, "..", vp,

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 18:18:13 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E058106566B;
	Fri, 17 Apr 2009 18:18:13 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id F34418FC13;
	Fri, 17 Apr 2009 18:18:12 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 8FD9C46B1A;
	Fri, 17 Apr 2009 14:18:12 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id DE9478A01A;
	Fri, 17 Apr 2009 14:18:10 -0400 (EDT)
From: John Baldwin 
To: Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= 
Date: Fri, 17 Apr 2009 14:18:05 -0400
User-Agent: KMail/1.9.7
References: <200903300847.n2U8lSGo058512@svn.freebsd.org>
	<86hc0nmbzg.fsf@ds4.des.no>
In-Reply-To: <86hc0nmbzg.fsf@ds4.des.no>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Message-Id: <200904171418.05731.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Fri, 17 Apr 2009 14:18:10 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=0.1 required=4.2 tests=AWL,RDNS_NONE autolearn=no
	version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Konstantin Belousov 
Subject: Re: svn commit: r190543 - in head: include libexec/rtld-elf sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 18:18:14 -0000

On Friday 17 April 2009 1:22:27 pm Dag-Erling Sm=C3=B8rgrav wrote:
> Konstantin Belousov  writes:
> > Log:
> >   Implement support for RTLD_NODELETE flag for dlopen() and -z nodelete
> >   static linker option. Do it by incrementing reference count on the=20
loaded
> >   object and its dependencies.
>=20
> Where is this documented?

NODELETE is actually an ELF flag and it is supported on other platforms=20
via '-z nodelete' and RTLD_NODELETE (e.g. Linux and Solaris).

=2D-=20
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 18:34:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3663A10656C6;
	Fri, 17 Apr 2009 18:34:12 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1F8C08FC18;
	Fri, 17 Apr 2009 18:34:12 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HIYClH031110;
	Fri, 17 Apr 2009 18:34:12 GMT (envelope-from kan@svn.freebsd.org)
Received: (from kan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HIYCiY031109;
	Fri, 17 Apr 2009 18:34:12 GMT (envelope-from kan@svn.freebsd.org)
Message-Id: <200904171834.n3HIYCiY031109@svn.freebsd.org>
From: Alexander Kabaev 
Date: Fri, 17 Apr 2009 18:34:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191220 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 18:34:14 -0000

Author: kan
Date: Fri Apr 17 18:34:11 2009
New Revision: 191220
URL: http://svn.freebsd.org/changeset/base/191220

Log:
  Undo private changes that should never have been committed.

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Fri Apr 17 18:29:30 2009	(r191219)
+++ head/sys/kern/vfs_bio.c	Fri Apr 17 18:34:11 2009	(r191220)
@@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -755,38 +754,6 @@ bread(struct vnode * vp, daddr_t blkno, 
 }
 
 /*
- * Same as bread, but also checks that cached indirect block
- * buffers were not tampered with.
- */
-int
-breadi(struct vnode * vp, daddr_t blkno, int size, struct ucred * cred,
-    struct buf **bpp)
-{
-	struct buf *bp;
-	int rv = 0;
-
-	CTR3(KTR_BUF, "breadi(%p, %jd, %d)", vp, blkno, size);
-	*bpp = bp = getblk(vp, blkno, size, 0, 0, GB_INDIR);
-
-	/* if not found in cache, do some I/O */
-	if ((bp->b_flags & B_CACHE) == 0) {
-		if (!TD_IS_IDLETHREAD(curthread))
-			curthread->td_ru.ru_inblock++;
-		bp->b_iocmd = BIO_READ;
-		bp->b_flags &= ~B_INVAL;
-		bp->b_ioflags &= ~BIO_ERROR;
-		if (bp->b_rcred == NOCRED && cred != NOCRED)
-			bp->b_rcred = crhold(cred);
-		vfs_busy_pages(bp, 0);
-		bp->b_iooffset = dbtob(bp->b_blkno);
-		bstrategy(bp);
-		rv = bufwait(bp);
-	}
-
-	return (rv);
-}
-
-/*
  * Attempt to initiate asynchronous I/O on read-ahead blocks.  We must
  * clear BIO_ERROR and B_INVAL prior to initiating I/O . If B_CACHE is set,
  * the buffer is valid and we do not have to do anything.
@@ -1251,10 +1218,6 @@ brelse(struct buf *bp)
 		}
 	}
 
-	/* Validate indirect buffer before VMIO buffer rundown. */
-	if ((bp->b_flags & B_INDIR) && !(bp->b_flags & B_INVAL))
-		BO_INDIR_CHECK(bp->b_bufobj, bp);
-
 	/*
 	 * We must clear B_RELBUF if B_DELWRI is set.  If vfs_vmio_release() 
 	 * is called with B_DELWRI set, the underlying pages may wind up
@@ -1478,9 +1441,6 @@ brelse(struct buf *bp)
 	bp->b_flags &= ~(B_ASYNC | B_NOCACHE | B_AGE | B_RELBUF | B_DIRECT);
 	if ((bp->b_flags & B_DELWRI) == 0 && (bp->b_xflags & BX_VNDIRTY))
 		panic("brelse: not dirty");
-
-	if ((bp->b_flags & B_INDIR) && !(bp->b_flags & B_INVAL))
-		BO_INDIR_CHECK(bp->b_bufobj, bp);
 	/* unlock */
 	BUF_UNLOCK(bp);
 }
@@ -1570,10 +1530,6 @@ bqrelse(struct buf *bp)
 	bp->b_flags &= ~(B_ASYNC | B_NOCACHE | B_AGE | B_RELBUF);
 	if ((bp->b_flags & B_DELWRI) == 0 && (bp->b_xflags & BX_VNDIRTY))
 		panic("bqrelse: not dirty");
-
-	if ((bp->b_flags & B_INDIR) && !(bp->b_flags & B_INVAL))
-		BO_INDIR_CHECK(bp->b_bufobj, bp);
-
 	/* unlock */
 	BUF_UNLOCK(bp);
 }
@@ -2702,18 +2658,6 @@ loop:
 			goto loop;
 		}
 		bp->b_flags &= ~B_DONE;
-
-		if (flags & GB_INDIR) {
-			if (bp->b_flags & B_INDIR) {
-				if (bp->b_flags & B_CACHE)
-					BO_INDIR_CHECK(bo, bp);
-			} else {
-				printf("XXKAN: Looking incore indirect buffer "
-					"found non-indirect one");
-				kdb_backtrace();
-				bp->b_flags |= B_INDIR;
-			}
-		}
 	} else {
 		int bsize, maxsize, vmio;
 		off_t offset;
@@ -2798,8 +2742,6 @@ loop:
 
 		allocbuf(bp, size);
 		bp->b_flags &= ~B_DONE;
-		if (flags & GB_INDIR)
-			bp->b_flags |= B_INDIR;
 	}
 	CTR4(KTR_BUF, "getblk(%p, %ld, %d) = %p", vp, (long)blkno, size, bp);
 	BUF_ASSERT_HELD(bp);
@@ -3308,12 +3250,6 @@ bufdone(struct buf *bp)
 	if (bp->b_iodone != NULL) {
 		biodone = bp->b_iodone;
 		bp->b_iodone = NULL;
-		if (bp->b_flags & B_INDIR) {
-			if ((bp->b_flags & B_INVAL) == 0  &&
-			    (bp->b_ioflags & BIO_ERROR) == 0) {
-				BO_INDIR_CHECK(bp->b_bufobj, bp);
-			}
-		}
 		(*biodone) (bp);
 		if (dropobj)
 			bufobj_wdrop(dropobj);
@@ -3457,12 +3393,6 @@ bufdone_finish(struct buf *bp)
 		VM_OBJECT_UNLOCK(obj);
 	}
 
-	if (bp->b_flags & B_INDIR) {
-		if ((bp->b_flags & B_INVAL) == 0  &&
-		    (bp->b_ioflags & BIO_ERROR) == 0) {
-			BO_INDIR_CHECK(bp->b_bufobj, bp);
-		}
-	}
 	/*
 	 * For asynchronous completions, release the buffer now. The brelse
 	 * will do a wakeup there if necessary - so no need to do a wakeup

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 18:38:49 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 522451065700;
	Fri, 17 Apr 2009 18:38:49 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147])
	by mx1.freebsd.org (Postfix) with ESMTP id DFB008FC19;
	Fri, 17 Apr 2009 18:38:48 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua)
	by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256)
	(Exim 4.63 (FreeBSD)) (envelope-from )
	id 1LusxB-000Own-IP; Fri, 17 Apr 2009 21:38:22 +0300
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n3HIcIAf053450
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 17 Apr 2009 21:38:18 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id
	n3HIcHMY025644; Fri, 17 Apr 2009 21:38:17 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n3HIcHZQ025643; 
	Fri, 17 Apr 2009 21:38:17 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Fri, 17 Apr 2009 21:38:17 +0300
From: Kostik Belousov 
To: Dag-Erling Sm??rgrav 
Message-ID: <20090417183817.GE3014@deviant.kiev.zoral.com.ua>
References: <200903300847.n2U8lSGo058512@svn.freebsd.org>
	<86hc0nmbzg.fsf@ds4.des.no>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="7/Z1yz1L7BOCEubH"
Content-Disposition: inline
In-Reply-To: <86hc0nmbzg.fsf@ds4.des.no>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: ClamAV version 0.94.2,
	clamav-milter version 0.94.2 on skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00
	autolearn=ham version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
X-Virus-Scanned: mail.terabit.net.ua 1LusxB-000Own-IP
	b31e9b6b5afd2f300505811704df9743
X-Terabit: YES
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190543 - in head: include libexec/rtld-elf sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 18:38:51 -0000


--7/Z1yz1L7BOCEubH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Apr 17, 2009 at 07:22:27PM +0200, Dag-Erling Sm??rgrav wrote:
> Konstantin Belousov  writes:
> > Log:
> >   Implement support for RTLD_NODELETE flag for dlopen() and -z nodelete
> >   static linker option. Do it by incrementing reference count on the lo=
aded
> >   object and its dependencies.
>=20
> Where is this documented?
As John said, this is standard feature of the ELF platform.
Also, see r190624.

--7/Z1yz1L7BOCEubH
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAknozJkACgkQC3+MBN1Mb4jV7QCdFKkoTJW5Iyuz90/9y0AUbd5T
ggkAoMTuIlkhWnHsBoJa4I+b9bUNFAxy
=qd4x
-----END PGP SIGNATURE-----

--7/Z1yz1L7BOCEubH--

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 18:48:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 49AA11065672;
	Fri, 17 Apr 2009 18:48:51 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 34B678FC14;
	Fri, 17 Apr 2009 18:48:51 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HImpf5031442;
	Fri, 17 Apr 2009 18:48:51 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HImpCx031441;
	Fri, 17 Apr 2009 18:48:51 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200904171848.n3HImpCx031441@svn.freebsd.org>
From: Kip Macy 
Date: Fri, 17 Apr 2009 18:48:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191221 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 18:48:53 -0000

Author: kmacy
Date: Fri Apr 17 18:48:50 2009
New Revision: 191221
URL: http://svn.freebsd.org/changeset/base/191221

Log:
  clarify state of llentry that is passed back

Modified:
  head/sys/net/if_llatbl.c

Modified: head/sys/net/if_llatbl.c
==============================================================================
--- head/sys/net/if_llatbl.c	Fri Apr 17 18:34:11 2009	(r191220)
+++ head/sys/net/if_llatbl.c	Fri Apr 17 18:48:50 2009	(r191221)
@@ -106,6 +106,8 @@ llentry_free(struct llentry *lle)
 /*
  * Update an llentry for address dst (equivalent to rtalloc for new-arp)
  * Caller must pass in a valid struct llentry *
+ *
+ * if found the llentry * is returned referenced and unlocked
  */
 int
 llentry_update(struct llentry **llep, struct lltable *lt,

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 19:07:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A2BF4106564A;
	Fri, 17 Apr 2009 19:07:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 90F048FC0C;
	Fri, 17 Apr 2009 19:07:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HJ7ia4031859;
	Fri, 17 Apr 2009 19:07:44 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HJ7ilP031857;
	Fri, 17 Apr 2009 19:07:44 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200904171907.n3HJ7ilP031857@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 17 Apr 2009 19:07:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191222 - in head: sys/dev/pci usr.sbin/pciconf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 19:07:45 -0000

Author: jhb
Date: Fri Apr 17 19:07:44 2009
New Revision: 191222
URL: http://svn.freebsd.org/changeset/base/191222

Log:
  - Add a few more register defintions for the PCI express capability
    registers.
  - Cleanup PCI-X capability printf to not leave a dangling "supports" for
    some PCI-X bridges.
  - Display additional PCI express details including the negotiated and max
    link width and the actual and maximum supported max payload.
  
  MFC after:	1 month

Modified:
  head/sys/dev/pci/pcireg.h
  head/usr.sbin/pciconf/cap.c

Modified: head/sys/dev/pci/pcireg.h
==============================================================================
--- head/sys/dev/pci/pcireg.h	Fri Apr 17 18:48:50 2009	(r191221)
+++ head/sys/dev/pci/pcireg.h	Fri Apr 17 19:07:44 2009	(r191222)
@@ -596,8 +596,36 @@
 #define	PCIM_EXP_TYPE_UPSTREAM_PORT	0x0050
 #define	PCIM_EXP_TYPE_DOWNSTREAM_PORT	0x0060
 #define	PCIM_EXP_TYPE_PCI_BRIDGE	0x0070
+#define	PCIM_EXP_TYPE_PCIE_BRIDGE	0x0080
+#define	PCIM_EXP_TYPE_ROOT_INT_EP	0x0090
+#define	PCIM_EXP_TYPE_ROOT_EC		0x00a0
 #define	PCIM_EXP_FLAGS_SLOT		0x0100
 #define	PCIM_EXP_FLAGS_IRQ		0x3e00
+#define	PCIR_EXPRESS_DEVICE_CAP	0x4
+#define	PCIM_EXP_CAP_MAX_PAYLOAD	0x0007
+#define	PCIR_EXPRESS_DEVICE_CTL	0x8
+#define	PCIM_EXP_CTL_MAX_PAYLOAD	0x00e0
+#define	PCIM_EXP_CTL_MAX_READ_REQUEST	0x7000
+#define	PCIR_EXPRESS_DEVICE_STA	0xa
+#define	PCIR_EXPRESS_LINK_CAP	0xc
+#define	PCIM_LINK_CAP_MAX_SPEED		0x0000000f
+#define	PCIM_LINK_CAP_MAX_WIDTH		0x000003f0
+#define	PCIM_LINK_CAP_ASPM		0x00000c00
+#define	PCIM_LINK_CAP_L0S_EXIT		0x00007000
+#define	PCIM_LINK_CAP_L1_EXIT		0x00038000
+#define	PCIM_LINK_CAP_PORT		0xff000000
+#define	PCIR_EXPRESS_LINK_CTL	0x10
+#define	PCIR_EXPRESS_LINK_STA	0x12
+#define	PCIM_LINK_STA_SPEED		0x000f
+#define	PCIM_LINK_STA_WIDTH		0x03f0
+#define	PCIM_LINK_STA_TRAINING_ERROR	0x0400
+#define	PCIM_LINK_STA_TRAINING		0x0800
+#define	PCIM_LINK_STA_SLOT_CLOCK	0x1000
+#define	PCIR_EXPRESS_SLOT_CAP	0x14
+#define	PCIR_EXPRESS_SLOT_CTL	0x18
+#define	PCIR_EXPRESS_SLOT_STA	0x1a
+#define	PCIR_EXPRESS_ROOT_CTL	0x1c
+#define	PCIR_EXPRESS_ROOT_STA	0x20
 
 /* MSI-X definitions */
 #define	PCIR_MSIX_CTRL		0x2

Modified: head/usr.sbin/pciconf/cap.c
==============================================================================
--- head/usr.sbin/pciconf/cap.c	Fri Apr 17 18:48:50 2009	(r191221)
+++ head/usr.sbin/pciconf/cap.c	Fri Apr 17 19:07:44 2009	(r191222)
@@ -151,7 +151,9 @@ cap_pcix(int fd, struct pci_conf *p, uin
 		printf("64-bit ");
 	if ((p->pc_hdr & PCIM_HDRTYPE) == 1)
 		printf("bridge ");
-	printf("supports");
+	if ((p->pc_hdr & PCIM_HDRTYPE) != 1 || (status & (PCIXM_STATUS_133CAP |
+	    PCIXM_STATUS_266CAP | PCIXM_STATUS_533CAP)) != 0)
+		printf("supports");
 	comma = 0;
 	if (status & PCIXM_STATUS_133CAP) {
 		printf("%s 133MHz", comma ? "," : "");
@@ -357,9 +359,12 @@ cap_subvendor(int fd, struct pci_conf *p
 	printf("PCI Bridge card=0x%08x", id);
 }
 
+#define	MAX_PAYLOAD(field)		(128 << (field))
+
 static void
 cap_express(int fd, struct pci_conf *p, uint8_t ptr)
 {
+	uint32_t val;
 	uint16_t flags;
 
 	flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_FLAGS, 2);
@@ -383,12 +388,30 @@ cap_express(int fd, struct pci_conf *p, 
 	case PCIM_EXP_TYPE_PCI_BRIDGE:
 		printf("PCI bridge");
 		break;
+	case PCIM_EXP_TYPE_PCIE_BRIDGE:
+		printf("PCI to PCIe bridge");
+		break;
+	case PCIM_EXP_TYPE_ROOT_INT_EP:
+		printf("root endpoint");
+		break;
+	case PCIM_EXP_TYPE_ROOT_EC:
+		printf("event collector");
+		break;
 	default:
-		printf("type %d", (flags & PCIM_EXP_FLAGS_TYPE) >> 8);
+		printf("type %d", (flags & PCIM_EXP_FLAGS_TYPE) >> 4);
 		break;
 	}
 	if (flags & PCIM_EXP_FLAGS_IRQ)
-		printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 17);
+		printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 8);
+	val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CAP, 4);
+	flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CTL, 2);
+	printf(" max data %d(%d)",
+	    MAX_PAYLOAD((flags & PCIM_EXP_CTL_MAX_PAYLOAD) >> 5),
+	    MAX_PAYLOAD(val & PCIM_EXP_CAP_MAX_PAYLOAD));
+	val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_LINK_CAP, 4);
+	flags = read_config(fd, &p->pc_sel, ptr+ PCIR_EXPRESS_LINK_STA, 2);
+	printf(" link x%d(x%d)", (flags & PCIM_LINK_STA_WIDTH) >> 4,
+	    (val & PCIM_LINK_CAP_MAX_WIDTH) >> 4);
 }
 
 static void

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 21:35:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B00B0106566B;
	Fri, 17 Apr 2009 21:35:51 +0000 (UTC) (envelope-from des@des.no)
Received: from tim.des.no (tim.des.no [194.63.250.121])
	by mx1.freebsd.org (Postfix) with ESMTP id 70AFC8FC17;
	Fri, 17 Apr 2009 21:35:51 +0000 (UTC) (envelope-from des@des.no)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 626C36D43F;
	Fri, 17 Apr 2009 21:35:50 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 461E2844C4; Fri, 17 Apr 2009 23:35:50 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Kostik Belousov 
References: <200903300847.n2U8lSGo058512@svn.freebsd.org>
	<86hc0nmbzg.fsf@ds4.des.no>
	<20090417183817.GE3014@deviant.kiev.zoral.com.ua>
Date: Fri, 17 Apr 2009 23:35:50 +0200
In-Reply-To: <20090417183817.GE3014@deviant.kiev.zoral.com.ua> (Kostik
	Belousov's message of "Fri, 17 Apr 2009 21:38:17 +0300")
Message-ID: <868wlzm095.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r190543 - in head: include libexec/rtld-elf sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 21:35:52 -0000

Kostik Belousov  writes:
> "Dag-Erling Sm=C3=B8rgrav"  writes:
> > Where is this documented?
> As John said, this is standard feature of the ELF platform.
> Also, see r190624.

Hmmm...  there is something wrong with my repo.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 22:13:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B761A1065692;
	Fri, 17 Apr 2009 22:13:41 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9B4EC8FC23;
	Fri, 17 Apr 2009 22:13:41 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HMDfnA036156;
	Fri, 17 Apr 2009 22:13:41 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HMDf9L036155;
	Fri, 17 Apr 2009 22:13:41 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200904172213.n3HMDf9L036155@svn.freebsd.org>
From: Ed Schouten 
Date: Fri, 17 Apr 2009 22:13:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191226 - head/sys/netgraph/bluetooth/drivers/ubtbcmfw
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 22:13:43 -0000

Author: ed
Date: Fri Apr 17 22:13:41 2009
New Revision: 191226
URL: http://svn.freebsd.org/changeset/base/191226

Log:
  Switch ubtbcmfw(4) to use si_drv1 instead of storing the unit number.
  
  The unit number is still used to store the type of the device node.
  
  Approved by:	emax

Modified:
  head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c

Modified: head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c
==============================================================================
--- head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c	Fri Apr 17 22:04:19 2009	(r191225)
+++ head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c	Fri Apr 17 22:13:41 2009	(r191226)
@@ -83,9 +83,6 @@ typedef struct ubtbcmfw_softc	*ubtbcmfw_
  * Device methods
  */
 
-#define UBTBCMFW_UNIT(n)	((dev2unit(n) >> 4) & 0xf)
-#define UBTBCMFW_ENDPOINT(n)	(dev2unit(n) & 0xf)
-#define UBTBCMFW_MINOR(u, e)	(((u) << 4) | (e))
 #define UBTBCMFW_BSIZE		1024
 
 static d_open_t		ubtbcmfw_open;
@@ -210,19 +207,19 @@ ubtbcmfw_attach(device_t self)
 
 	/* Create device nodes */
 	sc->sc_ctrl_dev = make_dev(&ubtbcmfw_cdevsw,
-		UBTBCMFW_MINOR(device_get_unit(sc->sc_dev), 0),
-		UID_ROOT, GID_OPERATOR, 0644,
+		0, UID_ROOT, GID_OPERATOR, 0644,
 		"%s", device_get_nameunit(sc->sc_dev));
+	sc->sc_ctrl_dev->si_drv1 = sc;
 
 	sc->sc_intr_in_dev = make_dev(&ubtbcmfw_cdevsw,
-		UBTBCMFW_MINOR(device_get_unit(sc->sc_dev), UBTBCMFW_INTR_IN),
-		UID_ROOT, GID_OPERATOR, 0644,
+		UBTBCMFW_INTR_IN, UID_ROOT, GID_OPERATOR, 0644,
 		"%s.%d", device_get_nameunit(sc->sc_dev), UBTBCMFW_INTR_IN);
+	sc->sc_intr_in_dev->si_drv1 = sc;
 
 	sc->sc_bulk_out_dev = make_dev(&ubtbcmfw_cdevsw,
-		UBTBCMFW_MINOR(device_get_unit(sc->sc_dev), UBTBCMFW_BULK_OUT),
-		UID_ROOT, GID_OPERATOR, 0644,
+		UBTBCMFW_BULK_OUT, UID_ROOT, GID_OPERATOR, 0644,
 		"%s.%d", device_get_nameunit(sc->sc_dev), UBTBCMFW_BULK_OUT);
+	sc->sc_bulk_out_dev->si_drv1 = sc;
 
 	return 0;
 bad:
@@ -288,17 +285,13 @@ ubtbcmfw_detach(device_t self)
 static int
 ubtbcmfw_open(struct cdev *dev, int flag, int mode, struct thread *p)
 {
-	ubtbcmfw_softc_p	sc = NULL;
+	ubtbcmfw_softc_p	sc = dev->si_drv1;
 	int			error = 0;
 
-	/* checks for sc != NULL */
-	sc = devclass_get_softc(ubtbcmfw_devclass, UBTBCMFW_UNIT(dev));
-	if (sc == NULL)
-		return (ENXIO);
 	if (sc->sc_dying)
 		return (ENXIO);
 
-	switch (UBTBCMFW_ENDPOINT(dev)) {
+	switch (dev2unit(dev)) {
 	case USB_CONTROL_ENDPOINT:
 		if (!(sc->sc_flags & UBTBCMFW_CTRL_DEV))
 			sc->sc_flags |= UBTBCMFW_CTRL_DEV;
@@ -342,13 +335,9 @@ ubtbcmfw_open(struct cdev *dev, int flag
 static int
 ubtbcmfw_close(struct cdev *dev, int flag, int mode, struct thread *p)
 {
-	ubtbcmfw_softc_p	sc = NULL;
-
-	sc = devclass_get_softc(ubtbcmfw_devclass, UBTBCMFW_UNIT(dev));
-	if (sc == NULL)
-		return (ENXIO);
+	ubtbcmfw_softc_p	sc = dev->si_drv1;
 
-	switch (UBTBCMFW_ENDPOINT(dev)) {
+	switch (dev2unit(dev)) {
 	case USB_CONTROL_ENDPOINT:
 		sc->sc_flags &= ~UBTBCMFW_CTRL_DEV;
 		break;
@@ -379,17 +368,16 @@ ubtbcmfw_close(struct cdev *dev, int fla
 static int
 ubtbcmfw_read(struct cdev *dev, struct uio *uio, int flag)
 {
-	ubtbcmfw_softc_p	sc = NULL;
+	ubtbcmfw_softc_p	sc = dev->si_drv1;
 	u_int8_t		buf[UBTBCMFW_BSIZE];
 	usbd_xfer_handle	xfer;
 	usbd_status		err;
 	int			n, tn, error = 0;
 
-	sc = devclass_get_softc(ubtbcmfw_devclass, UBTBCMFW_UNIT(dev));
-	if (sc == NULL || sc->sc_dying)
+	if (sc->sc_dying)
 		return (ENXIO);
 
-	if (UBTBCMFW_ENDPOINT(dev) != UBTBCMFW_INTR_IN)
+	if (dev2unit(dev) != UBTBCMFW_INTR_IN)
 		return (EOPNOTSUPP);
 	if (sc->sc_intr_in_pipe == NULL)
 		return (ENXIO);
@@ -443,17 +431,16 @@ ubtbcmfw_read(struct cdev *dev, struct u
 static int
 ubtbcmfw_write(struct cdev *dev, struct uio *uio, int flag)
 {
-	ubtbcmfw_softc_p	sc = NULL;
+	ubtbcmfw_softc_p	sc = dev->si_drv1;
 	u_int8_t		buf[UBTBCMFW_BSIZE];
 	usbd_xfer_handle	xfer;
 	usbd_status		err;
 	int			n, error = 0;
 
-	sc = devclass_get_softc(ubtbcmfw_devclass, UBTBCMFW_UNIT(dev));
-	if (sc == NULL || sc->sc_dying)
+	if (sc->sc_dying)
 		return (ENXIO);
 
-	if (UBTBCMFW_ENDPOINT(dev) != UBTBCMFW_BULK_OUT)
+	if (dev2unit(dev) != UBTBCMFW_BULK_OUT)
 		return (EOPNOTSUPP);
 	if (sc->sc_bulk_out_pipe == NULL)
 		return (ENXIO);
@@ -509,14 +496,13 @@ static int
 ubtbcmfw_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag,
   struct thread *p)
 {
-	ubtbcmfw_softc_p	sc = NULL;
+	ubtbcmfw_softc_p	sc = dev->si_drv1;
 	int			error = 0;
 
-	sc = devclass_get_softc(ubtbcmfw_devclass, UBTBCMFW_UNIT(dev));
-	if (sc == NULL || sc->sc_dying)
+	if (sc->sc_dying)
 		return (ENXIO);
 
-	if (UBTBCMFW_ENDPOINT(dev) != USB_CONTROL_ENDPOINT)
+	if (dev2unit(dev) != USB_CONTROL_ENDPOINT)
 		return (EOPNOTSUPP);
 
 	sc->sc_refcnt ++;
@@ -546,14 +532,10 @@ ubtbcmfw_ioctl(struct cdev *dev, u_long 
 static int
 ubtbcmfw_poll(struct cdev *dev, int events, struct thread *p)
 {
-	ubtbcmfw_softc_p	sc = NULL;
+	ubtbcmfw_softc_p	sc = dev->si_drv1;
 	int			revents = 0;
 
-	sc = devclass_get_softc(ubtbcmfw_devclass, UBTBCMFW_UNIT(dev));
-	if (sc == NULL)
-		return (ENXIO);
-
-	switch (UBTBCMFW_ENDPOINT(dev)) {
+	switch (dev2unit(dev)) {
 	case UBTBCMFW_INTR_IN:
 		if (sc->sc_intr_in_pipe != NULL)
 			revents |= events & (POLLIN | POLLRDNORM);

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 22:20:44 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DAF10106564A;
	Fri, 17 Apr 2009 22:20:44 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CA1E08FC15;
	Fri, 17 Apr 2009 22:20:44 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HMKiJ5036379;
	Fri, 17 Apr 2009 22:20:44 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HMKiuF036378;
	Fri, 17 Apr 2009 22:20:44 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904172220.n3HMKiuF036378@svn.freebsd.org>
From: Tim Kientzle 
Date: Fri, 17 Apr 2009 22:20:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191227 - head/rescue/rescue
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 22:20:45 -0000

Author: kientzle
Date: Fri Apr 17 22:20:44 2009
New Revision: 191227
URL: http://svn.freebsd.org/changeset/base/191227

Log:
  *** empty log message ***

Modified:
  head/rescue/rescue/Makefile

Modified: head/rescue/rescue/Makefile
==============================================================================
--- head/rescue/rescue/Makefile	Fri Apr 17 22:13:41 2009	(r191226)
+++ head/rescue/rescue/Makefile	Fri Apr 17 22:20:44 2009	(r191227)
@@ -118,7 +118,7 @@ CRUNCH_PROGS_sbin= atacontrol badsect			
 	mount_udf mount_unionfs newfs				\
 	newfs_msdos nos-tun ping reboot				\
 	restore rcorder route routed rtquery rtsol savecore	\
-	spppcontrol swapon sysctl tunefs umount 
+	spppcontrol swapon sysctl tunefs umount
 
 .if ${MK_ATM} != "no"
 CRUNCH_PROGS_sbin+= atmconfig
@@ -188,7 +188,7 @@ CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRU
 
 ##################################################################
 # Programs from stock /usr/bin
-# 
+#
 CRUNCH_SRCDIRS+= usr.bin
 
 CRUNCH_PROGS_usr.bin= head mt sed tail tee
@@ -211,7 +211,7 @@ CRUNCH_ALIAS_id= groups whoami
 
 ##################################################################
 # Programs from stock /usr/sbin
-# 
+#
 CRUNCH_SRCDIRS+= usr.sbin
 
 CRUNCH_PROGS_usr.sbin= chroot
@@ -303,7 +303,7 @@ objs: $(OUTMK)
 #  Someone should replace the bin/csh and bin/sh build-tools with
 # shell scripts so we can remove this nonsense.
 build-tools:
-.for _tool in bin/csh bin/sh 
+.for _tool in bin/csh bin/sh
 	cd $(.CURDIR)/../../${_tool}; \
 	MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \
 	MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 22:23:06 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 45A8C106564A;
	Fri, 17 Apr 2009 22:23:06 +0000 (UTC)
	(envelope-from kientzle@freebsd.org)
Received: from kientzle.com (kientzle.com [66.166.149.50])
	by mx1.freebsd.org (Postfix) with ESMTP id 03CAA8FC1E;
	Fri, 17 Apr 2009 22:23:05 +0000 (UTC)
	(envelope-from kientzle@freebsd.org)
Received: (from root@localhost)
	by kientzle.com (8.14.3/8.14.3) id n3HMN5Cb030142;
	Fri, 17 Apr 2009 15:23:05 -0700 (PDT)
	(envelope-from kientzle@freebsd.org)
Received: from dark.x.kientzle.com (fw2.kientzle.com [10.123.1.2])
	by kientzle.com with SMTP id 76w8niwfifn93xe2cc6wz3gcb6;
	Fri, 17 Apr 2009 15:23:05 -0700 (PDT)
	(envelope-from kientzle@freebsd.org)
Message-ID: <49E90148.8070804@freebsd.org>
Date: Fri, 17 Apr 2009 15:23:04 -0700
From: Tim Kientzle 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US;
	rv:1.8.1.21) Gecko/20090409 SeaMonkey/1.1.15
MIME-Version: 1.0
References: <200904172220.n3HMKiuF036378@svn.freebsd.org>
In-Reply-To: <200904172220.n3HMKiuF036378@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191227 - head/rescue/rescue
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 22:23:06 -0000

Tim Kientzle wrote:
> Author: kientzle
> Date: Fri Apr 17 22:20:44 2009
> New Revision: 191227
> URL: http://svn.freebsd.org/changeset/base/191227
> 
> Log:
>   *** empty log message ***

Fat-fingered that one.  Of course, that should read:

Log:
    Style fix; strip a few trailing spaces.

Pointy hat to me for the botched commit.

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 22:45:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C46E5106564A;
	Fri, 17 Apr 2009 22:45:57 +0000 (UTC)
	(envelope-from ticso@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B3DB78FC13;
	Fri, 17 Apr 2009 22:45:57 +0000 (UTC)
	(envelope-from ticso@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HMjvGa037022;
	Fri, 17 Apr 2009 22:45:57 GMT (envelope-from ticso@svn.freebsd.org)
Received: (from ticso@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HMjvsH037021;
	Fri, 17 Apr 2009 22:45:57 GMT (envelope-from ticso@svn.freebsd.org)
Message-Id: <200904172245.n3HMjvsH037021@svn.freebsd.org>
From: Bernd Walter 
Date: Fri, 17 Apr 2009 22:45:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191228 - head/sys/arm/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 22:45:58 -0000

Author: ticso
Date: Fri Apr 17 22:45:57 2009
New Revision: 191228
URL: http://svn.freebsd.org/changeset/base/191228

Log:
  minor cleanup

Modified:
  head/sys/arm/conf/BWCT

Modified: head/sys/arm/conf/BWCT
==============================================================================
--- head/sys/arm/conf/BWCT	Fri Apr 17 22:20:44 2009	(r191227)
+++ head/sys/arm/conf/BWCT	Fri Apr 17 22:45:57 2009	(r191228)
@@ -51,7 +51,7 @@ options 	NFSCLIENT		#Network Filesystem 
 #options 	NFSLOCKD		#Network Lock Manager
 options		NFS_ROOT		#NFS usable as /, requires NFSCLIENT
 options		BOOTP_NFSROOT
-options	BOOTP
+options		BOOTP
 
 #options 	MSDOSFS			#MSDOS Filesystem
 #options 	CD9660			#ISO 9660 Filesystem
@@ -83,7 +83,7 @@ device		rlswitch
 #options 	INVARIANT_SUPPORT	#Extra sanity checks of internal structures, required by INVARIANTS
 #options 	WITNESS			#Enable checks to detect deadlocks and cycles
 #options 	WITNESS_SKIPSPIN	#Don't run witness on spinlocks for speed
-#options		DIAGNOSTIC
+#options	DIAGNOSTIC
 
 device		md
 device		at91_twi		# TWI: Two Wire Interface
@@ -101,7 +101,7 @@ device		ds1672		# DS1672 on I2C bus
 #device		smb
 # SPI bus
 device		spibus
-#device  	at45d		# at45db642 and maybe others
+#device		at45d		# at45db642 and maybe others
 
 device		bpf		# Berkeley packet filter
 
@@ -109,5 +109,3 @@ device		bpf		# Berkeley packet filter
 #device		ohci
 #device		usb
 #device		umass		# Disks/Mass storage - Requires scbus and da
-
-#device		at91_qdmmc

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 17 23:33:30 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 939B31065672;
	Fri, 17 Apr 2009 23:33:30 +0000 (UTC)
	(envelope-from emax@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 829848FC19;
	Fri, 17 Apr 2009 23:33:30 +0000 (UTC)
	(envelope-from emax@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HNXUGZ038818;
	Fri, 17 Apr 2009 23:33:30 GMT (envelope-from emax@svn.freebsd.org)
Received: (from emax@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HNXU80038817;
	Fri, 17 Apr 2009 23:33:30 GMT (envelope-from emax@svn.freebsd.org)
Message-Id: <200904172333.n3HNXU80038817@svn.freebsd.org>
From: Maksim Yevmenkin 
Date: Fri, 17 Apr 2009 23:33:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191232 - head/usr.sbin/bluetooth/btpand
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 17 Apr 2009 23:33:31 -0000

Author: emax
Date: Fri Apr 17 23:33:30 2009
New Revision: 191232
URL: http://svn.freebsd.org/changeset/base/191232

Log:
  Fix bug in event timeout handling
  
  Submitted by:	mav
  MFC after:	3 days

Modified:
  head/usr.sbin/bluetooth/btpand/event.c

Modified: head/usr.sbin/bluetooth/btpand/event.c
==============================================================================
--- head/usr.sbin/bluetooth/btpand/event.c	Fri Apr 17 23:22:06 2009	(r191231)
+++ head/usr.sbin/bluetooth/btpand/event.c	Fri Apr 17 23:33:30 2009	(r191232)
@@ -110,12 +110,12 @@ __event_dispatch(void)
 		event_del(ev);
 
 		if (ev->flags & EV_HAS_TIMEOUT) {
-			t = now;
-
-			if (tv_cmp(&t, &ev->expire) <= 0)
+			if (tv_cmp(&now, &ev->expire) >= 0)
 				t.tv_sec = t.tv_usec = 0;
-			else
-				tv_sub(&t, &ev->expire);
+			else {
+				t = ev->expire;
+				tv_sub(&t, &now);
+			}
 
 			if (tv_cmp(&t, &timeout) < 0)
 				timeout = t;

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 03:02:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 07CEB1065675;
	Sat, 18 Apr 2009 03:02:45 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E96B48FC1A;
	Sat, 18 Apr 2009 03:02:44 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3I32i74051577;
	Sat, 18 Apr 2009 03:02:44 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3I32iED051576;
	Sat, 18 Apr 2009 03:02:44 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200904180302.n3I32iED051576@svn.freebsd.org>
From: Warner Losh 
Date: Sat, 18 Apr 2009 03:02:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191233 - head/sys/dev/ed
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 03:02:46 -0000

Author: imp
Date: Sat Apr 18 03:02:44 2009
New Revision: 191233
URL: http://svn.freebsd.org/changeset/base/191233

Log:
  Remove debug write accidentally left in.

Modified:
  head/sys/dev/ed/if_ed_pccard.c

Modified: head/sys/dev/ed/if_ed_pccard.c
==============================================================================
--- head/sys/dev/ed/if_ed_pccard.c	Fri Apr 17 23:33:30 2009	(r191232)
+++ head/sys/dev/ed/if_ed_pccard.c	Sat Apr 18 03:02:44 2009	(r191233)
@@ -585,7 +585,6 @@ ed_pccard_attach(device_t dev)
 		sc->sc_media_ioctl = ed_pccard_media_ioctl;
 		ed_pccard_kick_phy(sc);
 	} else {
-		printf("Generic ifmedia\n");
 		ed_gen_ifmedia_init(sc);
 	}
 	if (sc->modem_rid != -1)

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 03:10:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 13F8C106566B;
	Sat, 18 Apr 2009 03:10:29 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 023688FC12;
	Sat, 18 Apr 2009 03:10:29 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3I3ASFa052312;
	Sat, 18 Apr 2009 03:10:28 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3I3ASIg052308;
	Sat, 18 Apr 2009 03:10:28 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200904180310.n3I3ASIg052308@svn.freebsd.org>
From: Warner Losh 
Date: Sat, 18 Apr 2009 03:10:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191234 - head/sys/dev/ed
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 03:10:29 -0000

Author: imp
Date: Sat Apr 18 03:10:28 2009
New Revision: 191234
URL: http://svn.freebsd.org/changeset/base/191234

Log:
  Establish the interrupt handler AFTER we successfully attach.  We need
  to do this in case we have a shared interrupt that fires during the
  attach process....

Modified:
  head/sys/dev/ed/if_ed_cbus.c
  head/sys/dev/ed/if_ed_isa.c
  head/sys/dev/ed/if_ed_pccard.c
  head/sys/dev/ed/if_ed_pci.c

Modified: head/sys/dev/ed/if_ed_cbus.c
==============================================================================
--- head/sys/dev/ed/if_ed_cbus.c	Sat Apr 18 03:02:44 2009	(r191233)
+++ head/sys/dev/ed/if_ed_cbus.c	Sat Apr 18 03:10:28 2009	(r191234)
@@ -242,15 +242,18 @@ ed_cbus_attach(dev)
 
 	ed_alloc_irq(dev, sc->irq_rid, 0);
 
-	error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
-	    NULL, edintr, sc, &sc->irq_handle);
+	if (sc->sc_media_ioctl == NULL)
+		ed_gen_ifmedia_init(sc);
+	error = ed_attach(dev);
 	if (error) {
 		ed_release_resources(dev);
 		return (error);
 	}
-	if (sc->sc_media_ioctl == NULL)
-		ed_gen_ifmedia_init(sc);
-	return ed_attach(dev);
+	error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
+	    NULL, edintr, sc, &sc->irq_handle);
+	if (error)
+		ed_release_resources(dev);
+	return (error);
 }
 
 /*

Modified: head/sys/dev/ed/if_ed_isa.c
==============================================================================
--- head/sys/dev/ed/if_ed_isa.c	Sat Apr 18 03:02:44 2009	(r191233)
+++ head/sys/dev/ed/if_ed_isa.c	Sat Apr 18 03:10:28 2009	(r191234)
@@ -169,15 +169,18 @@ ed_isa_attach(device_t dev)
 
 	ed_alloc_irq(dev, sc->irq_rid, 0);
 
-	error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
-	    NULL, edintr, sc, &sc->irq_handle);
+	if (sc->sc_media_ioctl == NULL)
+		ed_gen_ifmedia_init(sc);
+	error = ed_attach(dev);
 	if (error) {
 		ed_release_resources(dev);
 		return (error);
 	}
-	if (sc->sc_media_ioctl == NULL)
-		ed_gen_ifmedia_init(sc);
-	return ed_attach(dev);
+	error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
+	    NULL, edintr, sc, &sc->irq_handle);
+	if (error)
+		ed_release_resources(dev);
+	return (error);
 }
 
 static device_method_t ed_isa_methods[] = {

Modified: head/sys/dev/ed/if_ed_pccard.c
==============================================================================
--- head/sys/dev/ed/if_ed_pccard.c	Sat Apr 18 03:02:44 2009	(r191233)
+++ head/sys/dev/ed/if_ed_pccard.c	Sat Apr 18 03:10:28 2009	(r191234)
@@ -495,13 +495,6 @@ ed_pccard_attach(device_t dev)
 	if (error)
 		goto bad;
 
-	error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
-	    NULL, edintr, sc, &sc->irq_handle);
-	if (error) {
-		device_printf(dev, "setup intr failed %d \n", error);
-		goto bad;
-	}	      
-
 	/*
 	 * There are several ways to get the MAC address for the card.
 	 * Some of the above probe routines can fill in the enaddr.  If
@@ -589,6 +582,14 @@ ed_pccard_attach(device_t dev)
 	}
 	if (sc->modem_rid != -1)
 		ed_pccard_add_modem(dev);
+
+	error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
+	    NULL, edintr, sc, &sc->irq_handle);
+	if (error) {
+		device_printf(dev, "setup intr failed %d \n", error);
+		goto bad;
+	}	      
+
 	return (0);
 bad:
 	ed_detach(dev);

Modified: head/sys/dev/ed/if_ed_pci.c
==============================================================================
--- head/sys/dev/ed/if_ed_pci.c	Sat Apr 18 03:02:44 2009	(r191233)
+++ head/sys/dev/ed/if_ed_pci.c	Sat Apr 18 03:10:28 2009	(r191234)
@@ -110,15 +110,15 @@ ed_pci_attach(device_t dev)
 		ed_release_resources(dev);
 		return (error);
 	}
-	error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
-	    NULL, edintr, sc, &sc->irq_handle);
+	if (sc->sc_media_ioctl == NULL)
+		ed_gen_ifmedia_init(sc);
+	error = ed_attach(dev);
 	if (error) {
 		ed_release_resources(dev);
 		return (error);
 	}
-	if (sc->sc_media_ioctl == NULL)
-		ed_gen_ifmedia_init(sc);
-	error = ed_attach(dev);
+	error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE,
+	    NULL, edintr, sc, &sc->irq_handle);
 	if (error)
 		ed_release_resources(dev);
 	return (error);

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 03:47:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B2FA9106564A;
	Sat, 18 Apr 2009 03:47:29 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9F7CD8FC08;
	Sat, 18 Apr 2009 03:47:29 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3I3lTl5053781;
	Sat, 18 Apr 2009 03:47:29 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3I3lT8e053780;
	Sat, 18 Apr 2009 03:47:29 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904180347.n3I3lT8e053780@svn.freebsd.org>
From: Tim Kientzle 
Date: Sat, 18 Apr 2009 03:47:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191235 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 03:47:30 -0000

Author: kientzle
Date: Sat Apr 18 03:47:29 2009
New Revision: 191235
URL: http://svn.freebsd.org/changeset/base/191235

Log:
  Correct and update the manpage to include
  more details about some of the formats and
  to briefly describe the mtree writing capability.

Modified:
  head/lib/libarchive/libarchive-formats.5

Modified: head/lib/libarchive/libarchive-formats.5
==============================================================================
--- head/lib/libarchive/libarchive-formats.5	Sat Apr 18 03:10:28 2009	(r191234)
+++ head/lib/libarchive/libarchive-formats.5	Sat Apr 18 03:47:29 2009	(r191235)
@@ -24,8 +24,8 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 27, 2004
-.Dt libarchive-formats 3
+.Dd April 17, 2009
+.Dt libarchive-formats 5
 .Os
 .Sh NAME
 .Nm libarchive-formats
@@ -93,8 +93,9 @@ to define custom keys by preceding them 
 When writing pax archives, libarchive uses many of the SCHILY keys
 defined by Joerg Schilling's
 .Dq star
-archiver.
-The libarchive library can read most of the SCHILY keys.
+archiver and a few LIBARCHIVE keys.
+The libarchive library can read most of the SCHILY keys
+and most of the GNU keys introduced by GNU tar.
 It silently ignores any keywords that it does not understand.
 .It Cm restricted pax
 The libarchive library can also write pax archives in which it
@@ -156,7 +157,8 @@ and
 format archives.
 A cpio archive stores each entry as a fixed-size header followed
 by a variable-length filename and variable-length data.
-Unlike tar, cpio does only minimal padding of the header or file data.
+Unlike the tar format, the cpio format does only minimal padding
+of the header or file data.
 There are a variety of cpio formats, which differ primarily in
 how they store the initial header: some store the values as
 octal or hexadecimal numbers in ASCII, others as binary values of
@@ -169,7 +171,12 @@ This format used 32-bit binary values fo
 and 16-bit binary values for the other fields.
 .It Cm odc
 The libarchive library can both read and write this
-POSIX-standard format.
+POSIX-standard format, which is officially known as the
+.Dq cpio interchange format
+or the
+.Dq octet-oriented cpio archive format
+and sometimes unofficially referred to as the
+.Dq old character format .
 This format stores the header contents as octal values in ASCII.
 It is standard, portable, and immune from byte-order confusion.
 File sizes and mtime are limited to 33 bits (8GB file size),
@@ -237,16 +244,24 @@ shardump archives less portable than pla
 Libarchive can read and extract from files containing ISO9660-compliant
 CDROM images.
 It also has partial support for Rockridge extensions.
-In many cases, this can remove the need to burn a physical CDROM.
+In many cases, this can remove the need to burn a physical CDROM
+just in order to read the files contained in an ISO9660 image.
 It also avoids security and complexity issues that come with
 virtual mounts and loopback devices.
 .Ss Zip format
-Libarchive can extract from most zip format archives.
+Libarchive can extract from most zip format archives, including
+jar archives, archives that use Zip64 extensions and many
+self-extracting zip archives.
 It currently only supports uncompressed entries and entries
 compressed with the
 .Dq deflate
 algorithm.
 Older zip compression algorithms are not supported.
+Libarchive reads Zip archives as they are being streamed,
+which allows it to read archives of arbitrary size.
+It currently does not use the central directory; this
+limits libarchive's ability to support some self-extracting
+archives and ones that have been modified in certain ways.
 .Ss Archive (library) file format
 The Unix archive format (commonly created by the
 .Xr ar 1
@@ -260,13 +275,32 @@ the GNU format derived from SVR4,
 and the BSD format, which first appeared in 4.4BSD.
 Libarchive provides read and write support for both variants.
 .Ss mtree
-Libarchive can read files in
+Libarchive can read and write files in
 .Xr mtree 5
-format. This format is not a true archive format, but rather a description
-of a file hierarchy. When requested, libarchive obtains the contents of
-the files described by the
+format.
+This format is not a true archive format, but rather a textual description
+of a file hierarchy in which each line specifies the name of a file and
+provides specific metadata about that file.
+Libarchive can read all of the keywords supported by both
+the NetBSD and FreeBSD versions of
+.Xr mtree 1 ,
+although many of the keywords cannot currently be stored in an
+.Tn archive_entry
+object.
+When reading, libarchive supports an extension that allows it
+to obtain the contents of the files described by the
 .Xr mtree 5
-format from files on disk instead.
+description from files on disk.
+When writing, libarchive supports use of the
+.Xr archive_write_set_options 3
+interface to specify which keywords should be included in the
+output.
+This includes the ability to compute hash entries such
+as
+.Cm sha512
+or
+.Cm md5
+from file data being written to the mtree writer.
 .Sh SEE ALSO
 .Xr ar 1 ,
 .Xr cpio 1 ,

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 04:21:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DFCBC106566C;
	Sat, 18 Apr 2009 04:21:04 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CFA558FC14;
	Sat, 18 Apr 2009 04:21:04 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3I4L43j054667;
	Sat, 18 Apr 2009 04:21:04 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3I4L4dn054666;
	Sat, 18 Apr 2009 04:21:04 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200904180421.n3I4L4dn054666@svn.freebsd.org>
From: Warner Losh 
Date: Sat, 18 Apr 2009 04:21:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191236 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 04:21:05 -0000

Author: imp
Date: Sat Apr 18 04:21:04 2009
New Revision: 191236
URL: http://svn.freebsd.org/changeset/base/191236

Log:
  This turns out to be wrong...

Modified:
  head/share/man/man4/ed.4

Modified: head/share/man/man4/ed.4
==============================================================================
--- head/share/man/man4/ed.4	Sat Apr 18 03:47:29 2009	(r191235)
+++ head/share/man/man4/ed.4	Sat Apr 18 04:21:04 2009	(r191236)
@@ -311,8 +311,6 @@ driver does not support the following Et
 .Bl -bullet -compact
 .It
 Mitsubishi LAN Adapter B8895
-.It
-D-Link DE-650
 .El
 .Sh DIAGNOSTICS
 .Bl -diag
@@ -395,13 +393,6 @@ The Mitsubishi B8895 PC Card uses a DP83
 undocumented.
 Neither the NE2000 nor the WD83x0 drivers work with this card.
 .Pp
-The D-LINK DE-650 has funky resources that differ from other cards and could
-likely be made to work.
-Its shared memory interface conflicts with other resources on many
-laptops and cannot be moved.
-The pccard(4) layer does not support activating a CFE that it fails to
-allocate all the resources for.
-.Pp
 .Sh SEE ALSO
 .Xr altq 4 ,
 .Xr arp 4 ,

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 04:37:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8D00F106566B;
	Sat, 18 Apr 2009 04:37:54 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7C7078FC0A;
	Sat, 18 Apr 2009 04:37:54 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3I4bs41055176;
	Sat, 18 Apr 2009 04:37:54 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3I4bsOv055175;
	Sat, 18 Apr 2009 04:37:54 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200904180437.n3I4bsOv055175@svn.freebsd.org>
From: Warner Losh 
Date: Sat, 18 Apr 2009 04:37:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191237 - head/sys/dev/ed
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 04:37:55 -0000

Author: imp
Date: Sat Apr 18 04:37:53 2009
New Revision: 191237
URL: http://svn.freebsd.org/changeset/base/191237

Log:
  Add GVP NIC 2000P and New Media Livewire.  Also New Media LanSurfer
  doesn't have a function type of network, so add a quirk for that...

Modified:
  head/sys/dev/ed/if_ed_pccard.c

Modified: head/sys/dev/ed/if_ed_pccard.c
==============================================================================
--- head/sys/dev/ed/if_ed_pccard.c	Sat Apr 18 04:21:04 2009	(r191236)
+++ head/sys/dev/ed/if_ed_pccard.c	Sat Apr 18 04:37:53 2009	(r191237)
@@ -176,6 +176,7 @@ static const struct ed_product {
 	{ PCMCIA_CARD(GREY_CELL, TDK3000), 0},
 	{ PCMCIA_CARD(GREY_CELL, DMF650TX),
 	    NE2000DVF_ANYFUNC | NE2000DVF_DL100XX | NE2000DVF_MODEM},
+	{ PCMCIA_CARD(GVC, NIC_2000P), 0},
 	{ PCMCIA_CARD(IBM, HOME_AND_AWAY), 0},
 	{ PCMCIA_CARD(IBM, INFOMOVER), 0},
 	{ PCMCIA_CARD(IODATA3, PCLAT), 0},
@@ -200,7 +201,8 @@ static const struct ed_product {
 	/* Same ID as DLINK DFE-670TXD.  670 has DL10022, fa411 has ax88790 */
 	{ PCMCIA_CARD(NETGEAR, FA411), NE2000DVF_AX88X90 | NE2000DVF_DL100XX},
 	{ PCMCIA_CARD(NEXTCOM, NEXTHAWK), 0},
-	{ PCMCIA_CARD(NEWMEDIA, LANSURFER), 0},
+	{ PCMCIA_CARD(NEWMEDIA, LANSURFER), NE2000DVF_ANYFUNC},
+	{ PCMCIA_CARD(NEWMEDIA, LIVEWIRE), 0},
 	{ PCMCIA_CARD(OEM2, ETHERNET), 0},
 	{ PCMCIA_CARD(OEM2, FAST_ETHERNET), NE2000DVF_AX88X90 },
 	{ PCMCIA_CARD(OEM2, NE2000), 0},

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 04:45:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 468AB106564A;
	Sat, 18 Apr 2009 04:45:03 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 35F5E8FC13;
	Sat, 18 Apr 2009 04:45:03 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3I4j3gY055394;
	Sat, 18 Apr 2009 04:45:03 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3I4j3oe055393;
	Sat, 18 Apr 2009 04:45:03 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <200904180445.n3I4j3oe055393@svn.freebsd.org>
From: Warner Losh 
Date: Sat, 18 Apr 2009 04:45:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191238 - head/sys/dev/ed
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 04:45:03 -0000

Author: imp
Date: Sat Apr 18 04:45:02 2009
New Revision: 191238
URL: http://svn.freebsd.org/changeset/base/191238

Log:
  Make sure that the data in the ROM with a valid signature isn't all
  0's.  At least one PC Card ASIC does this...

Modified:
  head/sys/dev/ed/if_ed_pccard.c

Modified: head/sys/dev/ed/if_ed_pccard.c
==============================================================================
--- head/sys/dev/ed/if_ed_pccard.c	Sat Apr 18 04:37:53 2009	(r191237)
+++ head/sys/dev/ed/if_ed_pccard.c	Sat Apr 18 04:45:02 2009	(r191238)
@@ -330,7 +330,7 @@ static int
 ed_pccard_rom_mac(device_t dev, uint8_t *enaddr)
 {
 	struct ed_softc *sc = device_get_softc(dev);
-	uint8_t romdata[32];
+	uint8_t romdata[32], sum;
 	int i;
 
 	/*
@@ -371,6 +371,10 @@ ed_pccard_rom_mac(device_t dev, uint8_t 
 		device_printf(dev, "ROM DATA: %32D\n", romdata, " ");
 	if (romdata[28] != 0x57 || romdata[30] != 0x57)
 		return (0);
+	for (i = 0, sum = 0; i < ETHER_ADDR_LEN; i++)
+		sum |= romdata[i * 2];
+	if (sum == 0)
+		return (0);
 	for (i = 0; i < ETHER_ADDR_LEN; i++)
 		enaddr[i] = romdata[i * 2];
 	return (1);

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 06:01:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EB89A106564A;
	Sat, 18 Apr 2009 06:01:55 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D9E348FC12;
	Sat, 18 Apr 2009 06:01:55 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3I61tQq057452;
	Sat, 18 Apr 2009 06:01:55 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3I61tfE057451;
	Sat, 18 Apr 2009 06:01:55 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904180601.n3I61tfE057451@svn.freebsd.org>
From: Tim Kientzle 
Date: Sat, 18 Apr 2009 06:01:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191239 - head/rescue/rescue
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 06:01:56 -0000

Author: kientzle
Date: Sat Apr 18 06:01:55 2009
New Revision: 191239
URL: http://svn.freebsd.org/changeset/base/191239

Log:
  Libarchive is sprouting dependencies on libmd and libcrypto.
  Because crunchgen drops any repeated library (keeping only the
  first), the -lcrypto reference must be moved to after -larchive,
  not merely duplicated.
  
  I'm considering changing crunchgen's handling of duplicate
  libraries, but that's a rather more delicate issue.

Modified:
  head/rescue/rescue/Makefile

Modified: head/rescue/rescue/Makefile
==============================================================================
--- head/rescue/rescue/Makefile	Sat Apr 18 04:45:02 2009	(r191238)
+++ head/rescue/rescue/Makefile	Sat Apr 18 06:01:55 2009	(r191239)
@@ -73,9 +73,6 @@ CRUNCH_PROGS_bin= cat chflags chio chmod
 	 ed expr getfacl hostname kenv kill ln ls mkdir mv	\
 	 pkill ps pwd realpath rm rmdir setfacl sh stty sync test
 CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -lm -ltermcap -lutil
-.if ${MK_OPENSSL} != "no"
-CRUNCH_LIBS+= -lcrypto
-.endif
 
 # Additional options for specific programs
 CRUNCH_ALIAS_test= [
@@ -201,7 +198,10 @@ CRUNCH_ALIAS_bzip2= bunzip2 bzcat
 CRUNCH_LIBS+= -lbz2
 
 CRUNCH_PROGS_usr.bin+= tar
-CRUNCH_LIBS+= -larchive
+CRUNCH_LIBS+= -larchive -lmd
+.if ${MK_OPENSSL} != "no"
+CRUNCH_LIBS+= -lcrypto
+.endif
 
 CRUNCH_PROGS_usr.bin+= vi
 CRUNCH_ALIAS_vi= ex

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 06:03:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4CDF1106566C;
	Sat, 18 Apr 2009 06:03:10 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B3BE8FC17;
	Sat, 18 Apr 2009 06:03:10 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3I63AWC057513;
	Sat, 18 Apr 2009 06:03:10 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3I63ADv057511;
	Sat, 18 Apr 2009 06:03:10 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904180603.n3I63ADv057511@svn.freebsd.org>
From: Tim Kientzle 
Date: Sat, 18 Apr 2009 06:03:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191240 - in head/usr.bin: cpio tar
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 06:03:10 -0000

Author: kientzle
Date: Sat Apr 18 06:03:09 2009
New Revision: 191240
URL: http://svn.freebsd.org/changeset/base/191240

Log:
  Make -lcrypto usage dependent on whether or not we're building with OpenSSL.

Modified:
  head/usr.bin/cpio/Makefile
  head/usr.bin/tar/Makefile

Modified: head/usr.bin/cpio/Makefile
==============================================================================
--- head/usr.bin/cpio/Makefile	Sat Apr 18 06:01:55 2009	(r191239)
+++ head/usr.bin/cpio/Makefile	Sat Apr 18 06:03:09 2009	(r191240)
@@ -9,7 +9,10 @@ WARNS?=	6
 DPADD=	${LIBARCHIVE} ${LIBZ} ${LIBBZ2}
 CFLAGS+= -DBSDCPIO_VERSION_STRING=\"${BSDCPIO_VERSION_STRING}\"
 CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\"
-LDADD+=	-larchive -lz -lbz2 -lmd -lcrypto
+LDADD+=	-larchive -lz -lbz2 -lmd
+.if ${MK_OPENSSL} != "no"
+LDADD+= -lcrypto
+.endif
 
 .if ${MK_GNU_CPIO} != "yes"
 SYMLINKS=bsdcpio ${BINDIR}/cpio

Modified: head/usr.bin/tar/Makefile
==============================================================================
--- head/usr.bin/tar/Makefile	Sat Apr 18 06:01:55 2009	(r191239)
+++ head/usr.bin/tar/Makefile	Sat Apr 18 06:03:09 2009	(r191240)
@@ -1,11 +1,15 @@
 # $FreeBSD$
+.include 
 
 PROG=	bsdtar
 BSDTAR_VERSION_STRING=2.7.0
 SRCS=	bsdtar.c cmdline.c getdate.c matching.c read.c siginfo.c subst.c tree.c util.c write.c
 WARNS?=	5
 DPADD=	${LIBARCHIVE} ${LIBBZ2} ${LIBZ}
-LDADD=	-larchive -lbz2 -lz -lmd -lcrypto
+LDADD=	-larchive -lbz2 -lz -lmd
+.if ${MK_OPENSSL} != "no"
+LDADD+= -lcrypto
+.endif
 CFLAGS+=	-DBSDTAR_VERSION_STRING=\"${BSDTAR_VERSION_STRING}\"
 CFLAGS+=	-DPLATFORM_CONFIG_H=\"config_freebsd.h\"
 CFLAGS+=	-I${.CURDIR}

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 06:06:47 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 79733106564A;
	Sat, 18 Apr 2009 06:06:47 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 67BC38FC0C;
	Sat, 18 Apr 2009 06:06:47 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3I66l0J057640;
	Sat, 18 Apr 2009 06:06:47 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3I66lmS057637;
	Sat, 18 Apr 2009 06:06:47 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200904180606.n3I66lmS057637@svn.freebsd.org>
From: Tim Kientzle 
Date: Sat, 18 Apr 2009 06:06:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191241 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 06:06:48 -0000

Author: kientzle
Date: Sat Apr 18 06:06:47 2009
New Revision: 191241
URL: http://svn.freebsd.org/changeset/base/191241

Log:
  Rely on OpenSSL bits only if we're building a system with OpenSSL.
  Also, adjust the MD5 calls to rely on libmd instead of libcrypto,
  so we keep MD5 support even in the !OpenSSL case.

Modified:
  head/lib/libarchive/Makefile
  head/lib/libarchive/archive_write_set_format_mtree.c
  head/lib/libarchive/config_freebsd.h

Modified: head/lib/libarchive/Makefile
==============================================================================
--- head/lib/libarchive/Makefile	Sat Apr 18 06:03:09 2009	(r191240)
+++ head/lib/libarchive/Makefile	Sat Apr 18 06:06:47 2009	(r191241)
@@ -1,4 +1,5 @@
 # $FreeBSD$
+.include 
 
 LIB=	archive
 DPADD=	${LIBBZ2} ${LIBZ}
@@ -11,6 +12,11 @@ SHLIB_MAJOR= 4
 CFLAGS+=	-DPLATFORM_CONFIG_H=\"config_freebsd.h\"
 CFLAGS+=	-I${.OBJDIR}
 
+.if ${MK_OPENSSL} != "no"
+CFLAGS+=	-DWITH_OPENSSL
+.endif
+
+
 WARNS?=	6
 
 # Headers to be installed in /usr/include

Modified: head/lib/libarchive/archive_write_set_format_mtree.c
==============================================================================
--- head/lib/libarchive/archive_write_set_format_mtree.c	Sat Apr 18 06:03:09 2009	(r191240)
+++ head/lib/libarchive/archive_write_set_format_mtree.c	Sat Apr 18 06:06:47 2009	(r191241)
@@ -33,13 +33,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef HAVE_OPENSSL_MD5_H
-#include 
-#else /* HAVE_OPENSSL_MD5_H */
 #ifdef HAVE_MD5_H
 #include 
-#endif
+#else
+#ifdef HAVE_OPENSSL_MD5_H
+#include 
 #endif /* HAVE_OPENSSL_MD5_H */
+#endif /* HAVE_MD5_H */
 #ifdef HAVE_OPENSSL_RIPEMD_H
 #include 
 #else /* HAVE_OPENSSL_RIPEMD_H */
@@ -618,7 +618,7 @@ archive_write_mtree_header(struct archiv
 	if ((mtree->keys & F_MD5) != 0 &&
 	    archive_entry_filetype(entry) == AE_IFREG) {
 		mtree->compute_sum |= F_MD5;
-		MD5_Init(&mtree->md5ctx);
+		MD5Init(&mtree->md5ctx);
 	} else
 		mtree->compute_sum &= ~F_MD5;
 #endif
@@ -803,7 +803,7 @@ archive_write_mtree_finish_entry(struct 
 	if (mtree->compute_sum & F_MD5) {
 		unsigned char buf[16];
 
-		MD5_Final(buf, &mtree->md5ctx);
+		MD5Final(buf, &mtree->md5ctx);
 		archive_strcat(str, " md5digest=");
 		strappend_bin(str, buf, sizeof(buf));
 	}
@@ -901,7 +901,7 @@ archive_write_mtree_data(struct archive_
 	}
 #ifdef HAVE_MD5
 	if (mtree->compute_sum & F_MD5)
-		MD5_Update(&mtree->md5ctx, buff, n);
+		MD5Update(&mtree->md5ctx, buff, n);
 #endif
 #ifdef HAVE_RMD160
 	if (mtree->compute_sum & F_RMD160)

Modified: head/lib/libarchive/config_freebsd.h
==============================================================================
--- head/lib/libarchive/config_freebsd.h	Sat Apr 18 06:03:09 2009	(r191240)
+++ head/lib/libarchive/config_freebsd.h	Sat Apr 18 06:06:47 2009	(r191241)
@@ -42,6 +42,14 @@
 #define	HAVE_SYS_EXTATTR_H 1
 #endif
 
+#ifdef WITH_OPENSSL
+#define	HAVE_OPENSSL_MD5_H 1
+#define	HAVE_OPENSSL_RIPEMD_H 1
+#define	HAVE_OPENSSL_SHA_H 1
+#define	HAVE_SHA384 1
+#define	HAVE_SHA512 1
+#endif
+
 #define	HAVE_BZLIB_H 1
 #define	HAVE_CHFLAGS 1
 #define	HAVE_CHOWN 1
@@ -75,38 +83,26 @@
 #define	HAVE_LIMITS_H 1
 #define	HAVE_LUTIMES 1
 #define	HAVE_MALLOC 1
-#if 0
 #define	HAVE_MD5 1
 #define	HAVE_MD5_H 1
-#endif
 #define	HAVE_MEMMOVE 1
 #define	HAVE_MEMSET 1
 #define	HAVE_MKDIR 1
 #define	HAVE_MKFIFO 1
 #define	HAVE_MKNOD 1
-#if 0
-#define	HAVE_OPENSSL_MD5_H 1
-#define	HAVE_OPENSSL_RIPEMD_H 1
-#define	HAVE_OPENSSL_SHA_H 1
-#endif
 #define	HAVE_PIPE 1
 #define	HAVE_POLL 1
 #define	HAVE_POLL_H 1
 #define	HAVE_PWD_H 1
 #define	HAVE_READLINK 1
-#if 0
+#define	HAVE_RIPEMD_H
 #define	HAVE_RMD160 1
-#endif
 #define	HAVE_SELECT 1
 #define	HAVE_SETENV 1
-#if 0
 #define	HAVE_SHA_H 1
 #define	HAVE_SHA1 1
 #define	HAVE_SHA256 1
 #define	HAVE_SHA256_H 1
-#define	HAVE_SHA384 1
-#define	HAVE_SHA512 1
-#endif
 #define	HAVE_SIGNAL_H 1
 #define	HAVE_STDINT_H 1
 #define	HAVE_STDLIB_H 1

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 07:36:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC6431065670;
	Sat, 18 Apr 2009 07:36:38 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9F01C8FC08;
	Sat, 18 Apr 2009 07:36:38 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3I7ac4j059820;
	Sat, 18 Apr 2009 07:36:38 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3I7acqZ059818;
	Sat, 18 Apr 2009 07:36:38 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200904180736.n3I7acqZ059818@svn.freebsd.org>
From: Ed Schouten 
Date: Sat, 18 Apr 2009 07:36:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191242 - in head/sys/dev: mlx mly
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 07:36:39 -0000

Author: ed
Date: Sat Apr 18 07:36:38 2009
New Revision: 191242
URL: http://svn.freebsd.org/changeset/base/191242

Log:
  Convert mlx(4) and mly(4) to si_drv1 instead of dev2unit().

Modified:
  head/sys/dev/mlx/mlx.c
  head/sys/dev/mly/mly.c

Modified: head/sys/dev/mlx/mlx.c
==============================================================================
--- head/sys/dev/mlx/mlx.c	Sat Apr 18 06:06:47 2009	(r191241)
+++ head/sys/dev/mlx/mlx.c	Sat Apr 18 07:36:38 2009	(r191242)
@@ -474,8 +474,9 @@ mlx_attach(struct mlx_softc *sc)
     /*
      * Create the control device.
      */
-    sc->mlx_dev_t = make_dev(&mlx_cdevsw, device_get_unit(sc->mlx_dev), UID_ROOT, GID_OPERATOR, 
+    sc->mlx_dev_t = make_dev(&mlx_cdevsw, 0, UID_ROOT, GID_OPERATOR, 
 			     S_IRUSR | S_IWUSR, "mlx%d", device_get_unit(sc->mlx_dev));
+    sc->mlx_dev_t->si_drv1 = sc;
 
     /*
      * Start the timeout routine.
@@ -711,8 +712,7 @@ mlx_submit_buf(struct mlx_softc *sc, mlx
 int
 mlx_open(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
-    int			unit = dev2unit(dev);
-    struct mlx_softc	*sc = devclass_get_softc(mlx_devclass, unit);
+    struct mlx_softc	*sc = dev->si_drv1;
 
     sc->mlx_state |= MLX_STATE_OPEN;
     return(0);
@@ -724,8 +724,7 @@ mlx_open(struct cdev *dev, int flags, in
 int
 mlx_close(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
-    int			unit = dev2unit(dev);
-    struct mlx_softc	*sc = devclass_get_softc(mlx_devclass, unit);
+    struct mlx_softc	*sc = dev->si_drv1;
 
     sc->mlx_state &= ~MLX_STATE_OPEN;
     return (0);
@@ -737,8 +736,7 @@ mlx_close(struct cdev *dev, int flags, i
 int
 mlx_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td)
 {
-    int				unit = dev2unit(dev);
-    struct mlx_softc		*sc = devclass_get_softc(mlx_devclass, unit);
+    struct mlx_softc		*sc = dev->si_drv1;
     struct mlx_rebuild_request	*rb = (struct mlx_rebuild_request *)addr;
     struct mlx_rebuild_status	*rs = (struct mlx_rebuild_status *)addr;
     int				*arg = (int *)addr;

Modified: head/sys/dev/mly/mly.c
==============================================================================
--- head/sys/dev/mly/mly.c	Sat Apr 18 06:06:47 2009	(r191241)
+++ head/sys/dev/mly/mly.c	Sat Apr 18 07:36:38 2009	(r191242)
@@ -310,7 +310,7 @@ mly_attach(device_t dev)
     /*
      * Create the control device.
      */
-    sc->mly_dev_t = make_dev(&mly_cdevsw, device_get_unit(sc->mly_dev), UID_ROOT, GID_OPERATOR,
+    sc->mly_dev_t = make_dev(&mly_cdevsw, 0, UID_ROOT, GID_OPERATOR,
 			     S_IRUSR | S_IWUSR, "mly%d", device_get_unit(sc->mly_dev));
     sc->mly_dev_t->si_drv1 = sc;
 
@@ -2834,8 +2834,7 @@ mly_print_controller(int controller)
 static int
 mly_user_open(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
-    int			unit = dev2unit(dev);
-    struct mly_softc	*sc = devclass_get_softc(devclass_find("mly"), unit);
+    struct mly_softc	*sc = dev->si_drv1;
 
     sc->mly_state |= MLY_STATE_OPEN;
     return(0);
@@ -2847,8 +2846,7 @@ mly_user_open(struct cdev *dev, int flag
 static int
 mly_user_close(struct cdev *dev, int flags, int fmt, struct thread *td)
 {
-    int			unit = dev2unit(dev);
-    struct mly_softc	*sc = devclass_get_softc(devclass_find("mly"), unit);
+    struct mly_softc	*sc = dev->si_drv1;
 
     sc->mly_state &= ~MLY_STATE_OPEN;
     return (0);

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 07:39:11 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 94C8F106566B;
	Sat, 18 Apr 2009 07:39:11 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 82F148FC17;
	Sat, 18 Apr 2009 07:39:11 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3I7dBOM059899;
	Sat, 18 Apr 2009 07:39:11 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3I7dBxT059898;
	Sat, 18 Apr 2009 07:39:11 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200904180739.n3I7dBxT059898@svn.freebsd.org>
From: Ed Schouten 
Date: Sat, 18 Apr 2009 07:39:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191243 - head/sys/cam/scsi
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 07:39:12 -0000

Author: ed
Date: Sat Apr 18 07:39:11 2009
New Revision: 191243
URL: http://svn.freebsd.org/changeset/base/191243

Log:
  Remove unused SESUNIT() macro from ses(4).

Modified:
  head/sys/cam/scsi/scsi_ses.c

Modified: head/sys/cam/scsi/scsi_ses.c
==============================================================================
--- head/sys/cam/scsi/scsi_ses.c	Sat Apr 18 07:36:38 2009	(r191242)
+++ head/sys/cam/scsi/scsi_ses.c	Sat Apr 18 07:39:11 2009	(r191243)
@@ -155,8 +155,6 @@ struct ses_softc {
 #define	SES_FLAG_OPEN		0x02
 #define	SES_FLAG_INITIALIZED	0x04
 
-#define SESUNIT(x)       (dev2unit((x)))
-
 static	d_open_t	sesopen;
 static	d_close_t	sesclose;
 static	d_ioctl_t	sesioctl;

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 09:17:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 59BA6106566C;
	Sat, 18 Apr 2009 09:17:18 +0000 (UTC)
	(envelope-from niclas.zeising@gmail.com)
Received: from mx6.bahnhof.se (mx6.bahnhof.se [213.80.101.16])
	by mx1.freebsd.org (Postfix) with ESMTP id 0AB608FC0C;
	Sat, 18 Apr 2009 09:17:17 +0000 (UTC)
	(envelope-from niclas.zeising@gmail.com)
Received: from localhost (mx6.local [127.0.0.1])
	by mx6-reinject (Postfix) with ESMTP id 97ED32110F8;
	Sat, 18 Apr 2009 10:49:39 +0200 (CEST)
Received: from mx6.bahnhof.se ([127.0.0.1])
	by localhost (mx6.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 47813-01; Sat, 18 Apr 2009 10:49:36 +0200 (CEST)
Received: from [79.136.90.99] (h-90-99.A163.priv.bahnhof.se [79.136.90.99])
	by mx6.bahnhof.se (Postfix) with ESMTP id 9B16F2110C8;
	Sat, 18 Apr 2009 10:49:36 +0200 (CEST)
Received: from 127.0.0.1 (AVG SMTP 8.5.287 [270.12.0/2065]);
	Sat, 18 Apr 2009 10:49:28 +0200
Message-ID: <49E99418.40109@gmail.com>
Date: Sat, 18 Apr 2009 10:49:28 +0200
From: Niclas Zeising 
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: John Baldwin 
References: <200904171740.n3HHelQT029880@svn.freebsd.org>
In-Reply-To: <200904171740.n3HHelQT029880@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MX6)
X-Spam-Status: No, score=1.44 tagged_above=-99 required=5
	tests=[DNS_FROM_RFC_POST=1.44]
X-Spam-Score: 1.44
X-Spam-Level: *
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191217 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 09:17:19 -0000

John Baldwin wrote:
> Author: jhb
> Date: Fri Apr 17 17:40:47 2009
> New Revision: 191217
> URL: http://svn.freebsd.org/changeset/base/191217
> 
> Log:
>   The vlan code has not required the miibus code since 6.0 when
>   if_link_state_change() was added and the vlan link-state hook was moved
>   out of miibus and into net/if.c.
>   
>   MFC after:	1 month
> 
> Modified:
>   head/sys/net/if_vlan.c
> 
> Modified: head/sys/net/if_vlan.c
> ==============================================================================
> --- head/sys/net/if_vlan.c	Fri Apr 17 17:24:07 2009	(r191216)
> +++ head/sys/net/if_vlan.c	Fri Apr 17 17:40:47 2009	(r191217)
> @@ -574,7 +574,6 @@ static moduledata_t vlan_mod = {
>  
>  DECLARE_MODULE(if_vlan, vlan_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
>  MODULE_VERSION(if_vlan, 3);
> -MODULE_DEPEND(if_vlan, miibus, 1, 1, 1);
>  
>  static struct ifnet *
>  vlan_clone_match_ethertag(struct if_clone *ifc, const char *name, int *tag)
> _______________________________________________
> svn-src-all@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
> 

This should be changed in NOTES as well.
Regards!
//Niclas

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 15:42:52 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A637710656C8;
	Sat, 18 Apr 2009 15:42:52 +0000 (UTC)
	(envelope-from swell.k@gmail.com)
Received: from mail-fx0-f167.google.com (mail-fx0-f167.google.com
	[209.85.220.167])
	by mx1.freebsd.org (Postfix) with ESMTP id B46628FC14;
	Sat, 18 Apr 2009 15:42:51 +0000 (UTC)
	(envelope-from swell.k@gmail.com)
Received: by fxm11 with SMTP id 11so1309299fxm.43
	for ; Sat, 18 Apr 2009 08:42:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:from:to:cc:subject:references
	:date:in-reply-to:message-id:user-agent:mime-version:content-type;
	bh=AEx5c0y8vC2cnX/gtMGxxLIbn/3DrqRWktuAJMJkx/Q=;
	b=cFHB2013+2/XXTJ4fAhlEtHLt2x2C0Ea+6vn0Rb3JKiCtZo1WQKTAlMWimB191tqqU
	VchnQDLfsy3kpKob2PUruORWbvBovlA2Wv083qhGCBV3nEHVRJN+HZ3z5y/g/jzUKb9l
	nAY6ZSWepns67aYV0t+mtMEPzZlE4wv0nSJxE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=from:to:cc:subject:references:date:in-reply-to:message-id
	:user-agent:mime-version:content-type;
	b=UhzZfmgUz0lRI0Tize4GBWTKwhaTTmOUQ8wiXQZRTr93DC7EPRlawu0NxkfYpgsDcz
	756CnHLb9397W7cCwP/Dhl14gT0aHw9mrkq53S2nW09clzc8AsMDxEwZr00/KBoFna2u
	uHsqXf5tWgjo6yvM6RFU3pxda2ETadrBWBi6k=
Received: by 10.86.3.4 with SMTP id 4mr2776565fgc.41.1240067801270;
	Sat, 18 Apr 2009 08:16:41 -0700 (PDT)
Received: from localhost (95-24-70-84.broadband.corbina.ru [95.24.70.84])
	by mx.google.com with ESMTPS id l19sm2258975fgb.6.2009.04.18.08.16.38
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Sat, 18 Apr 2009 08:16:40 -0700 (PDT)
From: Anonymous 
To: Tim Kientzle 
References: <200904180347.n3I3lT8e053780@svn.freebsd.org>
Date: Sat, 18 Apr 2009 19:16:36 +0400
In-Reply-To: <200904180347.n3I3lT8e053780@svn.freebsd.org> (Tim Kientzle's
	message of "Sat, 18 Apr 2009 03:47:29 +0000 (UTC)")
Message-ID: <86iql2q9ez.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191235 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 15:42:54 -0000

Tim Kientzle  writes:

> Author: kientzle
> Date: Sat Apr 18 03:47:29 2009
> New Revision: 191235
> URL: http://svn.freebsd.org/changeset/base/191235
>
> Log:
>   Correct and update the manpage to include
>   more details about some of the formats and
>   to briefly describe the mtree writing capability.
>
> Modified:
>   head/lib/libarchive/libarchive-formats.5
>
> Modified: head/lib/libarchive/libarchive-formats.5
> ==============================================================================
> --- head/lib/libarchive/libarchive-formats.5	Sat Apr 18 03:10:28 2009	(r191234)
> +++ head/lib/libarchive/libarchive-formats.5	Sat Apr 18 03:47:29 2009	(r191235)
[...]
> +Libarchive can read all of the keywords supported by both
> +the NetBSD and FreeBSD versions of
> +.Xr mtree 1 ,

Wrong section again, it's mtree(8), not mtree(1) for both FreeBSD and NetBSD.

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 15:59:10 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 619FE1065677;
	Sat, 18 Apr 2009 15:59:10 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4F7758FC0C;
	Sat, 18 Apr 2009 15:59:10 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3IFx9ww080317;
	Sat, 18 Apr 2009 15:59:09 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3IFx9HX080316;
	Sat, 18 Apr 2009 15:59:09 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200904181559.n3IFx9HX080316@svn.freebsd.org>
From: Sam Leffler 
Date: Sat, 18 Apr 2009 15:59:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191246 - head/tools/tools/nanobsd/gateworks
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 15:59:11 -0000

Author: sam
Date: Sat Apr 18 15:59:09 2009
New Revision: 191246
URL: http://svn.freebsd.org/changeset/base/191246

Log:
  allow NANO_CFGDIR to be overridden

Modified:
  head/tools/tools/nanobsd/gateworks/common

Modified: head/tools/tools/nanobsd/gateworks/common
==============================================================================
--- head/tools/tools/nanobsd/gateworks/common	Sat Apr 18 12:16:33 2009	(r191245)
+++ head/tools/tools/nanobsd/gateworks/common	Sat Apr 18 15:59:09 2009	(r191246)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-NANO_CFGDIR=${NANO_SRC}/${NANO_TOOLS}/gateworks/cfg
+NANO_CFGDIR=${NANO_CFGDIR:-${NANO_SRC}/${NANO_TOOLS}/gateworks/cfg}
 test -d ${NANO_CFGDIR} || NANO_CFGDIR=/var/empty
 NANO_PMAKE="make"					# NB: disable -j 3
 

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 16:14:03 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 95097106577B;
	Sat, 18 Apr 2009 16:14:03 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 820698FC1C;
	Sat, 18 Apr 2009 16:14:03 +0000 (UTC) (envelope-from sam@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3IGE38V080713;
	Sat, 18 Apr 2009 16:14:03 GMT (envelope-from sam@svn.freebsd.org)
Received: (from sam@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3IGE3JL080712;
	Sat, 18 Apr 2009 16:14:03 GMT (envelope-from sam@svn.freebsd.org)
Message-Id: <200904181614.n3IGE3JL080712@svn.freebsd.org>
From: Sam Leffler 
Date: Sat, 18 Apr 2009 16:14:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191247 - head/tools/tools/net80211/wlanwds
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 16:14:06 -0000

Author: sam
Date: Sat Apr 18 16:14:03 2009
New Revision: 191247
URL: http://svn.freebsd.org/changeset/base/191247

Log:
  Cleanups to prepare this code for wider use (likely merged into hostapd):
  o add (required) cmd line args to specify the set of ifnet's to monitor
    for WDS discovery msgs; "any" is a wildcard
  o change the default script run on wds vap create to the "null script"
  o auto-daemonize; add -f option to force foreground operation
  o add -P option for integration with rc.d (implementation missing, tba)
  o use syslog; default to log up to LOG_INFO, -t (terse) gives you up to
    LOG_ERR, and -v (verbose) gives you up to LOG_DEBUG
  o scan for existing vaps on startup to recover existing state
  o correct some types

Modified:
  head/tools/tools/net80211/wlanwds/wlanwds.c

Modified: head/tools/tools/net80211/wlanwds/wlanwds.c
==============================================================================
--- head/tools/tools/net80211/wlanwds/wlanwds.c	Sat Apr 18 15:59:09 2009	(r191246)
+++ head/tools/tools/net80211/wlanwds/wlanwds.c	Sat Apr 18 16:14:03 2009	(r191247)
@@ -36,12 +36,6 @@
  *   and launch a script to handle adding the vap to the
  *   bridge, etc.
  * o destroy wds vap's when station leaves
- *
- * Note we query only internal state which means if we don't see
- * a vap created we won't handle leave/delete properly.  Also there
- * are several fixed pathnames/strings.
- *
- * Code liberaly swiped from wlanwatch; probably should nuke printfs.
  */
 #include 
 #include 
@@ -66,10 +60,12 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -83,11 +79,14 @@ struct wds {
 };
 static struct wds *wds;
 
-static	const char *script = "/usr/local/bin/wdsup";
+static	const char *script = NULL;
+static	char **ifnets;
+static	int nifnets = 0;
 static	int verbose = 0;
 static	int discover_on_join = 0;
 
-static	void handle_rtmsg(struct rt_msghdr *rtm, int msglen);
+static	void scanforvaps(int s);
+static	void handle_rtmsg(struct rt_msghdr *rtm, ssize_t msglen);
 static	void wds_discovery(const char *ifname,
 		const uint8_t bssid[IEEE80211_ADDR_LEN]);
 static	void wds_destroy(const char *ifname);
@@ -95,42 +94,80 @@ static	void wds_leave(const uint8_t bssi
 static	int wds_vap_create(const char *ifname, struct wds *);
 static	int wds_vap_destroy(const char *ifname);
 
+static void
+usage(const char *progname)
+{
+	fprintf(stderr, "usage: %s [-fjtv] [-P pidfile] [-s ] [ifnet0 ... | any]\n",
+		progname);
+	exit(-1);
+}
+
 int
 main(int argc, char *argv[])
 {
-	int n, s, c;
+	const char *progname = argv[0];
+	const char *pidfile = NULL;
+	int s, c, logmask, bg = 1;
 	char msg[2048];
 
-	while ((c = getopt(argc, argv, "js:vn")) != -1)
+	logmask = LOG_UPTO(LOG_INFO);
+	while ((c = getopt(argc, argv, "fjP:s:tv")) != -1)
 		switch (c) {
+		case 'f':
+			bg = 0;
+			break;
 		case 'j':
 			discover_on_join = 1;
 			break;
+		case 'P':
+			pidfile = optarg;
+			break;
 		case 's':
 			script = optarg;
 			break;
+		case 't':
+			logmask = LOG_UPTO(LOG_ERR);
+			break;
 		case 'v':
-			verbose = 1;
+			logmask = LOG_UPTO(LOG_DEBUG);
 			break;
 		case '?':
-			errx(1, "usage: %s [-s ]\n"
-				" [-v (for verbose)]\n"
-				" [-j (act on join/rejoin events)]\n", argv[0]);
+			usage(progname);
 			/*NOTREACHED*/
 		}
+	argc -= optind, argv += optind;
+	if (argc == 0) {
+		fprintf(stderr, "%s: no ifnet's specified to monitor\n",
+		    progname);
+		usage(progname);
+	}
+	ifnets = argv;
+	nifnets = argc;
 
 	s = socket(PF_ROUTE, SOCK_RAW, 0);
 	if (s < 0)
 		err(EX_OSERR, "socket");
-	for(;;) {
-		n = read(s, msg, 2048);
+	/*
+	 * Scan for inherited state.
+	 */
+	scanforvaps(s);
+
+	/* XXX what directory to work in? */
+	if (bg && daemon(0, 0) < 0)
+		err(EX_OSERR, "daemon");
+
+	openlog("wlanwds", LOG_PID | LOG_CONS, LOG_DAEMON);
+	setlogmask(logmask);
+
+	for (;;) {
+		ssize_t n = read(s, msg, sizeof(msg));
 		handle_rtmsg((struct rt_msghdr *)msg, n);
 	}
 	return 0;
 }
 
 static const char *
-ether_sprintf(const uint8_t mac[6])
+ether_sprintf(const uint8_t mac[IEEE80211_ADDR_LEN])
 {
 	static char buf[32];
 
@@ -139,76 +176,182 @@ ether_sprintf(const uint8_t mac[6])
 	return buf;
 }
 
+/*
+ * Fetch a vap's parent ifnet name.
+ */
+static int
+getparent(const char *ifname, char parent[IFNAMSIZ+1])
+{
+	char oid[256];
+	int parentlen;
+
+	/* fetch parent interface name */
+	snprintf(oid, sizeof(oid), "net.wlan.%s.%%parent", ifname+4);
+	parentlen = IFNAMSIZ;
+	if (sysctlbyname(oid, parent, &parentlen, NULL, 0) < 0)
+		return -1;
+	parent[parentlen] = '\0';
+	return 0;
+}
+
+/*
+ * Check if the specified ifnet is one we're supposed to monitor.
+ * The ifnet is assumed to be a vap; we find it's parent and check
+ * it against the set of ifnet's specified on the command line.
+ */
+static int
+checkifnet(const char *ifname, int complain)
+{
+	char parent[256];
+	int i;
+
+	if (getparent(ifname, parent) < 0) {
+		if (complain)
+			syslog(LOG_ERR,
+			   "%s: no pointer to parent interface: %m", ifname);
+		return 0;
+	}
+
+	for (i = 0; i < nifnets; i++)
+		if (strcasecmp(ifnets[i], "any") == 0 ||
+		    strcmp(ifnets[i], parent) == 0)
+			return 1;
+	syslog(LOG_DEBUG, "%s: parent %s not being monitored", ifname, parent);
+	return 0;
+}
+
+/*
+ * Return 1 if the specified ifnet is a WDS vap.
+ */
+static int
+iswdsvap(int s, const char *ifname)
+{
+	struct ifmediareq ifmr;
+
+	memset(&ifmr, 0, sizeof(ifmr));
+	strncpy(ifmr.ifm_name, ifname, sizeof(ifmr.ifm_name));
+	if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0)
+		err(-1, "%s: cannot get media", ifname);
+	return (ifmr.ifm_current & IFM_IEEE80211_WDS) != 0;
+}
+
+/*
+ * Fetch the bssid for an ifnet.  The caller is assumed
+ * to have already verified this is possible.
+ */
 static void
-handle_rtmsg(struct rt_msghdr *rtm, int msglen)
+getbssid(int s, const char *ifname, char bssid[IEEE80211_ADDR_LEN])
+{
+	struct ieee80211req ireq;
+
+	memset(&ireq, 0, sizeof(ireq));
+	strncpy(ireq.i_name, ifname, sizeof(ireq.i_name));
+	ireq.i_type = IEEE80211_IOC_BSSID;
+	ireq.i_data = bssid;
+	ireq.i_len = IEEE80211_ADDR_LEN;
+	if (ioctl(s, SIOCG80211, &ireq) < 0)
+		err(-1, "%s: cannot fetch bssid", ifname);
+}
+
+/*
+ * Scan the system for WDS vaps associated with the ifnet's we're
+ * supposed to monitor.  Any vaps are added to our internal table
+ * so we can find them (and destroy them) on station leave.
+ */
+static void
+scanforvaps(int s)
+{
+	char ifname[IFNAMSIZ+1];
+	char bssid[IEEE80211_ADDR_LEN];
+	int i;
+
+	/* XXX brutal; should just walk sysctl tree */
+	for (i = 0; i < 128; i++) {
+		snprintf(ifname, sizeof(ifname), "wlan%d", i);
+		if (checkifnet(ifname, 0) && iswdsvap(s, ifname)) {
+			struct wds *p = malloc(sizeof(struct wds));
+			if (p == NULL)
+				err(-1, "%s: malloc failed", __func__);
+			strlcpy(p->ifname, ifname, IFNAMSIZ);
+			getbssid(s, ifname, p->bssid);
+			p->next = wds;
+			wds = p;
+
+			syslog(LOG_INFO, "[%s] discover wds vap %s",
+			    ether_sprintf(bssid), ifname);
+		}
+	}
+}
+
+/*
+ * Process a routing socket message.  We handle messages related
+ * to dynamic WDS:
+ * o on WDS discovery (rx of a 4-address frame with DWDS enabled)
+ *   we create a WDS vap for the specified mac address
+ * o on station leave we destroy any associated WDS vap
+ * o on ifnet destroy we update state if this is manual destroy of
+ *   a WDS vap in our table
+ * o if the -j option is supplied on the command line we create
+ *   WDS vaps on station join/rejoin, this is useful for some setups
+ *   where a WDS vap is required for 4-address traffic to flow
+ */
+static void
+handle_rtmsg(struct rt_msghdr *rtm, ssize_t msglen)
 {
 	struct if_announcemsghdr *ifan;
-	time_t now = time(NULL);
-	char *cnow = ctime(&now);
 
 	if (rtm->rtm_version != RTM_VERSION) {
-		(void) printf("routing message version %d not understood\n",
+		syslog(LOG_ERR, "routing message version %d not understood",
 		    rtm->rtm_version);
 		return;
 	}
 	switch (rtm->rtm_type) {
 	case RTM_IFANNOUNCE:
 		ifan = (struct if_announcemsghdr *)rtm;
-		if (!verbose)
-			break;
-		printf("%.19s RTM_IFANNOUNCE: if# %d, what: ",
-			cnow, ifan->ifan_index);
 		switch (ifan->ifan_what) {
 		case IFAN_ARRIVAL:
-			printf("arrival");
+			syslog(LOG_DEBUG,
+			    "RTM_IFANNOUNCE: if# %d, what: arrival",
+			    ifan->ifan_index);
 			break;
 		case IFAN_DEPARTURE:
-			printf("departure");
+			syslog(LOG_DEBUG,
+			    "RTM_IFANNOUNCE: if# %d, what: departure",
+			    ifan->ifan_index);
+			/* NB: ok to call w/ unmonitored ifnets */
 			wds_destroy(ifan->ifan_name);
 			break;
-		default:
-			printf("#%d", ifan->ifan_what);
-			break;
 		}
-		printf("\n");
 		break;
 	case RTM_IEEE80211:
 #define	V(type)	((struct type *)(&ifan[1]))
 		ifan = (struct if_announcemsghdr *)rtm;
 		switch (ifan->ifan_what) {
+		case RTM_IEEE80211_DISASSOC:
+			if (!discover_on_join)
+				break;
+			/* fall thru... */
 		case RTM_IEEE80211_LEAVE:
-			if (verbose)
-				printf("%.19s %s station leave", cnow,
-				    ether_sprintf(V(ieee80211_leave_event)->iev_addr));
+			if (!checkifnet(ifan->ifan_name, 1))
+				break;
+			syslog(LOG_INFO, "[%s] station leave",
+			    ether_sprintf(V(ieee80211_leave_event)->iev_addr));
 			wds_leave(V(ieee80211_leave_event)->iev_addr);
-			if (verbose)
-				printf("\n");
 			break;
 		case RTM_IEEE80211_JOIN:
 		case RTM_IEEE80211_REJOIN:
+		case RTM_IEEE80211_ASSOC:
+		case RTM_IEEE80211_REASSOC:
 			if (!discover_on_join)
 				break;
 			/* fall thru... */
 		case RTM_IEEE80211_WDS:
-			if (verbose)
-				printf("%.19s %s wds discovery", cnow,
-				    ether_sprintf(V(ieee80211_wds_event)->iev_addr));
+			syslog(LOG_INFO, "[%s] wds discovery",
+			    ether_sprintf(V(ieee80211_wds_event)->iev_addr));
+			if (!checkifnet(ifan->ifan_name, 1))
+				break;
 			wds_discovery(ifan->ifan_name,
 			    V(ieee80211_wds_event)->iev_addr);
-			if (verbose)
-				printf("\n");
-			break;
-		case RTM_IEEE80211_ASSOC:
-		case RTM_IEEE80211_REASSOC:
-		case RTM_IEEE80211_DISASSOC:
-		case RTM_IEEE80211_SCAN:
-		case RTM_IEEE80211_REPLAY:
-		case RTM_IEEE80211_MICHAEL:
-			break;
-		default:
-			if (verbose)
-				printf("%.19s RTM_IEEE80211: if# %d, what: #%d\n", cnow,
-					ifan->ifan_index, ifan->ifan_what);
 			break;
 		}
 		break;
@@ -216,58 +359,61 @@ handle_rtmsg(struct rt_msghdr *rtm, int 
 	}
 }
 
+/*
+ * Handle WDS discovery; create a WDS vap for the specified bssid.
+ * If a vap already exists then do nothing (can happen when a flood
+ * of 4-address frames causes multiple events to be queued before
+ * we create a vap).
+ */
 static void
 wds_discovery(const char *ifname, const uint8_t bssid[IEEE80211_ADDR_LEN])
 {
 	struct wds *p;
-	char oid[256], parent[256];
-	int parentlen;
+	char parent[256];
+	char cmd[1024];
+	int status;
 
 	for (p = wds; p != NULL; p = p->next)
 		if (IEEE80211_ADDR_EQ(p->bssid, bssid)) {
-			if (verbose)
-				printf(" (already created)");
+			syslog(LOG_INFO, "[%s] wds vap already created (%s)",
+			    ether_sprintf(bssid), ifname);
 			return;
 		}
-
-	/* fetch parent interface name */
-	snprintf(oid, sizeof(oid), "net.wlan.%s.%%parent", ifname+4);
-	parentlen = sizeof(parent);
-	if (sysctlbyname(oid, parent, &parentlen, NULL, 0) < 0) {
-		warn("%s: no pointer to parent interface", __func__);
+	if (getparent(ifname, parent) < 0) {
+		syslog(LOG_ERR, "%s: no pointer to parent interface: %m",
+		    ifname);
 		return;
 	}
-	parent[parentlen] = '\0';
 
 	p = malloc(sizeof(struct wds));
 	if (p == NULL) {
-		warn("%s: malloc", __func__);
+		syslog(LOG_ERR, "%s: malloc failed: %m", __func__);
 		return;
 	}
 	IEEE80211_ADDR_COPY(p->bssid, bssid);
-	if (wds_vap_create(parent, p) >= 0) {
-		char cmd[1024];
-		int status;
-
-		/*
-		 * Add to table.
-		 */
-		p->next = wds;
-		wds = p;
-		if (verbose)
-			printf(" (create %s)", p->ifname);
-		/*
-		 * XXX launch script to setup bridge, etc.
-		 */
+	if (wds_vap_create(parent, p) < 0) {
+		free(p);
+		return;
+	}
+	/*
+	 * Add to table and launch setup script.
+	 */
+	p->next = wds;
+	wds = p;
+	syslog(LOG_INFO, "[%s] create wds vap %s", ether_sprintf(bssid),
+	    p->ifname);
+	if (script != NULL) {
 		snprintf(cmd, sizeof(cmd), "%s %s", script, p->ifname);
 		status = system(cmd);
 		if (status)
-			warnx("vap setup script %s exited with status %d\n",
-				script, status);
-	} else
-		free(p);
+			syslog(LOG_ERR, "vap setup script %s exited with "
+			    "status %d", script, status);
+	}
 }
 
+/* 
+ * Destroy a WDS vap (if known).
+ */
 static void
 wds_destroy(const char *ifname)
 {
@@ -276,16 +422,17 @@ wds_destroy(const char *ifname)
 	for (pp = &wds; (p = *pp) != NULL; pp = &p->next)
 		if (strncmp(p->ifname, ifname, IFNAMSIZ) == 0)
 			break;
-	/* XXX check for device directly */
-	if (p == NULL)		/* not ours/known */
+	if (p != NULL) {
+		*pp = p->next;
+		/* NB: vap already destroyed */
+		free(p);
 		return;
-	*pp = p->next;
-	if (wds_vap_destroy(p->ifname) >= 0)
-		if (verbose)
-			printf(" (wds vap destroyed)");
-	free(p);
+	}
 }
 
+/*
+ * Handle a station leave event; destroy any associated WDS vap.
+ */
 static void
 wds_leave(const uint8_t bssid[IEEE80211_ADDR_LEN])
 {
@@ -294,13 +441,13 @@ wds_leave(const uint8_t bssid[IEEE80211_
 	for (pp = &wds; (p = *pp) != NULL; pp = &p->next)
 		if (IEEE80211_ADDR_EQ(p->bssid, bssid))
 			break;
-	/* XXX fall back to check device */
-	if (p == NULL)		/* not ours/known */
-		return;
-	*pp = p->next;
-	if (wds_vap_destroy(p->ifname) >= 0)
-		printf(" (wds vap destroyed)");
-	free(p);
+	if (p != NULL) {
+		*pp = p->next;
+		if (wds_vap_destroy(p->ifname) >= 0)
+			syslog(LOG_INFO, "[%s] wds vap %s destroyed",
+			    ether_sprintf(bssid), p->ifname);
+		free(p);
+	}
 }
 
 static int
@@ -326,14 +473,14 @@ wds_vap_create(const char *parent, struc
 			strlcpy(p->ifname, ifr.ifr_name, IFNAMSIZ);
 			status = 0;
 		} else {
-			warn("SIOCIFCREATE2("
-			    "mode %u flags 0x%x parent %s bssid %s)",
+			syslog(LOG_ERR, "SIOCIFCREATE2("
+			    "mode %u flags 0x%x parent %s bssid %s): %m",
 			    cp.icp_opmode, cp.icp_flags, parent,
 			    ether_sprintf(cp.icp_bssid));
 		}
 		close(s);
 	} else
-		warn("socket(SOCK_DRAGM)");
+		syslog(LOG_ERR, "socket(SOCK_DRAGM): %m");
 	return status;
 }
 
@@ -345,13 +492,13 @@ wds_vap_destroy(const char *ifname)
 
 	s = socket(AF_INET, SOCK_DGRAM, 0);
 	if (s < 0) {
-		warn("socket(SOCK_DRAGM)");
+		syslog(LOG_ERR, "socket(SOCK_DRAGM): %m");
 		return -1;
 	}
 	memset(&ifr, 0, sizeof(ifr));
 	strncpy(ifr.i_name, ifname, IFNAMSIZ);
 	if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) {
-		warn("ioctl(SIOCIFDESTROY)");
+		syslog(LOG_ERR, "ioctl(SIOCIFDESTROY): %m");
 		status = -1;
 	} else
 		status = 0;

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 16:36:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7A5931065673;
	Sat, 18 Apr 2009 16:36:28 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4CFB38FC0A;
	Sat, 18 Apr 2009 16:36:28 +0000 (UTC)
	(envelope-from lulf@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3IGaSA1081167;
	Sat, 18 Apr 2009 16:36:28 GMT (envelope-from lulf@svn.freebsd.org)
Received: (from lulf@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3IGaSPJ081165;
	Sat, 18 Apr 2009 16:36:28 GMT (envelope-from lulf@svn.freebsd.org)
Message-Id: <200904181636.n3IGaSPJ081165@svn.freebsd.org>
From: Ulf Lilleengen 
Date: Sat, 18 Apr 2009 16:36:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191248 - head/sys/geom/vinum
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 16:36:30 -0000

Author: lulf
Date: Sat Apr 18 16:36:27 2009
New Revision: 191248
URL: http://svn.freebsd.org/changeset/base/191248

Log:
  - Remove assertion of topology lock remaining from 7.x gvinum. It is not needed,
    as the renaming only changes internal gvinum names and will not alter the geom
    topology.
  - The topology lock was not held when calling g_wither_geom after renaming.

Modified:
  head/sys/geom/vinum/geom_vinum.c
  head/sys/geom/vinum/geom_vinum_rename.c

Modified: head/sys/geom/vinum/geom_vinum.c
==============================================================================
--- head/sys/geom/vinum/geom_vinum.c	Sat Apr 18 16:14:03 2009	(r191247)
+++ head/sys/geom/vinum/geom_vinum.c	Sat Apr 18 16:36:27 2009	(r191248)
@@ -897,7 +897,9 @@ gv_worker(void *arg)
 					    v->name);
 					break;
 				}
+				g_topology_lock();
 				g_wither_provider(v->provider, ENOENT);
+				g_topology_unlock();
 				v->provider = NULL;
 				gv_post_event(sc, GV_EVENT_SETUP_OBJECTS, sc,
 				    NULL, 0, 0);

Modified: head/sys/geom/vinum/geom_vinum_rename.c
==============================================================================
--- head/sys/geom/vinum/geom_vinum_rename.c	Sat Apr 18 16:14:03 2009	(r191247)
+++ head/sys/geom/vinum/geom_vinum_rename.c	Sat Apr 18 16:36:27 2009	(r191248)
@@ -125,7 +125,6 @@ gv_rename_drive(struct gv_softc *sc, str
 {
 	struct gv_sd *s;
 
-	g_topology_assert();
 	KASSERT(d != NULL, ("gv_rename_drive: NULL d"));
 
 	if (gv_object_type(sc, newname) != GV_ERR_NOTFOUND) {
@@ -151,7 +150,6 @@ gv_rename_plex(struct gv_softc *sc, stru
 	char *ptr;
 	int err;
 
-	g_topology_assert();
 	KASSERT(p != NULL, ("gv_rename_plex: NULL p"));
 
 	if (gv_object_type(sc, newname) != GV_ERR_NOTFOUND) {
@@ -203,7 +201,6 @@ gv_rename_sd(struct gv_softc *sc, struct
 {
 	char *dot1, *dot2;
 
-	g_topology_assert();
 	KASSERT(s != NULL, ("gv_rename_sd: NULL s"));
 
 	if (gv_object_type(sc, newname) != GV_ERR_NOTFOUND) {
@@ -231,7 +228,6 @@ gv_rename_vol(struct gv_softc *sc, struc
 	char newplex[GV_MAXPLEXNAME], *ptr;
 	int err;
 
-	g_topology_assert();
 	KASSERT(v != NULL, ("gv_rename_vol: NULL v"));
 	pp = v->provider;
 	KASSERT(pp != NULL, ("gv_rename_vol: NULL pp"));

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 16:47:34 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 02B231065672;
	Sat, 18 Apr 2009 16:47:34 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DA2B28FC13;
	Sat, 18 Apr 2009 16:47:33 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3IGlXKs081438;
	Sat, 18 Apr 2009 16:47:33 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3IGlXdp081435;
	Sat, 18 Apr 2009 16:47:33 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <200904181647.n3IGlXdp081435@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Sat, 18 Apr 2009 16:47:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191249 - in head/sys: kern sys ufs/ufs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 16:47:35 -0000

Author: trasz
Date: Sat Apr 18 16:47:33 2009
New Revision: 191249
URL: http://svn.freebsd.org/changeset/base/191249

Log:
  Use acl_alloc() and acl_free() instead of using uma(9) directly.
  This will make switching to malloc(9) easier; also, it would be
  neccessary to add these routines if/when we implement variable-size
  ACLs.

Modified:
  head/sys/kern/vfs_acl.c
  head/sys/sys/acl.h
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/kern/vfs_acl.c
==============================================================================
--- head/sys/kern/vfs_acl.c	Sat Apr 18 16:36:27 2009	(r191248)
+++ head/sys/kern/vfs_acl.c	Sat Apr 18 16:47:33 2009	(r191249)
@@ -81,28 +81,31 @@ static int
 vacl_set_acl(struct thread *td, struct vnode *vp, acl_type_t type,
     struct acl *aclp)
 {
-	struct acl inkernacl;
+	struct acl *inkernelacl;
 	struct mount *mp;
 	int error;
 
-	error = copyin(aclp, &inkernacl, sizeof(struct acl));
+	inkernelacl = acl_alloc(M_WAITOK);
+	error = copyin(aclp, inkernelacl, sizeof(struct acl));
 	if (error)
-		return(error);
+		goto out;
 	error = vn_start_write(vp, &mp, V_WAIT | PCATCH);
 	if (error != 0)
-		return (error);
+		goto out;
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 #ifdef MAC
-	error = mac_vnode_check_setacl(td->td_ucred, vp, type, &inkernacl);
+	error = mac_vnode_check_setacl(td->td_ucred, vp, type, inkernelacl);
 	if (error != 0)
-		goto out;
+		goto out_unlock;
 #endif
-	error = VOP_SETACL(vp, type, &inkernacl, td->td_ucred, td);
+	error = VOP_SETACL(vp, type, inkernelacl, td->td_ucred, td);
 #ifdef MAC
-out:
+out_unlock:
 #endif
 	VOP_UNLOCK(vp, 0);
 	vn_finished_write(mp);
+out:
+	acl_free(inkernelacl);
 	return(error);
 }
 
@@ -113,22 +116,24 @@ static int
 vacl_get_acl(struct thread *td, struct vnode *vp, acl_type_t type,
     struct acl *aclp)
 {
-	struct acl inkernelacl;
+	struct acl *inkernelacl;
 	int error;
 
+	inkernelacl = acl_alloc(M_WAITOK);
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 #ifdef MAC
 	error = mac_vnode_check_getacl(td->td_ucred, vp, type);
 	if (error != 0)
 		goto out;
 #endif
-	error = VOP_GETACL(vp, type, &inkernelacl, td->td_ucred, td);
+	error = VOP_GETACL(vp, type, inkernelacl, td->td_ucred, td);
 #ifdef MAC
 out:
 #endif
 	VOP_UNLOCK(vp, 0);
 	if (error == 0)
-		error = copyout(&inkernelacl, aclp, sizeof(struct acl));
+		error = copyout(inkernelacl, aclp, sizeof(struct acl));
+	acl_free(inkernelacl);
 	return (error);
 }
 
@@ -166,13 +171,16 @@ static int
 vacl_aclcheck(struct thread *td, struct vnode *vp, acl_type_t type,
     struct acl *aclp)
 {
-	struct acl inkernelacl;
+	struct acl *inkernelacl;
 	int error;
 
-	error = copyin(aclp, &inkernelacl, sizeof(struct acl));
+	inkernelacl = acl_alloc(M_WAITOK);
+	error = copyin(aclp, inkernelacl, sizeof(struct acl));
 	if (error)
-		return(error);
-	error = VOP_ACLCHECK(vp, type, &inkernelacl, td->td_ucred, td);
+		goto out;
+	error = VOP_ACLCHECK(vp, type, inkernelacl, td->td_ucred, td);
+out:
+	acl_free(inkernelacl);
 	return (error);
 }
 
@@ -417,6 +425,23 @@ __acl_aclcheck_fd(struct thread *td, str
 	return (error);
 }
 
+struct acl *
+acl_alloc(int flags)
+{
+	struct acl *aclp;
+
+	aclp = uma_zalloc(acl_zone, flags);
+
+	return (aclp);
+}
+
+void
+acl_free(struct acl *aclp)
+{
+
+	uma_zfree(acl_zone, aclp);
+}
+
 /* ARGUSED */
 
 static void

Modified: head/sys/sys/acl.h
==============================================================================
--- head/sys/sys/acl.h	Sat Apr 18 16:36:27 2009	(r191248)
+++ head/sys/sys/acl.h	Sat Apr 18 16:47:33 2009	(r191249)
@@ -116,8 +116,6 @@ typedef struct acl_t_struct *acl_t;
 
 #ifdef _KERNEL
 
-extern uma_zone_t	acl_zone;
-
 /*
  * POSIX.1e ACLs are capable of expressing the read, write, and execute bits
  * of the POSIX mode field.  We provide two masks: one that defines the bits
@@ -141,6 +139,8 @@ mode_t			acl_posix1e_perms_to_mode(
 mode_t			acl_posix1e_acl_to_mode(struct acl *acl);
 mode_t			acl_posix1e_newfilemode(mode_t cmode,
 			    struct acl *dacl);
+struct acl		*acl_alloc(int flags);
+void			acl_free(struct acl *aclp);
 
 /*
  * File system independent syntax check for a POSIX.1e ACL.

Modified: head/sys/ufs/ufs/ufs_vnops.c
==============================================================================
--- head/sys/ufs/ufs/ufs_vnops.c	Sat Apr 18 16:36:27 2009	(r191248)
+++ head/sys/ufs/ufs/ufs_vnops.c	Sat Apr 18 16:47:33 2009	(r191249)
@@ -374,7 +374,7 @@ relock:
 
 #ifdef UFS_ACL
 	if ((vp->v_mount->mnt_flag & MNT_ACLS) != 0) {
-		acl = uma_zalloc(acl_zone, M_WAITOK);
+		acl = acl_alloc(M_WAITOK);
 		error = VOP_GETACL(vp, ACL_TYPE_ACCESS, acl, ap->a_cred,
 		    ap->a_td);
 		switch (error) {
@@ -398,7 +398,7 @@ relock:
 			error = vaccess(vp->v_type, ip->i_mode, ip->i_uid,
 			    ip->i_gid, ap->a_accmode, ap->a_cred, NULL);
 		}
-		uma_zfree(acl_zone, acl);
+		acl_free(acl);
 	} else
 #endif /* !UFS_ACL */
 		error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid,
@@ -1507,8 +1507,8 @@ ufs_mkdir(ap)
 #ifdef UFS_ACL
 	acl = dacl = NULL;
 	if ((dvp->v_mount->mnt_flag & MNT_ACLS) != 0) {
-		acl = uma_zalloc(acl_zone, M_WAITOK);
-		dacl = uma_zalloc(acl_zone, M_WAITOK);
+		acl = acl_alloc(M_WAITOK);
+		dacl = acl_alloc(M_WAITOK);
 
 		/*
 		 * Retrieve default ACL from parent, if any.
@@ -1538,16 +1538,16 @@ ufs_mkdir(ap)
 			 */
 			ip->i_mode = dmode;
 			DIP_SET(ip, i_mode, dmode);
-			uma_zfree(acl_zone, acl);
-			uma_zfree(acl_zone, dacl);
+			acl_free(acl);
+			acl_free(dacl);
 			dacl = acl = NULL;
 			break;
 		
 		default:
 			UFS_VFREE(tvp, ip->i_number, dmode);
 			vput(tvp);
-			uma_zfree(acl_zone, acl);
-			uma_zfree(acl_zone, dacl);
+			acl_free(acl);
+			acl_free(dacl);
 			return (error);
 		}
 	} else {
@@ -1617,13 +1617,13 @@ ufs_mkdir(ap)
 			break;
 
 		default:
-			uma_zfree(acl_zone, acl);
-			uma_zfree(acl_zone, dacl);
+			acl_free(acl);
+			acl_free(dacl);
 			dacl = acl = NULL;
 			goto bad;
 		}
-		uma_zfree(acl_zone, acl);
-		uma_zfree(acl_zone, dacl);
+		acl_free(acl);
+		acl_free(dacl);
 		dacl = acl = NULL;
 	}
 #endif /* !UFS_ACL */
@@ -1689,9 +1689,9 @@ bad:
 	} else {
 #ifdef UFS_ACL
 		if (acl != NULL)
-			uma_zfree(acl_zone, acl);
+			acl_free(acl);
 		if (dacl != NULL)
-			uma_zfree(acl_zone, dacl);
+			acl_free(dacl);
 #endif
 		dp->i_effnlink--;
 		dp->i_nlink--;
@@ -2325,7 +2325,7 @@ ufs_makeinode(mode, dvp, vpp, cnp)
 #ifdef UFS_ACL
 	acl = NULL;
 	if ((dvp->v_mount->mnt_flag & MNT_ACLS) != 0) {
-		acl = uma_zalloc(acl_zone, M_WAITOK);
+		acl = acl_alloc(M_WAITOK);
 
 		/*
 		 * Retrieve default ACL for parent, if any.
@@ -2360,14 +2360,14 @@ ufs_makeinode(mode, dvp, vpp, cnp)
 			 */
 			ip->i_mode = mode;
 			DIP_SET(ip, i_mode, mode);
-			uma_zfree(acl_zone, acl);
+			acl_free(acl);
 			acl = NULL;
 			break;
 	
 		default:
 			UFS_VFREE(tvp, ip->i_number, mode);
 			vput(tvp);
-			uma_zfree(acl_zone, acl);
+			acl_free(acl);
 			acl = NULL;
 			return (error);
 		}
@@ -2433,10 +2433,10 @@ ufs_makeinode(mode, dvp, vpp, cnp)
 			break;
 
 		default:
-			uma_zfree(acl_zone, acl);
+			acl_free(acl);
 			goto bad;
 		}
-		uma_zfree(acl_zone, acl);
+		acl_free(acl);
 	}
 #endif /* !UFS_ACL */
 	ufs_makedirentry(ip, cnp, &newdir);

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 18:22:50 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 39E7610657B7;
	Sat, 18 Apr 2009 18:22:49 +0000 (UTC)
	(envelope-from antoine@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1A3288FC12;
	Sat, 18 Apr 2009 18:21:43 +0000 (UTC)
	(envelope-from antoine@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3IILgtZ083256;
	Sat, 18 Apr 2009 18:21:42 GMT (envelope-from antoine@svn.freebsd.org)
Received: (from antoine@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3IILgM5083254;
	Sat, 18 Apr 2009 18:21:42 GMT (envelope-from antoine@svn.freebsd.org)
Message-Id: <200904181821.n3IILgM5083254@svn.freebsd.org>
From: Antoine Brodin 
Date: Sat, 18 Apr 2009 18:21:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191250 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 18:23:49 -0000

Author: antoine
Date: Sat Apr 18 18:21:42 2009
New Revision: 191250
URL: http://svn.freebsd.org/changeset/base/191250

Log:
  Add more obsolete files, usb related.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Sat Apr 18 16:47:33 2009	(r191249)
+++ head/ObsoleteFiles.inc	Sat Apr 18 18:21:42 2009	(r191250)
@@ -14,6 +14,21 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20090417: removal of legacy versions of USB network interface drivers
+OLD_FILES+=usr/include/legacy/dev/usb/if_auereg.h
+OLD_FILES+=usr/include/legacy/dev/usb/if_axereg.h
+OLD_FILES+=usr/include/legacy/dev/usb/if_cdcereg.h
+OLD_FILES+=usr/include/legacy/dev/usb/if_cuereg.h
+OLD_FILES+=usr/include/legacy/dev/usb/if_kuereg.h
+OLD_FILES+=usr/include/legacy/dev/usb/if_ruereg.h
+OLD_FILES+=usr/include/legacy/dev/usb/if_rumreg.h
+OLD_FILES+=usr/include/legacy/dev/usb/if_rumvar.h
+OLD_FILES+=usr/include/legacy/dev/usb/if_udavreg.h
+OLD_FILES+=usr/include/legacy/dev/usb/if_uralreg.h
+OLD_FILES+=usr/include/legacy/dev/usb/if_uralvar.h
+OLD_FILES+=usr/include/legacy/dev/usb/if_zydfw.h
+OLD_FILES+=usr/include/legacy/dev/usb/if_zydreg.h
+OLD_FILES+=usr/include/legacy/dev/usb/kue_fw.h
 # 20090416: removal of ar(4), ray(4), sr(4), raycontrol(8)
 OLD_FILES+=usr/sbin/raycontrol
 OLD_FILES+=usr/share/man/man4/i386/ar.4.gz
@@ -22,6 +37,8 @@ OLD_FILES+=usr/share/man/man4/i386/sr.4.
 OLD_FILES+=usr/share/man/man8/raycontrol.8.gz
 # 20090410: VOP_LEASE.9 removed
 OLD_FILES+=usr/share/man/man9/VOP_LEASE.9.gz
+# 20090406: usb_sw_transfer.h removed
+OLD_FILES+=usr/include/dev/usb/usb_sw_transfer.h
 # 20090405: removal of if_ppp(4) and if_sl(4)
 OLD_FILES+=sbin/slattach rescue/slattach
 OLD_FILES+=sbin/startslip rescue/startslip
@@ -60,6 +77,7 @@ OLD_FILES+=usr/lib/libusb20.a
 OLD_FILES+=usr/lib/libusb20.so
 OLD_FILES+=usr/lib/libusb20_p.a
 OLD_FILES+=usr/include/libusb20_compat01.h
+OLD_FILES+=usr/include/libusb20_compat10.h
 .if ${TARGET_ARCH} == "amd64"
 OLD_LIBS+=usr/lib32/libusb20.so.1
 OLD_FILES+=usr/lib32/libusb20.a
@@ -103,6 +121,8 @@ OLD_FILES+=usr/include/dev/usb/if_udavre
 OLD_FILES+=usr/include/dev/usb/if_upgtvar.h
 OLD_FILES+=usr/include/dev/usb/if_uralreg.h
 OLD_FILES+=usr/include/dev/usb/if_uralvar.h
+OLD_FILES+=usr/include/dev/usb/if_urtwreg.h
+OLD_FILES+=usr/include/dev/usb/if_urtwvar.h
 OLD_FILES+=usr/include/dev/usb/if_zydfw.h
 OLD_FILES+=usr/include/dev/usb/if_zydreg.h
 OLD_FILES+=usr/include/dev/usb/kue_fw.h
@@ -128,6 +148,8 @@ OLD_FILES+=usr/include/dev/usb/usbdi.h
 OLD_FILES+=usr/include/dev/usb/usbdi_util.h
 OLD_FILES+=usr/include/dev/usb/usbdivar.h
 OLD_FILES+=usr/include/dev/usb/uxb360gp_rdesc.h
+OLD_FILES+=usr/sbin/usbdevs
+OLD_FILES+=usr/share/man/man8/usbdevs.8.gz
 # 20090203: removal of pccard header files
 OLD_FILES+=usr/include/pccard/cardinfo.h
 OLD_FILES+=usr/include/pccard/cis.h

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 18:50:49 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 32A6310657A0;
	Sat, 18 Apr 2009 18:50:49 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from mail.vega.ru (mail.vega.ru [90.156.167.5])
	by mx1.freebsd.org (Postfix) with ESMTP id D7A298FC14;
	Sat, 18 Apr 2009 18:50:48 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from [10.100.124.99] (port=50016 helo=edoofus.dev.vega.ru)
	by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.69 (FreeBSD)) (envelope-from )
	id 1LvFcl-000CmN-0k; Sat, 18 Apr 2009 22:50:47 +0400
Date: Sat, 18 Apr 2009 22:50:45 +0400
From: Ruslan Ermilov 
To: Antoine Brodin 
Message-ID: <20090418185045.GA72031@edoofus.dev.vega.ru>
References: <200904181821.n3IILgM5083254@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200904181821.n3IILgM5083254@svn.freebsd.org>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191250 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 18:50:58 -0000

On Sat, Apr 18, 2009 at 06:21:42PM +0000, Antoine Brodin wrote:
> Modified: head/ObsoleteFiles.inc
[...]
> +OLD_FILES+=usr/sbin/usbdevs
> +OLD_FILES+=usr/share/man/man8/usbdevs.8.gz

Hmm, when I asked, I was told that usbdevs(8) was disconnected
from the build only temporarily.


Cheers,
-- 
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 19:46:23 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 507D410656B4;
	Sat, 18 Apr 2009 19:46:23 +0000 (UTC)
	(envelope-from antoine.brodin.freebsd@gmail.com)
Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156])
	by mx1.freebsd.org (Postfix) with ESMTP id 43C028FC51;
	Sat, 18 Apr 2009 19:14:15 +0000 (UTC)
	(envelope-from antoine.brodin.freebsd@gmail.com)
Received: by fg-out-1718.google.com with SMTP id e12so50290fga.12
	for ; Sat, 18 Apr 2009 12:14:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:received:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=FCBtt6AalHtunaRwDE56qkE0WKwInYrmBoHiUK79IwI=;
	b=DaHeFkDZiKvjHxEPoFDsfEETc8SIper2Mq8pqOvTY6TwShA2AM4T9L6G6jLui4cLiH
	Jwp9i5w1VD66HFMdI2A/Un/1WLwukqQ+i1BkvTXAsatHFp/+XnFrybhjDL18a3t38hVL
	EcxyRiXlFX2P7HlIu6woaZlfeTnVSMq7yexE0=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=f8MbYcImp8rBS2IQPiMwTvcmqy3/5Kg/JWcPX5GZC8EH1nxFX0amWeiML3JkD1ObPb
	r5peEurY9YkbxiXHRY+5tB5TT/pvp19iLn0fKHyAzj7RtTKSCHUWJstNsTjq4mdSNeOK
	oqnsfTCaLo9KeeusbAdZndg+awUNZy6JXyRCI=
MIME-Version: 1.0
Sender: antoine.brodin.freebsd@gmail.com
Received: by 10.86.82.6 with SMTP id f6mr2842869fgb.69.1240081732400; Sat, 18 
	Apr 2009 12:08:52 -0700 (PDT)
In-Reply-To: <20090418185045.GA72031@edoofus.dev.vega.ru>
References: <200904181821.n3IILgM5083254@svn.freebsd.org>
	<20090418185045.GA72031@edoofus.dev.vega.ru>
Date: Sat, 18 Apr 2009 21:08:52 +0200
X-Google-Sender-Auth: 426ce6316fddfe56
Message-ID: 
From: Antoine Brodin 
To: Ruslan Ermilov 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r191250 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 19:46:28 -0000

On Sat, Apr 18, 2009 at 8:50 PM, Ruslan Ermilov  wrote:
> On Sat, Apr 18, 2009 at 06:21:42PM +0000, Antoine Brodin wrote:
>> Modified: head/ObsoleteFiles.inc
> [...]
>> +OLD_FILES+=usr/sbin/usbdevs
>> +OLD_FILES+=usr/share/man/man8/usbdevs.8.gz
>
> Hmm, when I asked, I was told that usbdevs(8) was disconnected
> from the build only temporarily.

I can remove theses two lines now or they can be removed when
usbdevs(8) is reconnected.
What do you prefer?

Cheers,

Antoine

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 20:09:43 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 66E6C106567A;
	Sat, 18 Apr 2009 20:09:43 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 551718FC16;
	Sat, 18 Apr 2009 20:09:43 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3IK9hEw085537;
	Sat, 18 Apr 2009 20:09:43 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3IK9hlI085536;
	Sat, 18 Apr 2009 20:09:43 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200904182009.n3IK9hlI085536@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 18 Apr 2009 20:09:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191251 - head/share/man/man9
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 20:09:43 -0000

Author: rwatson
Date: Sat Apr 18 20:09:43 2009
New Revision: 191251
URL: http://svn.freebsd.org/changeset/base/191251

Log:
  Garbage collect man page reference to IFF_NEEDSGIANT.

Modified:
  head/share/man/man9/altq.9

Modified: head/share/man/man9/altq.9
==============================================================================
--- head/share/man/man9/altq.9	Sat Apr 18 18:21:42 2009	(r191250)
+++ head/share/man/man9/altq.9	Sat Apr 18 20:09:43 2009	(r191251)
@@ -543,11 +543,6 @@ Make sure that calls to
 and
 .Fn IFQ_DRV_PURGE
 are protected with a mutex of some kind.
-Setting
-.Dv IFF_NEEDSGIANT
-in
-.Va if_flags
-might also be appropriate.
 .Ss Attach routine
 Use
 .Fn IFQ_SET_MAXLEN

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 20:10:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 80261106566C;
	Sat, 18 Apr 2009 20:10:39 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6E8378FC0C;
	Sat, 18 Apr 2009 20:10:39 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3IKAdf5085600;
	Sat, 18 Apr 2009 20:10:39 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3IKAdLa085599;
	Sat, 18 Apr 2009 20:10:39 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200904182010.n3IKAdLa085599@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 18 Apr 2009 20:10:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191252 - head/sbin/ifconfig
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 20:10:39 -0000

Author: rwatson
Date: Sat Apr 18 20:10:39 2009
New Revision: 191252
URL: http://svn.freebsd.org/changeset/base/191252

Log:
  ifconfig(8) no longer needs to know how to print the IFF_NEEDSGIANT flag,
  since it shortly won't be defined at all.

Modified:
  head/sbin/ifconfig/ifconfig.c

Modified: head/sbin/ifconfig/ifconfig.c
==============================================================================
--- head/sbin/ifconfig/ifconfig.c	Sat Apr 18 20:09:43 2009	(r191251)
+++ head/sbin/ifconfig/ifconfig.c	Sat Apr 18 20:10:39 2009	(r191252)
@@ -783,7 +783,7 @@ setifname(const char *val, int dummy __u
 #define	IFFBITS \
 "\020\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5POINTOPOINT\6SMART\7RUNNING" \
 "\10NOARP\11PROMISC\12ALLMULTI\13OACTIVE\14SIMPLEX\15LINK0\16LINK1\17LINK2" \
-"\20MULTICAST\22PPROMISC\23MONITOR\24STATICARP\25NEEDSGIANT"
+"\20MULTICAST\22PPROMISC\23MONITOR\24STATICARP"
 
 #define	IFCAPBITS \
 "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 20:39:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 47B0A106564A;
	Sat, 18 Apr 2009 20:39:18 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 35C9A8FC12;
	Sat, 18 Apr 2009 20:39:18 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3IKdIij086236;
	Sat, 18 Apr 2009 20:39:18 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3IKdI2N086235;
	Sat, 18 Apr 2009 20:39:18 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200904182039.n3IKdI2N086235@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 18 Apr 2009 20:39:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191253 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 20:39:18 -0000

Author: rwatson
Date: Sat Apr 18 20:39:17 2009
New Revision: 191253
URL: http://svn.freebsd.org/changeset/base/191253

Log:
  Remove IFF_NEEDSGIANT interface flag: we no longer provide ifnet-layer
  infrastructure to support non-MPSAFE network device drivers.

Modified:
  head/sys/net/if.h

Modified: head/sys/net/if.h
==============================================================================
--- head/sys/net/if.h	Sat Apr 18 20:10:39 2009	(r191252)
+++ head/sys/net/if.h	Sat Apr 18 20:39:17 2009	(r191253)
@@ -149,7 +149,6 @@ struct if_data {
 #define	IFF_PPROMISC	0x20000		/* (n) user-requested promisc mode */
 #define	IFF_MONITOR	0x40000		/* (n) user-requested monitor mode */
 #define	IFF_STATICARP	0x80000		/* (n) static ARP */
-#define	IFF_NEEDSGIANT	0x100000	/* (i) hold Giant over if_start calls */
 
 /*
  * Old names for driver flags so that user space tools can continue to use
@@ -163,8 +162,7 @@ struct if_data {
 /* flags set internally only: */
 #define	IFF_CANTCHANGE \
 	(IFF_BROADCAST|IFF_POINTOPOINT|IFF_DRV_RUNNING|IFF_DRV_OACTIVE|\
-	    IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART|IFF_PROMISC|\
-	    IFF_NEEDSGIANT)
+	    IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART|IFF_PROMISC)
 
 /*
  * Values for if_link_state.

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 21:06:03 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F043F106564A;
	Sat, 18 Apr 2009 21:06:03 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from mail.vega.ru (mail.vega.ru [90.156.167.5])
	by mx1.freebsd.org (Postfix) with ESMTP id A2AEF8FC0A;
	Sat, 18 Apr 2009 21:06:03 +0000 (UTC) (envelope-from ru@FreeBSD.org)
Received: from [10.100.124.99] (port=62523 helo=edoofus.dev.vega.ru)
	by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.69 (FreeBSD)) (envelope-from )
	id 1LvHje-0005qS-6s; Sun, 19 Apr 2009 01:06:02 +0400
Date: Sun, 19 Apr 2009 01:06:00 +0400
From: Ruslan Ermilov 
To: Antoine Brodin 
Message-ID: <20090418210600.GA89327@edoofus.dev.vega.ru>
References: <200904181821.n3IILgM5083254@svn.freebsd.org>
	<20090418185045.GA72031@edoofus.dev.vega.ru>
	
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: 
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r191250 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 21:06:04 -0000

On Sat, Apr 18, 2009 at 09:08:52PM +0200, Antoine Brodin wrote:
> On Sat, Apr 18, 2009 at 8:50 PM, Ruslan Ermilov  wrote:
> > On Sat, Apr 18, 2009 at 06:21:42PM +0000, Antoine Brodin wrote:
> >> Modified: head/ObsoleteFiles.inc
> > [...]
> >> +OLD_FILES+=usr/sbin/usbdevs
> >> +OLD_FILES+=usr/share/man/man8/usbdevs.8.gz
> >
> > Hmm, when I asked, I was told that usbdevs(8) was disconnected
> > from the build only temporarily.
> 
> I can remove theses two lines now or they can be removed when
> usbdevs(8) is reconnected.
> What do you prefer?
> 
The former, as usbdevs(8) is not obsoleted.


Cheers,
-- 
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 18 22:16:47 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0098C106564A;
	Sat, 18 Apr 2009 22:16:47 +0000 (UTC)
	(envelope-from antoine@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E30A48FC0C;
	Sat, 18 Apr 2009 22:16:46 +0000 (UTC)
	(envelope-from antoine@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3IMGkJt088124;
	Sat, 18 Apr 2009 22:16:46 GMT (envelope-from antoine@svn.freebsd.org)
Received: (from antoine@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3IMGkll088122;
	Sat, 18 Apr 2009 22:16:46 GMT (envelope-from antoine@svn.freebsd.org)
Message-Id: <200904182216.n3IMGkll088122@svn.freebsd.org>
From: Antoine Brodin 
Date: Sat, 18 Apr 2009 22:16:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191254 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 18 Apr 2009 22:16:47 -0000

Author: antoine
Date: Sat Apr 18 22:16:46 2009
New Revision: 191254
URL: http://svn.freebsd.org/changeset/base/191254

Log:
  usbdevs(8) is not obsoleted, just temporarily disconnected from the build
  
  Noticed by:	ru@

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Sat Apr 18 20:39:17 2009	(r191253)
+++ head/ObsoleteFiles.inc	Sat Apr 18 22:16:46 2009	(r191254)
@@ -148,8 +148,6 @@ OLD_FILES+=usr/include/dev/usb/usbdi.h
 OLD_FILES+=usr/include/dev/usb/usbdi_util.h
 OLD_FILES+=usr/include/dev/usb/usbdivar.h
 OLD_FILES+=usr/include/dev/usb/uxb360gp_rdesc.h
-OLD_FILES+=usr/sbin/usbdevs
-OLD_FILES+=usr/share/man/man8/usbdevs.8.gz
 # 20090203: removal of pccard header files
 OLD_FILES+=usr/include/pccard/cardinfo.h
 OLD_FILES+=usr/include/pccard/cis.h