svn commit: r184590 - in stable/7/sys: . kern ufs/ffs

2008-11-03 Thread Konstantin Belousov
Author: kib
Date: Mon Nov  3 14:08:08 2008
New Revision: 184590
URL: http://svn.freebsd.org/changeset/base/184590

Log:
  MFC r184074:
  Assert that v_holdcnt is non-zero before entering lockmgr in vn_lock and
  ffs_lock. This cannot catch situations where holdcnt is incremented not
  by curthread, but I think it is useful.
  
  Approved by:  re (kensmith)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/kern/vfs_vnops.c
  stable/7/sys/ufs/ffs/ffs_vnops.c

Modified: stable/7/sys/kern/vfs_vnops.c
==
--- stable/7/sys/kern/vfs_vnops.c   Mon Nov  3 10:39:35 2008
(r184589)
+++ stable/7/sys/kern/vfs_vnops.c   Mon Nov  3 14:08:08 2008
(r184590)
@@ -800,6 +800,10 @@ _vn_lock(struct vnode *vp, int flags, st
do {
if ((flags  LK_INTERLOCK) == 0)
VI_LOCK(vp);
+#ifdef DEBUG_VFS_LOCKS
+   KASSERT(vp-v_holdcnt != 0,
+   (vn_lock %p: zero hold count, vp));
+#endif
if ((flags  LK_NOWAIT || (flags  LK_TYPE_MASK) == 0) 
vp-v_iflag  VI_DOOMED) {
VI_UNLOCK(vp);

Modified: stable/7/sys/ufs/ffs/ffs_vnops.c
==
--- stable/7/sys/ufs/ffs/ffs_vnops.cMon Nov  3 10:39:35 2008
(r184589)
+++ stable/7/sys/ufs/ffs/ffs_vnops.cMon Nov  3 14:08:08 2008
(r184590)
@@ -369,6 +369,10 @@ ffs_lock(ap)
VI_LOCK(vp);
flags |= LK_INTERLOCK;
}
+#ifdef DEBUG_VFS_LOCKS
+   KASSERT(vp-v_holdcnt != 0,
+   (ffs_lock %p: zero hold count, vp));
+#endif
lkp = vp-v_vnlock;
result = _lockmgr(lkp, flags, VI_MTX(vp), ap-a_td, 
ap-a_file, ap-a_line);
if (lkp == vp-v_vnlock || result != 0)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


svn commit: r184592 - head/sys/netsmb

2008-11-03 Thread Robert Watson
Author: rwatson
Date: Mon Nov  3 14:23:15 2008
New Revision: 184592
URL: http://svn.freebsd.org/changeset/base/184592

Log:
  Implement device cloning for /dev/nsmb, the netsmb control pseudo-device.
  The smb library in userspace already knows how to deal with this type of
  cloning.
  
  This also corrects a leak in which the netsmb kernel module could not be
  unloaded if device nodes had been stat'd but not open'd.
  
  Discussed with:   kib

Modified:
  head/sys/netsmb/smb_dev.c

Modified: head/sys/netsmb/smb_dev.c
==
--- head/sys/netsmb/smb_dev.c   Mon Nov  3 14:11:06 2008(r184591)
+++ head/sys/netsmb/smb_dev.c   Mon Nov  3 14:23:15 2008(r184592)
@@ -89,28 +89,38 @@ int smb_dev_queue(struct smb_dev *ndp, s
 
 static struct cdevsw nsmb_cdevsw = {
.d_version =D_VERSION,
-   .d_flags =  D_NEEDGIANT,
+   .d_flags =  D_NEEDGIANT | D_NEEDMINOR,
.d_open =   nsmb_dev_open,
.d_close =  nsmb_dev_close,
.d_ioctl =  nsmb_dev_ioctl,
.d_name =   NSMB_NAME
 };
 
-static eventhandler_tag nsmb_dev_tag;
+static eventhandler_tag nsmb_dev_tag;
+static struct clonedevs*nsmb_clones;
 
 static void
 nsmb_dev_clone(void *arg, struct ucred *cred, char *name, int namelen,
 struct cdev **dev)
 {
-   int u;
+   int i, u;
 
if (*dev != NULL)
return;
-   if (dev_stdclone(name, NULL, NSMB_NAME, u) != 1)
+
+   if (strcmp(name, NSMB_NAME) == 0)
+   u = -1;
+   else if (dev_stdclone(name, NULL, NSMB_NAME, u) != 1)
return;
-   *dev = make_dev(nsmb_cdevsw, u, 0, 0, 0600,
-   NSMB_NAME%d, u);
-   dev_ref(*dev);
+   i = clone_create(nsmb_clones, nsmb_cdevsw, u, dev, 0);
+   if (i) {
+   *dev = make_dev(nsmb_cdevsw, u, UID_ROOT, GID_WHEEL, 0600,
+   %s%d, NSMB_NAME, u);
+   if (*dev != NULL) {
+   dev_ref(*dev);
+   (*dev)-si_flags |= SI_CHEAPCLONE;
+   }
+   }
 }
 
 static int
@@ -340,6 +350,7 @@ nsmb_dev_load(module_t mod, int cmd, voi
smb_sm_done();
break;
}
+   clone_setup(nsmb_clones);
nsmb_dev_tag = EVENTHANDLER_REGISTER(dev_clone, nsmb_dev_clone, 
0, 1000);
printf(netsmb_dev: loaded\n);
break;
@@ -350,6 +361,7 @@ nsmb_dev_load(module_t mod, int cmd, voi
break;
EVENTHANDLER_DEREGISTER(dev_clone, nsmb_dev_tag);
drain_dev_clone_events();
+   clone_cleanup(nsmb_clones);
destroy_dev_drain(nsmb_cdevsw);
printf(netsmb_dev: unloaded\n);
break;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


svn commit: r184593 - in stable/7/sys: . ufs/ufs

2008-11-03 Thread Konstantin Belousov
Author: kib
Date: Mon Nov  3 14:35:43 2008
New Revision: 184593
URL: http://svn.freebsd.org/changeset/base/184593

Log:
  MFC r184408:
  Provide an explanation for getinoquota() call in the ufs_access vop.
  
  Approved by:  re (kensmith)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/ufs/ufs/ufs_vnops.c

Modified: stable/7/sys/ufs/ufs/ufs_vnops.c
==
--- stable/7/sys/ufs/ufs/ufs_vnops.cMon Nov  3 14:23:15 2008
(r184592)
+++ stable/7/sys/ufs/ufs/ufs_vnops.cMon Nov  3 14:35:43 2008
(r184593)
@@ -330,7 +330,18 @@ ufs_access(ap)
if (vp-v_mount-mnt_flag  MNT_RDONLY)
return (EROFS);
 #ifdef QUOTA
+   /*
+* Inode is accounted in the quotas only if struct
+* dquot is attached to it. VOP_ACCESS() is called
+* from vn_open_cred() and provides a convenient
+* point to call getinoquota().
+*/
if (VOP_ISLOCKED(vp, ap-a_td) != LK_EXCLUSIVE) {
+
+   /*
+* Upgrade vnode lock, since getinoquota()
+* requires exclusive lock to modify inode.
+*/
relocked = 1;
vhold(vp);
vn_lock(vp, LK_UPGRADE | LK_RETRY, ap-a_td);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: svn commit: r184558 - head/sys/dev/acpica/Osd

2008-11-03 Thread Jung-uk Kim
On Sunday 02 November 2008 07:50 am, Alexander Motin wrote:
 Author: mav
 Date: Sun Nov  2 12:50:16 2008
 New Revision: 184558
 URL: http://svn.freebsd.org/changeset/base/184558

 Log:
   As soon as we have several threads per process now, it is not
 correct to use process ID as ACPI thread ID. Concurrent requests
 with equal thread IDs broke ACPI mutexes operation causing
 unpredictable errors including AE_AML_MUTEX_NOT_ACQUIRED that I
 have seen.

   Use kernel thread ID instead of process ID for ACPI thread.

Sorry but this patch is incorrect, i.e., td_tid is not unique.  You 
have to use curthread or (p_pid, td_tid) pair.  Unfortunately, even 
if you correct this problem, you also have to correct ACPI_THREAD_ID 
definition, which is in the vendor code.  That's why it wasn't done 
yet and it is more complicated than you think, i.e., ACPI-CA assumes 
sizeof(ACPI_THREAD_ID) == sizeof(int), etc.  Please see the related 
ACPI-CA bugs:

http://www.acpica.org/bugzilla/show_bug.cgi?id=719
http://www.acpica.org/bugzilla/show_bug.cgi?id=732

In fact, I have been maintaining patchsets with the fix here:

http://people.freebsd.org/~jkim/acpica-import-ACPI_RELEASE.diff.gz

Please revert this commit until we resolve these issues with the 
vendor first.

Thanks!

Jung-uk Kim
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


svn commit: r184586 - head/lib/libc/string

2008-11-03 Thread Konstantin Belousov
Author: kib
Date: Mon Nov  3 10:14:47 2008
New Revision: 184586
URL: http://svn.freebsd.org/changeset/base/184586

Log:
  Fix style.

Modified:
  head/lib/libc/string/ffsl.c

Modified: head/lib/libc/string/ffsl.c
==
--- head/lib/libc/string/ffsl.c Mon Nov  3 07:52:18 2008(r184585)
+++ head/lib/libc/string/ffsl.c Mon Nov  3 10:14:47 2008(r184586)
@@ -41,7 +41,7 @@ ffsl(long mask)
int bit;
 
if (mask == 0)
-   return(0);
+   return (0);
for (bit = 1; !(mask  1); bit++)
mask = (unsigned long)mask  1;
return (bit);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


svn commit: r184595 - head/sys/fs/coda

2008-11-03 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Nov  3 16:36:23 2008
New Revision: 184595
URL: http://svn.freebsd.org/changeset/base/184595

Log:
  Fix few missed accmode changes in coda.
  
  Approved by:  rwatson (mentor)

Modified:
  head/sys/fs/coda/cnode.h
  head/sys/fs/coda/coda_subr.c
  head/sys/fs/coda/coda_venus.c

Modified: head/sys/fs/coda/cnode.h
==
--- head/sys/fs/coda/cnode.hMon Nov  3 15:38:45 2008(r184594)
+++ head/sys/fs/coda/cnode.hMon Nov  3 16:36:23 2008(r184595)
@@ -102,7 +102,7 @@ struct cnode {
char*c_symlink; /* pointer to symbolic link */
u_short  c_symlen;  /* length of symbolic link */
uid_tc_cached_uid;  /* cached uid */
-   mode_t   c_cached_mode; /* cached access mode */
+   accmode_tc_cached_mode; /* cached access mode */
struct cnode*c_next;/* links if on FreeBSD machine */
 };
 #defineVTOC(vp)((struct cnode *)(vp)-v_data)

Modified: head/sys/fs/coda/coda_subr.c
==
--- head/sys/fs/coda/coda_subr.cMon Nov  3 15:38:45 2008
(r184594)
+++ head/sys/fs/coda/coda_subr.cMon Nov  3 16:36:23 2008
(r184595)
@@ -195,7 +195,7 @@ coda_acccache_purge(struct mount *mnt)
CODADEBUG(CODA_FLUSH, myprintf((acccache 
purge fid %s uid %d mode 0x%x\n,
coda_f2s(cp-c_fid), cp-c_cached_uid,
-   cp-c_cached_mode)););
+   (int)cp-c_cached_mode)););
cp-c_flags = ~C_ACCCACHE;
}
}
@@ -223,7 +223,7 @@ coda_acccache_purgeuser(struct mount *mn
CODADEBUG(CODA_PURGEUSER, myprintf((
acccache purgeuser fid %s uid %d mode 
0x%x\n, coda_f2s(cp-c_fid),
-   cp-c_cached_uid, cp-c_cached_mode)););
+   cp-c_cached_uid, 
(int)cp-c_cached_mode)););
cp-c_flags = ~C_ACCCACHE;
}
}

Modified: head/sys/fs/coda/coda_venus.c
==
--- head/sys/fs/coda/coda_venus.c   Mon Nov  3 15:38:45 2008
(r184594)
+++ head/sys/fs/coda/coda_venus.c   Mon Nov  3 16:36:23 2008
(r184595)
@@ -347,7 +347,7 @@ venus_setattr(void *mdp, CodaFid *fid, s
 }
 
 int
-venus_access(void *mdp, CodaFid *fid, int mode, struct ucred *cred,
+venus_access(void *mdp, CodaFid *fid, accmode_t accmode, struct ucred *cred,
 struct proc *p)
 {
DECL_NO_OUT(coda_access);   /* sets Isize  Osize */
@@ -362,8 +362,10 @@ venus_access(void *mdp, CodaFid *fid, in
/*
 * NOTE: FreeBSD and Venus internals use the data in the low 3
 * bits.  Hence, the conversion.
+*
+* XXX: We cast accmode_t variable into an int.
 */
-   inp-flags = mode6;
+   inp-flags = (int)accmode6;
 
error = coda_call(mdp, Isize, Osize, (char *)inp);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


svn commit: r184587 - in head: include lib/libc/string

2008-11-03 Thread Konstantin Belousov
Author: kib
Date: Mon Nov  3 10:22:19 2008
New Revision: 184587
URL: http://svn.freebsd.org/changeset/base/184587

Log:
  Add the ffsll and flsll functions. These are ffs and fls operating
  on long long arguments.
  
  Reviewed by:  bde (previous version, that included asm implementation
for all ffs and fls functions on i386 and amd64)
  MFC after:2 weeks

Added:
  head/lib/libc/string/ffsll.c   (contents, props changed)
 - copied, changed from r184585, head/lib/libc/string/ffs.c
  head/lib/libc/string/flsll.c   (contents, props changed)
 - copied, changed from r184585, head/lib/libc/string/fls.c
Modified:
  head/include/strings.h
  head/lib/libc/string/Makefile.inc
  head/lib/libc/string/Symbol.map
  head/lib/libc/string/ffs.3

Modified: head/include/strings.h
==
--- head/include/strings.h  Mon Nov  3 10:14:47 2008(r184586)
+++ head/include/strings.h  Mon Nov  3 10:22:19 2008(r184587)
@@ -44,8 +44,10 @@ void  bzero(void *, size_t); 
/* LEGA
 int ffs(int) __pure2;
 #ifdef __BSD_VISIBLE
 int ffsl(long) __pure2;
+int ffsll(long long) __pure2;
 int fls(int) __pure2;
 int flsl(long) __pure2;
+int flsll(long long) __pure2;
 #endif
 char   *index(const char *, int) __pure;   /* LEGACY */
 char   *rindex(const char *, int) __pure;  /* LEGACY */

Modified: head/lib/libc/string/Makefile.inc
==
--- head/lib/libc/string/Makefile.inc   Mon Nov  3 10:14:47 2008
(r184586)
+++ head/lib/libc/string/Makefile.inc   Mon Nov  3 10:22:19 2008
(r184587)
@@ -6,8 +6,8 @@
 CFLAGS+= -I${.CURDIR}/locale
 
 # machine-independent string sources
-MISRCS+=bcmp.c bcopy.c bzero.c ffs.c ffsl.c fls.c flsl.c index.c memccpy.c \
-   memchr.c memrchr.c memcmp.c \
+MISRCS+=bcmp.c bcopy.c bzero.c ffs.c ffsl.c ffsll.c fls.c flsl.c flsll.c \
+   index.c memccpy.c memchr.c memrchr.c memcmp.c \
memcpy.c memmem.c memmove.c memset.c rindex.c stpcpy.c strcasecmp.c \
strcat.c strchr.c strcmp.c strcoll.c strcpy.c strcspn.c strdup.c \
strerror.c strlcat.c strlcpy.c strlen.c strmode.c strncat.c strncmp.c \
@@ -38,6 +38,8 @@ MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 f
 MLINKS+=ffs.3 ffsl.3
 MLINKS+=ffs.3 fls.3
 MLINKS+=ffs.3 flsl.3
+MLINKS+=ffs.3 ffsll.3
+MLINKS+=ffs.3 flsll.3
 MLINKS+=index.3 rindex.3
 MLINKS+=memchr.3 memrchr.3
 MLINKS+=strcasecmp.3 strncasecmp.3

Modified: head/lib/libc/string/Symbol.map
==
--- head/lib/libc/string/Symbol.map Mon Nov  3 10:14:47 2008
(r184586)
+++ head/lib/libc/string/Symbol.map Mon Nov  3 10:22:19 2008
(r184587)
@@ -78,6 +78,8 @@ FBSD_1.0 {
 };
 
 FBSD_1.1 {
+   ffsll;
+   flsll;
memrchr;
 };
 

Modified: head/lib/libc/string/ffs.3
==
--- head/lib/libc/string/ffs.3  Mon Nov  3 10:14:47 2008(r184586)
+++ head/lib/libc/string/ffs.3  Mon Nov  3 10:22:19 2008(r184587)
@@ -30,14 +30,16 @@
 .\ @(#)ffs.3  8.2 (Berkeley) 4/19/94
 .\ $FreeBSD$
 .\
-.Dd October 12, 2006
+.Dd October 26, 2008
 .Dt FFS 3
 .Os
 .Sh NAME
 .Nm ffs ,
 .Nm ffsl ,
+.Nm ffsll ,
 .Nm fls ,
-.Nm flsl
+.Nm flsl ,
+.Nm flsll
 .Nd find first or last bit set in a bit string
 .Sh LIBRARY
 .Lb libc
@@ -48,14 +50,19 @@
 .Ft int
 .Fn ffsl long value
 .Ft int
+.Ft int
+.Fn ffsll long long value
 .Fn fls int value
 .Ft int
 .Fn flsl long value
+.Ft int
+.Fn flsll long long value
 .Sh DESCRIPTION
 The
-.Fn ffs
-and
+.Fn ffs ,
 .Fn ffsl
+and
+.Fn ffsll
 functions find the first bit set
 (beginning with the least significant bit)
 in
@@ -63,9 +70,10 @@ in
 and return the index of that bit.
 .Pp
 The
-.Fn fls
-and
+.Fn fls ,
 .Fn flsl
+and
+.Fn flsll
 functions find the last bit set in
 .Fa value
 and return the index of that bit.
@@ -95,3 +103,9 @@ and
 .Fn flsl
 functions appeared in
 .Fx 5.3 .
+The
+.Fn ffsll
+and
+.Fn flsll
+functions appeared in
+.Fx 8.0 .

Copied and modified: head/lib/libc/string/ffsll.c (from r184585, 
head/lib/libc/string/ffs.c)
==
--- head/lib/libc/string/ffs.c  Mon Nov  3 07:52:18 2008(r184585, copy 
source)
+++ head/lib/libc/string/ffsll.cMon Nov  3 10:22:19 2008
(r184587)
@@ -27,9 +27,6 @@
  * SUCH DAMAGE.
  */
 
-#if defined(LIBC_SCCS)  !defined(lint)
-static char sccsid[] = @(#)ffs.c  8.1 (Berkeley) 6/4/93;
-#endif /* LIBC_SCCS and not lint */
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
@@ -39,13 +36,13 @@ __FBSDID($FreeBSD$);
  * Find First Set bit
  */
 int
-ffs(int mask)
+ffsll(long long mask)
 {
int bit;
 
if (mask == 0)
-   return(0);
+   return 

Re: svn commit: r184558 - head/sys/dev/acpica/Osd

2008-11-03 Thread Alexander Motin
Jung-uk Kim wrote:
 On Sunday 02 November 2008 07:50 am, Alexander Motin wrote:
 Author: mav
 Date: Sun Nov  2 12:50:16 2008
 New Revision: 184558
 URL: http://svn.freebsd.org/changeset/base/184558

 Log:
   As soon as we have several threads per process now, it is not
 correct to use process ID as ACPI thread ID. Concurrent requests
 with equal thread IDs broke ACPI mutexes operation causing
 unpredictable errors including AE_AML_MUTEX_NOT_ACQUIRED that I
 have seen.

   Use kernel thread ID instead of process ID for ACPI thread.
 
 Sorry but this patch is incorrect, i.e., td_tid is not unique.  You 
 have to use curthread or (p_pid, td_tid) pair.  Unfortunately, even 
 if you correct this problem, you also have to correct ACPI_THREAD_ID 
 definition, which is in the vendor code.  That's why it wasn't done 
 yet and it is more complicated than you think, i.e., ACPI-CA assumes 
 sizeof(ACPI_THREAD_ID) == sizeof(int), etc.  Please see the related 
 ACPI-CA bugs:

I'm also sorry, but that is what I see:
typedef __int32_t   __lwpid_t;  /* Thread ID (a.k.a. LWP) */
...
td-td_tid = alloc_unr(tid_unrhdr);
...
tid_unrhdr = new_unrhdr(PID_MAX + 2, INT_MAX, tid_lock);

So what have I missed, where is the problem? Why td_tid is not unique
and where is the size problem?

-- 
Alexander Motin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: svn commit: r184558 - head/sys/dev/acpica/Osd

2008-11-03 Thread Jung-uk Kim
On Monday 03 November 2008 12:26 pm, Jung-uk Kim wrote:
 On top of that:

 /* Returning 0 is not allowed. */
 return (curthread-td_tid + 1);

 may actually return 0 because it can be INT_MAX. :-)

Sorry, it was just my stupidity.  I meant td_tid itself cannot be 0, 
so + 1 should be removed. :-(

Jung-uk Kim
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: svn commit: r184558 - head/sys/dev/acpica/Osd

2008-11-03 Thread Alexander Motin

Jung-uk Kim wrote:

I'm also sorry, but that is what I see:
typedef __int32_t   __lwpid_t;  /* Thread ID (a.k.a. LWP)
*/ ...
td-td_tid = alloc_unr(tid_unrhdr);
...
tid_unrhdr = new_unrhdr(PID_MAX + 2, INT_MAX, tid_lock);

So what have I missed, where is the problem? Why td_tid is not
unique and where is the size problem?


On top of that:

/* Returning 0 is not allowed. */
return (curthread-td_tid + 1);

may actually return 0 because it can be INT_MAX. :-)


No, maximum is positive overflow. :) Actually + 1 is probably not 
needed here as system assigns thread IDs are above process IDs and ID 0 
is already busy. :)


PS: More arguments sent privately.

--
Alexander Motin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: svn commit: r184471 - in head/bin: cat cp

2008-11-03 Thread Peter Jeremy
On 2008-Nov-03 00:34:47 +0100, Ivan Voras [EMAIL PROTECTED] wrote:
2008/10/31 Giorgos Keramidas [EMAIL PROTECTED]:
The difference between the best and the worst is 247 context switches
(total, not per second).

 It looks like it's probably worth pushing the limit up to 8 MB when we
 have lots of memory :)

Yes, it's an improvement, but who will ever notice? :)

Note that you will eventually hit a limit and start getting worse
performace:  Once the buffer size exceeds the available free RAM
then cp/cat will start eating into inactive pages or (worse) active
pages for other processes.

-- 
Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.


pgpcssar2g8kR.pgp
Description: PGP signature


Re: svn commit: r184471 - in head/bin: cat cp

2008-11-03 Thread Giorgos Keramidas
On Mon, 3 Nov 2008 18:58:18 +1100, Peter Jeremy [EMAIL PROTECTED] wrote:
 On 2008-Nov-03 00:34:47 +0100, Ivan Voras [EMAIL PROTECTED] wrote:
2008/10/31 Giorgos Keramidas [EMAIL PROTECTED]:
The difference between the best and the worst is 247 context switches
(total, not per second).

 It looks like it's probably worth pushing the limit up to 8 MB when we
 have lots of memory :)

Yes, it's an improvement, but who will ever notice? :)

 Note that you will eventually hit a limit and start getting worse
 performace:  Once the buffer size exceeds the available free RAM
 then cp/cat will start eating into inactive pages or (worse) active
 pages for other processes.

Yes, that's a possibility.  Ivan is right that shaving 1-2 hundred more
context _total_ context switches may be a small gain for the extra cost
in buffer memory :)


___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: svn commit: r184471 - in head/bin: cat cp

2008-11-03 Thread Joerg Sonnenberger
On Mon, Nov 03, 2008 at 12:34:47AM +0100, Ivan Voras wrote:
  It looks like it's probably worth pushing the limit up to 8 MB when we
  have lots of memory :)
 
 Yes, it's an improvement, but who will ever notice? :)

Is even the improvement from 64KB to 1MB even measurable? I mean on
anything but a VAX...

Joerg
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


svn commit: r184596 - head/sys/dev/acpica/Osd

2008-11-03 Thread Alexander Motin
Author: mav
Date: Mon Nov  3 18:28:12 2008
New Revision: 184596
URL: http://svn.freebsd.org/changeset/base/184596

Log:
  Remove  + 1.
  Thread ID can't be zero anyway while increment may give owerflow.

Modified:
  head/sys/dev/acpica/Osd/OsdSchedule.c

Modified: head/sys/dev/acpica/Osd/OsdSchedule.c
==
--- head/sys/dev/acpica/Osd/OsdSchedule.c   Mon Nov  3 16:36:23 2008
(r184595)
+++ head/sys/dev/acpica/Osd/OsdSchedule.c   Mon Nov  3 18:28:12 2008
(r184596)
@@ -191,5 +191,5 @@ AcpiOsGetThreadId(void)
 /* XXX do not add ACPI_FUNCTION_TRACE here, results in recursive call. */
 
 /* Returning 0 is not allowed. */
-return (curthread-td_tid + 1);
+return (curthread-td_tid);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: svn commit: r184509 - head/share/man/man9

2008-11-03 Thread John Baldwin
On Monday 03 November 2008 08:15:40 am Dag-Erling Smørgrav wrote:
 Bruce Evans [EMAIL PROTECTED] writes:
  Robert Watson [EMAIL PROTECTED] writes:
   In style(9) examples of err() and errx(), use sysexits(3) errors
   rather than returning 1.
  style(9) was correct.  Using sysexits(3) is a style bug in most cases
  [...]
 
 I agree.  If we must use symbolic names, I suggest we just follow the
 standard, cf. ISO/IEC 9899:1999 §7.20.4.3:
 
   If the value of status is zero or EXIT_SUCCESS, an implementation-
   defined form of the status successful termination is returned. If the
   value of status is EXIT_FAILURE, an implementation-defined form of the
   status unsuccessful termination is returned. Otherwise the status
   returned is implementation-defined.
 
 Note that our stdlib.h defines EXIT_FAILURE to 1.

I agree as well.  I always use 'err(1,...)' or 'errx(1,...)'.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: svn commit: r184558 - head/sys/dev/acpica/Osd

2008-11-03 Thread John Baldwin
On Monday 03 November 2008 11:27:13 am Jung-uk Kim wrote:
 On Monday 03 November 2008 11:08 am, Alexander Motin wrote:
  Jung-uk Kim wrote:
   On Sunday 02 November 2008 07:50 am, Alexander Motin wrote:
   Author: mav
   Date: Sun Nov  2 12:50:16 2008
   New Revision: 184558
   URL: http://svn.freebsd.org/changeset/base/184558
  
   Log:
 As soon as we have several threads per process now, it is not
   correct to use process ID as ACPI thread ID. Concurrent requests
   with equal thread IDs broke ACPI mutexes operation causing
   unpredictable errors including AE_AML_MUTEX_NOT_ACQUIRED that I
   have seen.
  
 Use kernel thread ID instead of process ID for ACPI thread.
  
   Sorry but this patch is incorrect, i.e., td_tid is not unique. 
   You have to use curthread or (p_pid, td_tid) pair. 
   Unfortunately, even if you correct this problem, you also have to
   correct ACPI_THREAD_ID definition, which is in the vendor code. 
   That's why it wasn't done yet and it is more complicated than you
   think, i.e., ACPI-CA assumes sizeof(ACPI_THREAD_ID) ==
   sizeof(int), etc.  Please see the related ACPI-CA bugs:
 
  I'm also sorry, but that is what I see:
  typedef __int32_t   __lwpid_t;  /* Thread ID (a.k.a. LWP)
  */ ...
  td-td_tid = alloc_unr(tid_unrhdr);
  ...
  tid_unrhdr = new_unrhdr(PID_MAX + 2, INT_MAX, tid_lock);
 
  So what have I missed, where is the problem? Why td_tid is not
  unique and where is the size problem?
 
 td_tid is unique for a process, i.e., it is used to identify thread 
 with a same pid, if I am not totally mistaken.  If you want a true 
 unique tid, you have to use struct thread *.

No, td_tid is globally unique.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: svn commit: r184588 - in head: etc/gss etc/rc.d include/rpc lib/libc/sys lib/libc/xdr lib/librpcsec_gss sbin/mount_nfs sys/compat/freebsd32 sys/conf sys/fs/unionfs sys/kern sys/kgssapi sys/kgssapi

2008-11-03 Thread Wilko Bulte
Quoting Doug Rabson, who wrote on Mon, Nov 03, 2008 at 02:43:16PM + ..
 
 On 3 Nov 2008, at 13:48, Simon L. Nielsen wrote:
 
 On 2008.11.03 10:38:00 +, Doug Rabson wrote:
 Author: dfr
 Date: Mon Nov  3 10:38:00 2008
 New Revision: 184588
 URL: http://svn.freebsd.org/changeset/base/184588
 
 Log:
  Implement support for RPCSEC_GSS authentication to both the NFS client
  and server. This replaces the RPC implementation of the NFS client and
 
 Cool, thanks!
 
 Which NFS Servers have you tested this against, or more specifically
 do, you think I should be able to get this working against an NetApp
 NFS Filer which supports Kerberos 5 for NFS?  Or am I mixing things up
 so that's something else?
 
 I've tested this with Solaris, Mac OS X and Linux. The NetApp filer will be 
 using the same protocol but I haven't actually tested with a NetApp. I look 
 forward to any success or failure reports with interest :)

Something tells me I know which NetApp Simon has in mind :)

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: svn commit: r184558 - head/sys/dev/acpica/Osd

2008-11-03 Thread John Baldwin
On Sunday 02 November 2008 07:50:16 am Alexander Motin wrote:
 Author: mav
 Date: Sun Nov  2 12:50:16 2008
 New Revision: 184558
 URL: http://svn.freebsd.org/changeset/base/184558
 
 Log:
   As soon as we have several threads per process now, it is not correct to
   use process ID as ACPI thread ID. Concurrent requests with equal thread
   IDs broke ACPI mutexes operation causing unpredictable errors including
   AE_AML_MUTEX_NOT_ACQUIRED that I have seen.
   
   Use kernel thread ID instead of process ID for ACPI thread.
 
 Modified:
   head/sys/dev/acpica/Osd/OsdSchedule.c
 
 Modified: head/sys/dev/acpica/Osd/OsdSchedule.c
 
==
 --- head/sys/dev/acpica/Osd/OsdSchedule.c Sun Nov  2 11:49:19 2008
 (r184557)
 +++ head/sys/dev/acpica/Osd/OsdSchedule.c Sun Nov  2 12:50:16 2008
 (r184558)
 @@ -187,13 +187,9 @@ AcpiOsStall(UINT32 Microseconds)
  ACPI_THREAD_ID
  AcpiOsGetThreadId(void)
  {
 -struct proc *p;
  
  /* XXX do not add ACPI_FUNCTION_TRACE here, results in recursive call. 
*/
  
 -p = curproc;
 -KASSERT(p != NULL, (%s: curproc is NULL!, __func__));
 -
  /* Returning 0 is not allowed. */
 -return (p-p_pid + 1);
 +return (curthread-td_tid + 1);
  }

You don't need the '+ 1' or comment now.  TIDs are never 0.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: svn commit: r184568 - head/sys/netsmb

2008-11-03 Thread John Baldwin
On Sunday 02 November 2008 03:22:24 pm Robert Watson wrote:
 Author: rwatson
 Date: Sun Nov  2 20:22:24 2008
 New Revision: 184568
 URL: http://svn.freebsd.org/changeset/base/184568
 
 Log:
   smb_vc_put() requires that the passed vcp be locked, so lock it before
   dropping the connection when the requested service isn't available, or
   we may try to release a lock that isn't locked.
   
   This prevents an assertion failure when trying to mount a non-present
   share using smbfs with INVARIANTS; a lock order reversal warning that
   immediately follows is not yet fixed.
   
   Reported by:attilio
   MFC after:  3 days
 
 Modified:
   head/sys/netsmb/smb_conn.c
 
 Modified: head/sys/netsmb/smb_conn.c
 
==
 --- head/sys/netsmb/smb_conn.cSun Nov  2 19:48:15 2008
 (r184567)
 +++ head/sys/netsmb/smb_conn.cSun Nov  2 20:22:24 2008
 (r184568)
 @@ -218,8 +218,10 @@ out:
   smb_sm_unlockvclist(td);
   if (error == 0)
   *vcpp = vcp;
 - else if (vcp)
 + else if (vcp) {
 + smb_vc_lock(vcp, LK_EXCLUSIVE, scred-scr_td);
   smb_vc_put(vcp, scred);
 + }
   return error;
  }

Can't you just do 'smb_vc_rele()' to avoid pointlessly acquiring the lock only 
to drop it again?  Just as with vput/vrele for vnodes, smb_XX_rele() drops 
the reference count and smb_xx_put() is equivalent to 'smb_XX_rele() + 
lockmgr(LK_RELEASE)'

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


svn commit: r184597 - head/sys/kern

2008-11-03 Thread John Baldwin
Author: jhb
Date: Mon Nov  3 19:33:20 2008
New Revision: 184597
URL: http://svn.freebsd.org/changeset/base/184597

Log:
  A few style nits.

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Mon Nov  3 18:28:12 2008(r184596)
+++ head/sys/kern/vfs_lookup.c  Mon Nov  3 19:33:20 2008(r184597)
@@ -331,12 +331,13 @@ namei(struct nameidata *ndp)
 static int
 compute_cn_lkflags(struct mount *mp, int lkflags)
 {
+
if (mp == NULL || 
((lkflags  LK_SHARED)  !(mp-mnt_kern_flag  
MNTK_LOOKUP_SHARED))) {
lkflags = ~LK_SHARED;
lkflags |= LK_EXCLUSIVE;
}
-   return lkflags;
+   return (lkflags);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


svn commit: r184598 - head/sys/tools

2008-11-03 Thread John Baldwin
Author: jhb
Date: Mon Nov  3 19:57:40 2008
New Revision: 184598
URL: http://svn.freebsd.org/changeset/base/184598

Log:
  Remove some unused and broken code that attempted to not invoke locking
  asserts on NULL vnode pointers.  All the vnode assertion routines already
  check for NULL vnode pointers.

Modified:
  head/sys/tools/vnode_if.awk

Modified: head/sys/tools/vnode_if.awk
==
--- head/sys/tools/vnode_if.awk Mon Nov  3 19:33:20 2008(r184597)
+++ head/sys/tools/vnode_if.awk Mon Nov  3 19:57:40 2008(r184598)
@@ -71,9 +71,6 @@ function add_debug_code(name, arg, pos, 
else
star = ;
if (lockdata[name, arg, pos]  (lockdata[name, arg, pos] != -)) {
-   if (arg ~ /^\*/) {
-   printc(indif (substr(arg, 2) != NULL) {);
-   }
printc(indASSERT_VI_UNLOCKED(stara-a_arg, \uname\););
# Add assertions for locking
if (lockdata[name, arg, pos] == L)
@@ -85,9 +82,6 @@ function add_debug_code(name, arg, pos, 
else if (0) {
# XXX More checks!
}
-   if (arg ~ /^\*/) {
-   printc(ind});
-   }
}
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


svn commit: r184599 - in head/sys: kern sys

2008-11-03 Thread Attilio Rao
Author: attilio
Date: Mon Nov  3 20:00:35 2008
New Revision: 184599
URL: http://svn.freebsd.org/changeset/base/184599

Log:
  Remove the mnt_holdcnt and mnt_holdcntwaiters because they are useless.
  Really, the concept of holdcnt in the struct mount is rappresented by
  the mnt_ref (which prevents the type-stable structure from being
  recycled) handled through vfs_ref() and vfs_rel().
  On this optic, switch the holdcnt acquisition into an emulated vfs_ref()
  (and subsequent release into vfs_rel()).
  
  Discussed with:   kib
  Tested by:pho

Modified:
  head/sys/kern/vfs_mount.c
  head/sys/kern/vfs_subr.c
  head/sys/sys/mount.h

Modified: head/sys/kern/vfs_mount.c
==
--- head/sys/kern/vfs_mount.c   Mon Nov  3 19:57:40 2008(r184598)
+++ head/sys/kern/vfs_mount.c   Mon Nov  3 20:00:35 2008(r184599)
@@ -509,16 +509,6 @@ vfs_mount_destroy(struct mount *mp)
MNT_ILOCK(mp);
while (mp-mnt_ref)
msleep(mp, MNT_MTX(mp), PVFS, mntref, 0);
-   if (mp-mnt_holdcnt != 0) {
-   printf(Waiting for mount point to be unheld\n);
-   while (mp-mnt_holdcnt != 0) {
-   mp-mnt_holdcntwaiters++;
-   msleep(mp-mnt_holdcnt, MNT_MTX(mp),
-  PZERO, mntdestroy, 0);
-   mp-mnt_holdcntwaiters--;
-   }
-   printf(mount point unheld\n);
-   }
if (mp-mnt_writeopcount  0) {
printf(Waiting for mount point write ops\n);
while (mp-mnt_writeopcount  0) {
@@ -2062,7 +2052,7 @@ __mnt_vnode_first(struct vnode **mvp, st
*mvp = NULL;
return (NULL);
}
-   mp-mnt_holdcnt++;
+   MNT_REF(mp);
MNT_IUNLOCK(mp);
*mvp = (struct vnode *) malloc(sizeof(struct vnode),
   M_VNODE_MARKER,
@@ -2080,9 +2070,7 @@ __mnt_vnode_first(struct vnode **mvp, st
free(*mvp, M_VNODE_MARKER);
MNT_ILOCK(mp);
*mvp = NULL;
-   mp-mnt_holdcnt--;
-   if (mp-mnt_holdcnt == 0  mp-mnt_holdcntwaiters != 0)
-   wakeup(mp-mnt_holdcnt);
+   MNT_REL(mp);
return (NULL);
}
(*mvp)-v_mount = mp;
@@ -2106,10 +2094,7 @@ __mnt_vnode_markerfree(struct vnode **mv
free(*mvp, M_VNODE_MARKER);
MNT_ILOCK(mp);
*mvp = NULL;
-
-   mp-mnt_holdcnt--;
-   if (mp-mnt_holdcnt == 0  mp-mnt_holdcntwaiters != 0)
-   wakeup(mp-mnt_holdcnt);
+   MNT_REL(mp);
 }
 
 

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cMon Nov  3 19:57:40 2008(r184598)
+++ head/sys/kern/vfs_subr.cMon Nov  3 20:00:35 2008(r184599)
@@ -2838,8 +2838,6 @@ DB_SHOW_COMMAND(mount, db_show_mount)
db_printf(mnt_maxsymlinklen = %d\n, mp-mnt_maxsymlinklen);
db_printf(mnt_iosize_max = %d\n, mp-mnt_iosize_max);
db_printf(mnt_hashseed = %u\n, mp-mnt_hashseed);
-   db_printf(mnt_holdcnt = %d\n, mp-mnt_holdcnt);
-   db_printf(mnt_holdcntwaiters = %d\n, mp-mnt_holdcntwaiters);
db_printf(mnt_secondary_writes = %d\n, mp-mnt_secondary_writes);
db_printf(mnt_secondary_accwrites = %d\n,
mp-mnt_secondary_accwrites);

Modified: head/sys/sys/mount.h
==
--- head/sys/sys/mount.hMon Nov  3 19:57:40 2008(r184598)
+++ head/sys/sys/mount.hMon Nov  3 20:00:35 2008(r184599)
@@ -174,8 +174,6 @@ struct mount {
struct label*mnt_label; /* MAC label for the fs */
u_int   mnt_hashseed;   /* Random seed for vfs_hash */
int mnt_lockref;/* (i) Lock reference count */
-   int mnt_holdcnt;/* hold count */
-   int mnt_holdcntwaiters; /* waits on hold count */
int mnt_secondary_writes;   /* (i) # of secondary writes */
int mnt_secondary_accwrites;/* (i) secondary wr. starts */
struct thread   *mnt_susp_owner;/* (i) thread owning suspension 
*/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: svn commit: r184251 - in head/sys: conf dev/cfi sys

2008-11-03 Thread M. Warner Losh
In message: [EMAIL PROTECTED]
John Baldwin [EMAIL PROTECTED] writes:
: On Friday 31 October 2008 05:59:41 am Dag-Erling Smørgrav wrote:
:  Marcel Moolenaar [EMAIL PROTECTED] writes:
:   Log:
: Add a driver for flash memory that implements to the Common Flash
: Memory Interface (CFI). The flash memory can be read and written
: to through /dev/cfi# and an ioctl() exists so processes can read
: the query information.
: The driver supports the AMD and Intel command set, though only
: the AMD command has been tested.
: 
: Obtained from:  Juniper Networks, Inc.
:  
:  You may want to *carefully* review the license on this code.
: 
: It appears to be a standard 3-clause BSD license?

Whose name is in the disclaimer?

Warner
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


svn commit: r184600 - head/sys/kern

2008-11-03 Thread John Baldwin
Author: jhb
Date: Mon Nov  3 20:31:00 2008
New Revision: 184600
URL: http://svn.freebsd.org/changeset/base/184600

Log:
  Use shared vnode locks instead of exclusive vnode locks for the access(),
  chdir(), chroot(), eaccess(), fpathconf(), fstat(), fstatfs(), lseek()
  (when figuring out the current size of the file in the SEEK_END case),
  pathconf(), readlink(), and statfs() system calls.
  
  Submitted by: ups (mostly)
  Tested by:pho
  MFC after:1 month

Modified:
  head/sys/kern/kern_descrip.c
  head/sys/kern/vfs_syscalls.c
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/kern_descrip.c
==
--- head/sys/kern/kern_descrip.cMon Nov  3 20:00:35 2008
(r184599)
+++ head/sys/kern/kern_descrip.cMon Nov  3 20:31:00 2008
(r184600)
@@ -1241,7 +1241,7 @@ fpathconf(struct thread *td, struct fpat
if (vp != NULL) {
int vfslocked;
vfslocked = VFS_LOCK_GIANT(vp-v_mount);
-   vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+   vn_lock(vp, LK_SHARED | LK_RETRY);
error = VOP_PATHCONF(vp, uap-name, td-td_retval);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cMon Nov  3 20:00:35 2008
(r184599)
+++ head/sys/kern/vfs_syscalls.cMon Nov  3 20:31:00 2008
(r184600)
@@ -286,8 +286,8 @@ kern_statfs(struct thread *td, char *pat
int error;
struct nameidata nd;
 
-   NDINIT(nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1,
-   pathseg, path, td);
+   NDINIT(nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE |
+   AUDITVNODE1, pathseg, path, td);
error = namei(nd);
if (error)
return (error);
@@ -368,7 +368,7 @@ kern_fstatfs(struct thread *td, int fd, 
return (error);
vp = fp-f_vnode;
vfslocked = VFS_LOCK_GIANT(vp-v_mount);
-   vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+   vn_lock(vp, LK_SHARED | LK_RETRY);
 #ifdef AUDIT
AUDIT_ARG(vnode, vp, ARG_VNODE1);
 #endif
@@ -800,8 +800,8 @@ kern_chdir(struct thread *td, char *path
struct vnode *vp;
int vfslocked;
 
-   NDINIT(nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1 | MPSAFE,
-   pathseg, path, td);
+   NDINIT(nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1 |
+   MPSAFE, pathseg, path, td);
if ((error = namei(nd)) != 0)
return (error);
vfslocked = NDHASGIANT(nd);
@@ -886,8 +886,8 @@ chroot(td, uap)
error = priv_check(td, PRIV_VFS_CHROOT);
if (error)
return (error);
-   NDINIT(nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1,
-   UIO_USERSPACE, uap-path, td);
+   NDINIT(nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE |
+   AUDITVNODE1, UIO_USERSPACE, uap-path, td);
error = namei(nd);
if (error)
goto error;
@@ -1938,7 +1938,7 @@ lseek(td, uap)
offset += fp-f_offset;
break;
case L_XTND:
-   vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+   vn_lock(vp, LK_SHARED | LK_RETRY);
error = VOP_GETATTR(vp, vattr, cred);
VOP_UNLOCK(vp, 0);
if (error)
@@ -2125,8 +2125,8 @@ kern_accessat(struct thread *td, int fd,
td-td_ucred = tmpcred;
} else
cred = tmpcred = td-td_ucred;
-   NDINIT_AT(nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1,
-   pathseg, path, fd, td);
+   NDINIT_AT(nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE |
+   AUDITVNODE1, pathseg, path, fd, td);
if ((error = namei(nd)) != 0)
goto out1;
vfslocked = NDHASGIANT(nd);
@@ -2492,8 +2492,8 @@ kern_pathconf(struct thread *td, char *p
struct nameidata nd;
int error, vfslocked;
 
-   NDINIT(nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1,
-   pathseg, path, td);
+   NDINIT(nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE |
+   AUDITVNODE1, pathseg, path, td);
if ((error = namei(nd)) != 0)
return (error);
vfslocked = NDHASGIANT(nd);
@@ -2568,8 +2568,8 @@ kern_readlinkat(struct thread *td, int f
struct nameidata nd;
int vfslocked;
 
-   NDINIT_AT(nd, LOOKUP, NOFOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1,
-   pathseg, path, fd, td);
+   NDINIT_AT(nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE |
+   AUDITVNODE1, pathseg, path, fd, td);
 
if ((error = namei(nd)) != 0)
return (error);

Modified: head/sys/kern/vfs_vnops.c
==
--- 

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

2008-11-03 Thread Warner Losh
Author: imp
Date: Mon Nov  3 22:43:37 2008
New Revision: 184606
URL: http://svn.freebsd.org/changeset/base/184606

Log:
  Use more standardized license language
  
  Approved by:  Thomas Quinot

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

Modified: head/share/man/man4/atapicam.4
==
--- head/share/man/man4/atapicam.4  Mon Nov  3 22:09:27 2008
(r184605)
+++ head/share/man/man4/atapicam.4  Mon Nov  3 22:43:37 2008
(r184606)
@@ -16,7 +16,7 @@
 .\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 .\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 .\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD
+.\ ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS
 .\ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 .\ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 .\ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


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

2008-11-03 Thread Warner Losh
Author: imp
Date: Tue Nov  4 00:20:43 2008
New Revision: 184607
URL: http://svn.freebsd.org/changeset/base/184607

Log:
  Replace the non-standard disclaimer with the standard one from /COPYRIGHT
  
  Approved by:  jedgar@

Modified:
  head/lib/libc/posix1e/acl_add_perm.3
  head/lib/libc/posix1e/acl_calc_mask.3
  head/lib/libc/posix1e/acl_calc_mask.c
  head/lib/libc/posix1e/acl_clear_perms.3
  head/lib/libc/posix1e/acl_copy.c
  head/lib/libc/posix1e/acl_copy_entry.3
  head/lib/libc/posix1e/acl_create_entry.3
  head/lib/libc/posix1e/acl_delete_entry.3
  head/lib/libc/posix1e/acl_delete_perm.3
  head/lib/libc/posix1e/acl_get_entry.3
  head/lib/libc/posix1e/acl_get_perm_np.3
  head/lib/libc/posix1e/acl_get_permset.3
  head/lib/libc/posix1e/acl_get_qualifier.3
  head/lib/libc/posix1e/acl_get_tag_type.3
  head/lib/libc/posix1e/acl_perm.c
  head/lib/libc/posix1e/acl_set_permset.3
  head/lib/libc/posix1e/acl_set_qualifier.3
  head/lib/libc/posix1e/acl_set_tag_type.3
  head/lib/libc/posix1e/acl_size.c

Modified: head/lib/libc/posix1e/acl_add_perm.3
==
--- head/lib/libc/posix1e/acl_add_perm.3Mon Nov  3 22:43:37 2008
(r184606)
+++ head/lib/libc/posix1e/acl_add_perm.3Tue Nov  4 00:20:43 2008
(r184607)
@@ -14,14 +14,14 @@
 .\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 .\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 .\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD 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.
+.\ ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+.\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\ SUCH DAMAGE.
 .\
 .\ $FreeBSD$
 .\

Modified: head/lib/libc/posix1e/acl_calc_mask.3
==
--- head/lib/libc/posix1e/acl_calc_mask.3   Mon Nov  3 22:43:37 2008
(r184606)
+++ head/lib/libc/posix1e/acl_calc_mask.3   Tue Nov  4 00:20:43 2008
(r184607)
@@ -14,14 +14,14 @@
 .\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 .\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 .\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD 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.
+.\ ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+.\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\ SUCH DAMAGE.
 .\
 .\ $FreeBSD$
 .\

Modified: head/lib/libc/posix1e/acl_calc_mask.c
==
--- head/lib/libc/posix1e/acl_calc_mask.c   Mon Nov  3 22:43:37 2008
(r184606)
+++ head/lib/libc/posix1e/acl_calc_mask.c   Tue Nov  4 00:20:43 2008
(r184607)
@@ -14,14 +14,14 @@
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE 

svn commit: r184608 - svnadmin/conf

2008-11-03 Thread Alfred Perlstein
Author: alfred
Date: Tue Nov  4 01:45:49 2008
New Revision: 184608
URL: http://svn.freebsd.org/changeset/base/184608

Log:
  unlimit my commit size check for usb2 import.

Modified:
  svnadmin/conf/sizelimit.conf

Modified: svnadmin/conf/sizelimit.conf
==
--- svnadmin/conf/sizelimit.confTue Nov  4 00:20:43 2008
(r184607)
+++ svnadmin/conf/sizelimit.confTue Nov  4 01:45:49 2008
(r184608)
@@ -17,3 +17,4 @@
 #peter 3141592
 #grog
 #kan
+alfred 3024
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


svn commit: r184610 - in head: lib/libusb20 share/man/man4 sys/conf sys/dev/sound/pcm sys/dev/usb2 sys/dev/usb2/bluetooth sys/dev/usb2/controller sys/dev/usb2/core sys/dev/usb2/ethernet sys/dev/usb...

2008-11-03 Thread Alfred Perlstein
Author: alfred
Date: Tue Nov  4 02:31:03 2008
New Revision: 184610
URL: http://svn.freebsd.org/changeset/base/184610

Log:
  Bring in USB4BSD, Hans Petter Selasky rework of the USB stack
  that includes significant features and SMP safety.
  
  This commit includes a more or less complete rewrite of the *BSD USB
  stack, including Host Controller and Device Controller drivers and
  updating all existing USB drivers to use the new USB API:
  
  1) A brief feature list:
  
- A new and mutex enabled USB API.
  
- Many USB drivers are now running Giant free.
  
- Linux USB kernel compatibility layer.
  
- New UGEN backend and libusb library, finally solves the driver
  unloading problem. The new BSD licensed libusb20 library is fully
  compatible with libusb-0.1.12 from sourceforge.
  
- New usbconfig utility, for easy configuration of USB.
  
- Full support for Split transactions, which means you can use your
  full speed USB audio device on a high speed USB HUB.
  
- Full support for HS ISOC transactions, which makes writing drivers
  for various HS webcams possible, for example.
  
- Full support for USB on embedded platforms, mostly cache flushing
  and buffer invalidating stuff.
  
- Safer parsing of USB descriptors.
  
- Autodetect of annoying USB install disks.
  
- Support for USB device side mode, also called USB gadget mode,
  using the same API like the USB host side. In other words the new
  USB stack is symmetric with regard to host and device side.
  
- Support for USB transfers like I/O vectors, means more throughput
  and less interrupts.
  
- ... see the FreeBSD quarterly status reports under USB project
  
  2) To enable the driver in the default kernel build:
  
  2.a) Remove all existing USB device options from your kernel config
  file.
  
  2.b) Add the following USB device options to your kernel configuration
  file:
  
  # USB core support
  device  usb2_core
  
  # USB controller support
  deviceusb2_controller
  deviceusb2_controller_ehci
  deviceusb2_controller_ohci
  deviceusb2_controller_uhci
  
  # USB mass storage support
  deviceusb2_storage
  deviceusb2_storage_mass
  
  # USB ethernet support, requires miibus
  deviceusb2_ethernet
  deviceusb2_ethernet_aue
  deviceusb2_ethernet_axe
  deviceusb2_ethernet_cdce
  deviceusb2_ethernet_cue
  deviceusb2_ethernet_kue
  deviceusb2_ethernet_rue
  deviceusb2_ethernet_dav
  
  # USB wireless LAN support
  deviceusb2_wlan
  deviceusb2_wlan_rum
  deviceusb2_wlan_ral
  deviceusb2_wlan_zyd
  
  # USB serial device support
  deviceusb2_serial
  deviceusb2_serial_ark
  deviceusb2_serial_bsa
  deviceusb2_serial_bser
  deviceusb2_serial_chcom
  deviceusb2_serial_cycom
  deviceusb2_serial_foma
  deviceusb2_serial_ftdi
  deviceusb2_serial_gensa
  deviceusb2_serial_ipaq
  deviceusb2_serial_lpt
  deviceusb2_serial_mct
  deviceusb2_serial_modem
  deviceusb2_serial_moscom
  deviceusb2_serial_plcom
  deviceusb2_serial_visor
  deviceusb2_serial_vscom
  
  # USB bluetooth support
  deviceusb2_bluetooth
  deviceusb2_bluetooth_ng
  
  # USB input device support
  deviceusb2_input
  deviceusb2_input_hid
  deviceusb2_input_kbd
  deviceusb2_input_ms
  
  # USB sound and MIDI device support
  deviceusb2_sound
  
  2) To enable the driver at runtime:
  
  2.a) Unload all existing USB modules. If USB is compiled into the
  kernel then you might have to build a new kernel.
  
  2.b) Load the usb2_xxx.ko modules under /boot/kernel having the same
  base name like the kernel device option.
  
  Submitted by: Hans Petter Selasky hselasky at c2i dot net
  Reviewed by: imp, alfred

Added:
  head/lib/libusb20/
  head/lib/libusb20/Makefile   (contents, props changed)
  head/lib/libusb20/libusb20.3   (contents, props changed)
  head/lib/libusb20/libusb20.c   (contents, props changed)
  head/lib/libusb20/libusb20.h   (contents, props changed)
  head/lib/libusb20/libusb20_compat01.c   (contents, props changed)
  head/lib/libusb20/libusb20_compat01.h   (contents, props changed)
  head/lib/libusb20/libusb20_compat10.c   (contents, props changed)
  head/lib/libusb20/libusb20_compat10.h   (contents, props changed)
  head/lib/libusb20/libusb20_desc.c   (contents, props changed)
  head/lib/libusb20/libusb20_desc.h   (contents, 

svn commit: r184611 - svnadmin/conf

2008-11-03 Thread Alfred Perlstein
Author: alfred
Date: Tue Nov  4 02:36:18 2008
New Revision: 184611
URL: http://svn.freebsd.org/changeset/base/184611

Log:
  all done with usb2 commit!

Modified:
  svnadmin/conf/sizelimit.conf

Modified: svnadmin/conf/sizelimit.conf
==
--- svnadmin/conf/sizelimit.confTue Nov  4 02:31:03 2008
(r184610)
+++ svnadmin/conf/sizelimit.confTue Nov  4 02:36:18 2008
(r184611)
@@ -17,4 +17,3 @@
 #peter 3141592
 #grog
 #kan
-alfred 3024
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]


svn commit: r184612 - head/sys/conf

2008-11-03 Thread Alfred Perlstein
Author: alfred
Date: Tue Nov  4 03:42:01 2008
New Revision: 184612
URL: http://svn.freebsd.org/changeset/base/184612

Log:
  add usb2_if.m to mfiles to unbreak build of modules.

Modified:
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Tue Nov  4 02:36:18 2008(r184611)
+++ head/sys/conf/kmod.mk   Tue Nov  4 03:42:01 2008(r184612)
@@ -331,6 +331,7 @@ MFILES?= dev/acpica/acpi_if.m dev/agp/ag
dev/sound/pcm/feeder_if.m dev/sound/pcm/mixer_if.m \
dev/sound/midi/mpu_if.m dev/sound/midi/mpufoi_if.m \
dev/sound/midi/synth_if.m dev/usb/usb_if.m isa/isa_if.m \
+   dev/usb2/core/usb2_if.m \
kern/bus_if.m kern/clock_if.m \
kern/cpufreq_if.m kern/device_if.m kern/serdev_if.m \
libkern/iconv_converter_if.m opencrypto/cryptodev_if.m \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to [EMAIL PROTECTED]