svn commit: r216401 - head/share/misc

2010-12-13 Thread Wen Heping
Author: wen (ports committer)
Date: Mon Dec 13 08:56:30 2010
New Revision: 216401
URL: http://svn.freebsd.org/changeset/base/216401

Log:
  - Add myself to committers-ports.dot

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotSun Dec 12 22:59:34 2010
(r216400)
+++ head/share/misc/committers-ports.dotMon Dec 13 08:56:30 2010
(r216401)
@@ -167,6 +167,7 @@ trhodes [label=Tom rhodes\ntrho...@free
 thierry [label=Thierry thomas\nthie...@freebsd.org\n2004/03/15]
 tmclaugh [label=Tom mclaughlin\ntmcla...@freebsd.org\n2005/09/15]
 vd [label=Vasil dimov\...@freebsd.org\n2006/01/19]
+wen [label=Wen heping\n...@freebsd.org\n2010/12/13]
 wxs [label=Wesley shields\n...@freebsd.org\n2008/01/03]
 xride [label=Soeren straarup\nxr...@freebsd.org\n2006/09/27]
 yzlin [label=Yi-Jheng lin\nyz...@freebsd.org\n2009/07/19]
@@ -265,6 +266,7 @@ itetcu - sahil
 
 jadawin - bapt
 jadawin - flo
+jadawin - wen
 
 joerg - netchild
 
@@ -315,6 +317,7 @@ miwi - mva
 miwi - nox
 miwi - tabthorpe
 miwi - trasz
+miwi - wen
 
 mnag - jmelo
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216404 - head/bin/sh

2010-12-13 Thread Ulrich Spoerlein
Author: uqs
Date: Mon Dec 13 10:48:49 2010
New Revision: 216404
URL: http://svn.freebsd.org/changeset/base/216404

Log:
  Remove duplicate check, turning dead code into live code.
  
  Coverity CID: 5114
  Reviewed by:  jilles

Modified:
  head/bin/sh/parser.c

Modified: head/bin/sh/parser.c
==
--- head/bin/sh/parser.cMon Dec 13 10:40:16 2010(r216403)
+++ head/bin/sh/parser.cMon Dec 13 10:48:49 2010(r216404)
@@ -887,8 +887,6 @@ xxreadtoken(void)
startlinno = plinno;
for (;;) {  /* until token or start of word found */
c = pgetc_macro();
-   if (c == ' ' || c == '\t')
-   continue;   /* quick check for white space 
first */
switch (c) {
case ' ': case '\t':
continue;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216405 - head/sys/amd64/conf

2010-12-13 Thread Robert Watson
Author: rwatson
Date: Mon Dec 13 12:15:46 2010
New Revision: 216405
URL: http://svn.freebsd.org/changeset/base/216405

Log:
  Add options NO_ADAPTIVE_SX to the XENHVM kernel configuration, matching
  its similar disabling of adaptive mutexes and rwlocks.  The existing
  comment on why this is the case also applies to sx locks.
  
  MFC after:3 days
  Discussed with:   attilio

Modified:
  head/sys/amd64/conf/XENHVM

Modified: head/sys/amd64/conf/XENHVM
==
--- head/sys/amd64/conf/XENHVM  Mon Dec 13 10:48:49 2010(r216404)
+++ head/sys/amd64/conf/XENHVM  Mon Dec 13 12:15:46 2010(r216405)
@@ -17,6 +17,7 @@ makeoptions   MODULES_OVERRIDE=
 #
 optionsNO_ADAPTIVE_MUTEXES
 optionsNO_ADAPTIVE_RWLOCKS
+optionsNO_ADAPTIVE_SX
 
 # Xen HVM support
 optionsXENHVM
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r216375 - head/sys/mips/rmi/dev/xlr

2010-12-13 Thread John Baldwin
On Saturday, December 11, 2010 5:21:38 am Andriy Gapon wrote:
 Author: avg
 Date: Sat Dec 11 10:21:38 2010
 New Revision: 216375
 URL: http://svn.freebsd.org/changeset/base/216375
 
 Log:
   fix atomic_set_xxx misuse in rge
   
   It seems that atomic_set_xxx and atomic_store_xxx were confused.
   
   Reviewed by:jhb (general issue)
   MFC after:  3 weeks
 
 Modified:
   head/sys/mips/rmi/dev/xlr/rge.c
 
 Modified: head/sys/mips/rmi/dev/xlr/rge.c
 ==
 --- head/sys/mips/rmi/dev/xlr/rge.c   Sat Dec 11 10:18:05 2010
 (r216374)
 +++ head/sys/mips/rmi/dev/xlr/rge.c   Sat Dec 11 10:21:38 2010
 (r216375)
 @@ -170,7 +170,7 @@ extern uint32_t cpu_ltop_map[32];
  static int port_counters[4][8] __aligned(XLR_CACHELINE_SIZE);
  
  #define port_inc_counter(port, counter)  
 atomic_add_int(port_counters[port][(counter)], 1)
 -#define port_set_counter(port, counter, value)   
 atomic_set_int(port_counters[port][(counter)], (value))
 +#define port_set_counter(port, counter, value)   
 atomic_store_int(port_counters[port][(counter)], (value))
  #else
  #define port_inc_counter(port, counter)  /* Nothing */
  #define port_set_counter(port, counter, value)   /* Nothing */
 @@ -2281,7 +2281,7 @@ rmi_xlr_mac_open(struct rge_softc *sc)
   mtx_unlock_spin(priv-lock);
  
   for (i = 0; i  8; i++) {
 - atomic_set_int((priv-frin_to_be_sent[i]), 0);
 + atomic_store_int((priv-frin_to_be_sent[i]), 0);

Err, there is no such op for this.  If you don't need a memory barrier then a
simple assignment to 0 should suffice.

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216407 - head/usr.sbin/sysinstall

2010-12-13 Thread Bruce Cran
Author: brucec
Date: Mon Dec 13 13:52:03 2010
New Revision: 216407
URL: http://svn.freebsd.org/changeset/base/216407

Log:
  USB probing often takes a long time and finishes finding devices after init
  has started. In the case of sysinstall, this means that it has already built
  its list of devices before probing finishes. Add a hint for users who have
  booted from a USB stick only to find that sysinstall can't find it.
  
  MFC after:3 days

Modified:
  head/usr.sbin/sysinstall/media.c

Modified: head/usr.sbin/sysinstall/media.c
==
--- head/usr.sbin/sysinstall/media.cMon Dec 13 12:34:35 2010
(r216406)
+++ head/usr.sbin/sysinstall/media.cMon Dec 13 13:52:03 2010
(r216407)
@@ -239,7 +239,7 @@ mediaSetUSB(dialogMenuItem *self)
cnt = deviceCount(devs);
 
if (!cnt) {
-   msgConfirm(No USB devices found!);
+   msgConfirm(No USB devices found (try Options/Re-scan 
Devices));
return DITEM_FAILURE | DITEM_CONTINUE;
}
else if (cnt  1) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216408 - head/sys/mips/rmi/dev/xlr

2010-12-13 Thread Andriy Gapon
Author: avg
Date: Mon Dec 13 14:30:35 2010
New Revision: 216408
URL: http://svn.freebsd.org/changeset/base/216408

Log:
  fix mips build breakage introduced in r216375: atomic_store_int doesn't exists
  
  1) 32-bit assignment are expected to always be atomic.
  2) Release/acquire memory barrier semantics doesn't seem to be needed here.
  So a simple assignment can be used.
  
  Remove unused port_set_counter() while here, it also used to mis-use
  atomic_set_int().
  
  Reported by:  jhb
  Pointyhat to: avg
  MFC after:3 weeks

Modified:
  head/sys/mips/rmi/dev/xlr/rge.c

Modified: head/sys/mips/rmi/dev/xlr/rge.c
==
--- head/sys/mips/rmi/dev/xlr/rge.c Mon Dec 13 13:52:03 2010
(r216407)
+++ head/sys/mips/rmi/dev/xlr/rge.c Mon Dec 13 14:30:35 2010
(r216408)
@@ -170,10 +170,8 @@ extern uint32_t cpu_ltop_map[32];
 static int port_counters[4][8] __aligned(XLR_CACHELINE_SIZE);
 
 #define port_inc_counter(port, counter)
atomic_add_int(port_counters[port][(counter)], 1)
-#define port_set_counter(port, counter, value) 
atomic_store_int(port_counters[port][(counter)], (value))
 #else
 #define port_inc_counter(port, counter)/* Nothing */
-#define port_set_counter(port, counter, value) /* Nothing */
 #endif
 
 int xlr_rge_tx_prepend[MAXCPU];
@@ -2281,7 +2279,7 @@ rmi_xlr_mac_open(struct rge_softc *sc)
mtx_unlock_spin(priv-lock);
 
for (i = 0; i  8; i++) {
-   atomic_store_int((priv-frin_to_be_sent[i]), 0);
+   priv-frin_to_be_sent[i] = 0;
}
 
return 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216409 - head/usr.bin/calendar/calendars

2010-12-13 Thread Warner Losh
Author: imp
Date: Mon Dec 13 16:23:02 2010
New Revision: 216409
URL: http://svn.freebsd.org/changeset/base/216409

Log:
  FreeBSD committer Dan Moschuk has passed away.  Here is his death notice:
  http://www.lifenews.ca/thespec/profile/98251--moschuk-daniel
  
  PR:   147479

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Dec 13 14:30:35 
2010(r216408)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Dec 13 16:23:02 
2010(r216409)
@@ -149,6 +149,7 @@
 05/17  Thomas Abthorpe tabtho...@freebsd.org born in Port Arthur, Ontario, 
Canada, 1968
 05/19  Philippe Charnier charn...@freebsd.org born in Fontainebleau, France, 
1966
 05/19  Ian Dowse iedo...@freebsd.org born in Dublin, Ireland, 1975
+05/20  Dan Moschuk d...@freebsd.org died in Burlington, Ontario, Canada, 
2010 
 05/21  Kris Kennaway k...@freebsd.org born in Winnipeg, Manitoba, Canada, 
1978
 05/22  Clive Tong-I Lin cl...@freebsd.org born in Changhua, Taiwan, Republic 
of China, 1978
 05/22  Michael Bushkov bush...@freebsd.org born in Rostov-on-Don, Russian 
Federation, 1985
@@ -284,7 +285,6 @@
 10/19  Nick Barkas s...@freebsd.org born in Longview, Washington, United 
States, 1981
 10/20  Joel Dahl j...@freebsd.org born in Lidkoping, Sweden, 1983
 10/20  Dmitry Marakasov amd...@freebsd.org born in Moscow, Russian 
Federation, 1984
-10/21  Dan Moschuk d...@freebsd.org born in Halifax, Nova Scotia, Canada, 
1980
 10/21  Ben Smithurst b...@freebsd.org born in Sheffield, South Yorkshire, 
United Kingdom, 1981
 10/22  Jean-Sebastien Pedron dumbb...@freebsd.org born in Redon, 
Ille-et-Vilaine, France, 1980
 10/23  Mario Sergio Fujikawa Ferreira li...@freebsd.org born in Brasilia, 
Distrito Federal, Brazil, 1976
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r216375 - head/sys/mips/rmi/dev/xlr

2010-12-13 Thread Jayachandran C.
On Mon, Dec 13, 2010 at 6:17 PM, John Baldwin j...@freebsd.org wrote:
 On Saturday, December 11, 2010 5:21:38 am Andriy Gapon wrote:
 Author: avg
 Date: Sat Dec 11 10:21:38 2010
 New Revision: 216375
 URL: http://svn.freebsd.org/changeset/base/216375

 Log:
   fix atomic_set_xxx misuse in rge

   It seems that atomic_set_xxx and atomic_store_xxx were confused.

   Reviewed by:        jhb (general issue)
   MFC after:  3 weeks

 Modified:
   head/sys/mips/rmi/dev/xlr/rge.c

 Modified: head/sys/mips/rmi/dev/xlr/rge.c
 ==
 --- head/sys/mips/rmi/dev/xlr/rge.c   Sat Dec 11 10:18:05 2010        
 (r216374)
 +++ head/sys/mips/rmi/dev/xlr/rge.c   Sat Dec 11 10:21:38 2010        
 (r216375)
 @@ -170,7 +170,7 @@ extern uint32_t cpu_ltop_map[32];
  static int port_counters[4][8] __aligned(XLR_CACHELINE_SIZE);

  #define port_inc_counter(port, counter)      
 atomic_add_int(port_counters[port][(counter)], 1)
 -#define port_set_counter(port, counter, value)       
 atomic_set_int(port_counters[port][(counter)], (value))
 +#define port_set_counter(port, counter, value)       
 atomic_store_int(port_counters[port][(counter)], (value))
  #else
  #define port_inc_counter(port, counter)      /* Nothing */
  #define port_set_counter(port, counter, value)       /* Nothing */
 @@ -2281,7 +2281,7 @@ rmi_xlr_mac_open(struct rge_softc *sc)
       mtx_unlock_spin(priv-lock);

       for (i = 0; i  8; i++) {
 -             atomic_set_int((priv-frin_to_be_sent[i]), 0);
 +             atomic_store_int((priv-frin_to_be_sent[i]), 0);

 Err, there is no such op for this.  If you don't need a memory barrier then a
 simple assignment to 0 should suffice.

This is the deprecated  driver for the XLR's on-chip network
interface. There is a new driver for this, so you can ignore problems
in this file - it should be removed soon.

Thanks,
JC
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216410 - head/sys/mips/rmi/dev/iic

2010-12-13 Thread Jayachandran C.
Author: jchandra
Date: Mon Dec 13 17:53:38 2010
New Revision: 216410
URL: http://svn.freebsd.org/changeset/base/216410

Log:
  Updates for I2C devices on XLR engg boards.
  
  - ds1374u : use multi-byte write.
  - at24co2n, max6657: remove mutex, iicbus has the necessary locking.
  
  Submitted by: Sreekanth M. S. (kanthms at netlogicmicro com)

Modified:
  head/sys/mips/rmi/dev/iic/at24co2n.c
  head/sys/mips/rmi/dev/iic/ds1374u.c
  head/sys/mips/rmi/dev/iic/max6657.c

Modified: head/sys/mips/rmi/dev/iic/at24co2n.c
==
--- head/sys/mips/rmi/dev/iic/at24co2n.cMon Dec 13 16:23:02 2010
(r216409)
+++ head/sys/mips/rmi/dev/iic/at24co2n.cMon Dec 13 17:53:38 2010
(r216410)
@@ -60,7 +60,6 @@ __FBSDID($FreeBSD$);
 struct at24co2n_softc {
uint32_tsc_addr;
device_tsc_dev;
-   struct mtx  sc_mtx;
uint8_t sc_mac_addr[6];
 };
 
@@ -103,8 +102,6 @@ at24co2n_attach(device_t dev)
sc-sc_dev = dev;
sc-sc_addr = iicbus_get_addr(dev);
 
-   mtx_init(sc-sc_mtx, eeprom, eeprom, MTX_DEF);
-
SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
eeprom-mac, CTLTYPE_STRING | CTLFLAG_RD, sc, 0,
at24co2n_mac_sysctl, A, mac address);
@@ -121,9 +118,7 @@ at24co2n_read_mac(struct at24co2n_softc 
 { sc-sc_addr, IIC_M_RD, 6, sc-sc_mac_addr},
};
 
-   mtx_lock(sc-sc_mtx);
iicbus_transfer(sc-sc_dev, msgs, 2);
-   mtx_unlock(sc-sc_mtx);
 }
 
 static device_method_t at24co2n_methods[] = {

Modified: head/sys/mips/rmi/dev/iic/ds1374u.c
==
--- head/sys/mips/rmi/dev/iic/ds1374u.c Mon Dec 13 16:23:02 2010
(r216409)
+++ head/sys/mips/rmi/dev/iic/ds1374u.c Mon Dec 13 17:53:38 2010
(r216410)
@@ -85,36 +85,22 @@ ds1374u_attach(device_t dev)
return (0);
 }
 
-
-static int
-ds1374u_write(device_t dev, int reg, uint8_t val) 
+static int 
+ds1374u_settime(device_t dev, struct timespec *ts)
 {
-   uint8_t data[2];
+   /* NB: register pointer precedes actual data */
+   uint8_t data[5] = { DS1374_RTC_COUNTER };
struct ds1374u_softc *sc = device_get_softc(dev);
struct iic_msg msgs[1] = {
-{ sc-sc_addr, IIC_M_WR, 2, data },
+{ sc-sc_addr, IIC_M_WR, 5, data },
};
 
-   data[0] = reg;
-   data[1] = val;
-   if (iicbus_transfer(dev, msgs, 1) == 0) 
-   return (0);
-   else
-   return (-1);
-}
-
-static int 
-ds1374u_settime(device_t dev, struct timespec *ts)
-{
-   int i; 
-   int temp = 0; 
+   data[1] = (ts-tv_sec  0)  0xff;
+   data[2] = (ts-tv_sec  8)  0xff;
+   data[3] = (ts-tv_sec  16)  0xff;
+   data[4] = (ts-tv_sec  24)  0xff;
 
-   for (i = 0; i  4; i++) {
-   temp = (ts-tv_sec  (8*i))  0xff; 
-   if (ds1374u_write(dev, DS1374_RTC_COUNTER+i, temp)!=0)
-   return (-1);
-   }
-   return 0;
+   return iicbus_transfer(dev, msgs, 1);
 }
 
 static int
@@ -137,7 +123,6 @@ ds1374u_gettime(device_t dev, struct tim
ts-tv_nsec = 0;
}
return error;
-   return 0;
 }
 
 static device_method_t ds1374u_methods[] = {

Modified: head/sys/mips/rmi/dev/iic/max6657.c
==
--- head/sys/mips/rmi/dev/iic/max6657.c Mon Dec 13 16:23:02 2010
(r216409)
+++ head/sys/mips/rmi/dev/iic/max6657.c Mon Dec 13 17:53:38 2010
(r216410)
@@ -62,7 +62,6 @@ __FBSDID($FreeBSD$);
 struct max6657_softc {
uint32_tsc_addr;
device_tsc_dev;
-   struct mtx  sc_mtx;
int sc_curtemp;
int sc_lastupdate;  /* in ticks */
 };
@@ -101,7 +100,6 @@ max6657_attach(device_t dev)
}
sc-sc_dev = dev;
sc-sc_addr = iicbus_get_addr(dev);
-   mtx_init(sc-sc_mtx, max6657, max6657, MTX_DEF);
 
SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
temp, CTLTYPE_INT | CTLFLAG_RD, sc, 0,
@@ -132,7 +130,6 @@ max6657_update(struct max6657_softc *sc)
 {
int v;
 
-   mtx_lock(sc-sc_mtx);
/* NB: no point in updating any faster than the chip */
if (ticks - sc-sc_lastupdate  hz) {
v = max6657_read(sc-sc_dev, sc-sc_addr, MAX6657_EXT_TEMP);
@@ -140,7 +137,6 @@ max6657_update(struct max6657_softc *sc)
sc-sc_curtemp = v;
sc-sc_lastupdate = ticks;
}
-   mtx_unlock(sc-sc_mtx);
 }
 
 static device_method_t max6657_methods[] = {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216413 - head/sys/kern

2010-12-13 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Dec 13 18:56:04 2010
New Revision: 216413
URL: http://svn.freebsd.org/changeset/base/216413

Log:
  Adapt filesystem-independent NFSv4 ACL code (used by UFS, but not by ZFS)
  to PSARC/2010/029.  In short, the semantics is simplified - weird stuff
  no longer happens after chmod, entries don't get duplicated during
  inheritance, and trivial ACLs no longer contain three DENY entries,
  which is also more friendly to MS Windows.
  
  By default, UFS keeps using old semantics.  To change it, set sysctl
  vfs.acl_nfs4_old_semantics to 0.  I'll flip the switch when ZFSv28
  hits the tree, to keep these two in sync - ZFS v28 uses PSARC semantics,
  and ZFS v15 uses the old one.

Modified:
  head/sys/kern/subr_acl_nfs4.c

Modified: head/sys/kern/subr_acl_nfs4.c
==
--- head/sys/kern/subr_acl_nfs4.c   Mon Dec 13 17:56:31 2010
(r216412)
+++ head/sys/kern/subr_acl_nfs4.c   Mon Dec 13 18:56:04 2010
(r216413)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2008-2009 Edward Tomasz Napierała tr...@freebsd.org
+ * Copyright (c) 2008-2010 Edward Tomasz Napierała tr...@freebsd.org
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,7 @@ __FBSDID($FreeBSD$);
 #include sys/vnode.h
 #include sys/errno.h
 #include sys/stat.h
+#include sys/sysctl.h
 #include sys/acl.h
 #else
 #include errno.h
@@ -49,10 +50,18 @@ __FBSDID($FreeBSD$);
 #include sys/stat.h
 #define KASSERT(a, b) assert(a)
 #define CTASSERT(a)
-#endif /* _KERNEL */
+
+void   acl_nfs4_trivial_from_mode(struct acl *aclp, mode_t mode);
+
+#endif /* !_KERNEL */
+
+static int acl_nfs4_old_semantics = 1;
 
 #ifdef _KERNEL
 
+SYSCTL_INT(_vfs, OID_AUTO, acl_nfs4_old_semantics, CTLFLAG_RW,
+acl_nfs4_old_semantics, 1, Use pre-PSARC/2010/029 NFSv4 ACL semantics);
+
 static struct {
accmode_t accmode;
int mask;
@@ -349,63 +358,9 @@ _acl_duplicate_entry(struct acl *aclp, i
return ((aclp-acl_entry[entry_index + 1]));
 }
 
-/*
- * Calculate trivial ACL in a manner compatible with PSARC/2010/029.
- * Note that this results in an ACL different from (but semantically
- * equal to) the canonical six trivial ACL computed using algorithm
- * described in draft-ietf-nfsv4-minorversion1-03.txt, 3.16.6.2.
- */
-void
-acl_nfs4_trivial_from_mode(struct acl *aclp, mode_t mode)
-{
-   acl_perm_t user_allow_first = 0, user_deny = 0, group_deny = 0;
-   acl_perm_t user_allow, group_allow, everyone_allow;
-
-   KASSERT(aclp-acl_cnt == 0, (aclp-acl_cnt == 0));
-
-   user_allow = group_allow = everyone_allow = ACL_READ_ACL |
-   ACL_READ_ATTRIBUTES | ACL_READ_NAMED_ATTRS | ACL_SYNCHRONIZE;
-   user_allow |= ACL_WRITE_ACL | ACL_WRITE_OWNER | ACL_WRITE_ATTRIBUTES |
-   ACL_WRITE_NAMED_ATTRS;
-
-   if (mode  S_IRUSR)
-   user_allow |= ACL_READ_DATA;
-   if (mode  S_IWUSR)
-   user_allow |= (ACL_WRITE_DATA | ACL_APPEND_DATA);
-   if (mode  S_IXUSR)
-   user_allow |= ACL_EXECUTE;
-
-   if (mode  S_IRGRP)
-   group_allow |= ACL_READ_DATA;
-   if (mode  S_IWGRP)
-   group_allow |= (ACL_WRITE_DATA | ACL_APPEND_DATA);
-   if (mode  S_IXGRP)
-   group_allow |= ACL_EXECUTE;
-
-   if (mode  S_IROTH)
-   everyone_allow |= ACL_READ_DATA;
-   if (mode  S_IWOTH)
-   everyone_allow |= (ACL_WRITE_DATA | ACL_APPEND_DATA);
-   if (mode  S_IXOTH)
-   everyone_allow |= ACL_EXECUTE;
-
-   user_deny = ((group_allow | everyone_allow)  ~user_allow);
-   group_deny = everyone_allow  ~group_allow;
-   user_allow_first = group_deny  ~user_deny;
-
-   if (user_allow_first != 0)
-   _acl_append(aclp, ACL_USER_OBJ, user_allow_first, 
ACL_ENTRY_TYPE_ALLOW);
-   if (user_deny != 0)
-   _acl_append(aclp, ACL_USER_OBJ, user_deny, ACL_ENTRY_TYPE_DENY);
-   if (group_deny != 0)
-   _acl_append(aclp, ACL_GROUP_OBJ, group_deny, 
ACL_ENTRY_TYPE_DENY);
-   _acl_append(aclp, ACL_USER_OBJ, user_allow, ACL_ENTRY_TYPE_ALLOW);
-   _acl_append(aclp, ACL_GROUP_OBJ, group_allow, ACL_ENTRY_TYPE_ALLOW);
-   _acl_append(aclp, ACL_EVERYONE, everyone_allow, ACL_ENTRY_TYPE_ALLOW);
-}
-
-void
-acl_nfs4_sync_acl_from_mode(struct acl *aclp, mode_t mode, int file_owner_id)
+static void
+acl_nfs4_sync_acl_from_mode_draft(struct acl *aclp, mode_t mode,
+int file_owner_id)
 {
int i, meets, must_append;
struct acl_entry *entry, *copy, *previous,
@@ -749,6 +704,17 @@ acl_nfs4_sync_acl_from_mode(struct acl *
 }
 
 void
+acl_nfs4_sync_acl_from_mode(struct acl *aclp, mode_t mode,
+int file_owner_id)
+{
+
+   if (acl_nfs4_old_semantics)
+   acl_nfs4_sync_acl_from_mode_draft(aclp, mode, file_owner_id);
+   else
+   acl_nfs4_trivial_from_mode(aclp, 

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

2010-12-13 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Dec 13 18:59:55 2010
New Revision: 216414
URL: http://svn.freebsd.org/changeset/base/216414

Log:
  Recognize NFSv4 ACL semantics and run proper regression test.

Modified:
  head/tools/regression/acltools/02.t

Modified: head/tools/regression/acltools/02.t
==
--- head/tools/regression/acltools/02.t Mon Dec 13 18:56:04 2010
(r216413)
+++ head/tools/regression/acltools/02.t Mon Dec 13 18:59:55 2010
(r216414)
@@ -69,7 +69,11 @@ chmod 600 xxx
 rm xxx
 echo ok 2
 
-perl $TESTDIR/run $TESTDIR/tools-nfs4.test  /dev/null
+if [ `sysctl -n vfs.acl_nfs4_old_semantics` = 0 ]; then
+   perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test  /dev/null
+else
+   perl $TESTDIR/run $TESTDIR/tools-nfs4.test  /dev/null
+fi
 
 if [ $? -eq 0 ]; then
echo ok 3
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216415 - head/lib/libc/posix1e

2010-12-13 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Dec 13 19:01:23 2010
New Revision: 216415
URL: http://svn.freebsd.org/changeset/base/216415

Log:
  After PSARC/2010/029, canonical six no longer exists.

Modified:
  head/lib/libc/posix1e/acl_is_trivial_np.3

Modified: head/lib/libc/posix1e/acl_is_trivial_np.3
==
--- head/lib/libc/posix1e/acl_is_trivial_np.3   Mon Dec 13 18:59:55 2010
(r216414)
+++ head/lib/libc/posix1e/acl_is_trivial_np.3   Mon Dec 13 19:01:23 2010
(r216415)
@@ -56,7 +56,9 @@ ACL is trivial if it can be fully expres
 any access rules.
 For POSIX.1e ACLs, ACL is trivial if it has the three required entries,
 one for owner, one for owning group, and one for other.
-For NFSv4 ACLs, ACL is trivial if it has the canonical six entries.
+For NFSv4 ACLs, ACL is trivial if is identical to the ACL generated by
+.Fn acl_strip_np 3
+from the file mode.
 Files that have non-trivial ACL have a plus sign appended after mode bits
 in ls -l output.
 .Sh RETURN VALUES
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216416 - head/lib/libc/posix1e

2010-12-13 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Dec 13 19:03:10 2010
New Revision: 216416
URL: http://svn.freebsd.org/changeset/base/216416

Log:
  Bump manual page date.

Modified:
  head/lib/libc/posix1e/acl_is_trivial_np.3

Modified: head/lib/libc/posix1e/acl_is_trivial_np.3
==
--- head/lib/libc/posix1e/acl_is_trivial_np.3   Mon Dec 13 19:01:23 2010
(r216415)
+++ head/lib/libc/posix1e/acl_is_trivial_np.3   Mon Dec 13 19:03:10 2010
(r216416)
@@ -27,7 +27,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd June 25, 2009
+.Dd December 13, 2010
 .Dt ACL_STRIP_NP 3
 .Os
 .Sh NAME
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216417 - head/usr.bin/printf

2010-12-13 Thread Xin LI
Author: delphij
Date: Mon Dec 13 19:50:12 2010
New Revision: 216417
URL: http://svn.freebsd.org/changeset/base/216417

Log:
  Move locale.h include to the beginning header section as pointed out by
  style(9)
  
  Submitted by: Pedro F. Giffuni giffunip tutopia.com

Modified:
  head/usr.bin/printf/printf.c

Modified: head/usr.bin/printf/printf.c
==
--- head/usr.bin/printf/printf.cMon Dec 13 19:03:10 2010
(r216416)
+++ head/usr.bin/printf/printf.cMon Dec 13 19:50:12 2010
(r216417)
@@ -1,4 +1,4 @@
-/*
+/*-
  * Copyright (c) 1989, 1993
  * The Regents of the University of California.  All rights reserved.
  *
@@ -49,6 +49,7 @@ static const char rcsid[] =
 #include errno.h
 #include inttypes.h
 #include limits.h
+#include locale.h
 #include stdio.h
 #include stdlib.h
 #include string.h
@@ -65,8 +66,6 @@ static const char rcsid[] =
 #definewarnx3(a, b, c) warnx(a, b, c)
 #endif
 
-#include locale.h
-
 #define PF(f, func) do { \
char *b = NULL; \
if (havewidth) \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216418 - head/usr.bin/printf

2010-12-13 Thread Xin LI
Author: delphij
Date: Mon Dec 13 19:54:42 2010
New Revision: 216418
URL: http://svn.freebsd.org/changeset/base/216418

Log:
  The only caller of mknum() provides a char instead of an int, so make it
  match the definition.
  
  PR:   bin/152934
  Submitted by: Pedro F. Giffuni giffunip tutopia.com
  Obtained from:Illumos

Modified:
  head/usr.bin/printf/printf.c

Modified: head/usr.bin/printf/printf.c
==
--- head/usr.bin/printf/printf.cMon Dec 13 19:50:12 2010
(r216417)
+++ head/usr.bin/printf/printf.cMon Dec 13 19:54:42 2010
(r216418)
@@ -92,7 +92,7 @@ static int getint(int *);
 static int  getnum(intmax_t *, uintmax_t *, int);
 static const char
*getstr(void);
-static char*mknum(char *, int);
+static char*mknum(char *, char);
 static void usage(void);
 
 static char **gargv;
@@ -336,7 +336,7 @@ printf_doformat(char *start, int *rval)
 }
 
 static char *
-mknum(char *str, int ch)
+mknum(char *str, char ch)
 {
static char *copy;
static size_t copy_size;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2010-12-13 Thread Robert Watson
Author: rwatson
Date: Mon Dec 13 23:26:31 2010
New Revision: 216419
URL: http://svn.freebsd.org/changeset/base/216419

Log:
  Add a rudimentary Xen man page summarising the state of Xen on amd64 and
  i386, how to configure the kernel, and some known issues.  Further
  refinement almost certainly required.  This is not a Xen installation
  manual.
  
  MFC after:3 days
  Sponsored by: DARPA, AFRL

Modified:
  head/share/man/man4/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileMon Dec 13 19:54:42 2010
(r216418)
+++ head/share/man/man4/MakefileMon Dec 13 23:26:31 2010
(r216419)
@@ -495,6 +495,7 @@ MAN=aac.4 \
wlan_xauth.4 \
${_wpi.4} \
xe.4 \
+   ${_xen.4} \
xl.4 \
xpt.4 \
zero.4 \
@@ -687,6 +688,7 @@ _spkr.4=spkr.4
 _tpm.4=tpm.4
 _urtw.4=   urtw.4
 _wpi.4=wpi.4
+_xen.4=xen.4
 
 MLINKS+=lindev.4 full.4
 .endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2010-12-13 Thread Robert Watson
Author: rwatson
Date: Mon Dec 13 23:30:56 2010
New Revision: 216420
URL: http://svn.freebsd.org/changeset/base/216420

Log:
  Add a rudimentary Xen man page summarising the state of Xen on amd64 and
  i386, how to configure the kernel, and some known issues.  Further
  refinement almost certainly required.  This is not a Xen installation
  manual.
  
  MFC after:  3 days
  Sponsored by:   DARPA, AFRL

Added:
  head/share/man/man4/xen.4   (contents, props changed)

Added: head/share/man/man4/xen.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/xen.4   Mon Dec 13 23:30:56 2010(r216420)
@@ -0,0 +1,115 @@
+.\ Copyright (c) 2010 Robert N. M. Watson
+.\ All rights reserved.
+.\
+.\ This software was developed by SRI International and the University of 
+.\ Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
+.\ (CTSRD), as part of the DARPA CRASH research program.
+.\
+.\ 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 AUTHORS 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 AUTHORS 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 December 13, 2010
+.Dt XEN 4
+.Os
+.Sh NAME
+.Nm xen 
+.Nd Xen Hypervisor Guest (DomU) Support
+.Sh SYNOPSIS
+To compile para-virtualized (PV) Xen guest support into the i386 kernel, place
+the following line in your kernel configuration file:
+.Bd -ragged -offset indent
+.Cd options PAE
+.Cd options XEN
+.Ed
+.Pp
+To compile hardware-assisted virtualization (HVM) Xen guest support into the
+amd64 kernel, place the following line in your kernel configuration file:
+.Bd -ragged -offset indent
+.Cd options XENHVM
+.Ed
+.Pp
+To compile the Xen PCI bus and para-virtualized (PV) drivers into an amd64
+or i386 kernel, place the following line in your kernel configuration file:
+.Bd -ragged -offset indent
+.Cd device xenpci
+.Ed
+.Sh DESCRIPTION
+The Xen Hypervisor allows multiple virtual machines to be run on a single
+computer system.
+When first released, Xen required that i386 kernels be compiled
+para-virtualized as the x86 instruction set was not fully virtualizable.
+With later instruction set extensions from AMD and Intel to support fully
+virtualizable instructions, unmodified kernels could also be supported,
+referred to as hardware-assisted virtualization (HVM).
+HVM systems may still use para-virtualized drivers, which are aware of
+virtualization and able to optimize certain behaviours to improve
+performance or semantics.
+.Pp
+.Fx
+supports a fully para-virtualized (PV) kernel on the i386 architecture using
+.Cd options XEN ;
+currently, this requires use of a PAE kernel, enabled via
+.Cd options PAE .
+.Fx
+supports hardware-assited virtualization (HVM) on both the i386 and amd64
+kernels; however, PV device drivers with an HVM kernel are only supported on
+the amd64 architecture.
+.Pp
+Para-virtualized device drivers are required in order to support certain
+functionality, such as the dynamic addition of new virtual devices, and the
+balloon driver (returning physical memory to the Hypervisor on demand),
+and VM suspend/resume.
+.Sh SEE ALSO
+.Xr pae 4
+.Sh HISTORY
+Support for
+.Nm
+first appeared in
+.Fx 8.1 .
+.Sh AUTHORS
+.An -nosplit
+.Fx
+support for Xen was first added by
+.An Kip Mac Aq km...@freebsd.org
+and
+.An Doug Rabson Aq d...@freebsd.org .
+Further refinements were made by
+.An Justin Gibbs Aq gi...@freebsd.org ,
+.An Adrian Chadd Aq adr...@freebsd.org ,
+and
+.An Colin Percival Aq cperc...@freebsd.org .
+This manual page was written by
+.An Robert Watson Aq rwat...@freebsd.org .
+.Sh BUGS
+.Fx
+is only able to run as a Xen guest (DomU) and not as a Xen host (Dom0).
+.Pp
+A fully para-virtualized (PV) kernel is only supported on i386, and not
+amd64.
+.Pp

svn commit: r216422 - head/usr.bin/printf

2010-12-13 Thread Xin LI
Author: delphij
Date: Tue Dec 14 00:21:34 2010
New Revision: 216422
URL: http://svn.freebsd.org/changeset/base/216422

Log:
  Make use of EX_USAGE for usage().

Modified:
  head/usr.bin/printf/printf.c

Modified: head/usr.bin/printf/printf.c
==
--- head/usr.bin/printf/printf.cMon Dec 13 23:53:55 2010
(r216421)
+++ head/usr.bin/printf/printf.cTue Dec 14 00:21:34 2010
(r216422)
@@ -53,6 +53,7 @@ static const char rcsid[] =
 #include stdio.h
 #include stdlib.h
 #include string.h
+#include sysexits.h
 #include unistd.h
 
 #ifdef SHELL
@@ -115,14 +116,14 @@ main(int argc, char *argv[])
case '?':
default:
usage();
-   return (1);
+   /* NOTREACHED */
}
argc -= optind;
argv += optind;
 
if (argc  1) {
usage();
-   return (1);
+   /* NOTREACHED */
}
 
 #ifdef SHELL
@@ -562,4 +563,5 @@ static void
 usage(void)
 {
(void)fprintf(stderr, usage: printf format [arguments ...]\n);
+   exit(EX_USAGE);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216423 - head/usr.bin/printf

2010-12-13 Thread Xin LI
Author: delphij
Date: Tue Dec 14 01:16:56 2010
New Revision: 216423
URL: http://svn.freebsd.org/changeset/base/216423

Log:
  IEEE Std 1003.1-2008, Section 1.4, Utility Description Defaults says
  that when the options section is listed as None, utility shall
  recognize -- as a first argument to be discarded.
  
  This implementation is largely based on OpenBSD implementation but
  we do slightly differently:
  
  a) We skip argv[0] as the first step;
  b) We test whether the next argument is -- and ignore it.
  
  With this change one will get:
  
  %printf
  usage: printf format [arguments ...]
  %printf -v
  -v%printf -- -v
  -v%
  %printf --
  usage: printf format [arguments ...]
  
  Which matches the behavior observed on a Debian system but different
  from the Illumos change.

Modified:
  head/usr.bin/printf/printf.c

Modified: head/usr.bin/printf/printf.c
==
--- head/usr.bin/printf/printf.cTue Dec 14 00:21:34 2010
(r216422)
+++ head/usr.bin/printf/printf.cTue Dec 14 01:16:56 2010
(r216423)
@@ -102,7 +102,7 @@ int
 main(int argc, char *argv[])
 {
size_t len;
-   int ch, chopped, end, rval;
+   int chopped, end, rval;
char *format, *fmt, *start;
 
 #ifndef SHELL
@@ -111,15 +111,15 @@ main(int argc, char *argv[])
 #ifdef SHELL
optreset = 1; optind = 1; opterr = 0; /* initialize getopt */
 #endif
-   while ((ch = getopt(argc, argv, )) != -1)
-   switch (ch) {
-   case '?':
-   default:
-   usage();
-   /* NOTREACHED */
-   }
-   argc -= optind;
-   argv += optind;
+   /* Skip argv[0] which is the process name */
+   argv++;
+   argc--;
+
+   /* Need to accept/ignore -- option. */
+   if (argc = 1  strcmp(*argv, --) == 0) {
+   argc--;
+   argv++;
+   }
 
if (argc  1) {
usage();
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216424 - head/usr.bin/printf

2010-12-13 Thread Xin LI
Author: delphij
Date: Tue Dec 14 01:28:33 2010
New Revision: 216424
URL: http://svn.freebsd.org/changeset/base/216424

Log:
  We work on ctype's and not only on numbers so set LC_ALL instead of
  LC_NUMERIC.
  
  PR:   bin/152934
  Submitted by: Pedro F. Giffuni giffunip tutopia.com
  Obtained from:Illumos

Modified:
  head/usr.bin/printf/printf.c

Modified: head/usr.bin/printf/printf.c
==
--- head/usr.bin/printf/printf.cTue Dec 14 01:16:56 2010
(r216423)
+++ head/usr.bin/printf/printf.cTue Dec 14 01:28:33 2010
(r216424)
@@ -106,7 +106,7 @@ main(int argc, char *argv[])
char *format, *fmt, *start;
 
 #ifndef SHELL
-   (void) setlocale(LC_NUMERIC, );
+   (void) setlocale(LC_ALL, );
 #endif
 #ifdef SHELL
optreset = 1; optind = 1; opterr = 0; /* initialize getopt */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216425 - head/sys/vm

2010-12-13 Thread Alan Cox
Author: alc
Date: Tue Dec 14 05:47:35 2010
New Revision: 216425
URL: http://svn.freebsd.org/changeset/base/216425

Log:
  Change memguard_fudge() so that it can handle km_max being zero.  Not
  every platform defines VM_KMEM_SIZE_MAX, and on those platforms km_max
  will be zero.
  
  Reviewed by:  mdf
  Tested by:marius

Modified:
  head/sys/vm/memguard.c

Modified: head/sys/vm/memguard.c
==
--- head/sys/vm/memguard.c  Tue Dec 14 01:28:33 2010(r216424)
+++ head/sys/vm/memguard.c  Tue Dec 14 05:47:35 2010(r216425)
@@ -184,9 +184,10 @@ memguard_fudge(unsigned long km_size, un
memguard_mapsize = km_max / vm_memguard_divisor;
/* size must be multiple of PAGE_SIZE */
memguard_mapsize = round_page(memguard_mapsize);
-   if (memguard_mapsize / (2 * PAGE_SIZE)  mem_pgs)
+   if (memguard_mapsize == 0 ||
+   memguard_mapsize / (2 * PAGE_SIZE)  mem_pgs)
memguard_mapsize = mem_pgs * 2 * PAGE_SIZE;
-   if (km_size + memguard_mapsize  km_max)
+   if (km_max  0  km_size + memguard_mapsize  km_max)
return (km_max);
return (km_size + memguard_mapsize);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216426 - head/usr.bin/man

2010-12-13 Thread Gordon Tetlow
Author: gordon
Date: Tue Dec 14 06:07:18 2010
New Revision: 216426
URL: http://svn.freebsd.org/changeset/base/216426

Log:
  Move sysctl invocation to using a variable that's fully pathed.
  This prevents errors for users that don't have /sbin in their PATH.
  
  Submitted by: Max Boyarov
  Approved by:  mentor (wes@ implicit)

Modified:
  head/usr.bin/man/man.sh

Modified: head/usr.bin/man/man.sh
==
--- head/usr.bin/man/man.sh Tue Dec 14 05:47:35 2010(r216425)
+++ head/usr.bin/man/man.sh Tue Dec 14 06:07:18 2010(r216426)
@@ -535,10 +535,10 @@ man_setup() {
MACHINE=${mflag##*:}
fi
if [ -z $MACHINE_ARCH ]; then
-   MACHINE_ARCH=$(sysctl -n hw.machine_arch)
+   MACHINE_ARCH=$($SYSCTL -n hw.machine_arch)
fi
if [ -z $MACHINE ]; then
-   MACHINE=$(sysctl -n hw.machine)
+   MACHINE=$($SYSCTL -n hw.machine)
fi
decho Using architecture: $MACHINE_ARCH:$MACHINE
 
@@ -895,6 +895,7 @@ EQN=/usr/bin/eqn
 COL=/usr/bin/col
 NROFF='/usr/bin/groff -S -Wall -mtty-char -man'
 PIC=/usr/bin/pic
+SYSCTL=/sbin/sysctl
 TBL=/usr/bin/tbl
 TROFF='/usr/bin/groff -S -man'
 REFER=/usr/bin/refer
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r216427 - head/sys/kern

2010-12-13 Thread Pawel Jakub Dawidek
Author: pjd
Date: Tue Dec 14 06:19:13 2010
New Revision: 216427
URL: http://svn.freebsd.org/changeset/base/216427

Log:
  Just pass M_ZERO to malloc(9) instead of clearing allocated memory separately.

Modified:
  head/sys/kern/uipc_syscalls.c

Modified: head/sys/kern/uipc_syscalls.c
==
--- head/sys/kern/uipc_syscalls.c   Tue Dec 14 06:07:18 2010
(r216426)
+++ head/sys/kern/uipc_syscalls.c   Tue Dec 14 06:19:13 2010
(r216427)
@@ -1888,8 +1888,7 @@ kern_sendfile(struct thread *td, struct 
mnw = 1;
 
if (uap-flags  SF_SYNC) {
-   sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK);
-   memset(sfs, 0, sizeof *sfs);
+   sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK | M_ZERO);
mtx_init(sfs-mtx, sendfile, NULL, MTX_DEF);
cv_init(sfs-cv, sendfile);
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r216016 - head/sys/sparc64/include

2010-12-13 Thread Alan Cox

m...@freebsd.org wrote:

On Tue, Dec 7, 2010 at 5:41 AM, Marius Strobl mar...@alchemy.franken.de wrote:
  

On Mon, Dec 06, 2010 at 02:30:01PM -0800, m...@freebsd.org wrote:


On Mon, Dec 6, 2010 at 2:07 PM, Marius Strobl mar...@alchemy.franken.de wrote:
[lots of snip]

  

With that one the kernel now survies memguard_init() but then panics
right afterwards when kmeminit() calls kmem_suballoc():
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2010 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
? ? ? ?The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 9.0-CURRENT #18 r215249:216120M: Mon Dec ?6 13:27:57 CET 2010
? ?mar...@v20z.zeist.de:/home/marius/co/build/head2/sparc64.sparc64/usr/home/m4
WARNING: WITNESS option enabled, expect reduced performance.
panic: kmem_suballoc: bad status return of 3


[more snip]

Shooting in the dark a little...

The bad status of 3 is presumably KERN_NO_SPACE because we attempted
to allocate too much space from the kernel_map.  What are the actual
values of vm_kmem_size, kernel_map-min_offset, kernel_map-max_offset
at panic time?
  

vm_kmem_size=5610405888 min_offset=3221225472 max_offset=13958643712
This is on a US3i machine with 16GB RAM.



So kernel_map is from 0xC000_ to 0x3_4000_, or 0x2_8000_
bytes large.  Double the vm_kmem_size is 0x2_9CD0_, which is why
this is failing.

This to me says that, for the moment, you need the
VM_MAX_KERNEL_ADDRESS define so that memguard does not take up too
much virtual space; at the moment this hardware is somewhat
constrained on virtual space.
  


Yes, I had thought that sparc64 had a much larger kernel address space.  
Marius, I would suggest that you revert back to Max's original commit 
that caps the kmem_map at 3/5 of the kernel address space.  Right now, 
you are allowing the kmem_map to consume the entire kernel address 
space, and given the relatively modest size of the kernel address space, 
a machine with more physical memory may try to create a kmem_map that 
leaves no space for the buffer cache, pipes, thread stacks, etc.


Alan

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org