svn commit: r196728 - head/sys/i386/xen

2009-08-31 Thread Adrian Chadd
Author: adrian
Date: Tue Sep  1 06:15:50 2009
New Revision: 196728
URL: http://svn.freebsd.org/changeset/base/196728

Log:
  Migrate to use cpuset_t.

Modified:
  head/sys/i386/xen/pmap.c

Modified: head/sys/i386/xen/pmap.c
==
--- head/sys/i386/xen/pmap.cTue Sep  1 05:55:10 2009(r196727)
+++ head/sys/i386/xen/pmap.cTue Sep  1 06:15:50 2009(r196728)
@@ -1729,7 +1729,7 @@ retry:
  * Deal with a SMP shootdown of other users of the pmap that we are
  * trying to dispose of.  This can be a bit hairy.
  */
-static u_int *lazymask;
+static cpumask_t *lazymask;
 static u_int lazyptd;
 static volatile u_int lazywait;
 
@@ -1738,7 +1738,7 @@ void pmap_lazyfix_action(void);
 void
 pmap_lazyfix_action(void)
 {
-   u_int mymask = PCPU_GET(cpumask);
+   cpumask_t mymask = PCPU_GET(cpumask);
 
 #ifdef COUNT_IPIS
(*ipi_lazypmap_counts[PCPU_GET(cpuid)])++;
@@ -1750,7 +1750,7 @@ pmap_lazyfix_action(void)
 }
 
 static void
-pmap_lazyfix_self(u_int mymask)
+pmap_lazyfix_self(cpumask_t mymask)
 {
 
if (rcr3() == lazyptd)
@@ -1762,8 +1762,7 @@ pmap_lazyfix_self(u_int mymask)
 static void
 pmap_lazyfix(pmap_t pmap)
 {
-   u_int mymask;
-   u_int mask;
+   cpumask_t mymask, mask;
u_int spins;
 
while ((mask = pmap->pm_active) != 0) {
___
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-unsubscr...@freebsd.org"


svn commit: r196727 - head/share/man/man5

2009-08-31 Thread Maxim Konovalov
Author: maxim
Date: Tue Sep  1 05:55:10 2009
New Revision: 196727
URL: http://svn.freebsd.org/changeset/base/196727

Log:
  o Document MALLOC_PRODUCTION knob.
  
  PR:   docs/136029
  Submitted by: anonymous
  MFC after:2 weeks

Modified:
  head/share/man/man5/make.conf.5

Modified: head/share/man/man5/make.conf.5
==
--- head/share/man/man5/make.conf.5 Tue Sep  1 05:15:45 2009
(r196726)
+++ head/share/man/man5/make.conf.5 Tue Sep  1 05:55:10 2009
(r196727)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 5, 2006
+.Dd September 1, 2009
 .Dt MAKE.CONF 5
 .Os
 .Sh NAME
@@ -466,6 +466,12 @@ console driver to
 and allow access over FireWire(IEEE1394) using
 .Xr dconschat 8 .
 Currently, only i386 and amd64 are supported.
+.It Va MALLOC_PRODUCTION
+.Pq Vt bool
+Set this to disable assertions and statistics gathering in
+.Xr malloc 3 .
+It also defaults the A and J runtime options to off.
+Disabled by default on -CURRENT.
 .It Va MODULES_WITH_WORLD
 .Pq Vt bool
 Set to build modules with the system instead of the kernel.
___
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-unsubscr...@freebsd.org"


svn commit: r196726 - head/sys/i386/xen

2009-08-31 Thread Adrian Chadd
Author: adrian
Date: Tue Sep  1 05:15:45 2009
New Revision: 196726
URL: http://svn.freebsd.org/changeset/base/196726

Log:
  Merge in the pat_works work from sys/i386/i386/pmap.c - primarily to reduce
  diff size.

Modified:
  head/sys/i386/xen/pmap.c

Modified: head/sys/i386/xen/pmap.c
==
--- head/sys/i386/xen/pmap.cTue Sep  1 03:44:25 2009(r196725)
+++ head/sys/i386/xen/pmap.cTue Sep  1 05:15:45 2009(r196726)
@@ -223,6 +223,8 @@ static uma_zone_t pdptzone;
 #endif
 #endif
 
+static int pat_works;  /* Is page attribute table sane? */
+
 /*
  * Data for the pv entry allocation mechanism
  */
@@ -514,33 +516,36 @@ pmap_init_pat(void)
if (!(cpu_feature & CPUID_PAT))
return;
 
-#ifdef PAT_WORKS
-   /*
-* Leave the indices 0-3 at the default of WB, WT, UC, and UC-.
-* Program 4 and 5 as WP and WC.
-* Leave 6 and 7 as UC and UC-.
-*/
-   pat_msr = rdmsr(MSR_PAT);
-   pat_msr &= ~(PAT_MASK(4) | PAT_MASK(5));
-   pat_msr |= PAT_VALUE(4, PAT_WRITE_PROTECTED) |
-   PAT_VALUE(5, PAT_WRITE_COMBINING);
-#else
-   /*
-* Due to some Intel errata, we can only safely use the lower 4
-* PAT entries.  Thus, just replace PAT Index 2 with WC instead
-* of UC-.
-*
-*   Intel Pentium III Processor Specification Update
-* Errata E.27 (Upper Four PAT Entries Not Usable With Mode B
-* or Mode C Paging)
-*
-*   Intel Pentium IV  Processor Specification Update
-* Errata N46 (PAT Index MSB May Be Calculated Incorrectly)
-*/
-   pat_msr = rdmsr(MSR_PAT);
-   pat_msr &= ~PAT_MASK(2);
-   pat_msr |= PAT_VALUE(2, PAT_WRITE_COMBINING);
-#endif
+   if (cpu_vendor_id != CPU_VENDOR_INTEL ||
+   (I386_CPU_FAMILY(cpu_id) == 6 && I386_CPU_MODEL(cpu_id) >= 0xe)) {
+   /*
+* Leave the indices 0-3 at the default of WB, WT, UC, and UC-.
+* Program 4 and 5 as WP and WC.
+* Leave 6 and 7 as UC and UC-.
+*/
+   pat_msr = rdmsr(MSR_PAT);
+   pat_msr &= ~(PAT_MASK(4) | PAT_MASK(5));
+   pat_msr |= PAT_VALUE(4, PAT_WRITE_PROTECTED) |
+   PAT_VALUE(5, PAT_WRITE_COMBINING);
+   pat_works = 1;
+   } else {
+   /*
+* Due to some Intel errata, we can only safely use the lower 4
+* PAT entries.  Thus, just replace PAT Index 2 with WC instead
+* of UC-.
+*
+*   Intel Pentium III Processor Specification Update
+* Errata E.27 (Upper Four PAT Entries Not Usable With Mode B
+* or Mode C Paging)
+*
+*   Intel Pentium IV  Processor Specification Update
+* Errata N46 (PAT Index MSB May Be Calculated Incorrectly)
+*/
+   pat_msr = rdmsr(MSR_PAT);
+   pat_msr &= ~PAT_MASK(2);
+   pat_msr |= PAT_VALUE(2, PAT_WRITE_COMBINING);
+   pat_works = 0;
+   }
wrmsr(MSR_PAT, pat_msr);
 }
 
@@ -769,44 +774,48 @@ pmap_cache_bits(int mode, boolean_t is_p
}

/* Map the caching mode to a PAT index. */
-   switch (mode) {
-#ifdef PAT_WORKS
-   case PAT_UNCACHEABLE:
-   pat_index = 3;
-   break;
-   case PAT_WRITE_THROUGH:
-   pat_index = 1;
-   break;
-   case PAT_WRITE_BACK:
-   pat_index = 0;
-   break;
-   case PAT_UNCACHED:
-   pat_index = 2;
-   break;
-   case PAT_WRITE_COMBINING:
-   pat_index = 5;
-   break;
-   case PAT_WRITE_PROTECTED:
-   pat_index = 4;
-   break;
-#else
-   case PAT_UNCACHED:
-   case PAT_UNCACHEABLE:
-   case PAT_WRITE_PROTECTED:
-   pat_index = 3;
-   break;
-   case PAT_WRITE_THROUGH:
-   pat_index = 1;
-   break;
-   case PAT_WRITE_BACK:
-   pat_index = 0;
-   break;
-   case PAT_WRITE_COMBINING:
-   pat_index = 2;
-   break;
-#endif
-   default:
-   panic("Unknown caching mode %d\n", mode);
+   if (pat_works) {
+   switch (mode) {
+   case PAT_UNCACHEABLE:
+   pat_index = 3;
+   break;
+   case PAT_WRITE_THROUGH:
+   pat_index = 1;
+   break;
+   case PAT_WRITE_BACK:
+   pat_index = 0;
+   break;
+   case PAT_UNCACHED:
+   pat_index = 2;
+

svn commit: r196725 - head/sys/i386/xen

2009-08-31 Thread Adrian Chadd
Author: adrian
Date: Tue Sep  1 03:44:25 2009
New Revision: 196725
URL: http://svn.freebsd.org/changeset/base/196725

Log:
  Fix broken build.

Modified:
  head/sys/i386/xen/pmap.c

Modified: head/sys/i386/xen/pmap.c
==
--- head/sys/i386/xen/pmap.cMon Aug 31 23:35:59 2009(r196724)
+++ head/sys/i386/xen/pmap.cTue Sep  1 03:44:25 2009(r196725)
@@ -311,6 +311,7 @@ static vm_offset_t pmap_kmem_choose(vm_o
 static boolean_t pmap_is_prefaultable_locked(pmap_t pmap, vm_offset_t addr);
 static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode);
 
+static __inline void pagezero(void *page);
 
 #if defined(PAE) && !defined(XEN)
 static void *pmap_pdpt_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int 
wait);
___
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-unsubscr...@freebsd.org"


Re: svn commit: r196706 - head/usr.sbin/pkg_install/lib

2009-08-31 Thread Brooks Davis
On Mon, Aug 31, 2009 at 05:50:33PM +, Doug Barton wrote:
> Author: dougb
> Date: Mon Aug 31 17:50:33 2009
> New Revision: 196706
> URL: http://svn.freebsd.org/changeset/base/196706
> 
> Log:
>   Add support for INDEX-9 [1]
>   
>   While I'm here, strip off support for FreeBSD 5.x.

I'm rather baffled as to why you'd bother removing 5.x support and keep
<=4.x support.  It seems vanishingly unlikely we'll ever support plain
INDEX files again.

-- Brooks


pgpNQtbB44pGc.pgp
Description: PGP signature


svn commit: r196724 - head/sys/i386/xen

2009-08-31 Thread Adrian Chadd
Author: adrian
Date: Mon Aug 31 23:35:59 2009
New Revision: 196724
URL: http://svn.freebsd.org/changeset/base/196724

Log:
  Revert previous commit; that was left-over junk in the tree.

Modified:
  head/sys/i386/xen/locore.s

Modified: head/sys/i386/xen/locore.s
==
--- head/sys/i386/xen/locore.s  Mon Aug 31 23:30:39 2009(r196723)
+++ head/sys/i386/xen/locore.s  Mon Aug 31 23:35:59 2009(r196724)
@@ -148,7 +148,9 @@ IdlePDPT:   .long   0   /* phys addr of kerne
.globl  KPTphys
 #endif
 KPTphys:   .long   0   /* phys addr of kernel page tables */
+#ifdef SMP
.globl  gdtset
+#endif
 gdtset:.long   0   /* GDT is valid */  
 
.globl  proc0kstack
___
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-unsubscr...@freebsd.org"


svn commit: r196723 - head/sys/i386/xen

2009-08-31 Thread Adrian Chadd
Author: adrian
Date: Mon Aug 31 23:30:39 2009
New Revision: 196723
URL: http://svn.freebsd.org/changeset/base/196723

Log:
  Shuffle pagezero() into the same location as in sys/i386/i386/pmap.c.

Modified:
  head/sys/i386/xen/locore.s
  head/sys/i386/xen/pmap.c

Modified: head/sys/i386/xen/locore.s
==
--- head/sys/i386/xen/locore.s  Mon Aug 31 22:58:29 2009(r196722)
+++ head/sys/i386/xen/locore.s  Mon Aug 31 23:30:39 2009(r196723)
@@ -148,9 +148,7 @@ IdlePDPT:   .long   0   /* phys addr of kerne
.globl  KPTphys
 #endif
 KPTphys:   .long   0   /* phys addr of kernel page tables */
-#ifdef SMP
.globl  gdtset
-#endif
 gdtset:.long   0   /* GDT is valid */  
 
.globl  proc0kstack

Modified: head/sys/i386/xen/pmap.c
==
--- head/sys/i386/xen/pmap.cMon Aug 31 22:58:29 2009(r196722)
+++ head/sys/i386/xen/pmap.cMon Aug 31 23:30:39 2009(r196723)
@@ -328,22 +328,6 @@ CTASSERT(KERNBASE % (1 << 24) == 0);
 
 
 
-static __inline void
-pagezero(void *page)
-{
-#if defined(I686_CPU)
-   if (cpu_class == CPUCLASS_686) {
-#if defined(CPU_ENABLE_SSE)
-   if (cpu_feature & CPUID_SSE2)
-   sse2_pagezero(page);
-   else
-#endif
-   i686_pagezero(page);
-   } else
-#endif
-   bzero(page, PAGE_SIZE);
-}
-
 void 
 pd_set(struct pmap *pmap, int ptepindex, vm_paddr_t val, int type)
 {
@@ -3343,6 +3327,22 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm
PMAP_UNLOCK(dst_pmap);
 }  
 
+static __inline void
+pagezero(void *page)
+{
+#if defined(I686_CPU)
+   if (cpu_class == CPUCLASS_686) {
+#if defined(CPU_ENABLE_SSE)
+   if (cpu_feature & CPUID_SSE2)
+   sse2_pagezero(page);
+   else
+#endif
+   i686_pagezero(page);
+   } else
+#endif
+   bzero(page, PAGE_SIZE);
+}
+
 /*
  * pmap_zero_page zeros the specified hardware page by mapping 
  * the page into KVM and using bzero to clear its contents.
___
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-unsubscr...@freebsd.org"


svn commit: r196721 - head/sys/dev/txp

2009-08-31 Thread Pyun YongHyeon
Author: yongari
Date: Mon Aug 31 22:09:48 2009
New Revision: 196721
URL: http://svn.freebsd.org/changeset/base/196721

Log:
  Make sure rx descriptor ring align on 16 bytes. I guess the
  alignment requirement could be multiple of 4 bytes but I think
  using descriptor size would make intention clearer.
  Previously the size of rx descriptor was not power of 2 so it
  caused panic in bus_dmamem_alloc(9).
  
  Reported by:  Jeff Blank (jb03 <> mr-happy dot com)
  MFC after:3 days

Modified:
  head/sys/dev/txp/if_txp.c

Modified: head/sys/dev/txp/if_txp.c
==
--- head/sys/dev/txp/if_txp.c   Mon Aug 31 21:36:19 2009(r196720)
+++ head/sys/dev/txp/if_txp.c   Mon Aug 31 22:09:48 2009(r196721)
@@ -1389,7 +1389,8 @@ txp_alloc_rings(struct txp_softc *sc)
 
/* High priority rx ring. */
error = txp_dma_alloc(sc, "hi priority rx ring",
-   &sc->sc_cdata.txp_rxhiring_tag, sizeof(struct txp_rx_desc), 0,
+   &sc->sc_cdata.txp_rxhiring_tag,
+   roundup(sizeof(struct txp_rx_desc), 16), 0,
&sc->sc_cdata.txp_rxhiring_map, (void **)&sc->sc_ldata.txp_rxhiring,
sizeof(struct txp_rx_desc) * RX_ENTRIES,
&sc->sc_ldata.txp_rxhiring_paddr);
@@ -1409,7 +1410,8 @@ txp_alloc_rings(struct txp_softc *sc)
 
/* Low priority rx ring. */
error = txp_dma_alloc(sc, "low priority rx ring",
-   &sc->sc_cdata.txp_rxloring_tag, sizeof(struct txp_rx_desc), 0,
+   &sc->sc_cdata.txp_rxloring_tag,
+   roundup(sizeof(struct txp_rx_desc), 16), 0,
&sc->sc_cdata.txp_rxloring_map, (void **)&sc->sc_ldata.txp_rxloring,
sizeof(struct txp_rx_desc) * RX_ENTRIES,
&sc->sc_ldata.txp_rxloring_paddr);
___
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-unsubscr...@freebsd.org"


svn commit: r196717 - head/sys/dev/ath

2009-08-31 Thread Sam Leffler
Author: sam
Date: Mon Aug 31 21:25:49 2009
New Revision: 196717
URL: http://svn.freebsd.org/changeset/base/196717

Log:
  On resume in sta mode program the beacon timers so when roaming (and
  the previous ap is no longer in range) the device will deliver bmiss
  interrupts and trigger the state machine.  Also arrange to sync the
  beacon timers on the next received beacon frame so that when we don't
  roam we re-synchronize with the ap.
  
  Tested by:trasz
  MFC after:1 week

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

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Mon Aug 31 21:07:05 2009(r196716)
+++ head/sys/dev/ath/if_ath.c   Mon Aug 31 21:25:49 2009(r196717)
@@ -1236,7 +1236,16 @@ ath_resume(struct ath_softc *sc)
if (sc->sc_resume_up) {
if (ic->ic_opmode == IEEE80211_M_STA) {
ath_init(sc);
-   ieee80211_beacon_miss(ic);
+   /*
+* Program the beacon registers using the last rx'd
+* beacon frame and enable sync on the next beacon
+* we see.  This should handle the case where we
+* wakeup and find the same AP and also the case where
+* we wakeup and need to roam.  For the latter we
+* should get bmiss events that trigger a roam.
+*/
+   ath_beacon_config(sc, NULL);
+   sc->sc_syncbeacon = 1;
} else
ieee80211_resume_all(ic);
}
___
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-unsubscr...@freebsd.org"


svn commit: r196714 - head/sys/netinet

2009-08-31 Thread Qing Li
Author: qingli
Date: Mon Aug 31 21:02:48 2009
New Revision: 196714
URL: http://svn.freebsd.org/changeset/base/196714

Log:
  This patch fixes the following issues:
  
  - Routing messages are not generated when adding and removing
interface address aliases.
  - Loopback route installed for an interface address alias is
not deleted from the routing table when that address alias
is removed from the associated interface.
  - Function in_ifscrub() is called extraneously.
  
  Reviewed by:  gnn, kmacy, sam
  MFC after:3 days

Modified:
  head/sys/netinet/in.c

Modified: head/sys/netinet/in.c
==
--- head/sys/netinet/in.c   Mon Aug 31 20:59:23 2009(r196713)
+++ head/sys/netinet/in.c   Mon Aug 31 21:02:48 2009(r196714)
@@ -536,7 +536,6 @@ in_control(struct socket *so, u_long cmd
hostIsNew = 0;
}
if (ifra->ifra_mask.sin_len) {
-   in_ifscrub(ifp, ia);
ia->ia_sockmask = ifra->ifra_mask;
ia->ia_sockmask.sin_family = AF_INET;
ia->ia_subnetmask =
@@ -545,7 +544,6 @@ in_control(struct socket *so, u_long cmd
}
if ((ifp->if_flags & IFF_POINTOPOINT) &&
(ifra->ifra_dstaddr.sin_family == AF_INET)) {
-   in_ifscrub(ifp, ia);
ia->ia_dstaddr = ifra->ifra_dstaddr;
maskIsNew  = 1; /* We lie; but the effect's the same */
}
@@ -991,6 +989,40 @@ in_addprefix(struct in_ifaddr *target, i
IN_IFADDR_RUNLOCK();
return (EEXIST);
} else {
+   struct route pfx_ro;
+   struct sockaddr_in *pfx_addr;
+   struct rtentry msg_rt;
+
+   /* QL: XXX
+* This is a bit questionable because there is 
no
+* additional route entry added for an address 
alias.
+* Therefore this route report is inaccurate. 
Perhaps
+* it's better to supply a empty rtentry as how 
it
+* is done in in_scrubprefix().
+*/
+   bzero(&pfx_ro, sizeof(pfx_ro));
+   pfx_addr = (struct sockaddr_in 
*)(&pfx_ro.ro_dst);
+   pfx_addr->sin_len = sizeof(*pfx_addr);
+   pfx_addr->sin_family = AF_INET;
+   pfx_addr->sin_addr = prefix;
+   rtalloc_ign_fib(&pfx_ro, 0, 0);
+   if (pfx_ro.ro_rt != NULL) {
+   msg_rt = *pfx_ro.ro_rt;
+   /* QL: XXX
+* Point the gateway to the given 
interface
+* address as if a new prefix route 
entry has 
+* been added through the new address 
alias. 
+* All other parts of the rtentry is 
accurate, 
+* e.g., rt_key, rt_mask, rt_ifp etc.
+*/
+   msg_rt.rt_gateway = 
+   (struct sockaddr *)&ia->ia_addr;
+   rt_newaddrmsg(RTM_ADD, 
+ (struct ifaddr *)target,
+ 0, &msg_rt);
+   RTFREE(pfx_ro.ro_rt);
+   }
+
IN_IFADDR_RUNLOCK();
return (0);
}
@@ -1024,9 +1056,6 @@ in_scrubprefix(struct in_ifaddr *target)
struct rt_addrinfo info;
struct sockaddr_dl null_sdl;
 
-   if ((target->ia_flags & IFA_ROUTE) == 0)
-   return (0);
-
/*
 * Remove the loopback route to the interface address.
 * The "useloopback" setting is not consulted because if the
@@ -1054,6 +1083,20 @@ in_scrubprefix(struct in_ifaddr *target)
log(LOG_INFO, "in_scrubprefix: deletion failed\n");
}
 
+   if ((target->ia_flags & IFA_ROUTE) == 0) {
+   struct rtentry rt;
+
+   /* QL: XXX
+* Report a blank rtentry when a route has not been
+* installed for the given interface address.
+*/
+   bzero(&rt, sizeof(rt));
+   rt_newaddrmsg(RTM_DELETE, 
+ (struc

svn commit: r196712 - head/bin/ls

2009-08-31 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Aug 31 20:53:01 2009
New Revision: 196712
URL: http://svn.freebsd.org/changeset/base/196712

Log:
  Add NFSv4 ACL support to ls(1).

Modified:
  head/bin/ls/print.c

Modified: head/bin/ls/print.c
==
--- head/bin/ls/print.c Mon Aug 31 20:42:07 2009(r196711)
+++ head/bin/ls/print.c Mon Aug 31 20:53:01 2009(r196712)
@@ -70,7 +70,7 @@ static void   printsize(size_t, off_t);
 static voidendcolor(int);
 static int colortype(mode_t);
 #endif
-static voidaclmode(char *, const FTSENT *, int *);
+static voidaclmode(char *, const FTSENT *);
 
 #defineIS_NOPRINT(p)   ((p)->fts_number == NO_PRINT)
 
@@ -139,16 +139,12 @@ printlong(const DISPLAY *dp)
 #ifdef COLORLS
int color_printed = 0;
 #endif
-   int haveacls;
-   dev_t prevdev;
 
if ((dp->list == NULL || dp->list->fts_level != FTS_ROOTLEVEL) &&
(f_longform || f_size)) {
(void)printf("total %lu\n", howmany(dp->btotal, blocksize));
}
 
-   haveacls = 1;
-   prevdev = (dev_t)-1;
for (p = dp->list; p; p = p->fts_link) {
if (IS_NOPRINT(p))
continue;
@@ -159,14 +155,7 @@ printlong(const DISPLAY *dp)
(void)printf("%*jd ",
dp->s_block, howmany(sp->st_blocks, blocksize));
strmode(sp->st_mode, buf);
-   /*
-* Cache whether or not the filesystem supports ACL's to
-* avoid expensive syscalls. Try again when we change devices.
-*/
-   if (haveacls || sp->st_dev != prevdev) {
-   aclmode(buf, p, &haveacls);
-   prevdev = sp->st_dev;
-   }
+   aclmode(buf, p);
np = p->fts_pointer;
(void)printf("%s %*u %-*s  %-*s  ", buf, dp->s_nlink,
sp->st_nlink, dp->s_user, np->user, dp->s_group,
@@ -612,56 +601,69 @@ printsize(size_t width, off_t bytes)
(void)printf("%*jd ", (u_int)width, bytes);
 }
 
+/*
+ * Add a + after the standard rwxrwxrwx mode if the file has an
+ * ACL. strmode() reserves space at the end of the string.
+ */
 static void
-aclmode(char *buf, const FTSENT *p, int *haveacls)
+aclmode(char *buf, const FTSENT *p)
 {
char name[MAXPATHLEN + 1];
-   int entries, ret;
+   int ret, trivial;
+   static dev_t previous_dev = NODEV;
+   static int supports_acls = -1;
+   static int type = ACL_TYPE_ACCESS;
acl_t facl;
-   acl_entry_t ae;
 
/*
-* Add a + after the standard rwxrwxrwx mode if the file has an
-* extended ACL. strmode() reserves space at the end of the string.
-*/
-   if (p->fts_level == FTS_ROOTLEVEL)
-   snprintf(name, sizeof(name), "%s", p->fts_name);
-   else
-   snprintf(name, sizeof(name), "%s/%s",
-   p->fts_parent->fts_accpath, p->fts_name);
-   /*
-* We have no way to tell whether a symbolic link has an ACL since
-* pathconf() and acl_get_file() both follow them.  They also don't
-* support whiteouts.
+* XXX: ACLs are not supported on whiteouts and device files
+* residing on UFS.
 */
-   if (S_ISLNK(p->fts_statp->st_mode) || S_ISWHT(p->fts_statp->st_mode)) {
-   *haveacls = 1;
+   if (S_ISCHR(p->fts_statp->st_mode) || S_ISBLK(p->fts_statp->st_mode) ||
+   S_ISWHT(p->fts_statp->st_mode))
return;
-   }
-   if ((ret = pathconf(name, _PC_ACL_EXTENDED)) <= 0) {
-   if (ret < 0 && errno != EINVAL)
-   warn("%s", name);
+
+   if (previous_dev != p->fts_statp->st_dev) {
+   previous_dev = p->fts_statp->st_dev;
+   supports_acls = 0;
+
+   if (p->fts_level == FTS_ROOTLEVEL)
+   snprintf(name, sizeof(name), "%s", p->fts_name);
else
-   *haveacls = 0;
+   snprintf(name, sizeof(name), "%s/%s",
+   p->fts_parent->fts_accpath, p->fts_name);
+   ret = lpathconf(name, _PC_ACL_NFS4);
+   if (ret > 0) {
+   type = ACL_TYPE_NFS4;
+   supports_acls = 1;
+   } else if (ret < 0 && errno != EINVAL) {
+   warn("%s", name);
+   return;
+   }
+   if (supports_acls == 0) {
+   ret = lpathconf(name, _PC_ACL_EXTENDED);
+   if (ret > 0) {
+   type = ACL_TYPE_ACCESS;
+   supports_acls = 1;
+   } else if (ret < 0 && errno != EINVAL) {
+   warn("%s", name);
+   return;
+

svn commit: r196711 - head/bin/chmod

2009-08-31 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Aug 31 20:42:07 2009
New Revision: 196711
URL: http://svn.freebsd.org/changeset/base/196711

Log:
  Make the code more readable and fix chmod(1) on symlinks with
  NFSv4 enabled.

Modified:
  head/bin/chmod/chmod.c

Modified: head/bin/chmod/chmod.c
==
--- head/bin/chmod/chmod.c  Mon Aug 31 20:11:35 2009(r196710)
+++ head/bin/chmod/chmod.c  Mon Aug 31 20:42:07 2009(r196711)
@@ -42,6 +42,7 @@ static char sccsid[] = "@(#)chmod.c   8.8 
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 
 #include 
@@ -54,7 +55,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 static void usage(void);
-static int may_have_nfs4acl(const FTSENT *ent);
+static int may_have_nfs4acl(const FTSENT *ent, int hflag);
 
 int
 main(int argc, char *argv[])
@@ -62,11 +63,10 @@ main(int argc, char *argv[])
FTS *ftsp;
FTSENT *p;
mode_t *set;
-   int Hflag, Lflag, Rflag, ch, fflag, fts_options, hflag, rval;
+   int Hflag, Lflag, Rflag, ch, fflag, fts_options, hflag, rval, error;
int vflag;
char *mode;
mode_t newmode;
-   int (*change_mode)(const char *, mode_t);
 
set = NULL;
Hflag = Lflag = Rflag = fflag = hflag = vflag = 0;
@@ -140,11 +140,6 @@ done:  argv += optind;
} else
fts_options = hflag ? FTS_PHYSICAL : FTS_LOGICAL;
 
-   if (hflag)
-   change_mode = lchmod;
-   else
-   change_mode = chmod;
-
mode = *argv;
if ((set = setmode(mode)) == NULL)
errx(1, "invalid file mode: %s", mode);
@@ -186,10 +181,14 @@ done: argv += optind;
 * identical to the one computed from an ACL will change
 * that ACL.
 */
-   if (may_have_nfs4acl(p) == 0 &&
+   if (may_have_nfs4acl(p, hflag) == 0 &&
(newmode & ALLPERMS) == (p->fts_statp->st_mode & ALLPERMS))
continue;
-   if ((*change_mode)(p->fts_accpath, newmode) && !fflag) {
+   if (hflag)
+   error = lchmod(p->fts_accpath, newmode);
+   else
+   error = chmod(p->fts_accpath, newmode);
+   if (error && !fflag) {
warn("%s", p->fts_path);
rval = 1;
} else {
@@ -228,17 +227,20 @@ usage(void)
 }
 
 static int
-may_have_nfs4acl(const FTSENT *ent)
+may_have_nfs4acl(const FTSENT *ent, int hflag)
 {
int ret;
-   static dev_t previous_dev = (dev_t)-1;
+   static dev_t previous_dev = NODEV;
static int supports_acls = -1;
 
if (previous_dev != ent->fts_statp->st_dev) {
previous_dev = ent->fts_statp->st_dev;
supports_acls = 0;
 
-   ret = pathconf(ent->fts_accpath, _PC_ACL_NFS4);
+   if (hflag)
+   ret = lpathconf(ent->fts_accpath, _PC_ACL_NFS4);
+   else
+   ret = pathconf(ent->fts_accpath, _PC_ACL_NFS4);
if (ret > 0)
supports_acls = 1;
else if (ret < 0 && errno != EINVAL)
___
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-unsubscr...@freebsd.org"


svn commit: r196710 - head/tools/regression/acltools

2009-08-31 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Aug 31 20:11:35 2009
New Revision: 196710
URL: http://svn.freebsd.org/changeset/base/196710

Log:
  Add regression test for ACLs on device files - mostly to make
  sure we don't crash on attempt to set ACL on them.

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

Modified: head/tools/regression/acltools/tools-posix.test
==
--- head/tools/regression/acltools/tools-posix.test Mon Aug 31 19:16:58 
2009(r196709)
+++ head/tools/regression/acltools/tools-posix.test Mon Aug 31 20:11:35 
2009(r196710)
@@ -387,3 +387,19 @@ $ ls -l fff | cut -d' ' -f1
 
 $ rm fff
 
+# Test if we deal properly with device files.
+$ mknod bbb b 1 1
+$ setfacl -m u:42:r,g:43:w bbb
+> setfacl: acl_get_file() failed: Operation not supported
+$ ls -l bbb | cut -d' ' -f1
+> brw-r--r--
+
+$ rm bbb
+
+$ mknod ccc c 1 1
+$ setfacl -m u:42:r,g:43:w ccc
+> setfacl: acl_get_file() failed: Operation not supported
+$ ls -l ccc | cut -d' ' -f1
+> crw-r--r--
+
+$ rm ccc
___
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-unsubscr...@freebsd.org"


svn commit: r196709 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern

2009-08-31 Thread Marius Strobl
Author: marius
Date: Mon Aug 31 19:16:58 2009
New Revision: 196709
URL: http://svn.freebsd.org/changeset/base/196709

Log:
  Add a temporary workaround which just lets init die instead of
  causing a panic if it is killed due to a unsolved stack overflow
  seen very late during shutdown on sparc64 when the gmirror worker
  process exists, which is a regression introduced in 8.0.
  
  Reviewed by:  kib
  Approved by:  re (rwatson)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/kern/kern_exit.c

Modified: stable/8/sys/kern/kern_exit.c
==
--- stable/8/sys/kern/kern_exit.c   Mon Aug 31 19:07:19 2009
(r196708)
+++ stable/8/sys/kern/kern_exit.c   Mon Aug 31 19:16:58 2009
(r196709)
@@ -131,7 +131,12 @@ exit1(struct thread *td, int rv)
mtx_assert(&Giant, MA_NOTOWNED);
 
p = td->td_proc;
-   if (p == initproc) {
+   /*
+* XXX in case we're rebooting we just let init die in order to
+* work around an unsolved stack overflow seen very late during
+* shutdown on sparc64 when the gmirror worker process exists.
+*/ 
+   if (p == initproc && rebooting == 0) {
printf("init died (signal %d, exit %d)\n",
WTERMSIG(rv), WEXITSTATUS(rv));
panic("Going nowhere without my init!");
___
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-unsubscr...@freebsd.org"


svn commit: r196708 - in stable/7: share/man/man9 sys sys/conf sys/contrib/pf sys/kern sys/sys

2009-08-31 Thread John Baldwin
Author: jhb
Date: Mon Aug 31 19:07:19 2009
New Revision: 196708
URL: http://svn.freebsd.org/changeset/base/196708

Log:
  MFC 193260 and 196417:
  Add a simple API to manage scatter/gather lists of phyiscal addresses.
  Each list describes a logical memory object that is backed by one or more
  physical address ranges.  To minimize locking, the sglist objects
  themselves are immutable once they are shared.

Added:
  stable/7/share/man/man9/sglist.9
 - copied, changed from r193260, head/share/man/man9/sglist.9
  stable/7/sys/kern/subr_sglist.c
 - copied, changed from r193260, head/sys/kern/subr_sglist.c
  stable/7/sys/sys/sglist.h
 - copied unchanged from r193260, head/sys/sys/sglist.h
Modified:
  stable/7/share/man/man9/   (props changed)
  stable/7/share/man/man9/Makefile
  stable/7/sys/   (props changed)
  stable/7/sys/conf/files
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/share/man/man9/Makefile
==
--- stable/7/share/man/man9/MakefileMon Aug 31 18:41:13 2009
(r196707)
+++ stable/7/share/man/man9/MakefileMon Aug 31 19:07:19 2009
(r196708)
@@ -210,6 +210,7 @@ MAN=accept_filter.9 \
selrecord.9 \
sema.9 \
sf_buf.9 \
+   sglist.9 \
signal.9 \
sleep.9 \
sleepqueue.9 \
@@ -983,6 +984,24 @@ MLINKS+=sf_buf.9 sf_buf_alloc.9 \
sf_buf.9 sf_buf_free.9 \
sf_buf.9 sf_buf_kva.9 \
sf_buf.9 sf_buf_page.9
+MLINKS+=sglist.9 sglist_alloc.9 \
+   sglist.9 sglist_append.9 \
+   sglist.9 sglist_append_mbuf.9 \
+   sglist.9 sglist_append_phys.9 \
+   sglist.9 sglist_append_uio.9 \
+   sglist.9 sglist_append_user.9 \
+   sglist.9 sglist_build.9 \
+   sglist.9 sglist_clone.9 \
+   sglist.9 sglist_consume_uio.9 \
+   sglist.9 sglist_count.9 \
+   sglist.9 sglist_free.9 \
+   sglist.9 sglist_hold.9 \
+   sglist.9 sglist_init.9 \
+   sglist.9 sglist_join.9 \
+   sglist.9 sglist_length.9 \
+   sglist.9 sglist_reset.9 \
+   sglist.9 sglist_slice.9 \
+   sglist.9 sglist_split.9
 MLINKS+=signal.9 cursig.9 \
signal.9 execsigs.9 \
signal.9 issignal.9 \

Copied and modified: stable/7/share/man/man9/sglist.9 (from r193260, 
head/share/man/man9/sglist.9)
==
--- head/share/man/man9/sglist.9Mon Jun  1 20:35:39 2009
(r193260, copy source)
+++ stable/7/share/man/man9/sglist.9Mon Aug 31 19:07:19 2009
(r196708)
@@ -191,6 +191,8 @@ Specifically, the
 family of routines can be used to append the physical address ranges described
 by an object to the end of a scatter/gather list.
 All of these routines return 0 on success or an error on failure.
+If a request to append an address range to a scatter/gather list fails,
+the scatter/gather list will remain unchanged.
 .Pp
 The
 .Nm sglist_append
@@ -445,6 +447,7 @@ There are not enough available segments 
 to append the physical address ranges from
 .Fa second .
 .El
+.Pp
 The
 .Nm sglist_slice
 function returns the following errors on failure:
@@ -470,6 +473,7 @@ list in
 .Fa *slice
 to describe the requested physical address ranges.
 .El
+.Pp
 The
 .Nm sglist_split
 function returns the following errors on failure:

Modified: stable/7/sys/conf/files
==
--- stable/7/sys/conf/files Mon Aug 31 18:41:13 2009(r196707)
+++ stable/7/sys/conf/files Mon Aug 31 19:07:19 2009(r196708)
@@ -1630,6 +1630,7 @@ kern/kern_proc.c  standard
 kern/kern_prot.c   standard
 kern/kern_resource.c   standard
 kern/kern_rwlock.c standard
+kern/kern_sdt.coptional kdtrace_hooks
 kern/kern_sema.c   standard
 kern/kern_shutdown.c   standard
 kern/kern_sig.cstandard
@@ -1683,7 +1684,7 @@ kern/subr_rman.c  standard
 kern/subr_rtc.coptional genclock
 kern/subr_sbuf.c   standard
 kern/subr_scanf.c  standard
-kern/kern_sdt.coptional kdtrace_hooks
+kern/subr_sglist.c standard
 kern/subr_sleepqueue.c standard
 kern/subr_smp.cstandard
 kern/subr_stack.c  optional ddb | stack

Copied and modified: stable/7/sys/kern/subr_sglist.c (from r193260, 
head/sys/kern/subr_sglist.c)
==
--- head/sys/kern/subr_sglist.c Mon Jun  1 20:35:39 2009(r193260, copy 
source)
+++ stable/7/sys/kern/subr_sglist.c Mon Aug 31 19:07:19 2009
(r196708)
@@ -48,6 +48,32 @@ __FBSDID("$FreeBSD$");
 static MALLOC_DEFINE(M_SGLIST, "sglist", "scatter/gather lists");
 
 /*
+ * Convenience macros to save the state of an sglist so it can be restored

svn commit: r196707 - in head/sys: amd64/amd64 i386/i386

2009-08-31 Thread John Baldwin
Author: jhb
Date: Mon Aug 31 18:41:13 2009
New Revision: 196707
URL: http://svn.freebsd.org/changeset/base/196707

Log:
  Simplify pmap_change_attr() a bit:
  - Always calculate the cache bits instead of doing it on-demand.
  - Always set changed to TRUE rather than only doing it if it is false.
  
  Discussed with:   alc
  MFC after:3 days

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Mon Aug 31 17:50:33 2009(r196706)
+++ head/sys/amd64/amd64/pmap.c Mon Aug 31 18:41:13 2009(r196707)
@@ -4476,7 +4476,8 @@ pmap_change_attr_locked(vm_offset_t va, 
if (base < DMAP_MIN_ADDRESS)
return (EINVAL);
 
-   cache_bits_pde = cache_bits_pte = -1;
+   cache_bits_pde = pmap_cache_bits(mode, 1);
+   cache_bits_pte = pmap_cache_bits(mode, 0);
changed = FALSE;
 
/*
@@ -4493,8 +4494,6 @@ pmap_change_attr_locked(vm_offset_t va, 
 * memory type, then we need not demote this page. Just
 * increment tmpva to the next 1GB page frame.
 */
-   if (cache_bits_pde < 0)
-   cache_bits_pde = pmap_cache_bits(mode, 1);
if ((*pdpe & PG_PDE_CACHE) == cache_bits_pde) {
tmpva = trunc_1gpage(tmpva) + NBPDP;
continue;
@@ -4522,8 +4521,6 @@ pmap_change_attr_locked(vm_offset_t va, 
 * memory type, then we need not demote this page. Just
 * increment tmpva to the next 2MB page frame.
 */
-   if (cache_bits_pde < 0)
-   cache_bits_pde = pmap_cache_bits(mode, 1);
if ((*pde & PG_PDE_CACHE) == cache_bits_pde) {
tmpva = trunc_2mpage(tmpva) + NBPDR;
continue;
@@ -4557,12 +4554,9 @@ pmap_change_attr_locked(vm_offset_t va, 
for (tmpva = base; tmpva < base + size; ) {
pdpe = pmap_pdpe(kernel_pmap, tmpva);
if (*pdpe & PG_PS) {
-   if (cache_bits_pde < 0)
-   cache_bits_pde = pmap_cache_bits(mode, 1);
if ((*pdpe & PG_PDE_CACHE) != cache_bits_pde) {
pmap_pde_attr(pdpe, cache_bits_pde);
-   if (!changed)
-   changed = TRUE;
+   changed = TRUE;
}
if (tmpva >= VM_MIN_KERNEL_ADDRESS) {
if (pa_start == pa_end) {
@@ -4588,12 +4582,9 @@ pmap_change_attr_locked(vm_offset_t va, 
}
pde = pmap_pdpe_to_pde(pdpe, tmpva);
if (*pde & PG_PS) {
-   if (cache_bits_pde < 0)
-   cache_bits_pde = pmap_cache_bits(mode, 1);
if ((*pde & PG_PDE_CACHE) != cache_bits_pde) {
pmap_pde_attr(pde, cache_bits_pde);
-   if (!changed)
-   changed = TRUE;
+   changed = TRUE;
}
if (tmpva >= VM_MIN_KERNEL_ADDRESS) {
if (pa_start == pa_end) {
@@ -4616,13 +4607,10 @@ pmap_change_attr_locked(vm_offset_t va, 
}
tmpva = trunc_2mpage(tmpva) + NBPDR;
} else {
-   if (cache_bits_pte < 0)
-   cache_bits_pte = pmap_cache_bits(mode, 0);
pte = pmap_pde_to_pte(pde, tmpva);
if ((*pte & PG_PTE_CACHE) != cache_bits_pte) {
pmap_pte_attr(pte, cache_bits_pte);
-   if (!changed)
-   changed = TRUE;
+   changed = TRUE;
}
if (tmpva >= VM_MIN_KERNEL_ADDRESS) {
if (pa_start == pa_end) {

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Mon Aug 31 17:50:33 2009(r196706)
+++ head/sys/i386/i386/pmap.c   Mon Aug 31 18:41:13 2009(r196707)
@@ -4635,7 +4635,8 @@ pmap_change_attr(vm_offset_t va, vm_size
if (base < VM_MIN_KERNEL_ADDRESS)
return (EINVAL);
 
-   cache_bits_pde = cache_bits_pte = -1;
+   cache_bits_pde = pmap_cache_bits(mode, 1);
+   cache_bits_pte = pmap_cache_bits(mode, 0);
changed = FALSE;
 
/*
@@ -4656,8 +4657,

svn commit: r196706 - head/usr.sbin/pkg_install/lib

2009-08-31 Thread Doug Barton
Author: dougb
Date: Mon Aug 31 17:50:33 2009
New Revision: 196706
URL: http://svn.freebsd.org/changeset/base/196706

Log:
  Add support for INDEX-9 [1]
  
  While I'm here, strip off support for FreeBSD 5.x.
  
  Submitted by: Alexey Shuvaev  [1]

Modified:
  head/usr.sbin/pkg_install/lib/lib.h

Modified: head/usr.sbin/pkg_install/lib/lib.h
==
--- head/usr.sbin/pkg_install/lib/lib.h Mon Aug 31 17:42:52 2009
(r196705)
+++ head/usr.sbin/pkg_install/lib/lib.h Mon Aug 31 17:50:33 2009
(r196706)
@@ -84,14 +84,14 @@
 #define DISPLAY_FNAME  "+DISPLAY"
 #define MTREE_FNAME"+MTREE_DIRS"
 
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 80
+#if defined(__FreeBSD_version) && __FreeBSD_version >= 90
+#define INDEX_FNAME"INDEX-9"
+#elif defined(__FreeBSD_version) && __FreeBSD_version >= 80
 #define INDEX_FNAME"INDEX-8"
 #elif defined(__FreeBSD_version) && __FreeBSD_version >= 70
 #define INDEX_FNAME"INDEX-7"
 #elif defined(__FreeBSD_version) && __FreeBSD_version >= 60
 #define INDEX_FNAME"INDEX-6"
-#elif defined(__FreeBSD_version) && __FreeBSD_version >= 500036
-#define INDEX_FNAME"INDEX-5"
 #else
 #define INDEX_FNAME"INDEX"
 #endif
___
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-unsubscr...@freebsd.org"


svn commit: r196705 - in head/sys/i386: i386 include

2009-08-31 Thread John Baldwin
Author: jhb
Date: Mon Aug 31 17:42:52 2009
New Revision: 196705
URL: http://svn.freebsd.org/changeset/base/196705

Log:
  Improve pmap_change_attr() so that it is able to demote a large (2/4MB)
  page into 4KB pages as needed.  This should be fairly rare in practice
  on i386.  This includes merging the following changes from the amd64 pmap:
  180430, 180485, 180845, 181043, 181077, and 196318.
  - Add basic support for changing attributes on PDEs to pmap_change_attr()
similar to the support in the initial version of pmap_change_attr() on
amd64 including inlines for pmap_pde_attr() and pmap_pte_attr().
  - Extend pmap_demote_pde() to include the ability to instantiate a new page
table page where none existed before.
  - Enhance pmap_change_attr().  Use pmap_demote_pde() to demote a 2/4MB page
mapping to 4KB page mappings when the specified attribute change only
applies to a portion of the 2/4MB page.  Previously, in such cases,
pmap_change_attr() gave up and returned an error.
  - Correct a critical accounting error in pmap_demote_pde().
  
  Reviewed by:  alc
  MFC after:3 days

Modified:
  head/sys/i386/i386/pmap.c
  head/sys/i386/include/pmap.h

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Mon Aug 31 17:34:11 2009(r196704)
+++ head/sys/i386/i386/pmap.c   Mon Aug 31 17:42:52 2009(r196705)
@@ -288,12 +288,15 @@ static boolean_t pmap_enter_pde(pmap_t p
 static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va,
 vm_page_t m, vm_prot_t prot, vm_page_t mpte);
 static void pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte);
+static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte);
 static boolean_t pmap_is_modified_pvh(struct md_page *pvh);
 static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode);
 static vm_page_t pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va);
+static void pmap_pde_attr(pd_entry_t *pde, int cache_bits);
 static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va);
 static boolean_t pmap_protect_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t 
sva,
 vm_prot_t prot);
+static void pmap_pte_attr(pt_entry_t *pte, int cache_bits);
 static void pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva,
 vm_page_t *free);
 static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva,
@@ -2289,32 +2292,62 @@ pmap_pv_insert_pde(pmap_t pmap, vm_offse
 }
 
 /*
- * Tries to demote a 2- or 4MB page mapping.
+ * Fills a page table page with mappings to consecutive physical pages.
+ */
+static void
+pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte)
+{
+   pt_entry_t *pte;
+
+   for (pte = firstpte; pte < firstpte + NPTEPG; pte++) {
+   *pte = newpte;  
+   newpte += PAGE_SIZE;
+   }
+}
+
+/*
+ * Tries to demote a 2- or 4MB page mapping.  If demotion fails, the
+ * 2- or 4MB page mapping is invalidated.
  */
 static boolean_t
 pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va)
 {
pd_entry_t newpde, oldpde;
pmap_t allpmaps_entry;
-   pt_entry_t *firstpte, newpte, *pte;
+   pt_entry_t *firstpte, newpte;
vm_paddr_t mptepa;
vm_page_t free, mpte;
 
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
+   oldpde = *pde;
+   KASSERT((oldpde & (PG_PS | PG_V)) == (PG_PS | PG_V),
+   ("pmap_demote_pde: oldpde is missing PG_PS and/or PG_V"));
mpte = pmap_lookup_pt_page(pmap, va);
if (mpte != NULL)
pmap_remove_pt_page(pmap, mpte);
else {
-   KASSERT((*pde & PG_W) == 0,
+   KASSERT((oldpde & PG_W) == 0,
("pmap_demote_pde: page table page for a wired mapping"
" is missing"));
-   free = NULL;
-   pmap_remove_pde(pmap, pde, trunc_4mpage(va), &free);
-   pmap_invalidate_page(pmap, trunc_4mpage(va));
-   pmap_free_zero_pages(free);
-   CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#x"
-   " in pmap %p", va, pmap);
-   return (FALSE);
+
+   /*
+* Invalidate the 2- or 4MB page mapping and return
+* "failure" if the mapping was never accessed or the
+* allocation of the new page table page fails.
+*/
+   if ((oldpde & PG_A) == 0 || (mpte = vm_page_alloc(NULL,
+   va >> PDRSHIFT, VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL |
+   VM_ALLOC_WIRED)) == NULL) {
+   free = NULL;
+   pmap_remove_pde(pmap, pde, trunc_4mpage(va), &free);
+   pmap_invalidate_page(pmap, trunc_4mpage(va));
+   pmap_free_zero_pages(free);
+   CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#x"
+   " in pmap %p", va, pmap);

svn commit: r196704 - head/sys/i386/isa

2009-08-31 Thread Xin LI
Author: delphij
Date: Mon Aug 31 17:34:11 2009
New Revision: 196704
URL: http://svn.freebsd.org/changeset/base/196704

Log:
  Partially revert 196524: this part of change should not be committed as
  part of the changeset - it's an unrelated one.
  
  Reported by:  danfe

Modified:
  head/sys/i386/isa/vesa.c

Modified: head/sys/i386/isa/vesa.c
==
--- head/sys/i386/isa/vesa.cMon Aug 31 16:27:00 2009(r196703)
+++ head/sys/i386/isa/vesa.cMon Aug 31 17:34:11 2009(r196704)
@@ -1074,11 +1074,6 @@ vesa_set_mode(video_adapter_t *adp, int 
(info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0;
vesa_adp->va_crtc_addr =
(vesa_adp->va_flags & V_ADP_COLOR) ? COLOR_CRTC : MONO_CRTC;
-
-   vesa_adp->va_window = BIOS_PADDRTOVADDR(info.vi_window);
-   vesa_adp->va_window_size = info.vi_window_size;
-   vesa_adp->va_window_gran = info.vi_window_gran;
-
if (info.vi_flags & V_INFO_LINEAR) {
 #if VESA_DEBUG > 1
printf("VESA: setting up LFB\n");
@@ -1088,31 +1083,41 @@ vesa_set_mode(video_adapter_t *adp, int 
vesa_adp_info->v_memsize*64*1024);
vesa_adp->va_buffer_size = info.vi_buffer_size;
vesa_adp->va_window = vesa_adp->va_buffer;
+   vesa_adp->va_window_size = info.vi_buffer_size/info.vi_planes;
+   vesa_adp->va_window_gran = info.vi_buffer_size/info.vi_planes;
} else {
vesa_adp->va_buffer = 0;
-   vesa_adp->va_buffer_size = 0;
+   vesa_adp->va_buffer_size = info.vi_buffer_size;
+   vesa_adp->va_window = BIOS_PADDRTOVADDR(info.vi_window);
+   vesa_adp->va_window_size = info.vi_window_size;
+   vesa_adp->va_window_gran = info.vi_window_gran;
}
-#if VESA_DEBUG > 1
-   printf("VESA: buffer %x, buffer_size %d, window %x, window_size %d\n",
-   vesa_adp->va_buffer,
-   vesa_adp->va_buffer_size,
-   vesa_adp->va_window,
-   vesa_adp->va_window_size);
-#endif
vesa_adp->va_window_orig = 0;
len = vesa_bios_get_line_length();
-   if (info.vi_flags & V_INFO_GRAPHICS) {
-   switch (info.vi_depth) {
+   if (len > 0) {
+   vesa_adp->va_line_width = len;
+   } else if (info.vi_flags & V_INFO_GRAPHICS) {
+   switch (info.vi_depth/info.vi_planes) {
+   case 1:
+   vesa_adp->va_line_width = info.vi_width/8;
+   break;
+   case 2:
+   vesa_adp->va_line_width = info.vi_width/4;
+   break;
case 4:
-   vesa_adp->va_line_width = info.vi_width;
+   vesa_adp->va_line_width = info.vi_width/2;
break;
case 8:
+   default: /* shouldn't happen */
+   vesa_adp->va_line_width = info.vi_width;
+   break;
case 15:
case 16:
+   vesa_adp->va_line_width = info.vi_width*2;
+   break;
case 24:
case 32:
-   default:
-   vesa_adp->va_line_width = info.vi_width * 
(info.vi_depth / 8);
+   vesa_adp->va_line_width = info.vi_width*4;
break;
}
} else {
@@ -1121,8 +1126,8 @@ vesa_set_mode(video_adapter_t *adp, int 
vesa_adp->va_disp_start.x = 0;
vesa_adp->va_disp_start.y = 0;
 #if VESA_DEBUG > 0
-   printf("vesa_set_mode(): vi_width:%d, len:%d, line_width:%d 
vi_mem_model:%d\n",
-  info.vi_width, len, vesa_adp->va_line_width, info.vi_mem_model);
+   printf("vesa_set_mode(): vi_width:%d, len:%d, line_width:%d\n",
+  info.vi_width, len, vesa_adp->va_line_width);
 #endif
bcopy(&info, &vesa_adp->va_info, sizeof(vesa_adp->va_info));
 
___
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-unsubscr...@freebsd.org"


Re: svn commit: r196701 - head/share/man/man4

2009-08-31 Thread pluknet
2009/8/31 Edward Tomasz Napierala :
> Author: trasz
> Date: Mon Aug 31 16:20:06 2009
> New Revision: 196701
> URL: http://svn.freebsd.org/changeset/base/196701
>
> Log:
>  Make it easier to find proper manual page for newer ServeRAID controllers.
>
> Modified:
>  head/share/man/man4/ips.4
>
> Modified: head/share/man/man4/ips.4
> ==
> --- head/share/man/man4/ips.4   Mon Aug 31 16:19:06 2009        (r196700)
> +++ head/share/man/man4/ips.4   Mon Aug 31 16:20:06 2009        (r196701)
> @@ -92,6 +92,10 @@ ServeRAID 6i/6M
>  .It
>  ServeRAID 7t/7k/7M
>  .El
> +.Pp
> +Newer ServeRAID controllers are supported by the
> +.Xr aac 4
> +driver.
[...]

Please, note also that the latest ServeRAID found on x3650 m2 appears
to be LSI based mfi(4).
mfi0:  port 0x1000-0x10ff mem 0x9790-0x9793,0x9794
-0x9797 irq 16 at device 0.0 on pci1
mfi0: Reserved 0x4 bytes for rid 0x10 type 3 at 0x9790
mfi0: Megaraid SAS driver Ver 3.00
mfi0: Max fw cmds= 1008, sizing driver pool to 128

See also http://archive.netbsd.se/?ml=sunhelp-geeks&a=2009-06&t=10857150.

-- 
wbr,
pluknet
___
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-unsubscr...@freebsd.org"


svn commit: r196703 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2009-08-31 Thread Pawel Jakub Dawidek
Author: pjd
Date: Mon Aug 31 16:27:00 2009
New Revision: 196703
URL: http://svn.freebsd.org/changeset/base/196703

Log:
  Backport the 'dirtying dbuf' panic fix from newer ZFS version.
  
  Reported by:  Thomas Backman 
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c  Mon Aug 
31 16:25:55 2009(r196702)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c  Mon Aug 
31 16:27:00 2009(r196703)
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -864,10 +864,11 @@ restore_object(struct restorearg *ra, ob
/* currently allocated, want to be allocated */
dmu_tx_hold_bonus(tx, drro->drr_object);
/*
-* We may change blocksize, so need to
-* hold_write
+* We may change blocksize and delete old content,
+* so need to hold_write and hold_free.
 */
dmu_tx_hold_write(tx, drro->drr_object, 0, 1);
+   dmu_tx_hold_free(tx, drro->drr_object, 0, DMU_OBJECT_END);
err = dmu_tx_assign(tx, TXG_WAIT);
if (err) {
dmu_tx_abort(tx);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Aug 31 
16:25:55 2009(r196702)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Aug 31 
16:27:00 2009(r196703)
@@ -415,7 +415,7 @@ void
 dnode_reallocate(dnode_t *dn, dmu_object_type_t ot, int blocksize,
 dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx)
 {
-   int i, old_nblkptr;
+   int i, nblkptr;
dmu_buf_impl_t *db = NULL;
 
ASSERT3U(blocksize, >=, SPA_MINBLOCKSIZE);
@@ -445,6 +445,8 @@ dnode_reallocate(dnode_t *dn, dmu_object
dnode_free_range(dn, 0, -1ULL, tx);
}
 
+   nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT);
+
/* change blocksize */
rw_enter(&dn->dn_struct_rwlock, RW_WRITER);
if (blocksize != dn->dn_datablksz &&
@@ -457,6 +459,8 @@ dnode_reallocate(dnode_t *dn, dmu_object
dnode_setdirty(dn, tx);
dn->dn_next_bonuslen[tx->tx_txg&TXG_MASK] = bonuslen;
dn->dn_next_blksz[tx->tx_txg&TXG_MASK] = blocksize;
+   if (dn->dn_nblkptr != nblkptr)
+   dn->dn_next_nblkptr[tx->tx_txg&TXG_MASK] = nblkptr;
rw_exit(&dn->dn_struct_rwlock);
if (db)
dbuf_rele(db, FTAG);
@@ -466,19 +470,15 @@ dnode_reallocate(dnode_t *dn, dmu_object
 
/* change bonus size and type */
mutex_enter(&dn->dn_mtx);
-   old_nblkptr = dn->dn_nblkptr;
dn->dn_bonustype = bonustype;
dn->dn_bonuslen = bonuslen;
-   dn->dn_nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT);
+   dn->dn_nblkptr = nblkptr;
dn->dn_checksum = ZIO_CHECKSUM_INHERIT;
dn->dn_compress = ZIO_COMPRESS_INHERIT;
ASSERT3U(dn->dn_nblkptr, <=, DN_MAX_NBLKPTR);
 
-   /* XXX - for now, we can't make nblkptr smaller */
-   ASSERT3U(dn->dn_nblkptr, >=, old_nblkptr);
-
-   /* fix up the bonus db_size if dn_nblkptr has changed */
-   if (dn->dn_bonus && dn->dn_bonuslen != old_nblkptr) {
+   /* fix up the bonus db_size */
+   if (dn->dn_bonus) {
dn->dn_bonus->db.db_size =
DN_MAX_BONUSLEN - (dn->dn_nblkptr-1) * sizeof (blkptr_t);
ASSERT(dn->dn_bonuslen <= dn->dn_bonus->db.db_size);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.cMon Aug 
31 16:25:55 2009(r196702)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.cMon Aug 
31 16:27:00 2009(r196703)
@@ -19,12 +19,10 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident  "%Z%%M% %I% %E% SMI"
-
 #include 
 #include 
 #include 
@@ -534,18 +532,12 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx)
/* XXX sh

svn commit: r196702 - head/sys/cddl/contrib/opensolaris/uts/common/rpc

2009-08-31 Thread Pawel Jakub Dawidek
Author: pjd
Date: Mon Aug 31 16:25:55 2009
New Revision: 196702
URL: http://svn.freebsd.org/changeset/base/196702

Log:
  Remove empty directory.

Deleted:
  head/sys/cddl/contrib/opensolaris/uts/common/rpc/
___
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-unsubscr...@freebsd.org"


svn commit: r196701 - head/share/man/man4

2009-08-31 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Aug 31 16:20:06 2009
New Revision: 196701
URL: http://svn.freebsd.org/changeset/base/196701

Log:
  Make it easier to find proper manual page for newer ServeRAID controllers.

Modified:
  head/share/man/man4/ips.4

Modified: head/share/man/man4/ips.4
==
--- head/share/man/man4/ips.4   Mon Aug 31 16:19:06 2009(r196700)
+++ head/share/man/man4/ips.4   Mon Aug 31 16:20:06 2009(r196701)
@@ -92,6 +92,10 @@ ServeRAID 6i/6M
 .It
 ServeRAID 7t/7k/7M
 .El
+.Pp
+Newer ServeRAID controllers are supported by the
+.Xr aac 4
+driver.
 .Sh DIAGNOSTICS
 Several error codes may be shown when the card initializes the
 .Tn IBM
@@ -180,6 +184,7 @@ driver does not use the
 .Tn SCSI
 subsystem.
 .Sh SEE ALSO
+.Xr aac 4 ,
 .Xr ch 4 ,
 .Xr da 4 ,
 .Xr sysctl 8
___
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-unsubscr...@freebsd.org"


svn commit: r196700 - head/share/man/man4

2009-08-31 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Aug 31 16:19:06 2009
New Revision: 196700
URL: http://svn.freebsd.org/changeset/base/196700

Log:
  Manual page for mfiutil(8) is in section 8 now.

Modified:
  head/share/man/man4/mfi.4

Modified: head/share/man/man4/mfi.4
==
--- head/share/man/man4/mfi.4   Mon Aug 31 14:13:45 2009(r196699)
+++ head/share/man/man4/mfi.4   Mon Aug 31 16:19:06 2009(r196700)
@@ -102,9 +102,9 @@ management interface
 An attempt was made to remove a mounted volume.
 .El
 .Sh SEE ALSO
-.Xr mfiutil 1 ,
 .Xr amr 4 ,
-.Xr pci 4
+.Xr pci 4 ,
+.Xr mfiutil 8
 .Sh HISTORY
 The
 .Nm
___
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-unsubscr...@freebsd.org"


RE: svn commit: r196679 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net

2009-08-31 Thread Qing Li
> 
> On Mon, 31 Aug 2009, Qing Li wrote:
> 
> >  As part of r196609, a call to  "rtalloc" did not take the 
> fib into  
> > account. So call the appropriate "rtalloc_ign_fib()" instead of  
> > calling "rtalloc_ign()".
> >
> >  Reviewed by:   pointed out by bz
> >  Approved by:   re
> 
> I don't have this in my list of re-approved merges.  Are you 
> sure this change was approved by re?
> 


>From "Kostik Belousov":

"There was (unhandled) note from Bjoern about interaction with FIB.
 Patch is approved, but please take care of that note."

I assume it's fine.

-- Qing


___
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-unsubscr...@freebsd.org"


RE: svn commit: r196673 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net

2009-08-31 Thread Qing Li
> 
> With this change, can I mark the following two TODO items as done:
> 
>   * RTM_CHANGE in net/rtsock.c can incorrectly set 
> RTF_GATEWAY (QingLi) (in
> progress)
>   * flowtable mishandles gateway (G) routes on POINT2POINT interfaces
> (BrianSomers) (in progress)
> 

 AFAIK, Yes.

>
> Also, do we believe your last few commits fix the three 
> issues raised by Sato-san in his IPv6 reports:
> 
>   * IPv6 regression on 8.x (QingLi) (in progress)

 One is reported as remaining, which I will investigate today and 
 hope to take care of it soon.

  -- Qing


___
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-unsubscr...@freebsd.org"


svn commit: r196699 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern

2009-08-31 Thread Jamie Gritton
Author: jamie
Date: Mon Aug 31 14:13:45 2009
New Revision: 196699
URL: http://svn.freebsd.org/changeset/base/196699

Log:
  MFC r196592:
Fix a LOR between allprison_lock and vnode locks by releasing
allprison_lock before releasing a prison's root vnode.
  
  PR:   kern/138004
  Reviewed by:  kib
  Approved by:  re (rwatson), bz (mentor)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/kern/kern_jail.c

Modified: stable/8/sys/kern/kern_jail.c
==
--- stable/8/sys/kern/kern_jail.c   Mon Aug 31 14:06:59 2009
(r196698)
+++ stable/8/sys/kern/kern_jail.c   Mon Aug 31 14:13:45 2009
(r196699)
@@ -2453,7 +2453,7 @@ prison_deref(struct prison *pr, int flag
ppr = pr->pr_parent;
for (tpr = ppr; tpr != NULL; tpr = tpr->pr_parent)
tpr->pr_childcount--;
-   sx_downgrade(&allprison_lock);
+   sx_xunlock(&allprison_lock);
 
 #ifdef VIMAGE
if (pr->pr_vnet != ppr->pr_vnet)
@@ -2479,7 +2479,7 @@ prison_deref(struct prison *pr, int flag
/* Removing a prison frees a reference on its parent. */
pr = ppr;
mtx_lock(&pr->pr_mtx);
-   flags = PD_DEREF | PD_LIST_SLOCKED;
+   flags = PD_DEREF;
}
 }
 
___
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-unsubscr...@freebsd.org"


svn commit: r196698 - head/lib/libusb

2009-08-31 Thread John Baldwin
Author: jhb
Date: Mon Aug 31 14:06:59 2009
New Revision: 196698
URL: http://svn.freebsd.org/changeset/base/196698

Log:
  Purge some non-useful mergeinfo that is a relic from a temporary USB2 name
  for this file.

Modified:
  head/lib/libusb/usb.h   (props changed)
___
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-unsubscr...@freebsd.org"


svn commit: r196696 - in head: lib/libusb tools/regression/lib/msun tools/tools/ath/common usr.sbin/makefs usr.sbin/makefs/ffs

2009-08-31 Thread John Baldwin
Author: jhb
Date: Mon Aug 31 13:23:55 2009
New Revision: 196696
URL: http://svn.freebsd.org/changeset/base/196696

Log:
  Delete some empty mergeinfo.

Modified:
  head/lib/libusb/   (props changed)
  head/lib/libusb/libusb20.3   (props changed)
  head/tools/regression/lib/msun/test-conj.t   (props changed)
  head/tools/tools/ath/common/dumpregs.h   (props changed)
  head/tools/tools/ath/common/dumpregs_5210.c   (props changed)
  head/tools/tools/ath/common/dumpregs_5211.c   (props changed)
  head/tools/tools/ath/common/dumpregs_5212.c   (props changed)
  head/tools/tools/ath/common/dumpregs_5416.c   (props changed)
  head/usr.sbin/makefs/ffs/ffs_bswap.c   (props changed)
  head/usr.sbin/makefs/ffs/ffs_subr.c   (props changed)
  head/usr.sbin/makefs/ffs/ufs_bswap.h   (props changed)
  head/usr.sbin/makefs/getid.c   (props changed)
___
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-unsubscr...@freebsd.org"


svn commit: r196695 - stable/8/usr.bin/look

2009-08-31 Thread Colin Percival
Author: cperciva
Date: Mon Aug 31 13:02:21 2009
New Revision: 196695
URL: http://svn.freebsd.org/changeset/base/196695

Log:
  MFC r196558: Don't try to mmap the contents of empty files.  This behaviour
  was harmless prior to r195693, when mmap(2) changed from silently ignoring
  requests for mapping zero bytes to returning EINVAL; this commit can be seen
  as adjusting for the change in mmap(2) in order to make look(1) act like it
  did previously.
  
  Reviewed by:  jhb
  Approved by:  re (kib)

Modified:
  stable/8/usr.bin/look/   (props changed)
  stable/8/usr.bin/look/look.c

Modified: stable/8/usr.bin/look/look.c
==
--- stable/8/usr.bin/look/look.cMon Aug 31 12:25:04 2009
(r196694)
+++ stable/8/usr.bin/look/look.cMon Aug 31 13:02:21 2009
(r196695)
@@ -140,6 +140,10 @@ main(int argc, char *argv[])
err(2, "%s", file);
if (sb.st_size > SIZE_T_MAX)
errx(2, "%s: %s", file, strerror(EFBIG));
+   if (sb.st_size == 0) {
+   close(fd);
+   continue;
+   }
if ((front = mmap(NULL, (size_t)sb.st_size, PROT_READ, 
MAP_SHARED, fd, (off_t)0)) == MAP_FAILED)
err(2, "%s", file);
back = front + sb.st_size;
___
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-unsubscr...@freebsd.org"


Re: svn commit: r196558 - head/usr.bin/look

2009-08-31 Thread John Baldwin
On Saturday 29 August 2009 4:35:16 pm Alan Cox wrote:
> John Baldwin wrote:
> > On Tuesday 25 August 2009 11:30:06 pm Colin Percival wrote:
> >   
> >> Author: cperciva
> >> Date: Wed Aug 26 03:30:06 2009
> >> New Revision: 196558
> >> URL: http://svn.freebsd.org/changeset/base/196558
> >>
> >> Log:
> >>   Don't try to mmap the contents of empty files.  This behaviour was 
> >> harmless
> >>   prior to r195693, since historical behaviour of mmap(2) was to silently
> >>   ignore length-zero mmap requests; but mmap now returns EINVAL, which 
> >> caused
> >>   look(1) to emit an error message and fail.
> >> 
> >
> > FWIW, it did not silently ignore the request.  Instead it rounded the size 
> > up
> > to a page and mapped a page of data.  However, if you then passed that 
> > pointer
> > with a length of 0 to munmap() munmap() would fail.
> >
> >   
> 
> I don't believe that your claim is correct; round_page(0) == 0.  Thus, 
> the value of "size" that would be passed to vm_mmap() would be 0, which 
> would cause it to immediately return "0", indicating success.  In this 
> case, I believe that the virtual address that would be returned by 
> mmap(2) would always be the "hint address" for where it should start 
> looking for free space, which would be the end of the heap/data segment, 
> unless the application specified its own hint.
> 
> In short, and the reason why I'm correcting you here, is to make clear 
> that we needn't worry about earlier versions of FreeBSD that don't 
> implement this change "leaking" or wasting memory from misuse of mmap(2) 
> in this way.

Yes, I think you are correct.

-- 
John Baldwin
___
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-unsubscr...@freebsd.org"


svn commit: r196694 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/asmc dev/xen/xenpci

2009-08-31 Thread Rui Paulo
Author: rpaulo
Date: Mon Aug 31 12:25:04 2009
New Revision: 196694
URL: http://svn.freebsd.org/changeset/base/196694

Log:
  MFC r196455:
   Make dev.asmc.N.light.control writable by everyone.
  
  Submitted by: Patrick Lamaiziere 
  Approved by:  re (rwatson)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/asmc/asmc.c
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/asmc/asmc.c
==
--- stable/8/sys/dev/asmc/asmc.cMon Aug 31 11:54:13 2009
(r196693)
+++ stable/8/sys/dev/asmc/asmc.cMon Aug 31 12:25:04 2009
(r196694)
@@ -419,7 +419,8 @@ asmc_attach(device_t dev)
 
SYSCTL_ADD_PROC(sysctlctx,
SYSCTL_CHILDREN(sc->sc_light_tree),
-   OID_AUTO, "control", CTLTYPE_INT | CTLFLAG_RW,
+   OID_AUTO, "control",
+   CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY,
dev, 0, model->smc_light_control, "I",
"Keyboard backlight brightness control");
}
___
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-unsubscr...@freebsd.org"


svn commit: r196693 - stable/7/sys/ufs/ufs

2009-08-31 Thread John Baldwin
Author: jhb
Date: Mon Aug 31 11:54:13 2009
New Revision: 196693
URL: http://svn.freebsd.org/changeset/base/196693

Log:
  MFC a part of 191990:
  Fix compile of UFS_EXTATTR without UFS_EXTATTR_AUTOSTART.
  
  PR:   kern/138350

Modified:
  stable/7/sys/ufs/ufs/ufs_extattr.c

Modified: stable/7/sys/ufs/ufs/ufs_extattr.c
==
--- stable/7/sys/ufs/ufs/ufs_extattr.c  Mon Aug 31 10:20:52 2009
(r196692)
+++ stable/7/sys/ufs/ufs/ufs_extattr.c  Mon Aug 31 11:54:13 2009
(r196693)
@@ -93,8 +93,10 @@ static int   ufs_extattr_set(struct vnode 
struct thread *td);
 static int ufs_extattr_rm(struct vnode *vp, int attrnamespace,
const char *name, struct ucred *cred, struct thread *td);
+#ifdef UFS_EXTATTR_AUTOSTART
 static int ufs_extattr_autostart_locked(struct mount *mp,
struct thread *td);
+#endif
 static int ufs_extattr_start_locked(struct ufsmount *ump,
struct thread *td);
 
___
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-unsubscr...@freebsd.org"


svn commit: r196692 - head/sys/kern

2009-08-31 Thread Konstantin Belousov
Author: kib
Date: Mon Aug 31 10:20:52 2009
New Revision: 196692
URL: http://svn.freebsd.org/changeset/base/196692

Log:
  Make the mnt_writeopcount and mnt_secondary_writes counters,
  used by the suspension code, not greater then mnt_ref reference
  counter value. Increment mnt_ref together with write counter
  in vn_start_write()/ vn_start_secondary_write(), releasing in
  vn_finished_write/vn_finished_secondary_write().
  
  Since r186197, unmount code requires that no writers occured after all
  references are expired. We still could get write counter incremented
  for freed or reused struct mount, but it seems to be innocent, since
  corresponding vnode should be referenced and reclaimed then.
  
  Reported by:  pho (last half a year), erwin
  Reviewed by:  attilio
  Tested by:pho, erwin
  MFC after:1 week

Modified:
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/vfs_vnops.c
==
--- head/sys/kern/vfs_vnops.c   Mon Aug 31 09:46:09 2009(r196691)
+++ head/sys/kern/vfs_vnops.c   Mon Aug 31 10:20:52 2009(r196692)
@@ -999,7 +999,8 @@ vn_start_write(vp, mpp, flags)
goto unlock;
mp->mnt_writeopcount++;
 unlock:
-   MNT_REL(mp);
+   if (error != 0)
+   MNT_REL(mp);
MNT_IUNLOCK(mp);
return (error);
 }
@@ -1049,7 +1050,6 @@ vn_start_secondary_write(vp, mpp, flags)
if ((mp->mnt_kern_flag & (MNTK_SUSPENDED | MNTK_SUSPEND2)) == 0) {
mp->mnt_secondary_writes++;
mp->mnt_secondary_accwrites++;
-   MNT_REL(mp);
MNT_IUNLOCK(mp);
return (0);
}
@@ -1081,6 +1081,7 @@ vn_finished_write(mp)
if (mp == NULL)
return;
MNT_ILOCK(mp);
+   MNT_REL(mp);
mp->mnt_writeopcount--;
if (mp->mnt_writeopcount < 0)
panic("vn_finished_write: neg cnt");
@@ -1103,6 +1104,7 @@ vn_finished_secondary_write(mp)
if (mp == NULL)
return;
MNT_ILOCK(mp);
+   MNT_REL(mp);
mp->mnt_secondary_writes--;
if (mp->mnt_secondary_writes < 0)
panic("vn_finished_secondary_write: neg cnt");
___
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-unsubscr...@freebsd.org"


Re: svn commit: r196679 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net

2009-08-31 Thread Robert Watson

University of Cambridge

On Mon, 31 Aug 2009, Qing Li wrote:


 As part of r196609, a call to  "rtalloc" did not take the fib into
 account. So call the appropriate "rtalloc_ign_fib()" instead of
 calling "rtalloc_ign()".

 Reviewed by:   pointed out by bz
 Approved by:   re


I don't have this in my list of re-approved merges.  Are you sure this change 
was approved by re?


Robert N M Watson
Computer Laboratory
University of Cambridge



Modified:
 stable/8/sys/   (props changed)
 stable/8/sys/amd64/include/xen/   (props changed)
 stable/8/sys/cddl/contrib/opensolaris/   (props changed)
 stable/8/sys/contrib/dev/acpica/   (props changed)
 stable/8/sys/contrib/pf/   (props changed)
 stable/8/sys/dev/xen/xenpci/   (props changed)
 stable/8/sys/net/rtsock.c

Modified: stable/8/sys/net/rtsock.c
==
--- stable/8/sys/net/rtsock.c   Mon Aug 31 00:14:37 2009(r196678)
+++ stable/8/sys/net/rtsock.c   Mon Aug 31 00:18:17 2009(r196679)
@@ -527,7 +527,7 @@ route_output(struct mbuf *m, struct sock

bzero(&gw_ro, sizeof(gw_ro));
gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY];
-   rtalloc_ign(&gw_ro, 0);
+   rtalloc_ign_fib(&gw_ro, 0, so->so_fibnum);
/*
 * A host route through the loopback interface is
 * installed for each interface adddress. In pre 8.0


___
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-unsubscr...@freebsd.org"


Re: svn commit: r196673 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net

2009-08-31 Thread Robert Watson


On Sun, 30 Aug 2009, Qing Li wrote:


 In ip_output(), the flow-table module must not try to cache L2/L3
 information for interface of IFF_POINTOPOINT or IFF_LOOPBACK type.
 Since the L2 information (rt_lle) is invalid for these interface
 types, accidental caching attempt will trigger panic when the invalid
 rt_lle reference is accessed.

 When installing a new route, or when updating an existing route, the
 user supplied gateway address may be an interface address (this is
 particularly true for point-to-point interface related modules such
 as ppp, if_tun, if_gif). Currently the routing command handler always
 set the RTF_GATEWAY flag if the gateway address is given as part of the
 command paramters. Therefore the gateway address must be verified against
 interface addresses or else the route would be treated as an indirect
 route, thus making that route unusable.


With this change, can I mark the following two TODO items as done:

 * RTM_CHANGE in net/rtsock.c can incorrectly set RTF_GATEWAY (QingLi) (in
   progress)
 * flowtable mishandles gateway (G) routes on POINT2POINT interfaces
   (BrianSomers) (in progress)

Also, do we believe your last few commits fix the three issues raised by 
Sato-san in his IPv6 reports:


 * IPv6 regression on 8.x (QingLi) (in progress)

Thanks!

Robert N M Watson
Computer Laboratory
University of Cambridge





 Reviewed by:   kmacy, julian, rwatson
 Approved by:   re

Modified:
 stable/8/sys/   (props changed)
 stable/8/sys/amd64/include/xen/   (props changed)
 stable/8/sys/cddl/contrib/opensolaris/   (props changed)
 stable/8/sys/contrib/dev/acpica/   (props changed)
 stable/8/sys/contrib/pf/   (props changed)
 stable/8/sys/dev/xen/xenpci/   (props changed)
 stable/8/sys/net/flowtable.c
 stable/8/sys/net/rtsock.c

Modified: stable/8/sys/net/flowtable.c
==
--- stable/8/sys/net/flowtable.cSun Aug 30 22:39:49 2009
(r196672)
+++ stable/8/sys/net/flowtable.cSun Aug 30 22:42:32 2009
(r196673)
@@ -692,6 +692,12 @@ uncached:
struct rtentry *rt = ro->ro_rt;
struct ifnet *ifp = rt->rt_ifp;

+   if (ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) {
+   RTFREE(rt);
+   ro->ro_rt = NULL;
+   return (ENOENT);
+   }
+
if (rt->rt_flags & RTF_GATEWAY)
l3addr = rt->rt_gateway;
else

Modified: stable/8/sys/net/rtsock.c
==
--- stable/8/sys/net/rtsock.c   Sun Aug 30 22:39:49 2009(r196672)
+++ stable/8/sys/net/rtsock.c   Sun Aug 30 22:42:32 2009(r196673)
@@ -513,6 +513,39 @@ route_output(struct mbuf *m, struct sock
senderr(error);
}

+   /*
+* The given gateway address may be an interface address.
+* For example, issuing a "route change" command on a route
+* entry that was created from a tunnel, and the gateway
+* address given is the local end point. In this case the
+* RTF_GATEWAY flag must be cleared or the destination will
+* not be reachable even though there is no error message.
+*/
+   if (info.rti_info[RTAX_GATEWAY] != NULL &&
+   info.rti_info[RTAX_GATEWAY]->sa_family != AF_LINK) {
+   struct route gw_ro;
+
+   bzero(&gw_ro, sizeof(gw_ro));
+   gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY];
+   rtalloc_ign(&gw_ro, 0);
+   /*
+* A host route through the loopback interface is
+* installed for each interface adddress. In pre 8.0
+* releases the interface address of a PPP link type
+* is not reachable locally. This behavior is fixed as
+* part of the new L2/L3 redesign and rewrite work. The
+* signature of this interface address route is the
+* AF_LINK sa_family type of the rt_gateway, and the
+* rt_ifp has the IFF_LOOPBACK flag set.
+*/
+   if (gw_ro.ro_rt != NULL &&
+   gw_ro.ro_rt->rt_gateway->sa_family == AF_LINK &&
+   gw_ro.ro_rt->rt_ifp->if_flags & IFF_LOOPBACK)
+   info.rti_flags &= ~RTF_GATEWAY;
+   if (gw_ro.ro_rt != NULL)
+   RTFREE(gw_ro.ro_rt);
+   }
+
switch (rtm->rtm_type) {
struct rtentry *saved_nrt;

@@ -714,7 +747,7 @@ route_output(struct mbuf *m, struct sock
RT_UNLOCK(rt);
senderr(error);
}
-   rt->rt_flags |= RTF_GATEWAY;
+   rt->rt_flags |= (RTF_GATEWAY & info.rti_flags);
}
 

svn commit: r196691 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris compat/linprocfs compat/linux contrib/dev/acpica contrib/pf dev/xen/xenpci

2009-08-31 Thread Marko Zec
Author: zec
Date: Mon Aug 31 09:46:09 2009
New Revision: 196691
URL: http://svn.freebsd.org/changeset/base/196691

Log:
  MFC r196635:
  
Fix a few panics in linuxulator + VIMAGE due to curvnet not being set.
  
This change affects only options VIMAGE builds.
  
Reviewed by:  julian
  
  Approved by:  re (rwatson)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/compat/linprocfs/linprocfs.c
  stable/8/sys/compat/linux/linux_ioctl.c
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/compat/linprocfs/linprocfs.c
==
--- stable/8/sys/compat/linprocfs/linprocfs.c   Mon Aug 31 09:44:07 2009
(r196690)
+++ stable/8/sys/compat/linprocfs/linprocfs.c   Mon Aug 31 09:46:09 2009
(r196691)
@@ -1085,6 +1085,7 @@ linprocfs_donetdev(PFS_FILL_ARGS)
"bytespackets errs drop fifo frame compressed",
"bytespackets errs drop fifo frame compressed");
 
+   CURVNET_SET(TD_TO_VNET(curthread));
IFNET_RLOCK();
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
linux_ifname(ifp, ifname, sizeof ifname);
@@ -1095,6 +1096,7 @@ linprocfs_donetdev(PFS_FILL_ARGS)
0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL);
}
IFNET_RUNLOCK();
+   CURVNET_RESTORE();
 
return (0);
 }

Modified: stable/8/sys/compat/linux/linux_ioctl.c
==
--- stable/8/sys/compat/linux/linux_ioctl.c Mon Aug 31 09:44:07 2009
(r196690)
+++ stable/8/sys/compat/linux/linux_ioctl.c Mon Aug 31 09:46:09 2009
(r196691)
@@ -2104,6 +2104,7 @@ ifname_linux_to_bsd(struct thread *td, c
return (NULL);
index = 0;
is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0;
+   CURVNET_SET(TD_TO_VNET(td));
IFNET_RLOCK();
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
/*
@@ -2117,6 +2118,7 @@ ifname_linux_to_bsd(struct thread *td, c
break;
}
IFNET_RUNLOCK();
+   CURVNET_RESTORE();
if (ifp != NULL)
strlcpy(bsdname, ifp->if_xname, IFNAMSIZ);
return (ifp);
@@ -2146,6 +2148,7 @@ linux_ifconf(struct thread *td, struct i
 
max_len = MAXPHYS - 1;
 
+   CURVNET_SET(TD_TO_VNET(td));
/* handle the 'request buffer size' case */
if (ifc.ifc_buf == PTROUT(NULL)) {
ifc.ifc_len = 0;
@@ -2157,11 +2160,14 @@ linux_ifconf(struct thread *td, struct i
}
}
error = copyout(&ifc, uifc, sizeof(ifc));
+   CURVNET_RESTORE();
return (error);
}
 
-   if (ifc.ifc_len <= 0)
+   if (ifc.ifc_len <= 0) {
+   CURVNET_RESTORE();
return (EINVAL);
+   }
 
 again:
/* Keep track of eth interfaces */
@@ -2223,6 +2229,7 @@ again:
memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len);
error = copyout(&ifc, uifc, sizeof(ifc));
sbuf_delete(sb);
+   CURVNET_RESTORE();
 
return (error);
 }
___
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-unsubscr...@freebsd.org"


svn commit: r196690 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net

2009-08-31 Thread Marko Zec
Author: zec
Date: Mon Aug 31 09:44:07 2009
New Revision: 196690
URL: http://svn.freebsd.org/changeset/base/196690

Log:
  MFC r196633:
  
Introduce a separate sx lock for protecting lists of vnet sysinit
and sysuninit handlers.
  
Previously, sx_vnet, which is a lock designated for protecting
the vnet list, was (ab)used for protecting vnet sysinit / sysuninit
handler lists as well.  Holding exclusively the sx_vnet lock while
invoking sysinit and / or sysuninit handlers turned out to be
problematic, since some of the handlers may attempt to wake up
another thread and wait for it to walk over the vnet list, hence
acquire a shared lock on sx_vnet, which in turn leads to a deadlock.
Protecting vnet sysinit / sysuninit lists with a separate lock
mitigates this issue, which was first observed with
flowtable_flush() / flowtable_cleaner() in sys/net/flowtable.c.
  
Reviewed by:  rwatson, jhb
MFC after:3 days
  
  Approved by:  re (rwatson)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/net/vnet.c

Modified: stable/8/sys/net/vnet.c
==
--- stable/8/sys/net/vnet.c Mon Aug 31 09:26:04 2009(r196689)
+++ stable/8/sys/net/vnet.c Mon Aug 31 09:44:07 2009(r196690)
@@ -182,14 +182,21 @@ static VNET_DEFINE(char, modspace[VNET_M
 
 /*
  * Global lists of subsystem constructor and destructors for vnets.  They are
- * registered via VNET_SYSINIT() and VNET_SYSUNINIT().  The lists are
- * protected by the vnet_sxlock global lock.
+ * registered via VNET_SYSINIT() and VNET_SYSUNINIT().  Both lists are
+ * protected by the vnet_sysinit_sxlock global lock.
  */
 static TAILQ_HEAD(vnet_sysinit_head, vnet_sysinit) vnet_constructors =
TAILQ_HEAD_INITIALIZER(vnet_constructors);
 static TAILQ_HEAD(vnet_sysuninit_head, vnet_sysinit) vnet_destructors =
TAILQ_HEAD_INITIALIZER(vnet_destructors);
 
+struct sx  vnet_sysinit_sxlock;
+
+#defineVNET_SYSINIT_WLOCK()sx_xlock(&vnet_sysinit_sxlock);
+#defineVNET_SYSINIT_WUNLOCK()  sx_xunlock(&vnet_sysinit_sxlock);
+#defineVNET_SYSINIT_RLOCK()sx_slock(&vnet_sysinit_sxlock);
+#defineVNET_SYSINIT_RUNLOCK()  sx_sunlock(&vnet_sysinit_sxlock);
+
 struct vnet_data_free {
uintptr_t   vnd_start;
int vnd_len;
@@ -228,12 +235,10 @@ vnet_alloc(void)
 
/* Initialize / attach vnet module instances. */
CURVNET_SET_QUIET(vnet);
-
-   sx_xlock(&vnet_sxlock);
vnet_sysinit();
CURVNET_RESTORE();
 
-   rw_wlock(&vnet_rwlock);
+   VNET_LIST_WLOCK();
LIST_INSERT_HEAD(&vnet_head, vnet, vnet_le);
VNET_LIST_WUNLOCK();
 
@@ -253,7 +258,7 @@ vnet_destroy(struct vnet *vnet)
 
VNET_LIST_WLOCK();
LIST_REMOVE(vnet, vnet_le);
-   rw_wunlock(&vnet_rwlock);
+   VNET_LIST_WUNLOCK();
 
CURVNET_SET_QUIET(vnet);
 
@@ -264,8 +269,6 @@ vnet_destroy(struct vnet *vnet)
}
 
vnet_sysuninit();
-   sx_xunlock(&vnet_sxlock);
-
CURVNET_RESTORE();
 
/*
@@ -287,6 +290,7 @@ vnet_init_prelink(void *arg)
 
rw_init(&vnet_rwlock, "vnet_rwlock");
sx_init(&vnet_sxlock, "vnet_sxlock");
+   sx_init(&vnet_sysinit_sxlock, "vnet_sysinit_sxlock");
LIST_INIT(&vnet_head);
 }
 SYSINIT(vnet_init_prelink, SI_SUB_VNET_PRELINK, SI_ORDER_FIRST,
@@ -494,7 +498,7 @@ vnet_register_sysinit(void *arg)
KASSERT(vs->subsystem > SI_SUB_VNET, ("vnet sysinit too early"));
 
/* Add the constructor to the global list of vnet constructors. */
-   sx_xlock(&vnet_sxlock);
+   VNET_SYSINIT_WLOCK();
TAILQ_FOREACH(vs2, &vnet_constructors, link) {
if (vs2->subsystem > vs->subsystem)
break;
@@ -515,7 +519,7 @@ vnet_register_sysinit(void *arg)
vs->func(vs->arg);
CURVNET_RESTORE();
}
-   sx_xunlock(&vnet_sxlock);
+   VNET_SYSINIT_WUNLOCK();
 }
 
 void
@@ -526,9 +530,9 @@ vnet_deregister_sysinit(void *arg)
vs = arg;
 
/* Remove the constructor from the global list of vnet constructors. */
-   sx_xlock(&vnet_sxlock);
+   VNET_SYSINIT_WLOCK();
TAILQ_REMOVE(&vnet_constructors, vs, link);
-   sx_xunlock(&vnet_sxlock);
+   VNET_SYSINIT_WUNLOCK();
 }
 
 void
@@ -539,7 +543,7 @@ vnet_register_sysuninit(void *arg)
vs = arg;
 
/* Add the destructor to the global list of vnet destructors. */
-   sx_xlock(&vnet_sxlock);
+   VNET_SYSINIT_WLOCK();
TAILQ_FOREACH(vs2, &vnet_destructors, link) {
if (vs2->subsystem > vs->subsystem)

svn commit: r196689 - head/sys/fs/pseudofs

2009-08-31 Thread Konstantin Belousov
Author: kib
Date: Mon Aug 31 09:26:04 2009
New Revision: 196689
URL: http://svn.freebsd.org/changeset/base/196689

Log:
  Remove spurious pfs_unlock().
  
  PR:   kern/137310
  Reviewed by:  des
  MFC after:3 days

Modified:
  head/sys/fs/pseudofs/pseudofs_vnops.c

Modified: head/sys/fs/pseudofs/pseudofs_vnops.c
==
--- head/sys/fs/pseudofs/pseudofs_vnops.c   Mon Aug 31 09:20:37 2009
(r196688)
+++ head/sys/fs/pseudofs/pseudofs_vnops.c   Mon Aug 31 09:26:04 2009
(r196689)
@@ -339,7 +339,6 @@ pfs_getextattr(struct vop_getextattr_arg
if (proc != NULL)
PROC_UNLOCK(proc);
 
-   pfs_unlock(pn);
PFS_RETURN (error);
 }
 
___
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-unsubscr...@freebsd.org"


svn commit: r196688 - in stable/7/sys: . contrib/pf kern

2009-08-31 Thread Konstantin Belousov
Author: kib
Date: Mon Aug 31 09:20:37 2009
New Revision: 196688
URL: http://svn.freebsd.org/changeset/base/196688

Log:
  MFC r196560:
  Honor the vfs.timestamp_precision sysctl settings for utimes(path, NULL)
  and similar calls.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/kern/vfs_syscalls.c

Modified: stable/7/sys/kern/vfs_syscalls.c
==
--- stable/7/sys/kern/vfs_syscalls.cMon Aug 31 09:08:14 2009
(r196687)
+++ stable/7/sys/kern/vfs_syscalls.cMon Aug 31 09:20:37 2009
(r196688)
@@ -2843,8 +2843,7 @@ getutimes(usrtvp, tvpseg, tsp)
int error;
 
if (usrtvp == NULL) {
-   microtime(&tv[0]);
-   TIMEVAL_TO_TIMESPEC(&tv[0], &tsp[0]);
+   vfs_timestamp(&tsp[0]);
tsp[1] = tsp[0];
} else {
if (tvpseg == UIO_SYSSPACE) {
___
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-unsubscr...@freebsd.org"


svn commit: r196687 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern

2009-08-31 Thread Konstantin Belousov
Author: kib
Date: Mon Aug 31 09:08:14 2009
New Revision: 196687
URL: http://svn.freebsd.org/changeset/base/196687

Log:
  MFC r196560:
  Honor the vfs.timestamp_precision sysctl settings for utimes(path, NULL)
  and similar calls.
  
  Approved by:  re (rwatson)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/kern/vfs_syscalls.c

Modified: stable/8/sys/kern/vfs_syscalls.c
==
--- stable/8/sys/kern/vfs_syscalls.cMon Aug 31 04:19:01 2009
(r196686)
+++ stable/8/sys/kern/vfs_syscalls.cMon Aug 31 09:08:14 2009
(r196687)
@@ -3134,8 +3134,7 @@ getutimes(usrtvp, tvpseg, tsp)
int error;
 
if (usrtvp == NULL) {
-   microtime(&tv[0]);
-   TIMEVAL_TO_TIMESPEC(&tv[0], &tsp[0]);
+   vfs_timestamp(&tsp[0]);
tsp[1] = tsp[0];
} else {
if (tvpseg == UIO_SYSSPACE) {
___
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-unsubscr...@freebsd.org"