svn commit: r209153 - head/lib/clang

2010-06-14 Thread Ed Schouten
Author: ed
Date: Mon Jun 14 06:23:47 2010
New Revision: 209153
URL: http://svn.freebsd.org/changeset/base/209153

Log:
  Unbreak Clang on PowerPC.
  
  It seems GCC 4.2.1 on PowerPC miscompiles Clang, causing it to crash
  when building even simple Hello World applications. Switch back to -O1
  for this architecture.
  
  Submitted by: nwhitehorn

Modified:
  head/lib/clang/clang.build.mk

Modified: head/lib/clang/clang.build.mk
==
--- head/lib/clang/clang.build.mk   Mon Jun 14 02:56:45 2010
(r209152)
+++ head/lib/clang/clang.build.mk   Mon Jun 14 06:23:47 2010
(r209153)
@@ -8,11 +8,16 @@ CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG
-DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG
 
+# Correct for gcc miscompilation when compiling on PPC with -O2
+.if ${MACHINE_ARCH} == powerpc
+CFLAGS+= -O1
+.endif
+
 TARGET_ARCH?=  ${MACHINE_ARCH}
 # XXX: 8.0, to keep __FreeBSD_cc_version happy
 CFLAGS+=-DLLVM_HOSTTRIPLE=\${TARGET_ARCH}-undermydesk-freebsd9.0\ \
-DCLANG_VENDOR=\FreeBSD\ \ -DSVN_REVISION=\104832\ \
-   -DCLANG_VENDOR_SUFFIX=\\ 20100613\
+   -DCLANG_VENDOR_SUFFIX=\\ 20100614\
 
 .PATH: ${LLVM_SRCS}/${SRCDIR}
 
___
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: r209154 - in head/sys: dev/pci kern x86/x86

2010-06-14 Thread Alexander Motin
Author: mav
Date: Mon Jun 14 07:10:37 2010
New Revision: 209154
URL: http://svn.freebsd.org/changeset/base/209154

Log:
  Virtualize pci_remap_msi_irq() call from general MSI code. It allows MSI
  (FSB interrupts) to be used by non-PCI devices, such as HPET.

Modified:
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pcivar.h
  head/sys/kern/bus_if.m
  head/sys/x86/x86/msi.c

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Mon Jun 14 06:23:47 2010(r209153)
+++ head/sys/dev/pci/pci.c  Mon Jun 14 07:10:37 2010(r209154)
@@ -118,6 +118,8 @@ static void pci_unmask_msix(device_t de
 static int pci_msi_blacklisted(void);
 static voidpci_resume_msi(device_t dev);
 static voidpci_resume_msix(device_t dev);
+static int pci_remap_intr_method(device_t bus, device_t dev,
+   u_int irq);
 
 static device_method_t pci_methods[] = {
/* Device interface */
@@ -147,6 +149,7 @@ static device_method_t pci_methods[] = {
DEVMETHOD(bus_deactivate_resource, pci_deactivate_resource),
DEVMETHOD(bus_child_pnpinfo_str, pci_child_pnpinfo_str_method),
DEVMETHOD(bus_child_location_str, pci_child_location_str_method),
+   DEVMETHOD(bus_remap_intr,   pci_remap_intr_method),
 
/* PCI interface */
DEVMETHOD(pci_read_config,  pci_read_config_method),
@@ -1736,21 +1739,18 @@ pci_resume_msi(device_t dev)
2);
 }
 
-int
-pci_remap_msi_irq(device_t dev, u_int irq)
+static int
+pci_remap_intr_method(device_t bus, device_t dev, u_int irq)
 {
struct pci_devinfo *dinfo = device_get_ivars(dev);
pcicfgregs *cfg = dinfo-cfg;
struct resource_list_entry *rle;
struct msix_table_entry *mte;
struct msix_vector *mv;
-   device_t bus;
uint64_t addr;
uint32_t data;  
int error, i, j;
 
-   bus = device_get_parent(dev);
-
/*
 * Handle MSI first.  We try to find this IRQ among our list
 * of MSI IRQs.  If we find it, we request updated address and

Modified: head/sys/dev/pci/pcivar.h
==
--- head/sys/dev/pci/pcivar.h   Mon Jun 14 06:23:47 2010(r209153)
+++ head/sys/dev/pci/pcivar.h   Mon Jun 14 07:10:37 2010(r209154)
@@ -445,12 +445,6 @@ device_t pci_find_bsf(uint8_t, uint8_t, 
 device_t pci_find_dbsf(uint32_t, uint8_t, uint8_t, uint8_t);
 device_t pci_find_device(uint16_t, uint16_t);
 
-/*
- * Can be used by MD code to request the PCI bus to re-map an MSI or
- * MSI-X message.
- */
-intpci_remap_msi_irq(device_t dev, u_int irq);
-
 /* Can be used by drivers to manage the MSI-X table. */
 intpci_pending_msix(device_t dev, u_int index);
 

Modified: head/sys/kern/bus_if.m
==
--- head/sys/kern/bus_if.m  Mon Jun 14 06:23:47 2010(r209153)
+++ head/sys/kern/bus_if.m  Mon Jun 14 07:10:37 2010(r209154)
@@ -47,6 +47,15 @@ CODE {
{
return (0);
}
+
+   static int
+   null_remap_intr(device_t bus, device_t dev, u_int irq)
+   {
+
+   if (dev != NULL)
+   return (BUS_REMAP_INTR(dev, NULL, irq));
+   return (ENXIO);
+   }
 };
 
 /**
@@ -600,3 +609,16 @@ METHOD void hint_device_unit {
 METHOD void new_pass {
device_t_dev;
 } DEFAULT bus_generic_new_pass;
+
+/**
+ * @brief Notify a bus that specified child's IRQ should be remapped.
+ *
+ * @param _dev the bus device
+ * @param _child   the child device
+ * @param _irq the irq number
+ */
+METHOD int remap_intr {
+   device_t_dev;
+   device_t_child;
+   u_int   _irq;
+} DEFAULT null_remap_intr;

Modified: head/sys/x86/x86/msi.c
==
--- head/sys/x86/x86/msi.c  Mon Jun 14 06:23:47 2010(r209153)
+++ head/sys/x86/x86/msi.c  Mon Jun 14 07:10:37 2010(r209154)
@@ -247,7 +247,8 @@ msi_assign_cpu(struct intsrc *isrc, u_in
msi: Assigning MSI IRQ %d to local APIC %u vector %u\n,
sib-msi_irq, sib-msi_cpu, sib-msi_vector);
}
-   pci_remap_msi_irq(msi-msi_dev, msi-msi_irq);
+   BUS_REMAP_INTR(device_get_parent(msi-msi_dev), msi-msi_dev,
+   msi-msi_irq);
 
/*
 * Free the old vector after the new one is established.  This is done
___
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: r209155 - in head/sys: amd64/amd64 i386/i386

2010-06-14 Thread Alexander Motin
Author: mav
Date: Mon Jun 14 07:38:53 2010
New Revision: 209155
URL: http://svn.freebsd.org/changeset/base/209155

Log:
  Fix bug introduced in SVN rev 194985. When calling pic_assign_cpu()
  for pre-bound IRQs during boot, submit there LAPIC ID, same as in other
  places, not CPU ID.

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

Modified: head/sys/amd64/amd64/intr_machdep.c
==
--- head/sys/amd64/amd64/intr_machdep.c Mon Jun 14 07:10:37 2010
(r209154)
+++ head/sys/amd64/amd64/intr_machdep.c Mon Jun 14 07:38:53 2010
(r209155)
@@ -529,7 +529,7 @@ intr_shuffle_irqs(void *arg __unused)
 */
if (isrc-is_event-ie_cpu != NOCPU)
(void)isrc-is_pic-pic_assign_cpu(isrc,
-   isrc-is_event-ie_cpu);
+   cpu_apic_ids[isrc-is_event-ie_cpu]);
else if (isrc-is_pic-pic_assign_cpu(isrc,
cpu_apic_ids[current_cpu]) == 0)
(void)intr_next_cpu();

Modified: head/sys/i386/i386/intr_machdep.c
==
--- head/sys/i386/i386/intr_machdep.c   Mon Jun 14 07:10:37 2010
(r209154)
+++ head/sys/i386/i386/intr_machdep.c   Mon Jun 14 07:38:53 2010
(r209155)
@@ -502,7 +502,7 @@ intr_shuffle_irqs(void *arg __unused)
 */
if (isrc-is_event-ie_cpu != NOCPU)
(void)isrc-is_pic-pic_assign_cpu(isrc,
-   isrc-is_event-ie_cpu);
+   cpu_apic_ids[isrc-is_event-ie_cpu]);
else if (isrc-is_pic-pic_assign_cpu(isrc,
cpu_apic_ids[current_cpu]) == 0)
(void)intr_next_cpu();
___
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: r209119 - head/sys/sys

2010-06-14 Thread Pawel Jakub Dawidek
On Mon, Jun 14, 2010 at 11:52:49AM +1000, Lawrence Stewart wrote:
 Given that the DPCPU variable name space is flat and variable names have 
 to be unique, perhaps something like the following would address the 
 concerns raised?
 
 #define DPCPU_SUM(n, var, sum) \
 do {   \
 u_int _##n##_i;\
 (sum) = 0; \
 CPU_FOREACH(_##n##_i)  \
 (sum) += (DPCPU_ID_PTR(_##n##_i, n))-var; \
 } while (0)

Looks ok to me. Thanks.

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
p...@freebsd.org   http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!


pgpS7kfPdOnDq.pgp
Description: PGP signature


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

2010-06-14 Thread Bernhard Schmidt
Author: bschmidt
Date: Mon Jun 14 08:24:00 2010
New Revision: 209156
URL: http://svn.freebsd.org/changeset/base/209156

Log:
  sc_lastrs is also used in case the sending station is not known, for
  example in a split IBSS scenario. Therefore always assign sc_lastrs.
  This removes a hack I committed in r206457.
  
  Approved by:  rpaulo (mentor)

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

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Mon Jun 14 07:38:53 2010(r209155)
+++ head/sys/dev/ath/if_ath.c   Mon Jun 14 08:24:00 2010(r209156)
@@ -3654,14 +3654,8 @@ ath_recv_mgmt(struct ieee80211_node *ni,
case IEEE80211_FC0_SUBTYPE_PROBE_RESP:
if (vap-iv_opmode == IEEE80211_M_IBSS 
vap-iv_state == IEEE80211_S_RUN) {
-   uint32_t rstamp;
-   uint64_t tsf;
-
-   if (sc-sc_lastrs == NULL)
-   break;
-
-   rstamp = sc-sc_lastrs-rs_tstamp;
-   tsf = ath_extend_tsf(rstamp,
+   uint32_t rstamp = sc-sc_lastrs-rs_tstamp;
+   uint64_t tsf = ath_extend_tsf(rstamp,
ath_hal_gettsf64(sc-sc_ah));
/*
 * Handle ibss merge as needed; check the tsf on the
@@ -4002,11 +3996,11 @@ rx_accept:
mtod(m, const struct ieee80211_frame_min *),
rs-rs_keyix == HAL_RXKEYIX_INVALID ?
IEEE80211_KEYIX_NONE : rs-rs_keyix);
+   sc-sc_lastrs = rs;
if (ni != NULL) {
/*
 * Sending station is known, dispatch directly.
 */
-   sc-sc_lastrs = rs;
type = ieee80211_input(ni, m, rs-rs_rssi, nf);
ieee80211_free_node(ni);
/*
___
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: r209119 - head/sys/sys

2010-06-14 Thread Kostik Belousov
On Mon, Jun 14, 2010 at 11:52:49AM +1000, Lawrence Stewart wrote:
 On 06/13/10 20:10, Pawel Jakub Dawidek wrote:
 On Sun, Jun 13, 2010 at 02:39:55AM +, Lawrence Stewart wrote:
 [snip]
 
 Modified: head/sys/sys/pcpu.h
 ==
 --- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010(r209118)
 +++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010(r209119)
 @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[];
   #define   DPCPU_ID_GET(i, n)  (*DPCPU_ID_PTR(i, n))
   #define   DPCPU_ID_SET(i, n, v)   (*DPCPU_ID_PTR(i, n) = v)
 
 +/*
 + * Utility macros.
 + */
 +#define DPCPU_SUM(n, var, sum)  \
 +do {\
 +   (sum) = 0;  \
 +   u_int i;\
 +   CPU_FOREACH(i)  \
 +   (sum) += (DPCPU_ID_PTR(i, n))-var; \
 +} while (0)
 
 I'd suggest first swapping variable declaration and '(sum) = 0;'.
 Also using 'i' as a counter in macro can easly lead to name collision.
 If you need to do it, I'd suggest '_i' or something.
 
 Given that the DPCPU variable name space is flat and variable names have 
 to be unique, perhaps something like the following would address the 
 concerns raised?
 
 #define DPCPU_SUM(n, var, sum) \
 do {   \
 u_int _##n##_i;\
 (sum) = 0; \
 CPU_FOREACH(_##n##_i)  \
 (sum) += (DPCPU_ID_PTR(_##n##_i, n))-var; \
 } while (0)

You do not have to jump through this. Mostly by convention, in our kernel
sources, names with _ prefix are reserved for the infrastructure (cannot
say implementation). I think it is quite safe to use _i for the iteration
variable.

As an example of this, look at sys/sys/mount.h, implementation of
VFS_NEEDGIANT, VFS_LOCK_GIANT etc macros. They do use gcc ({}) extension
to provide function-like macros, but this is irrelevant. Or, look at
the VFS_ASSERT_GIANT that is exactly like what you need.


pgpEYRXSiENYx.pgp
Description: PGP signature


Re: svn commit: r209119 - head/sys/sys

2010-06-14 Thread Lawrence Stewart

On 06/14/10 18:52, Kostik Belousov wrote:

On Mon, Jun 14, 2010 at 11:52:49AM +1000, Lawrence Stewart wrote:

On 06/13/10 20:10, Pawel Jakub Dawidek wrote:

On Sun, Jun 13, 2010 at 02:39:55AM +, Lawrence Stewart wrote:

[snip]


Modified: head/sys/sys/pcpu.h
==
--- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010(r209118)
+++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010(r209119)
@@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[];
  #define   DPCPU_ID_GET(i, n)  (*DPCPU_ID_PTR(i, n))
  #define   DPCPU_ID_SET(i, n, v)   (*DPCPU_ID_PTR(i, n) = v)

+/*
+ * Utility macros.
+ */
+#define DPCPU_SUM(n, var, sum)  \
+do {\
+   (sum) = 0;  \
+   u_int i;\
+   CPU_FOREACH(i)  \
+   (sum) += (DPCPU_ID_PTR(i, n))-var;  \
+} while (0)


I'd suggest first swapping variable declaration and '(sum) = 0;'.
Also using 'i' as a counter in macro can easly lead to name collision.
If you need to do it, I'd suggest '_i' or something.


Given that the DPCPU variable name space is flat and variable names have
to be unique, perhaps something like the following would address the
concerns raised?

#define DPCPU_SUM(n, var, sum) \
do {   \
 u_int _##n##_i;\
 (sum) = 0; \
 CPU_FOREACH(_##n##_i)  \
 (sum) += (DPCPU_ID_PTR(_##n##_i, n))-var; \
} while (0)


You do not have to jump through this. Mostly by convention, in our kernel
sources, names with _ prefix are reserved for the infrastructure (cannot
say implementation). I think it is quite safe to use _i for the iteration
variable.

As an example of this, look at sys/sys/mount.h, implementation of
VFS_NEEDGIANT, VFS_LOCK_GIANT etc macros. They do use gcc ({}) extension
to provide function-like macros, but this is irrelevant. Or, look at
the VFS_ASSERT_GIANT that is exactly like what you need.


Ok cool, thanks for the info and pointers (I didn't know about the ({}) 
extension or that _ prefix was definitely reserved). I'm happy to use 
_i. Does the following diff against head look suitable to commit?


--- a/sys/sys/pcpu.hSun Jun 13 02:39:55 2010 +
+++ b/sys/sys/pcpu.hMon Jun 14 20:12:27 2010 +1000
@@ -111,10 +111,10 @@
  */
 #define DPCPU_SUM(n, var, sum)\
 do {  \
+   u_int _i;  \
(sum) = 0; \
-   u_int i;   \
-   CPU_FOREACH(i) \
-   (sum) += (DPCPU_ID_PTR(i, n))-var;\
+   CPU_FOREACH(_i)\
+   (sum) += (DPCPU_ID_PTR(_i, n))-var;   \
 } while (0)

 /*


Cheers,
Lawrence
___
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: r209119 - head/sys/sys

2010-06-14 Thread Kostik Belousov
On Mon, Jun 14, 2010 at 08:34:15PM +1000, Lawrence Stewart wrote:
 On 06/14/10 18:52, Kostik Belousov wrote:
 On Mon, Jun 14, 2010 at 11:52:49AM +1000, Lawrence Stewart wrote:
 On 06/13/10 20:10, Pawel Jakub Dawidek wrote:
 On Sun, Jun 13, 2010 at 02:39:55AM +, Lawrence Stewart wrote:
 [snip]
 
 Modified: head/sys/sys/pcpu.h
 ==
 --- head/sys/sys/pcpu.h   Sun Jun 13 01:27:29 2010(r209118)
 +++ head/sys/sys/pcpu.h   Sun Jun 13 02:39:55 2010(r209119)
 @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[];
   #define DPCPU_ID_GET(i, n)  (*DPCPU_ID_PTR(i, n))
   #define DPCPU_ID_SET(i, n, v)   (*DPCPU_ID_PTR(i, n) = v)
 
 +/*
 + * Utility macros.
 + */
 +#define DPCPU_SUM(n, var, sum)\
 +do {  \
 + (sum) = 0;  \
 + u_int i;\
 + CPU_FOREACH(i)  \
 + (sum) += (DPCPU_ID_PTR(i, n))-var; \
 +} while (0)
 
 I'd suggest first swapping variable declaration and '(sum) = 0;'.
 Also using 'i' as a counter in macro can easly lead to name collision.
 If you need to do it, I'd suggest '_i' or something.
 
 Given that the DPCPU variable name space is flat and variable names have
 to be unique, perhaps something like the following would address the
 concerns raised?
 
 #define DPCPU_SUM(n, var, sum) \
 do {   \
  u_int _##n##_i;\
  (sum) = 0; \
  CPU_FOREACH(_##n##_i)  \
  (sum) += (DPCPU_ID_PTR(_##n##_i, n))-var; \
 } while (0)
 
 You do not have to jump through this. Mostly by convention, in our kernel
 sources, names with _ prefix are reserved for the infrastructure (cannot
 say implementation). I think it is quite safe to use _i for the iteration
 variable.
 
 As an example of this, look at sys/sys/mount.h, implementation of
 VFS_NEEDGIANT, VFS_LOCK_GIANT etc macros. They do use gcc ({}) extension
 to provide function-like macros, but this is irrelevant. Or, look at
 the VFS_ASSERT_GIANT that is exactly like what you need.
 
 Ok cool, thanks for the info and pointers (I didn't know about the ({}) 
 extension or that _ prefix was definitely reserved). I'm happy to use 
 _i. Does the following diff against head look suitable to commit?
 
 --- a/sys/sys/pcpu.hSun Jun 13 02:39:55 2010 +
 +++ b/sys/sys/pcpu.hMon Jun 14 20:12:27 2010 +1000
 @@ -111,10 +111,10 @@
   */
  #define DPCPU_SUM(n, var, sum)\
  do {  \
 +   u_int _i;  \
 (sum) = 0; \
 -   u_int i;   \
 -   CPU_FOREACH(i) \
 -   (sum) += (DPCPU_ID_PTR(i, n))-var;\
 +   CPU_FOREACH(_i)\
 +   (sum) += (DPCPU_ID_PTR(_i, n))-var;   \
  } while (0)

You might want to introduce local accumulator to prevent several evaluations
of sum, to avoid possible side-effects. Then, after, the loop, do single
asignment to the the sum.

Or, you could ditch the sum at all, indeed using ({}) and returning the
result. __typeof is your friend to select proper type of accumulator.


pgp7KqTFmqfH8.pgp
Description: PGP signature


Re: svn commit: r209119 - head/sys/sys

2010-06-14 Thread Bruce Evans

On Sun, 13 Jun 2010, Gabor Kovesdan wrote:


+/*
+ * Utility macros.
+ */
+#define DPCPU_SUM(n, var, sum) 
\
+do { 
\

+   (sum) = 0;  \
+   u_int i;\
+   CPU_FOREACH(i)  \
+   (sum) += (DPCPU_ID_PTR(i, n))-var;  \
+} while (0)


I'd suggest first swapping variable declaration and '(sum) = 0;'.
Also using 'i' as a counter in macro can easly lead to name collision.
If you need to do it, I'd suggest '_i' or something.
Maybe it would be better to make it an inline function rather than macro?


And why using old BSD-stlye u_int? style(9) also suggest using ISO C types.


That is for fixed-width types (uintN_t instead of u_intN_t).  KNF still uses
the abbreviation u_int for `unsigned' or worse `unsigned int', except where
namespace issues prevent use of u_nt.

Bruce
___
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: r209157 - head/games/random

2010-06-14 Thread Ulrich Spoerlein
Author: uqs
Date: Mon Jun 14 13:03:25 2010
New Revision: 209157
URL: http://svn.freebsd.org/changeset/base/209157

Log:
  random(6): avoid dead assignments
  
  Found by: clang static analyzer

Modified:
  head/games/random/random.c
  head/games/random/randomize_fd.c

Modified: head/games/random/random.c
==
--- head/games/random/random.c  Mon Jun 14 08:24:00 2010(r209156)
+++ head/games/random/random.c  Mon Jun 14 13:03:25 2010(r209157)
@@ -73,7 +73,7 @@ main(int argc, char *argv[])
denom = 0;
filename = /dev/fd/0;
random_type = RANDOM_TYPE_UNSET;
-   random_exit = randomize_lines = random_type = unbuffer_output = 0;
+   random_exit = randomize_lines = unbuffer_output = 0;
unique_output = 1;
 
(void)setlocale(LC_CTYPE, );

Modified: head/games/random/randomize_fd.c
==
--- head/games/random/randomize_fd.cMon Jun 14 08:24:00 2010
(r209156)
+++ head/games/random/randomize_fd.cMon Jun 14 13:03:25 2010
(r209157)
@@ -104,7 +104,7 @@ randomize_fd(int fd, int type, int uniqu
 
rand_root = rand_tail = NULL;
bufc = i = 0;
-   bufleft = eof = fndstr = numnode = ret = 0;
+   bufleft = eof = fndstr = numnode = 0;
 
if (type == RANDOM_TYPE_UNSET)
type = RANDOM_TYPE_LINES;
___
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: r209119 - head/sys/sys

2010-06-14 Thread Bruce Evans

On Sun, 13 Jun 2010, Lawrence Stewart wrote:


On 06/13/10 20:10, Pawel Jakub Dawidek wrote:

On Sun, Jun 13, 2010 at 02:39:55AM +, Lawrence Stewart wrote:

Log:
   Add a utility macro to simplify calculating an aggregate sum from a 
DPCPU

   counter variable.

   Sponsored by:FreeBSD Foundation
   Reviewed by: jhb, rpaulo, rwatson (previous version of patch)
   MFC after:   1 week

Modified:
   head/sys/sys/pcpu.h

Modified: head/sys/sys/pcpu.h
==
--- head/sys/sys/pcpu.h Sun Jun 13 01:27:29 2010(r209118)
+++ head/sys/sys/pcpu.h Sun Jun 13 02:39:55 2010(r209119)
@@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[];
  #define   DPCPU_ID_GET(i, n)  (*DPCPU_ID_PTR(i, n))
  #define   DPCPU_ID_SET(i, n, v)   (*DPCPU_ID_PTR(i, n) = v)

+/*
+ * Utility macros.
+ */
+#define DPCPU_SUM(n, var, sum) 
\
+do { 
\

+   (sum) = 0;  \
+   u_int i;\
+   CPU_FOREACH(i)  \
+   (sum) += (DPCPU_ID_PTR(i, n))-var;  \
+} while (0)


I'd suggest first swapping variable declaration and '(sum) = 0;'.


Of course.

Also fix the lexical style bugs:
- space instead of tab after #define
- do { at the beginning of a line (see queue.h for normal style)
- missing blank line after declarations
- missing braces around loop body (*).



Can do (will wait until consensus on other issues is reached first before 
tweaking though).



Also using 'i' as a counter in macro can easly lead to name collision.


I had a similar concern but after chatting with John on IRC felt it wasn't 
such a big deal in this case.



If you need to do it, I'd suggest '_i' or something.


Could do... is it worth it?


Maybe it would be better to make it an inline function rather than macro?


Inlining it could be annoying with respect to the types used in the function 
prototype, no? I suspect it would be more useful keeping it as a macro if 
possible.


Inlining it is impossible for the same reason that parenthesizing all the
macro args would be impossible -- `var' is a name and parenthesizing its
use would give the syntax error foo-(var).  Not sure about (n).  It's
a little surprising that parenthesizing works for lvalues like (sum)
(it works because lvalues include certain expressions including
parenthesized ones, but I wonder if it ever makes a difference).

BTW, one reason I liked BSD code more than gnu code is that it didn't
use so many macros.  Macros should only exist when they are not just
syntactic sugar, like DPCPU_SUM() and unlike CPU_FOREACH().

(*) style(9) recommends leaving out these unnecessary braces.  However,
mistakes like CPU_FOREACH() look less like syntax errors with the braces
than without them; the braces at least confuse indent(1) into not making
a mess.  indent(1) already knows that it doesn't understand macros so it
doesn't reformat them, so this doesn't quite apply here.

Bruce
___
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: r209119 - head/sys/sys

2010-06-14 Thread John Baldwin
On Sunday 13 June 2010 9:41:38 am Lawrence Stewart wrote:
 On 06/13/10 20:10, Pawel Jakub Dawidek wrote:
  On Sun, Jun 13, 2010 at 02:39:55AM +, Lawrence Stewart wrote:
  Author: lstewart
  Date: Sun Jun 13 02:39:55 2010
  New Revision: 209119
  URL: http://svn.freebsd.org/changeset/base/209119
 
  Log:
 Add a utility macro to simplify calculating an aggregate sum from a 
DPCPU
 counter variable.
 
 Sponsored by:   FreeBSD Foundation
 Reviewed by:jhb, rpaulo, rwatson (previous version of patch)
 MFC after:  1 week
 
  Modified:
 head/sys/sys/pcpu.h
 
  Modified: head/sys/sys/pcpu.h
  
==
  --- head/sys/sys/pcpu.hSun Jun 13 01:27:29 2010(r209118)
  +++ head/sys/sys/pcpu.hSun Jun 13 02:39:55 2010(r209119)
  @@ -106,6 +106,17 @@ extern uintptr_t dpcpu_off[];
#define  DPCPU_ID_GET(i, n)  (*DPCPU_ID_PTR(i, n))
#define  DPCPU_ID_SET(i, n, v)   (*DPCPU_ID_PTR(i, n) = v)
 
  +/*
  + * Utility macros.
  + */
  +#define DPCPU_SUM(n, var, sum)
  \
  +do {  
  \
  +  (sum) = 0;  \
  +  u_int i;\
  +  CPU_FOREACH(i)  \
  +  (sum) += (DPCPU_ID_PTR(i, n))-var; \
  +} while (0)
 
  I'd suggest first swapping variable declaration and '(sum) = 0;'.
 
 Can do (will wait until consensus on other issues is reached first 
 before tweaking though).
 
  Also using 'i' as a counter in macro can easly lead to name collision.
 
 I had a similar concern but after chatting with John on IRC felt it 
 wasn't such a big deal in this case.

Actually, I am a fan of using an inline function if possible to avoid the name 
collisions.

-- 
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


Re: svn commit: r209119 - head/sys/sys

2010-06-14 Thread mdf
 BTW, one reason I liked BSD code more than gnu code is that it didn't
 use so many macros.  Macros should only exist when they are not just
 syntactic sugar, like DPCPU_SUM() and unlike CPU_FOREACH().

As a style question, I do understand (generally) why too many macros
make the code confusing.  However, the *FOREACH macros all fit the
same pattern and having a macro to iterate protects one against
changes in the implementation -- there's a single location to change
if e.g. we want to make CPU_FOREACH use a bitwise operator to
determine the next non-zero bit, rather than testing each
individually.

So what I'm asking is, how do we balance the simplicity of the code
(no unnecessary macros) versus the simplicity of making certain
kinds of infrastructure changes simpler?

Thanks,
matthew
___
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: r209119 - head/sys/sys

2010-06-14 Thread John Baldwin
On Monday 14 June 2010 9:50:10 am m...@freebsd.org wrote:
  BTW, one reason I liked BSD code more than gnu code is that it didn't
  use so many macros.  Macros should only exist when they are not just
  syntactic sugar, like DPCPU_SUM() and unlike CPU_FOREACH().
 
 As a style question, I do understand (generally) why too many macros
 make the code confusing.  However, the *FOREACH macros all fit the
 same pattern and having a macro to iterate protects one against
 changes in the implementation -- there's a single location to change
 if e.g. we want to make CPU_FOREACH use a bitwise operator to
 determine the next non-zero bit, rather than testing each
 individually.

In the case of CPU_FOREACH() there is a very good chance that the 
implementation details will change when we switch from cpumask_t to cpuset_t, 
which is part of the reason I added it.  I am less of a fan of macros that 
just wrap TAILQ_FOREACH() (note that there isn't a PCPU_FOREACH() since you 
can already do this via SLIST_FOREACH() now for example) such as 
FOREACH_PROC_IN_SYSTEM().  CPU_FOREACH() has additional logic in that it hides 
the CPU_ABSENT() stuff, so to me it doesn't quite fall in that class.  (Some 
code was using pcpu_find() instead of CPU_ABSENT() to determine absent CPUs as 
well FWIW.)

-- 
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: r209159 - in head/usr.sbin/wpa: . hostapd wpa_supplicant

2010-06-14 Thread Rui Paulo
Author: rpaulo
Date: Mon Jun 14 15:38:30 2010
New Revision: 209159
URL: http://svn.freebsd.org/changeset/base/209159

Log:
  Update for hostapd  wpa_supplicant 0.6.10.

Deleted:
  head/usr.sbin/wpa/l2_packet.c
  head/usr.sbin/wpa/wpa_supplicant/driver_wired.c
Modified:
  head/usr.sbin/wpa/hostapd/Makefile
  head/usr.sbin/wpa/wpa_supplicant/Makefile

Modified: head/usr.sbin/wpa/hostapd/Makefile
==
--- head/usr.sbin/wpa/hostapd/Makefile  Mon Jun 14 15:37:48 2010
(r209158)
+++ head/usr.sbin/wpa/hostapd/Makefile  Mon Jun 14 15:38:30 2010
(r209159)
@@ -14,7 +14,7 @@ SRCS= accounting.c aes.c aes_wrap.c ap_l
ieee802_1x.c ip_addr.c md5.c mlme.c pmksa_cache.c radius.c \
radius_client.c rc4.c sha1.c sta_info.c vlan_init.c wme.c \
wpa.c wpa_auth_ie.c wpa_common.c wpa_debug.c wpabuf.c
-SRCS+= l2_packet.c driver_freebsd.c os_unix.c
+SRCS+= l2_packet_freebsd.c driver_freebsd.c os_unix.c
 
 MAN=   hostapd.8 hostapd.conf.5
 

Modified: head/usr.sbin/wpa/wpa_supplicant/Makefile
==
--- head/usr.sbin/wpa/wpa_supplicant/Makefile   Mon Jun 14 15:37:48 2010
(r209158)
+++ head/usr.sbin/wpa/wpa_supplicant/Makefile   Mon Jun 14 15:38:30 2010
(r209159)
@@ -9,7 +9,7 @@
 
 PROG=  wpa_supplicant
 SRCS=  aes.c aes_wrap.c blacklist.c common.c config.c ctrl_iface.c \
-   ctrl_iface_unix.c drivers.c eloop.c events.c l2_packet.c main.c \
+   ctrl_iface_unix.c drivers.c eloop.c events.c l2_packet_freebsd.c main.c\
md5.c preauth.c pmksa_cache.c rc4.c scan.c scan_helpers.c sha1.c \
wpa.c wpa_common.c wpa_debug.c wpa_ie.c wpa_supplicant.c \
wpabuf.c wpas_glue.c \
___
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: r209119 - head/sys/sys

2010-06-14 Thread Bruce Evans

On Mon, 14 Jun 2010, John Baldwin wrote:


On Monday 14 June 2010 9:50:10 am m...@freebsd.org wrote:

[bde wrote]

BTW, one reason I liked BSD code more than gnu code is that it didn't
use so many macros.  Macros should only exist when they are not just
syntactic sugar, like DPCPU_SUM() and unlike CPU_FOREACH().


As a style question, I do understand (generally) why too many macros
make the code confusing.  However, the *FOREACH macros all fit the
same pattern and having a macro to iterate protects one against
changes in the implementation -- there's a single location to change
if e.g. we want to make CPU_FOREACH use a bitwise operator to
determine the next non-zero bit, rather than testing each
individually.


I usually prefer readability to making the implementation easier to change.
Readability includes seeing all the details so that you can understand and
debug them.  Functions may also hide the details in an effectively similar
way for reading (browsing) but not from debugging.


In the case of CPU_FOREACH() there is a very good chance that the
implementation details will change when we switch from cpumask_t to cpuset_t,
which is part of the reason I added it.  I am less of a fan of macros that
just wrap TAILQ_FOREACH() (note that there isn't a PCPU_FOREACH() since you
can already do this via SLIST_FOREACH() now for example) such as
FOREACH_PROC_IN_SYSTEM().


I view the queue constructor and access macros as a necessary evil because
they can't be written as inline functions (except in C++?).  This doesn't
apply to the iterator macros.


CPU_FOREACH() has additional logic in that it hides
the CPU_ABSENT() stuff, so to me it doesn't quite fall in that class.  (Some
code was using pcpu_find() instead of CPU_ABSENT() to determine absent CPUs as
well FWIW.)


Maybe it is the magic in them that I dislike most.  I have yet to see
a debugger that can even automatically print the literal macro definition
when displaying lines near a macro, let alone prettyprint the
context-dependent macro expansion and allow stepping through or over
the expansion.  gdb has problems in this area even with inline functions.

Bruce
___
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: r209160 - in head/contrib/wpa/src: drivers l2_packet

2010-06-14 Thread Rui Paulo
Author: rpaulo
Date: Mon Jun 14 15:52:50 2010
New Revision: 209160
URL: http://svn.freebsd.org/changeset/base/209160

Log:
  Remove unused files.

Deleted:
  head/contrib/wpa/src/drivers/Apple80211.h
  head/contrib/wpa/src/drivers/MobileApple80211.c
  head/contrib/wpa/src/drivers/MobileApple80211.h
  head/contrib/wpa/src/drivers/driver_atmel.c
  head/contrib/wpa/src/drivers/driver_broadcom.c
  head/contrib/wpa/src/drivers/driver_bsd.c
  head/contrib/wpa/src/drivers/driver_hostap.c
  head/contrib/wpa/src/drivers/driver_hostap.h
  head/contrib/wpa/src/drivers/driver_iphone.m
  head/contrib/wpa/src/drivers/driver_ipw.c
  head/contrib/wpa/src/drivers/driver_madwifi.c
  head/contrib/wpa/src/drivers/driver_nl80211.c
  head/contrib/wpa/src/drivers/driver_osx.m
  head/contrib/wpa/src/drivers/driver_prism54.c
  head/contrib/wpa/src/drivers/driver_privsep.c
  head/contrib/wpa/src/drivers/driver_ps3.c
  head/contrib/wpa/src/drivers/driver_ralink.c
  head/contrib/wpa/src/drivers/driver_ralink.h
  head/contrib/wpa/src/drivers/driver_roboswitch.c
  head/contrib/wpa/src/drivers/driver_test.c
  head/contrib/wpa/src/drivers/driver_wext.c
  head/contrib/wpa/src/drivers/driver_wext.h
  head/contrib/wpa/src/drivers/priv_netlink.h
  head/contrib/wpa/src/l2_packet/l2_packet_linux.c
  head/contrib/wpa/src/l2_packet/l2_packet_pcap.c
  head/contrib/wpa/src/l2_packet/l2_packet_privsep.c
  head/contrib/wpa/src/l2_packet/l2_packet_winpcap.c
___
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: r209161 - head/sys/arm/include

2010-06-14 Thread Rafal Jaworowski
Author: raj
Date: Mon Jun 14 16:05:21 2010
New Revision: 209161
URL: http://svn.freebsd.org/changeset/base/209161

Log:
  Temporarily bring back the ARM bootinfo (and make tinderbox happy).
  
  BI will be eliminated for good when powerpc transition to FDT is complete.

Added:
 - copied unchanged from r209130, head/sys/arm/include/bootinfo.h
Directory Properties:
  head/sys/arm/include/bootinfo.h   (props changed)
Modified:
  head/sys/arm/include/metadata.h

Copied: head/sys/arm/include/bootinfo.h (from r209130, 
head/sys/arm/include/bootinfo.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/include/bootinfo.h Mon Jun 14 16:05:21 2010
(r209161, copy of r209130, head/sys/arm/include/bootinfo.h)
@@ -0,0 +1,72 @@
+/*-
+ * Copyright (C) 2006-2008 Semihalf, Marian Balakowicz m...@semihalf.com
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+ * NO EVENT SHALL THE AUTHOR 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$
+ */
+
+#ifndef _MACHINE_BOOTINFO_H_
+#define _MACHINE_BOOTINFO_H_
+
+#if !defined(LOCORE)
+
+/* Platform hardware spec, received from loader(8) */
+
+#define BI_VERSION 1
+
+struct bi_mem_region {
+   vm_paddr_t  mem_base;
+   vm_size_t   mem_size;
+};
+
+struct bi_eth_addr {
+   u_int8_tmac_addr[6];
+   u_int8_tpadding[2];
+};
+
+struct bootinfo {
+   u_int32_t   bi_version;
+   vm_offset_t bi_bar_base;
+   u_int32_t   bi_cpu_clk;
+   u_int32_t   bi_bus_clk;
+   u_int8_tbi_mem_reg_no;
+   u_int8_tbi_eth_addr_no;
+   u_int8_tpadding[2];
+
+   u_int8_tbi_data[1];
+   /*
+* The bi_data container is allocated in run time and has the
+* following layout:
+*
+* - bi_mem_reg_no elements of struct bi_mem_region
+* - bi_eth_addr_no elements of struct bi_eth_addr
+*/
+};
+
+extern struct bootinfo *bootinfo;
+
+struct bi_mem_region *bootinfo_mr(void);
+struct bi_eth_addr *bootinfo_eth(void);
+#endif
+
+#endif /* _MACHINE_BOOTINFO_H_ */

Modified: head/sys/arm/include/metadata.h
==
--- head/sys/arm/include/metadata.h Mon Jun 14 15:52:50 2010
(r209160)
+++ head/sys/arm/include/metadata.h Mon Jun 14 16:05:21 2010
(r209161)
@@ -31,4 +31,10 @@
 
 #defineMODINFOMD_DTBP  0x1001
 
+/*
+ * XXX this is for tinderbox compilation sake only and will go away once the
+ * FDT transition is complete.
+ */
+#define MODINFOMD_BOOTINFO 0x2000
+
 #endif /* !_MACHINE_METADATA_H_ */
___
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: r209162 - head/sys/boot/i386/pxeldr

2010-06-14 Thread Roman Divacky
Author: rdivacky
Date: Mon Jun 14 17:02:19 2010
New Revision: 209162
URL: http://svn.freebsd.org/changeset/base/209162

Log:
  Pass the -N flag to linked via -Wl.
  
  Approved by:  ed (mentor)

Modified:
  head/sys/boot/i386/pxeldr/Makefile

Modified: head/sys/boot/i386/pxeldr/Makefile
==
--- head/sys/boot/i386/pxeldr/Makefile  Mon Jun 14 16:05:21 2010
(r209161)
+++ head/sys/boot/i386/pxeldr/Makefile  Mon Jun 14 17:02:19 2010
(r209162)
@@ -32,7 +32,7 @@ ${BOOT}: ${LDR} ${LOADER}
dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync
rm ${.TARGET}.tmp
 
-LDFLAGS+= -N -e start -Ttext ${ORG} -Wl,-S,--oformat,binary
+LDFLAGS+=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary
 
 CLEANFILES+= ${LOADER}
 
___
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: r209153 - head/lib/clang

2010-06-14 Thread Ulrich Spörlein
On Mon, 14.06.2010 at 06:23:47 +, Ed Schouten wrote:
 Author: ed
 Date: Mon Jun 14 06:23:47 2010
 New Revision: 209153
 URL: http://svn.freebsd.org/changeset/base/209153
 
 Log:
   Unbreak Clang on PowerPC.
   
   It seems GCC 4.2.1 on PowerPC miscompiles Clang, causing it to crash
   when building even simple Hello World applications. Switch back to -O1
   for this architecture.

What about clang compiled using clang -O2? Ie., does clang bootstrap
correctly on PPC and this is a genuine gcc 4.2.1 bug?

Regards,
Uli
___
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: r209168 - head/share/man/man9

2010-06-14 Thread Jaakko Heinonen
Author: jh
Date: Mon Jun 14 17:31:46 2010
New Revision: 209168
URL: http://svn.freebsd.org/changeset/base/209168

Log:
  Update vfs_busy(9) and vfs_unbusy(9) manual pages to better match the
  current behaviour of the functions.
  
  Discussed with:   attilio

Modified:
  head/share/man/man9/vfs_busy.9
  head/share/man/man9/vfs_unbusy.9

Modified: head/share/man/man9/vfs_busy.9
==
--- head/share/man/man9/vfs_busy.9  Mon Jun 14 17:28:32 2010
(r209167)
+++ head/share/man/man9/vfs_busy.9  Mon Jun 14 17:31:46 2010
(r209168)
@@ -26,7 +26,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd November 2, 2008
+.Dd June 14, 2010
 .Dt VFS_BUSY 9
 .Os
 .Sh NAME
@@ -40,9 +40,8 @@
 .Sh DESCRIPTION
 The
 .Fn vfs_busy
-function marks a mount point as busy.
-The purpose of this
-function is to synchronize access to a mount point.
+function marks a mount point as busy by incrementing
+the reference count of a mount point.
 It also delays unmounting by sleeping on
 .Fa mp
 if the
@@ -50,7 +49,7 @@ if the
 flag is set in
 .Fa mp-mnt_kern_flag
 and the
-.Dv LK_NOWAIT
+.Dv MBF_NOWAIT
 flag is
 .Em not
 set.
@@ -75,9 +74,9 @@ drop the mountlist_mtx in the critical p
 .Sh RETURN VALUES
 A 0 value is returned on success.
 If the mount point is being
-unmounted
+unmounted and MBF_NOWAIT flag is specified
 .Er ENOENT
-will always be returned.
+will be returned.
 .Sh ERRORS
 .Bl -tag -width Er
 .It Bq Er ENOENT

Modified: head/share/man/man9/vfs_unbusy.9
==
--- head/share/man/man9/vfs_unbusy.9Mon Jun 14 17:28:32 2010
(r209167)
+++ head/share/man/man9/vfs_unbusy.9Mon Jun 14 17:31:46 2010
(r209168)
@@ -26,7 +26,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd August 29, 2008
+.Dd June 14, 2010
 .Dt VFS_UNBUSY 9
 .Os
 .Sh NAME
@@ -40,23 +40,17 @@
 .Sh DESCRIPTION
 The
 .Fn vfs_unbusy
-function un-busies a mount point by unlocking
-.Fa mp-mnt_lock .
-The lock is typically acquired by calling
+function un-busies a mount point by decrementing
+the reference count of a mount point.
+The reference count is typically incremented by calling
 .Xr vfs_busy 9
 prior to this call.
 .Pp
 Its arguments are:
 .Bl -tag -width .Fa mp
 .It Fa mp
-The mount point to unbusy (unlock).
+The mount point to unbusy.
 .El
-.Sh LOCKS
-.Va mnt_lock
-must be locked in
-.Fa mp
-prior to calling
-this function, and it will be unlocked upon return.
 .Sh SEE ALSO
 .Xr vfs_busy 9
 .Sh AUTHORS
___
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: r209153 - head/lib/clang

2010-06-14 Thread Nathan Whitehorn
On Mon, 14 Jun 2010 19:26:09 +0200
Ulrich Spörlein u...@spoerlein.net wrote:

 On Mon, 14.06.2010 at 06:23:47 +, Ed Schouten wrote:
  Author: ed
  Date: Mon Jun 14 06:23:47 2010
  New Revision: 209153
  URL: http://svn.freebsd.org/changeset/base/209153
  
  Log:
Unbreak Clang on PowerPC.

It seems GCC 4.2.1 on PowerPC miscompiles Clang, causing it to
  crash when building even simple Hello World applications. Switch
  back to -O1 for this architecture.
 
 What about clang compiled using clang -O2? Ie., does clang bootstrap
 correctly on PPC and this is a genuine gcc 4.2.1 bug?
 
 Regards,
 Uli

clang is not completely functional on PPC at the moment. It compiles
simple programs fine, but has two nasty bugs (One is LLVM bug 7374 and
relates to alignment of struct members, and the other is a missing
implementation of va_arg for ELF systems), so is not capable of
self-hosting.

Given the amount of time involved in binary searching the 2D space of
all of the LLVM libraries and the set of GCC optimizations added with
-O2, I haven't tracked down the problem in detail.
-Nathan
___
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: r209169 - head/sys/dev/iwn

2010-06-14 Thread Bernhard Schmidt
Author: bschmidt
Date: Mon Jun 14 18:26:10 2010
New Revision: 209169
URL: http://svn.freebsd.org/changeset/base/209169

Log:
  Fix TX retry rate handling. tx-linkq is an index to a rate table
  beginning with the highest available rate. Currently we always use
  54m for the first retry no matter what AMRR has choosen. Fix this
  by setting the index to the next lower rate.
  
  Approved by:  rpaulo (mentor)
  Tested by:Brandon Gooch jamesbrandongooch at gmail.com
  MFC after:2 weeks

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Mon Jun 14 17:31:46 2010(r209168)
+++ head/sys/dev/iwn/if_iwn.c   Mon Jun 14 18:26:10 2010(r209169)
@@ -3007,7 +3007,7 @@ iwn_tx_data(struct iwn_softc *sc, struct
txant = IWN_LSB(sc-txchainmask);
tx-rflags |= IWN_RFLAG_ANT(txant);
} else {
-   tx-linkq = 0;
+   tx-linkq = IWN_RIDX_OFDM54 - ridx;
flags |= IWN_TX_LINKQ;  /* enable MRR */
}
 
___
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: r209171 - head/tools/build/mk

2010-06-14 Thread Ed Schouten
Author: ed
Date: Mon Jun 14 19:10:30 2010
New Revision: 209171
URL: http://svn.freebsd.org/changeset/base/209171

Log:
  Add Clang to OptionalObsoleteFiles.inc.
  
  This means you can now deinstall Clang by running make delete-old with
  WITHOUT_CLANG set.

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Jun 14 18:45:33 
2010(r209170)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Jun 14 19:10:30 
2010(r209171)
@@ -624,6 +624,18 @@ OLD_FILES+=usr/share/man/man8/zfs.8.gz
 OLD_FILES+=usr/share/man/man8/zpool.8.gz
 .endif
 
+.if ${MK_CLANG} == no
+OLD_FILES+=usr/bin/clang
+OLD_FILES+=usr/bin/clang++
+OLD_FILES+=usr/bin/tblgen
+OLD_FILES+=usr/include/clang/2.0/emmintrin.h
+OLD_FILES+=usr/include/clang/2.0/mm_malloc.h
+OLD_FILES+=usr/include/clang/2.0/mmintrin.h
+OLD_FILES+=usr/include/clang/2.0/pmmintrin.h
+OLD_FILES+=usr/include/clang/2.0/tmmintrin.h
+OLD_FILES+=usr/include/clang/2.0/xmmintrin.h
+.endif
+
 .if ${MK_CPP} == no
 OLD_FILES+=usr/bin/cpp
 OLD_FILES+=usr/share/man/man1/cpp.1.gz
___
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: r209172 - head/usr.sbin/sysinstall

2010-06-14 Thread Marcel Moolenaar
Author: marcel
Date: Mon Jun 14 19:39:20 2010
New Revision: 209172
URL: http://svn.freebsd.org/changeset/base/209172

Log:
  Further unbreak powerpc  sparc64.

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

Modified: head/usr.sbin/sysinstall/disks.c
==
--- head/usr.sbin/sysinstall/disks.cMon Jun 14 19:10:30 2010
(r209171)
+++ head/usr.sbin/sysinstall/disks.cMon Jun 14 19:39:20 2010
(r209172)
@@ -215,6 +215,7 @@ print_command_summary(void)
 mvprintw(21, 0, Use F1 or ? to get more help, arrow keys to select.);
 move(0, 0);
 }
+#endif /* WITH_SLICES */
 
 #if !defined(__ia64__)
 static u_char *
@@ -249,8 +250,9 @@ bootalloc(char *name, size_t *size)
msgDebug(bootalloc: can't stat %s\n, buf);
 return NULL;
 }
-#endif
+#endif /* !defined(__ia64__) */
 
+#ifdef WITH_SLICES
 #ifdef PC98
 static void
 getBootMgr(char *dname, u_char **bootipl, size_t *bootipl_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


svn commit: r209173 - head/sys/vm

2010-06-14 Thread Alan Cox
Author: alc
Date: Mon Jun 14 19:54:19 2010
New Revision: 209173
URL: http://svn.freebsd.org/changeset/base/209173

Log:
  Eliminate checks for a page having a NULL object in vm_pageout_scan()
  and vm_pageout_page_stats().  These checks were recently introduced by
  the first page locking commit, r207410, but they are not needed.  At
  the same time, eliminate some redundant accesses to the page's object
  field.  (These accesses should have neen eliminated by r207410.)
  
  Make the assertion in vm_page_flag_set() stricter.  Specifically, only
  managed pages should have PG_WRITEABLE set.
  
  Add a comment documenting an assertion to vm_page_flag_clear().
  
  It has long been the case that fictitious pages have their wire count
  permanently set to one.  Add comments to vm_page_wire() and
  vm_page_unwire() documenting this.  Add assertions to these functions
  as well.
  
  Update the comment describing vm_page_unwire().  Much of the old
  comment had little to do with vm_page_unwire(), but a lot to do with
  _vm_page_deactivate().  Move relevant parts of the old comment to
  _vm_page_deactivate().
  
  Only pages that belong to an object can be paged out.  Therefore, it
  is pointless for vm_page_unwire() to acquire the page queues lock and
  enqueue such pages in one of the paging queues.  Generally speaking,
  such pages are immediately freed after the call to vm_page_unwire().
  Previously, it was the call to vm_page_free() that reacquired the page
  queues lock and removed these pages from the paging queues.  Now, we
  will never acquire the page queues lock for this case.  (It is also
  worth noting that since both vm_page_unwire() and vm_page_free()
  occurred with the page locked, the page daemon never saw the page with
  its object field set to NULL.)
  
  Change the panic with vm_page_unwire() to provide a more precise message.
  
  Reviewed by:  kib@

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Mon Jun 14 19:39:20 2010(r209172)
+++ head/sys/vm/vm_page.c   Mon Jun 14 19:54:19 2010(r209173)
@@ -487,13 +487,12 @@ vm_page_flag_set(vm_page_t m, unsigned s
 
mtx_assert(vm_page_queue_mtx, MA_OWNED);
/*
-* For a managed page, the PG_WRITEABLE flag can be set only if
-* the page is VPO_BUSY.  Currently this flag is only set by
-* pmap_enter().
+* The PG_WRITEABLE flag can only be set if the page is managed and
+* VPO_BUSY.  Currently, this flag is only set by pmap_enter().
 */
KASSERT((bits  PG_WRITEABLE) == 0 ||
-   (m-flags  (PG_UNMANAGED | PG_FICTITIOUS)) != 0 ||
-   (m-oflags  VPO_BUSY) != 0, (PG_WRITEABLE and !VPO_BUSY));
+   ((m-flags  (PG_UNMANAGED | PG_FICTITIOUS)) == 0 
+   (m-oflags  VPO_BUSY) != 0), (PG_WRITEABLE and !VPO_BUSY));
m-flags |= bits;
 } 
 
@@ -502,6 +501,10 @@ vm_page_flag_clear(vm_page_t m, unsigned
 {
 
mtx_assert(vm_page_queue_mtx, MA_OWNED);
+   /*
+* The PG_REFERENCED flag can only be cleared if the object
+* containing the page is locked.
+*/
KASSERT((bits  PG_REFERENCED) == 0 || VM_OBJECT_LOCKED(m-object),
(PG_REFERENCED and !VM_OBJECT_LOCKED));
m-flags = ~bits;
@@ -1582,6 +1585,8 @@ vm_page_free_toq(vm_page_t m)
  * another map, removing it from paging queues
  * as necessary.
  *
+ * If the page is fictitious, then its wire count must remain one.
+ *
  * The page must be locked.
  * This routine may not block.
  */
@@ -1595,8 +1600,12 @@ vm_page_wire(vm_page_t m)
 * it is already off the queues).
 */
vm_page_lock_assert(m, MA_OWNED);
-   if (m-flags  PG_FICTITIOUS)
+   if ((m-flags  PG_FICTITIOUS) != 0) {
+   KASSERT(m-wire_count == 1,
+   (vm_page_wire: fictitious page %p's wire count isn't one,
+   m));
return;
+   }
if (m-wire_count == 0) {
if ((m-flags  PG_UNMANAGED) == 0)
vm_pageq_remove(m);
@@ -1607,32 +1616,20 @@ vm_page_wire(vm_page_t m)
 }
 
 /*
- * vm_page_unwire:
+ * vm_page_unwire:
  *
- * Release one wiring of this page, potentially
- * enabling it to be paged again.
+ * Release one wiring of the specified page, potentially enabling it to be
+ * paged again.  If paging is enabled, then the value of the parameter
+ * activate determines to which queue the page is added.  If activate is
+ * non-zero, then the page is added to the active queue.  Otherwise, it is
+ * added to the inactive queue.
  *
- * Many pages placed on the inactive queue should actually go
- * into the cache, but it is difficult to figure out which.  What
- * we do instead, if the inactive target is well met, is to put
- * clean pages at the head 

svn commit: r209174 - in head/sys/amd64: acpica amd64

2010-06-14 Thread Jung-uk Kim
Author: jkim
Date: Mon Jun 14 20:08:26 2010
New Revision: 209174
URL: http://svn.freebsd.org/changeset/base/209174

Log:
  Fix ACPI suspend/resume on amd64, which was broken since r208833.
  We need actual storage for FPU state to save and restore.

Modified:
  head/sys/amd64/acpica/acpi_wakeup.c
  head/sys/amd64/amd64/mp_machdep.c

Modified: head/sys/amd64/acpica/acpi_wakeup.c
==
--- head/sys/amd64/acpica/acpi_wakeup.c Mon Jun 14 19:54:19 2010
(r209173)
+++ head/sys/amd64/acpica/acpi_wakeup.c Mon Jun 14 20:08:26 2010
(r209174)
@@ -245,7 +245,7 @@ acpi_sleep_machdep(struct acpi_softc *sc
cr3 = rcr3();
load_cr3(KPML4phys);
 
-   stopfpu = stopxpcbs[0]-xpcb_pcb.pcb_save;
+   stopfpu = stopxpcbs[0]-xpcb_pcb.pcb_user_save;
if (acpi_savecpu(stopxpcbs[0])) {
fpugetregs(curthread, stopfpu);
 

Modified: head/sys/amd64/amd64/mp_machdep.c
==
--- head/sys/amd64/amd64/mp_machdep.c   Mon Jun 14 19:54:19 2010
(r209173)
+++ head/sys/amd64/amd64/mp_machdep.c   Mon Jun 14 20:08:26 2010
(r209174)
@@ -1247,7 +1247,7 @@ cpususpend_handler(void)
 
rf = intr_disable();
cr3 = rcr3();
-   stopfpu = stopxpcbs[cpu]-xpcb_pcb.pcb_save;
+   stopfpu = stopxpcbs[cpu]-xpcb_pcb.pcb_user_save;
if (savectx2(stopxpcbs[cpu])) {
fpugetregs(curthread, stopfpu);
wbinvd();
___
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: r209175 - head/sbin/hastd

2010-06-14 Thread Pawel Jakub Dawidek
Author: pjd
Date: Mon Jun 14 21:01:13 2010
New Revision: 209175
URL: http://svn.freebsd.org/changeset/base/209175

Log:
  Eliminate dead code.
  
  Found by: Coverity Prevent
  CID:  5158
  MFC after:3 days

Modified:
  head/sbin/hastd/hast_proto.c

Modified: head/sbin/hastd/hast_proto.c
==
--- head/sbin/hastd/hast_proto.cMon Jun 14 20:08:26 2010
(r209174)
+++ head/sbin/hastd/hast_proto.cMon Jun 14 21:01:13 2010
(r209175)
@@ -329,9 +329,7 @@ hast_proto_recv_hdr(struct proto_conn *c
*nvp = nv;
return (0);
 fail:
-   if (nv != NULL)
-   nv_free(nv);
-   else if (eb != NULL)
+   if (eb != NULL)
ebuf_free(eb);
return (-1);
 }
___
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: r209177 - head/sbin/hastd

2010-06-14 Thread Pawel Jakub Dawidek
Author: pjd
Date: Mon Jun 14 21:18:58 2010
New Revision: 209177
URL: http://svn.freebsd.org/changeset/base/209177

Log:
  Remove macros that are not really needed. The idea was to have them in case
  we grow more descriptors, but I'll reconsider readding them once we get there.
  
  Passing (a = b) expression to FD_ISSET() is bad idea, as FD_ISSET() evaluates
  its argument twice.
  
  Found by: Coverity Prevent
  CID:  5243
  MFC after:3 days

Modified:
  head/sbin/hastd/hastd.c

Modified: head/sbin/hastd/hastd.c
==
--- head/sbin/hastd/hastd.c Mon Jun 14 21:11:23 2010(r209176)
+++ head/sbin/hastd/hastd.c Mon Jun 14 21:18:58 2010(r209177)
@@ -400,7 +400,11 @@ static void
 main_loop(void)
 {
fd_set rfds, wfds;
-   int fd, maxfd, ret;
+   int cfd, lfd, maxfd, ret;
+
+   cfd = proto_descriptor(cfg-hc_controlconn);
+   lfd = proto_descriptor(cfg-hc_listenconn);
+   maxfd = cfd  lfd ? cfd : lfd;
 
for (;;) {
if (sigchld_received) {
@@ -412,22 +416,13 @@ main_loop(void)
hastd_reload();
}
 
-   maxfd = 0;
+   /* Setup descriptors for select(2). */
FD_ZERO(rfds);
+   FD_SET(cfd, rfds);
+   FD_SET(lfd, rfds);
FD_ZERO(wfds);
-
-   /* Setup descriptors for select(2). */
-#defineSETUP_FD(conn)  do {
\
-   fd = proto_descriptor(conn);\
-   if (fd = 0) {  \
-   maxfd = fd  maxfd ? fd : maxfd;\
-   FD_SET(fd, rfds);  \
-   FD_SET(fd, wfds);  \
-   }   \
-} while (0)
-   SETUP_FD(cfg-hc_controlconn);
-   SETUP_FD(cfg-hc_listenconn);
-#undef SETUP_FD
+   FD_SET(cfd, wfds);
+   FD_SET(lfd, wfds);
 
ret = select(maxfd + 1, rfds, wfds, NULL, NULL);
if (ret == -1) {
@@ -437,13 +432,10 @@ main_loop(void)
pjdlog_exit(EX_OSERR, select() failed);
}
 
-#defineISSET_FD(conn)  \
-   (FD_ISSET((fd = proto_descriptor(conn)), rfds) || FD_ISSET(fd, wfds))
-   if (ISSET_FD(cfg-hc_controlconn))
+   if (FD_ISSET(cfd, rfds) || FD_ISSET(cfd, wfds))
control_handle(cfg);
-   if (ISSET_FD(cfg-hc_listenconn))
+   if (FD_ISSET(lfd, rfds) || FD_ISSET(lfd, wfds))
listen_accept();
-#undef ISSET_FD
}
 }
 
___
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: r209178 - head/sys/netinet

2010-06-14 Thread Michael Tuexen
Author: tuexen
Date: Mon Jun 14 21:25:07 2010
New Revision: 209178
URL: http://svn.freebsd.org/changeset/base/209178

Log:
  * Fix a bug where the length of the ASCONF-ACK was calculated wrong due
to using an uninitialized variable.
  * Fix a bug where a NULL pointer was dereferenced when interfaces
come and go at a high rate.
  * Fix a bug where inps where not deregistered from iterators.
  * Fix a race condition in freeing an association.
  * Fix a refcount problem related to the iterator.
  Each of the above bug results in a panic. It shows up when
  interfaces come and go at a high rate.
  
  Obtained from: rrs (partly)
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_asconf.c
  head/sys/netinet/sctp_pcb.c

Modified: head/sys/netinet/sctp_asconf.c
==
--- head/sys/netinet/sctp_asconf.c  Mon Jun 14 21:18:58 2010
(r209177)
+++ head/sys/netinet/sctp_asconf.c  Mon Jun 14 21:25:07 2010
(r209178)
@@ -826,6 +826,7 @@ send_reply:
ack-serial_number = serial_num;
ack-last_sent_to = NULL;
ack-data = m_ack;
+   ack-len = 0;
n = m_ack;
while (n) {
ack-len += SCTP_BUF_LEN(n);
@@ -1025,7 +1026,8 @@ sctp_asconf_nets_cleanup(struct sctp_tcb
 * address.
 */
if (SCTP_ROUTE_HAS_VALID_IFN(net-ro) 
-   SCTP_GET_IF_INDEX_FROM_ROUTE(net-ro) != ifn-ifn_index) {
+   ((ifn == NULL) ||
+   (SCTP_GET_IF_INDEX_FROM_ROUTE(net-ro) != 
ifn-ifn_index))) {
/* clear any cached route */
RTFREE(net-ro.ro_rt);
net-ro.ro_rt = NULL;

Modified: head/sys/netinet/sctp_pcb.c
==
--- head/sys/netinet/sctp_pcb.c Mon Jun 14 21:18:58 2010(r209177)
+++ head/sys/netinet/sctp_pcb.c Mon Jun 14 21:25:07 2010(r209178)
@@ -3074,6 +3074,9 @@ sctp_iterator_inp_being_freed(struct sct
SCTP_FREE(it, SCTP_M_ITER);
} else {
it-inp = LIST_NEXT(it-inp, sctp_list);
+   if (it-inp) {
+   SCTP_INP_INCR_REF(it-inp);
+   }
}
/*
 * When its put in the refcnt is incremented so decr
@@ -3114,17 +3117,10 @@ sctp_inpcb_free(struct sctp_inpcb *inp, 
 #ifdef SCTP_LOG_CLOSING
sctp_log_closing(inp, NULL, 0);
 #endif
-   if (from == SCTP_CALLED_AFTER_CMPSET_OFCLOSE) {
-   /*
-* Once we are in we can remove the flag from = 1 is only
-* passed from the actual closing routines that are called
-* via the sockets layer.
-*/
-   SCTP_ITERATOR_LOCK();
-   /* mark any iterators on the list or being processed */
-   sctp_iterator_inp_being_freed(inp);
-   SCTP_ITERATOR_UNLOCK();
-   }
+   SCTP_ITERATOR_LOCK();
+   /* mark any iterators on the list or being processed */
+   sctp_iterator_inp_being_freed(inp);
+   SCTP_ITERATOR_UNLOCK();
so = inp-sctp_socket;
if (inp-sctp_flags  SCTP_PCB_FLAGS_SOCKET_ALLGONE) {
/* been here before.. eeks.. get out of here */
@@ -4637,7 +4633,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, 
atomic_add_int(stcb-asoc.refcnt, 1);
 
SCTP_TCB_UNLOCK(stcb);
-
SCTP_INP_INFO_WLOCK();
SCTP_INP_WLOCK(inp);
SCTP_TCB_LOCK(stcb);
@@ -4680,6 +4675,16 @@ sctp_free_assoc(struct sctp_inpcb *inp, 
if (from_inpcbfree == SCTP_NORMAL_PROC) {
atomic_add_int(stcb-asoc.refcnt, -1);
}
+   if (stcb-asoc.refcnt) {
+   stcb-asoc.state = ~SCTP_STATE_IN_ACCEPT_QUEUE;
+   sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL);
+   if (from_inpcbfree == SCTP_NORMAL_PROC) {
+   SCTP_INP_INFO_WUNLOCK();
+   SCTP_INP_WUNLOCK(inp);
+   }
+   SCTP_TCB_UNLOCK(stcb);
+   return (0);
+   }
asoc-state = 0;
if (inp-sctp_tcbhash) {
LIST_REMOVE(stcb, sctp_tcbhash);
___
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: r209179 - head/sbin/hastd

2010-06-14 Thread Pawel Jakub Dawidek
Author: pjd
Date: Mon Jun 14 21:25:20 2010
New Revision: 209179
URL: http://svn.freebsd.org/changeset/base/209179

Log:
  Plug memory leaks.
  
  Found by: Coverity Prevent
  CID:  7052, 7053, 7054, 7055
  MFC after:3 days

Modified:
  head/sbin/hastd/metadata.c

Modified: head/sbin/hastd/metadata.c
==
--- head/sbin/hastd/metadata.c  Mon Jun 14 21:25:07 2010(r209178)
+++ head/sbin/hastd/metadata.c  Mon Jun 14 21:25:20 2010(r209179)
@@ -96,6 +96,7 @@ metadata_read(struct hast_resource *res,
rerrno = errno;
pjdlog_errno(LOG_ERR,
Unable to allocate memory to read metadata);
+   ebuf_free(eb);
goto fail;
}
buf = ebuf_data(eb, NULL);
@@ -154,6 +155,7 @@ metadata_read(struct hast_resource *res,
nv_free(nv);
goto fail;
}
+   nv_free(nv);
return (0);
 fail:
if (opened_here) {
@@ -172,6 +174,7 @@ metadata_write(struct hast_resource *res
unsigned char *buf, *ptr;
size_t size;
ssize_t done;
+   int ret;
 
buf = calloc(1, METADATA_SIZE);
if (buf == NULL) {
@@ -180,6 +183,8 @@ metadata_write(struct hast_resource *res
return (-1);
}
 
+   ret = -1;
+
nv = nv_alloc();
nv_add_string(nv, res-hr_name, resource);
nv_add_uint64(nv, (uint64_t)res-hr_datasize, datasize);
@@ -199,7 +204,7 @@ metadata_write(struct hast_resource *res
nv_add_string(nv, role2str(res-hr_role), prevrole);
if (nv_error(nv) != 0) {
pjdlog_error(Unable to create metadata.);
-   goto fail;
+   goto end;
}
res-hr_previous_role = res-hr_role;
eb = nv_hton(nv);
@@ -211,12 +216,11 @@ metadata_write(struct hast_resource *res
done = pwrite(res-hr_localfd, buf, METADATA_SIZE, 0);
if (done  0 || done != METADATA_SIZE) {
pjdlog_errno(LOG_ERR, Unable to write metadata);
-   goto fail;
+   goto end;
}
-
-   return (0);
-fail:
+   ret = 0;
+end:
free(buf);
nv_free(nv);
-   return (-1);
+   return (ret);
 }
___
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: r209180 - head/sbin/hastd

2010-06-14 Thread Pawel Jakub Dawidek
Author: pjd
Date: Mon Jun 14 21:33:18 2010
New Revision: 209180
URL: http://svn.freebsd.org/changeset/base/209180

Log:
  Plug memory leak.
  
  Found by: Coverity Prevent
  CID:  7051
  MFC after:3 days

Modified:
  head/sbin/hastd/nv.c

Modified: head/sbin/hastd/nv.c
==
--- head/sbin/hastd/nv.cMon Jun 14 21:25:20 2010(r209179)
+++ head/sbin/hastd/nv.cMon Jun 14 21:33:18 2010(r209180)
@@ -707,8 +707,10 @@ nv_add(struct nv *nv, const unsigned cha
assert(errno != 0);
if (nv-nv_error == 0)
nv-nv_error = errno;
+   free(nvh);
return;
}
+   free(nvh);
/* Add the actual data. */
if (ebuf_add_tail(nv-nv_ebuf, value, vsize)  0) {
assert(errno != 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: r209181 - head/sbin/hastd

2010-06-14 Thread Pawel Jakub Dawidek
Author: pjd
Date: Mon Jun 14 21:37:25 2010
New Revision: 209181
URL: http://svn.freebsd.org/changeset/base/209181

Log:
  Plug memory leak.
  
  Found by: Coverity Prevent
  CID:  7056
  MFC after:3 days

Modified:
  head/sbin/hastd/primary.c

Modified: head/sbin/hastd/primary.c
==
--- head/sbin/hastd/primary.c   Mon Jun 14 21:33:18 2010(r209180)
+++ head/sbin/hastd/primary.c   Mon Jun 14 21:37:25 2010(r209181)
@@ -447,6 +447,7 @@ init_local(struct hast_resource *res)
primary_exit(EX_NOINPUT, Unable to read activemap);
}
activemap_copyin(res-hr_amp, buf, mapsize);
+   free(buf);
if (res-hr_resuid != 0)
return;
/*
___
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: r209182 - head/sbin/hastd

2010-06-14 Thread Pawel Jakub Dawidek
Author: pjd
Date: Mon Jun 14 21:41:22 2010
New Revision: 209182
URL: http://svn.freebsd.org/changeset/base/209182

Log:
  Plug memory leak.
  
  Found by: Coverity Prevent
  CID:  7057
  MFC after:3 days

Modified:
  head/sbin/hastd/secondary.c

Modified: head/sbin/hastd/secondary.c
==
--- head/sbin/hastd/secondary.c Mon Jun 14 21:37:25 2010(r209181)
+++ head/sbin/hastd/secondary.c Mon Jun 14 21:41:22 2010(r209182)
@@ -295,6 +295,7 @@ init_remote(struct hast_resource *res, s
nv_free(nvout);
exit(EX_TEMPFAIL);
}
+   nv_free(nvout);
if (res-hr_secondary_localcnt  res-hr_primary_remotecnt 
 res-hr_primary_localcnt  res-hr_secondary_remotecnt) {
/* Exit on split-brain. */
___
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: r209183 - head/sbin/hastd

2010-06-14 Thread Pawel Jakub Dawidek
Author: pjd
Date: Mon Jun 14 21:44:20 2010
New Revision: 209183
URL: http://svn.freebsd.org/changeset/base/209183

Log:
  Initialize gctl_seq for synchronization requests.
  
  Reported by:  hiro...@soupacific.com
  Analysed by:  Mikolaj Golub to.my.troc...@gmail.com
  Tested by:hiro...@soupacific.com, Mikolaj Golub to.my.troc...@gmail.com
  MFC after:3 days

Modified:
  head/sbin/hastd/primary.c

Modified: head/sbin/hastd/primary.c
==
--- head/sbin/hastd/primary.c   Mon Jun 14 21:41:22 2010(r209182)
+++ head/sbin/hastd/primary.c   Mon Jun 14 21:44:20 2010(r209183)
@@ -195,7 +195,10 @@ static pthread_mutex_t metadata_lock;
mtx_unlock(hio_##name##_list_lock);\
 } while (0)
 
-#defineSYNCREQ(hio)do { (hio)-hio_ggio.gctl_unit = -1; } 
while (0)
+#defineSYNCREQ(hio)do {
\
+   (hio)-hio_ggio.gctl_unit = -1; \
+   (hio)-hio_ggio.gctl_seq = 1;   \
+} while (0)
 #defineISSYNCREQ(hio)  ((hio)-hio_ggio.gctl_unit == -1)
 #defineSYNCREQDONE(hio)do { (hio)-hio_ggio.gctl_unit = -2; } 
while (0)
 #defineISSYNCREQDONE(hio)  ((hio)-hio_ggio.gctl_unit == -2)
___
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: r209184 - head/sbin/hastd

2010-06-14 Thread Pawel Jakub Dawidek
Author: pjd
Date: Mon Jun 14 21:44:58 2010
New Revision: 209184
URL: http://svn.freebsd.org/changeset/base/209184

Log:
  Fix typos.
  
  MFC after:3 days

Modified:
  head/sbin/hastd/ebuf.c

Modified: head/sbin/hastd/ebuf.c
==
--- head/sbin/hastd/ebuf.c  Mon Jun 14 21:44:20 2010(r209183)
+++ head/sbin/hastd/ebuf.c  Mon Jun 14 21:44:58 2010(r209184)
@@ -55,8 +55,8 @@ struct ebuf {
size_t   eb_size;
 };
 
-static int ebuf_head_extent(struct ebuf *eb, size_t size);
-static int ebuf_tail_extent(struct ebuf *eb, size_t size);
+static int ebuf_head_extend(struct ebuf *eb, size_t size);
+static int ebuf_tail_extend(struct ebuf *eb, size_t size);
 
 struct ebuf *
 ebuf_alloc(size_t size)
@@ -110,7 +110,7 @@ ebuf_add_head(struct ebuf *eb, const voi
 * We can't add more entries at the front, so we have to extend
 * our buffer.
 */
-   if (ebuf_head_extent(eb, size)  0)
+   if (ebuf_head_extend(eb, size)  0)
return (-1);
}
assert(size = (size_t)(eb-eb_used - eb-eb_start));
@@ -137,13 +137,13 @@ ebuf_add_tail(struct ebuf *eb, const voi
 * We can't add more entries at the back, so we have to extend
 * our buffer.
 */
-   if (ebuf_tail_extent(eb, size)  0)
+   if (ebuf_tail_extend(eb, size)  0)
return (-1);
}
assert(size = (size_t)(eb-eb_end - (eb-eb_used + eb-eb_size)));
 
/*
-* If data is NULL the caller just wants to reserve place.
+* If data is NULL the caller just wants to reserve space.
 */
if (data != NULL)
bcopy(data, eb-eb_used + eb-eb_size, size);
@@ -203,7 +203,7 @@ ebuf_size(struct ebuf *eb)
  * Function adds size + (PAGE_SIZE / 4) bytes at the front of the buffer..
  */
 static int
-ebuf_head_extent(struct ebuf *eb, size_t size)
+ebuf_head_extend(struct ebuf *eb, size_t size)
 {
unsigned char *newstart, *newused;
size_t newsize;
@@ -231,7 +231,7 @@ ebuf_head_extent(struct ebuf *eb, size_t
  * Function adds size + ((3 * PAGE_SIZE) / 4) bytes at the back.
  */
 static int
-ebuf_tail_extent(struct ebuf *eb, size_t size)
+ebuf_tail_extend(struct ebuf *eb, size_t size)
 {
unsigned char *newstart;
size_t newsize;
___
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: r209185 - head/sbin/hastd

2010-06-14 Thread Pawel Jakub Dawidek
Author: pjd
Date: Mon Jun 14 21:46:48 2010
New Revision: 209185
URL: http://svn.freebsd.org/changeset/base/209185

Log:
  Correct various log messages.
  
  Submitted by: Mikolaj Golub to.my.troc...@gmail.com
  MFC after:3 days

Modified:
  head/sbin/hastd/hastd.c
  head/sbin/hastd/secondary.c

Modified: head/sbin/hastd/hastd.c
==
--- head/sbin/hastd/hastd.c Mon Jun 14 21:44:58 2010(r209184)
+++ head/sbin/hastd/hastd.c Mon Jun 14 21:46:48 2010(r209185)
@@ -200,7 +200,7 @@ listen_accept(void)
 
proto_local_address(conn, laddr, sizeof(laddr));
proto_remote_address(conn, raddr, sizeof(raddr));
-   pjdlog_info(Connection from %s to %s., laddr, raddr);
+   pjdlog_info(Connection from %s to %s., raddr, laddr);
 
/* Error in setting timeout is not critical, but why should it fail? */
if (proto_timeout(conn, HAST_TIMEOUT)  0)
@@ -286,7 +286,7 @@ listen_accept(void)
if (token != NULL  memcmp(token, res-hr_token,
sizeof(res-hr_token)) != 0) {
pjdlog_error(Token received from %s doesn't match., raddr);
-   nv_add_stringf(nverr, errmsg, Toke doesn't match.);
+   nv_add_stringf(nverr, errmsg, Token doesn't match.);
goto fail;
}
/*

Modified: head/sbin/hastd/secondary.c
==
--- head/sbin/hastd/secondary.c Mon Jun 14 21:44:58 2010(r209184)
+++ head/sbin/hastd/secondary.c Mon Jun 14 21:46:48 2010(r209185)
@@ -688,7 +688,7 @@ send_thread(void *arg)
pjdlog_exit(EX_TEMPFAIL, Unable to send reply.);
}
nv_free(nvout);
-   pjdlog_debug(2, disk: (%p) Moving request to the free queue.,
+   pjdlog_debug(2, send: (%p) Moving request to the free queue.,
hio);
nv_free(hio-hio_nv);
hio-hio_error = 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: r209186 - head/sys/geom/gate

2010-06-14 Thread Pawel Jakub Dawidek
Author: pjd
Date: Mon Jun 14 21:56:24 2010
New Revision: 209186
URL: http://svn.freebsd.org/changeset/base/209186

Log:
  BIO_DELETE contains range we want to delete and doesn't provide any useful
  data, so there is no need to copy it to userland.
  
  MFC after:3 days

Modified:
  head/sys/geom/gate/g_gate.c

Modified: head/sys/geom/gate/g_gate.c
==
--- head/sys/geom/gate/g_gate.c Mon Jun 14 21:46:48 2010(r209185)
+++ head/sys/geom/gate/g_gate.c Mon Jun 14 21:56:24 2010(r209186)
@@ -572,8 +572,8 @@ g_gate_ioctl(struct cdev *dev, u_long cm
 
switch (bp-bio_cmd) {
case BIO_READ:
-   break;
case BIO_DELETE:
+   break;
case BIO_WRITE:
error = copyout(bp-bio_data, ggio-gctl_data,
bp-bio_length);
___
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: r209187 - head/sys/geom/gate

2010-06-14 Thread Pawel Jakub Dawidek
Author: pjd
Date: Mon Jun 14 21:58:55 2010
New Revision: 209187
URL: http://svn.freebsd.org/changeset/base/209187

Log:
  'unit' can be negative, so use signed type for it.
  
  Found by: Coverity Prevent
  CID:  3731
  MFC after:3 days

Modified:
  head/sys/geom/gate/g_gate.c

Modified: head/sys/geom/gate/g_gate.c
==
--- head/sys/geom/gate/g_gate.c Mon Jun 14 21:56:24 2010(r209186)
+++ head/sys/geom/gate/g_gate.c Mon Jun 14 21:58:55 2010(r209187)
@@ -210,7 +210,7 @@ g_gate_start(struct bio *bp)
 }
 
 static struct g_gate_softc *
-g_gate_hold(u_int unit, const char *name)
+g_gate_hold(int unit, const char *name)
 {
struct g_gate_softc *sc = NULL;
 
___
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: r209188 - head/sys/cam/scsi

2010-06-14 Thread Kenneth D. Merry
Author: ken
Date: Mon Jun 14 22:02:18 2010
New Revision: 209188
URL: http://svn.freebsd.org/changeset/base/209188

Log:
  For the target port groups structures, don't allocate the initial element.
  This makes things easier for target implementations to calculate how many
  elements they need to allocate.
  
  Discussed with:   mjacob, gibbs
  MFC after:1 week

Modified:
  head/sys/cam/scsi/scsi_all.h

Modified: head/sys/cam/scsi/scsi_all.h
==
--- head/sys/cam/scsi/scsi_all.hMon Jun 14 21:58:55 2010
(r209187)
+++ head/sys/cam/scsi/scsi_all.hMon Jun 14 22:02:18 2010
(r209188)
@@ -902,6 +902,7 @@ struct scsi_target_group
 struct scsi_target_port_descriptor {
uint8_t reserved[2];
uint8_t relative_target_port_identifier[2];
+   uint8_t desc_list[];
 };
 
 struct scsi_target_port_group_descriptor {
@@ -928,12 +929,12 @@ struct scsi_target_port_group_descriptor
uint8_t status;
uint8_t vendor_specific;
uint8_t target_port_count;
-   struct scsi_target_port_descriptor descriptors[1];
+   struct scsi_target_port_descriptor descriptors[];
 };
 
 struct scsi_target_group_data {
uint8_t length[4];  /* length of returned data, in bytes */
-   struct scsi_target_port_group_descriptor groups[1];
+   struct scsi_target_port_group_descriptor groups[];
 };
 
 struct scsi_target_group_data_extended {
@@ -941,7 +942,7 @@ struct scsi_target_group_data_extended {
uint8_t format_type;/* STG_PDF_LENGTH or RPL_PDF_EXTENDED */
uint8_t implicit_transition_time;
uint8_t reserved[2];
-   struct scsi_target_port_group_descriptor groups[1];
+   struct scsi_target_port_group_descriptor groups[];
 };
 
 
___
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: r209189 - head/sys/dev/usb/wlan

2010-06-14 Thread Jung-uk Kim
Author: jkim
Date: Mon Jun 14 23:01:50 2010
New Revision: 209189
URL: http://svn.freebsd.org/changeset/base/209189

Log:
  Fix typos that broke duration calculations on protection frames.  A similar
  fix was done for ral(4) long ago and it must be copy-and-paste bugs.
  
  Found by: clang

Modified:
  head/sys/dev/usb/wlan/if_rum.c
  head/sys/dev/usb/wlan/if_run.c
  head/sys/dev/usb/wlan/if_ural.c

Modified: head/sys/dev/usb/wlan/if_rum.c
==
--- head/sys/dev/usb/wlan/if_rum.c  Mon Jun 14 22:02:18 2010
(r209188)
+++ head/sys/dev/usb/wlan/if_rum.c  Mon Jun 14 23:01:50 2010
(r209189)
@@ -1051,7 +1051,7 @@ rum_sendprot(struct rum_softc *sc,
ackrate = ieee80211_ack_rate(ic-ic_rt, rate);
 
isshort = (ic-ic_flags  IEEE80211_F_SHPREAMBLE) != 0;
-   dur = ieee80211_compute_duration(ic-ic_rt, pktlen, rate, isshort);
+   dur = ieee80211_compute_duration(ic-ic_rt, pktlen, rate, isshort)
+ ieee80211_ack_duration(ic-ic_rt, rate, isshort);
flags = RT2573_TX_MORE_FRAG;
if (prot == IEEE80211_PROT_RTSCTS) {

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Mon Jun 14 22:02:18 2010
(r209188)
+++ head/sys/dev/usb/wlan/if_run.c  Mon Jun 14 23:01:50 2010
(r209189)
@@ -3179,7 +3179,7 @@ run_sendprot(struct run_softc *sc,
ackrate = ieee80211_ack_rate(ic-ic_rt, rate);
 
isshort = (ic-ic_flags  IEEE80211_F_SHPREAMBLE) != 0;
-   dur = ieee80211_compute_duration(ic-ic_rt, pktlen, rate, isshort);
+   dur = ieee80211_compute_duration(ic-ic_rt, pktlen, rate, isshort)
+ ieee80211_ack_duration(ic-ic_rt, rate, isshort);
wflags = RT2860_TX_FRAG;
 

Modified: head/sys/dev/usb/wlan/if_ural.c
==
--- head/sys/dev/usb/wlan/if_ural.c Mon Jun 14 22:02:18 2010
(r209188)
+++ head/sys/dev/usb/wlan/if_ural.c Mon Jun 14 23:01:50 2010
(r209189)
@@ -1157,7 +1157,7 @@ ural_sendprot(struct ural_softc *sc,
ackrate = ieee80211_ack_rate(ic-ic_rt, rate);
 
isshort = (ic-ic_flags  IEEE80211_F_SHPREAMBLE) != 0;
-   dur = ieee80211_compute_duration(ic-ic_rt, pktlen, rate, isshort);
+   dur = ieee80211_compute_duration(ic-ic_rt, pktlen, rate, isshort)
+ ieee80211_ack_duration(ic-ic_rt, rate, isshort);
flags = RAL_TX_RETRY(7);
if (prot == IEEE80211_PROT_RTSCTS) {
___
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: r209190 - head/usr.sbin/tzsetup

2010-06-14 Thread Ed Maste
Author: emaste
Date: Mon Jun 14 23:51:35 2010
New Revision: 209190
URL: http://svn.freebsd.org/changeset/base/209190

Log:
  Use literal format strings.  Found by clang.

Modified:
  head/usr.sbin/tzsetup/tzsetup.c

Modified: head/usr.sbin/tzsetup/tzsetup.c
==
--- head/usr.sbin/tzsetup/tzsetup.c Mon Jun 14 23:01:50 2010
(r209189)
+++ head/usr.sbin/tzsetup/tzsetup.c Mon Jun 14 23:51:35 2010
(r209190)
@@ -204,7 +204,7 @@ read_iso3166_table(void)
 
fp = fopen(path_iso3166, r);
if (!fp)
-   err(1, path_iso3166);
+   err(1, %s, path_iso3166);
lineno = 0;
 
while ((s = fgetln(fp, len)) != 0) {
@@ -343,7 +343,7 @@ read_zones(void)
 
fp = fopen(path_zonetab, r);
if (!fp)
-   err(1, path_zonetab);
+   err(1, %s, path_zonetab);
lineno = 0;
 
while ((line = fgetln(fp, len)) != 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: r209191 - in head/sys/fs: nfsclient nfsserver

2010-06-14 Thread Rick Macklem
Author: rmacklem
Date: Tue Jun 15 00:25:04 2010
New Revision: 209191
URL: http://svn.freebsd.org/changeset/base/209191

Log:
  Add MODULE_DEPEND() macros to the experimental NFS client and
  server so that the modules will load when kernels are built with
  none of the NFS* configuration options specified. I believe this
  resolves the problems reported by PR kern/144458 and the email on
  freebsd-stable@ posted by Dmitry Pryanishnikov on June 13.
  
  Tested by:kib
  PR:   kern/144458
  Reviewed by:  kib
  MFC after:1 week

Modified:
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsclient/nfs_clport.c
==
--- head/sys/fs/nfsclient/nfs_clport.c  Mon Jun 14 23:51:35 2010
(r209190)
+++ head/sys/fs/nfsclient/nfs_clport.c  Tue Jun 15 00:25:04 2010
(r209191)
@@ -1275,4 +1275,6 @@ DECLARE_MODULE(nfscl, nfscl_mod, SI_SUB_
 /* So that loader and kldload(2) can find us, wherever we are.. */
 MODULE_VERSION(nfscl, 1);
 MODULE_DEPEND(nfscl, nfscommon, 1, 1, 1);
+MODULE_DEPEND(nfscl, krpc, 1, 1, 1);
+MODULE_DEPEND(nfscl, nfssvc, 1, 1, 1);
 

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cMon Jun 14 23:51:35 2010
(r209190)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cTue Jun 15 00:25:04 2010
(r209191)
@@ -3147,4 +3147,6 @@ DECLARE_MODULE(nfsd, nfsd_mod, SI_SUB_VF
 MODULE_VERSION(nfsd, 1);
 MODULE_DEPEND(nfsd, nfscommon, 1, 1, 1);
 MODULE_DEPEND(nfsd, nfslockd, 1, 1, 1);
+MODULE_DEPEND(nfsd, krpc, 1, 1, 1);
+MODULE_DEPEND(nfsd, nfssvc, 1, 1, 1);
 
___
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: r209192 - head/usr.bin/wtmpcvt

2010-06-14 Thread Ed Schouten
Author: ed
Date: Tue Jun 15 04:47:16 2010
New Revision: 209192
URL: http://svn.freebsd.org/changeset/base/209192

Log:
  err() takes a printf format.
  
  Submitted by: Pawel Worach
  Spotted by:   clang

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

Modified: head/usr.bin/wtmpcvt/wtmpcvt.c
==
--- head/usr.bin/wtmpcvt/wtmpcvt.c  Tue Jun 15 00:25:04 2010
(r209191)
+++ head/usr.bin/wtmpcvt/wtmpcvt.c  Tue Jun 15 04:47:16 2010
(r209192)
@@ -113,10 +113,10 @@ main(int argc, char *argv[])
/* Open files. */
in = fopen(argv[1], r);
if (in == NULL)
-   err(1, argv[1]);
+   err(1, %s, argv[1]);
out = fopen(argv[2], w);
if (out == NULL)
-   err(1, argv[2]);
+   err(1, %s, argv[2]);
 
/* Process entries. */
while (fread(ui, sizeof ui, 1, in) == 1) {
___
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