svn commit: r191987 - head/release/doc/en_US.ISO8859-1/relnotes

2009-05-11 Thread Xin LI
Author: delphij
Date: Mon May 11 07:57:29 2009
New Revision: 191987
URL: http://svn.freebsd.org/changeset/base/191987

Log:
  less has been updated to v429

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.sgml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml
==
--- head/release/doc/en_US.ISO8859-1/relnotes/article.sgml  Mon May 11 
05:16:57 2009(r191986)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.sgml  Mon May 11 
07:57:29 2009(r191987)
@@ -450,7 +450,7 @@
   4.1.23 to 4.1.28.
 
 less has been updated from
-  v408 to v416.
+  v408 to v429.
 
 ncurses has been updated from
   5.6-20061217 to 5.6-20080503.
___
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: r191988 - head/sys/compat/linux

2009-05-11 Thread Dmitry Chagin
Author: dchagin
Date: Mon May 11 13:42:40 2009
New Revision: 191988
URL: http://svn.freebsd.org/changeset/base/191988

Log:
  Add forgotten linux to bsd flags argument mapping into the linux_recv().
  
  PR:   kern/134276
  Submitted by: Thomas Mueller 
  Approved by:  kib (mentor)
  MFC after:2 weeks

Modified:
  head/sys/compat/linux/linux_socket.c

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cMon May 11 07:57:29 2009
(r191987)
+++ head/sys/compat/linux/linux_socket.cMon May 11 13:42:40 2009
(r191988)
@@ -924,7 +924,7 @@ linux_recv(struct thread *td, struct lin
bsd_args.s = args->s;
bsd_args.buf = (caddr_t)PTRIN(args->msg);
bsd_args.len = args->len;
-   bsd_args.flags = args->flags;
+   bsd_args.flags = linux_to_bsd_msg_flags(args->flags);
bsd_args.from = NULL;
bsd_args.fromlenaddr = 0;
return (recvfrom(td, &bsd_args));
___
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: r191989 - in head/sys: amd64/linux32 compat/linux

2009-05-11 Thread Dmitry Chagin
Author: dchagin
Date: Mon May 11 13:50:42 2009
New Revision: 191989
URL: http://svn.freebsd.org/changeset/base/191989

Log:
  Translate l_timeval arg to native struct timeval in
  linux_setsockopt()/linux_getsockopt() for SO_RCVTIMEO,
  SO_SNDTIMEO opts as l_timeval has MD members.
  
  Remove bogus __packed attribute from l_timeval struct on __amd64__.
  
  PR:   kern/134276
  Submitted by: Thomas Mueller 
  Approved by:  kib (mentor)
  MFC after:2 weeks

Modified:
  head/sys/amd64/linux32/linux.h
  head/sys/compat/linux/linux_socket.c

Modified: head/sys/amd64/linux32/linux.h
==
--- head/sys/amd64/linux32/linux.h  Mon May 11 13:42:40 2009
(r191988)
+++ head/sys/amd64/linux32/linux.h  Mon May 11 13:50:42 2009
(r191989)
@@ -96,7 +96,7 @@ typedef struct {
 typedef struct {
l_time_ttv_sec;
l_suseconds_t   tv_usec;
-} __packed l_timeval;
+} l_timeval;
 
 #definel_fd_setfd_set
 

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cMon May 11 13:42:40 2009
(r191988)
+++ head/sys/compat/linux/linux_socket.cMon May 11 13:50:42 2009
(r191989)
@@ -1278,6 +1278,8 @@ linux_setsockopt(struct thread *td, stru
caddr_t val;
int valsize;
} */ bsd_args;
+   l_timeval linux_tv;
+   struct timeval tv;
int error, name;
 
bsd_args.s = args->s;
@@ -1285,6 +1287,23 @@ linux_setsockopt(struct thread *td, stru
switch (bsd_args.level) {
case SOL_SOCKET:
name = linux_to_bsd_so_sockopt(args->optname);
+   switch (name) {
+   case SO_RCVTIMEO:
+   /* FALLTHROUGH */
+   case SO_SNDTIMEO:
+   error = copyin(PTRIN(args->optval), &linux_tv,
+   sizeof(linux_tv));
+   if (error)
+   return (error);
+   tv.tv_sec = linux_tv.tv_sec;
+   tv.tv_usec = linux_tv.tv_usec;
+   return (kern_setsockopt(td, args->s, bsd_args.level,
+   name, &tv, UIO_SYSSPACE, sizeof(tv)));
+   /* NOTREACHED */
+   break;
+   default:
+   break;
+   }
break;
case IPPROTO_IP:
name = linux_to_bsd_ip_sockopt(args->optname);
@@ -1333,6 +1352,9 @@ linux_getsockopt(struct thread *td, stru
caddr_t val;
int *avalsize;
} */ bsd_args;
+   l_timeval linux_tv;
+   struct timeval tv;
+   socklen_t tv_len;
int error, name;
 
bsd_args.s = args->s;
@@ -1340,6 +1362,24 @@ linux_getsockopt(struct thread *td, stru
switch (bsd_args.level) {
case SOL_SOCKET:
name = linux_to_bsd_so_sockopt(args->optname);
+   switch (name) {
+   case SO_RCVTIMEO:
+   /* FALLTHROUGH */
+   case SO_SNDTIMEO:
+   tv_len = sizeof(tv);
+   error = kern_getsockopt(td, args->s, bsd_args.level,
+   name, &tv, UIO_SYSSPACE, &tv_len);
+   if (error)
+   return (error);
+   linux_tv.tv_sec = tv.tv_sec;
+   linux_tv.tv_usec = tv.tv_usec;
+   return (copyout(&linux_tv, PTRIN(args->optval),
+   sizeof(linux_tv)));
+   /* NOTREACHED */
+   break;
+   default:
+   break;
+   }
break;
case IPPROTO_IP:
name = linux_to_bsd_ip_sockopt(args->optname);
___
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: r191990 - in head/sys: cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/coda fs/devfs fs/fdescfs fs/hpfs fs/msdosfs fs/nfs fs/nfsclient fs/nfsserver ...

2009-05-11 Thread Attilio Rao
Author: attilio
Date: Mon May 11 15:33:26 2009
New Revision: 191990
URL: http://svn.freebsd.org/changeset/base/191990

Log:
  Remove the thread argument from the FSD (File-System Dependent) parts of
  the VFS.  Now all the VFS_* functions and relating parts don't want the
  context as long as it always refers to curthread.
  
  In some points, in particular when dealing with VOPs and functions living
  in the same namespace (eg. vflush) which still need to be converted,
  pass curthread explicitly in order to retain the old behaviour.
  Such loose ends will be fixed ASAP.
  
  While here fix a bug: now, UFS_EXTATTR can be compiled alone without the
  UFS_EXTATTR_AUTOSTART option.
  
  VFS KPI is heavilly changed by this commit so thirdy parts modules needs
  to be recompiled.  Bump __FreeBSD_version in order to signal such
  situation.

Modified:
  head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c
  head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  head/sys/fs/cd9660/cd9660_vfsops.c
  head/sys/fs/coda/coda_vfsops.c
  head/sys/fs/devfs/devfs.h
  head/sys/fs/devfs/devfs_vfsops.c
  head/sys/fs/devfs/devfs_vnops.c
  head/sys/fs/fdescfs/fdesc.h
  head/sys/fs/fdescfs/fdesc_vfsops.c
  head/sys/fs/fdescfs/fdesc_vnops.c
  head/sys/fs/hpfs/hpfs_vfsops.c
  head/sys/fs/msdosfs/msdosfs_vfsops.c
  head/sys/fs/nfs/nfs_commonsubs.c
  head/sys/fs/nfs/nfs_var.h
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nfsserver/nfs_nfsdserv.c
  head/sys/fs/ntfs/ntfs_vfsops.c
  head/sys/fs/nullfs/null_vfsops.c
  head/sys/fs/nwfs/nwfs_vfsops.c
  head/sys/fs/portalfs/portal_vfsops.c
  head/sys/fs/pseudofs/pseudofs.c
  head/sys/fs/pseudofs/pseudofs.h
  head/sys/fs/smbfs/smbfs_vfsops.c
  head/sys/fs/tmpfs/tmpfs.h
  head/sys/fs/tmpfs/tmpfs_subr.c
  head/sys/fs/tmpfs/tmpfs_vfsops.c
  head/sys/fs/tmpfs/tmpfs_vnops.c
  head/sys/fs/udf/udf_vfsops.c
  head/sys/fs/unionfs/union_vfsops.c
  head/sys/geom/journal/g_journal.c
  head/sys/gnu/fs/ext2fs/ext2_vfsops.c
  head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
  head/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c
  head/sys/kern/kern_acct.c
  head/sys/kern/uipc_mqueue.c
  head/sys/kern/vfs_default.c
  head/sys/kern/vfs_export.c
  head/sys/kern/vfs_extattr.c
  head/sys/kern/vfs_lookup.c
  head/sys/kern/vfs_mount.c
  head/sys/kern/vfs_subr.c
  head/sys/kern/vfs_syscalls.c
  head/sys/kern/vfs_vnops.c
  head/sys/nfs4client/nfs4_vfsops.c
  head/sys/nfsclient/nfs.h
  head/sys/nfsclient/nfs_vfsops.c
  head/sys/nfsserver/nfs_serv.c
  head/sys/security/audit/audit_worker.c
  head/sys/sys/mount.h
  head/sys/sys/param.h
  head/sys/ufs/ffs/ffs_vfsops.c
  head/sys/ufs/ufs/extattr.h
  head/sys/ufs/ufs/ufs_extattr.c
  head/sys/ufs/ufs/ufs_vfsops.c

Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c
==
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c  Mon May 11 
13:50:42 2009(r191989)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c  Mon May 11 
15:33:26 2009(r191990)
@@ -66,7 +66,6 @@ lookupnameat(char *dirname, enum uio_seg
 int
 traverse(vnode_t **cvpp, int lktype)
 {
-   kthread_t *td = curthread;
vnode_t *cvp;
vnode_t *tvp;
vfs_t *vfsp;
@@ -101,7 +100,7 @@ traverse(vnode_t **cvpp, int lktype)
 * The read lock must be held across the call to VFS_ROOT() to
 * prevent a concurrent unmount from destroying the vfs.
 */
-   error = VFS_ROOT(vfsp, lktype, &tvp, td);
+   error = VFS_ROOT(vfsp, lktype, &tvp);
if (error != 0)
return (error);
cvp = tvp;

Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
==
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Mon May 11 
13:50:42 2009(r191989)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Mon May 11 
15:33:26 2009(r191990)
@@ -160,14 +160,14 @@ domount(kthread_t *td, vnode_t *vp, cons
 */
cr = td->td_ucred;
td->td_ucred = kcred;
-   error = VFS_MOUNT(mp, td);
+   error = VFS_MOUNT(mp);
td->td_ucred = cr;
 
if (!error) {
if (mp->mnt_opt != NULL)
vfs_freeopts(mp->mnt_opt);
mp->mnt_opt = mp->mnt_optnew;
-   (void)VFS_STATFS(mp, &mp->mnt_stat, td);
+   (void)VFS_STATFS(mp, &mp->mnt_stat);
}
/*
 * Prevent external consumers of mount options from reading
@@ -192,7 +192,7 @@ domount(kthread_t *td, vnode_t *vp, cons
TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list);
mtx_unlock(&mountlist_mtx);
   

svn commit: r191991 - head/sys/kern

2009-05-11 Thread Attilio Rao
Author: attilio
Date: Mon May 11 16:32:58 2009
New Revision: 191991
URL: http://svn.freebsd.org/changeset/base/191991

Log:
  Fix a kernel compilation error, introduced after r191990, by defining
  thread with curthread in the AUDIT case.
  
  Reported by:  dchagin

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Mon May 11 15:33:26 2009(r191990)
+++ head/sys/kern/vfs_lookup.c  Mon May 11 16:32:58 2009(r191991)
@@ -457,6 +457,9 @@ lookup(struct nameidata *ndp)
int dvfslocked; /* VFS Giant state for parent */
int tvfslocked;
int lkflags_save;
+#ifdef AUDIT
+   struct thread *td = curthread;
+#endif

/*
 * Setup: break out flag bits into variables.
___
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: r191991 - head/sys/kern

2009-05-11 Thread Attilio Rao
2009/5/11, Attilio Rao :
> Author: attilio
> Date: Mon May 11 16:32:58 2009
> New Revision: 191991
> URL: http://svn.freebsd.org/changeset/base/191991
>
> Log:
>   Fix a kernel compilation error, introduced after r191990, by defining
>   thread with curthread in the AUDIT case.

The r191990 revision introduced a large KPI breakage. I compiled LINT
and tried several combinations of key flags that let me identify
several stubs to be introduced, but other can spring as the upside, so
please be patienceful until all of them are reported and fixed.

Thanks,
Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
___
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: r191992 - in stable/7/sys: . conf contrib/pf dev/ath/ath_hal dev/cxgb

2009-05-11 Thread John Baldwin
Author: jhb
Date: Mon May 11 16:37:31 2009
New Revision: 191992
URL: http://svn.freebsd.org/changeset/base/191992

Log:
  MFC: Always compute the root of the kernel source tree and explicitly pass
  it to module builds.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/conf/kern.post.mk
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/conf/kern.post.mk
==
--- stable/7/sys/conf/kern.post.mk  Mon May 11 16:32:58 2009
(r191991)
+++ stable/7/sys/conf/kern.post.mk  Mon May 11 16:37:31 2009
(r191992)
@@ -12,7 +12,8 @@
 .if defined(DESTDIR)
 MKMODULESENV+= DESTDIR="${DESTDIR}"
 .endif
-MKMODULESENV+= KERNBUILDDIR="${.CURDIR}"
+SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;}
+MKMODULESENV+= KERNBUILDDIR="${.CURDIR}" SYSDIR="${SYSDIR}"
 
 .MAIN: all
 
@@ -29,7 +30,6 @@ modules-${target}:
 
 # Handle out of tree ports 
 .if !defined(NO_MODULES) && defined(PORTS_MODULES)
-SYSDIR?= ${S:C;^[^/];${.CURDIR}/&;}
 PORTSMODULESENV=SYSDIR=${SYSDIR}
 .for __target in all install reinstall clean
 ${__target}: ports-${__target}
___
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: r191993 - head/lib/libthr/thread

2009-05-11 Thread Brian Feldman
Author: green
Date: Mon May 11 16:45:53 2009
New Revision: 191993
URL: http://svn.freebsd.org/changeset/base/191993

Log:
  These are some cosmetic changes to improve the clarity of libthr's fork 
implementation.

Modified:
  head/lib/libthr/thread/thr_fork.c

Modified: head/lib/libthr/thread/thr_fork.c
==
--- head/lib/libthr/thread/thr_fork.c   Mon May 11 16:37:31 2009
(r191992)
+++ head/lib/libthr/thread/thr_fork.c   Mon May 11 16:45:53 2009
(r191993)
@@ -105,7 +105,7 @@ _fork(void)
struct pthread_atfork *af;
pid_t ret;
int errsave;
-   int unlock_malloc;
+   int was_threaded;
int rtld_locks[MAX_RTLD_LOCKS];
 
if (!_thr_is_inited())
@@ -122,16 +122,16 @@ _fork(void)
}
 
/*
-* Try our best to protect memory from being corrupted in
-* child process because another thread in malloc code will
-* simply be kill by fork().
+* All bets are off as to what should happen soon if the parent
+* process was not so kindly as to set up pthread fork hooks to
+* relinquish all running threads.
 */
if (_thr_isthreaded() != 0) {
-   unlock_malloc = 1;
+   was_threaded = 1;
_malloc_prefork();
_rtld_atfork_pre(rtld_locks);
} else {
-   unlock_malloc = 0;
+   was_threaded = 0;
}
 
/*
@@ -159,7 +159,7 @@ _fork(void)
_thr_umutex_init(&curthread->lock);
_thr_umutex_init(&_thr_atfork_lock);
 
-   if (unlock_malloc)
+   if (was_threaded)
_rtld_atfork_post(rtld_locks);
_thr_setthreaded(0);
 
@@ -173,7 +173,7 @@ _fork(void)
/* Ready to continue, unblock signals. */ 
_thr_signal_unblock(curthread);
 
-   if (unlock_malloc) {
+   if (was_threaded) {
__isthreaded = 1;
_malloc_postfork();
__isthreaded = 0;
@@ -191,7 +191,7 @@ _fork(void)
/* Ready to continue, unblock signals. */ 
_thr_signal_unblock(curthread);
 
-   if (unlock_malloc) {
+   if (was_threaded) {
_rtld_atfork_post(rtld_locks);
_malloc_postfork();
}
___
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: r191994 - head/share/man/man5

2009-05-11 Thread Warner Losh
Author: imp
Date: Mon May 11 17:05:41 2009
New Revision: 191994
URL: http://svn.freebsd.org/changeset/base/191994

Log:
  LFS cannot be loaded, compiled, torn, spindled or mutilated in
  FreeBSD: it was deleted around FreeBSD 3.x...

Modified:
  head/share/man/man5/fstab.5

Modified: head/share/man/man5/fstab.5
==
--- head/share/man/man5/fstab.5 Mon May 11 16:45:53 2009(r191993)
+++ head/share/man/man5/fstab.5 Mon May 11 17:05:41 2009(r191994)
@@ -80,8 +80,7 @@ Only the root, /usr, and /tmp file syste
 compiled into the kernel;
 everything else will be automatically loaded at mount
 time.
-(Exception: the UFS family - FFS and LFS cannot
-currently be demand-loaded.)
+(Exception: the FFS cannot currently be demand-loaded.)
 Some people still prefer to statically
 compile other file systems as well.
 .Pp
___
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: r191995 - head/sys/dev/bwi

2009-05-11 Thread Warner Losh
Author: imp
Date: Mon May 11 17:13:52 2009
New Revision: 191995
URL: http://svn.freebsd.org/changeset/base/191995

Log:
  Update a few XXX comments
  
  Submitted by: ddk ddk ddkprog at yahoo dot com

Modified:
  head/sys/dev/bwi/bwimac.c

Modified: head/sys/dev/bwi/bwimac.c
==
--- head/sys/dev/bwi/bwimac.c   Mon May 11 17:05:41 2009(r191994)
+++ head/sys/dev/bwi/bwimac.c   Mon May 11 17:13:52 2009(r191995)
@@ -300,7 +300,7 @@ bwi_mac_init(struct bwi_mac *mac)
if (error)
return error;
 
-   /* XXX work around for hardware bugs? */
+   /* do timeout fixup */
if (sc->sc_bus_regwin.rw_rev <= 5 &&
sc->sc_bus_regwin.rw_type != BWI_REGWIN_T_BUSPCIE) {
CSR_SETBITS_4(sc, BWI_CONF_LO,
@@ -364,7 +364,7 @@ bwi_mac_init(struct bwi_mac *mac)
 */
bwi_mac_opmode_init(mac);
 
-   /* XXX what's these */
+   /* set up Beacon interval */
if (mac->mac_rev < 3) {
CSR_WRITE_2(sc, 0x60e, 0);
CSR_WRITE_2(sc, 0x610, 0x8000);
@@ -389,7 +389,7 @@ bwi_mac_init(struct bwi_mac *mac)
CSR_WRITE_4(sc, BWI_TXRX_INTR_MASK(i), intrs);
}
 
-   /* XXX what's this */
+   /* allow the MAC to control the PHY clock (dynamic on/off) */
CSR_SETBITS_4(sc, BWI_STATE_LO, 0x10);
 
/* Setup MAC power up delay */
@@ -441,7 +441,7 @@ bwi_mac_init(struct bwi_mac *mac)
}
}
 
-   /* XXX what's these */
+   /* update PRETBTT */
CSR_WRITE_2(sc, 0x612, 0x50);   /* Force Pre-TBTT to 80? */
MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, 0x416, 0x50);
MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, 0x414, 0x1f4);
___
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: r191996 - head/sys/sys

2009-05-11 Thread John Baldwin
Author: jhb
Date: Mon May 11 17:29:11 2009
New Revision: 191996
URL: http://svn.freebsd.org/changeset/base/191996

Log:
  Always use __null to define NULL for GCC 4+.  Use '0' rather than
  '(void *)0' for NULL for C++ compilers compiling kernel code.  Together this
  makes it easier to build kernel modules using C++.
  
  Reviewed by:  imp
  MFC after:3 days

Modified:
  head/sys/sys/_null.h

Modified: head/sys/sys/_null.h
==
--- head/sys/sys/_null.hMon May 11 17:13:52 2009(r191995)
+++ head/sys/sys/_null.hMon May 11 17:29:11 2009(r191996)
@@ -28,18 +28,18 @@
 
 #ifndef NULL
 
-#if defined(_KERNEL) || !defined(__cplusplus)
-#defineNULL((void *)0)
-#else
 #if defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4
 #defineNULL__null
 #else
+#if defined(_KERNEL) && !defined(__cplusplus)
+#defineNULL((void *)0)
+#else
 #if defined(__LP64__)
 #defineNULL(0L)
 #else
 #defineNULL0
 #endif /* __LP64__ */
+#endif /* _KERNEL && !__cplusplus */
 #endif /* __GNUG__ */
-#endif /* _KERNEL || !__cplusplus */
 
 #endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r191984 - in head/sys: cddl/contrib/opensolaris/uts/common/rpc modules/zfs

2009-05-11 Thread Doug Rabson
The XDR support code that is in the main kernel should have a very  
similar API to the opensolaris bits, possibly identical. Perhaps the  
opensolaris compat could use the main kernel's XDR implementation?


On 11 May 2009, at 05:18, Kip Macy wrote:


Author: kmacy
Date: Mon May 11 04:18:58 2009
New Revision: 191984
URL: http://svn.freebsd.org/changeset/base/191984

Log:
 rename xdr support files to avoid conflicts when linking in to the  
kernel


Added:
 head/sys/cddl/contrib/opensolaris/uts/common/rpc/ 
opensolaris_xdr.c   (props changed)
- copied unchanged from r191983, head/sys/cddl/contrib/ 
opensolaris/uts/common/rpc/xdr.c
 head/sys/cddl/contrib/opensolaris/uts/common/rpc/ 
opensolaris_xdr_array.c   (props changed)
- copied unchanged from r191983, head/sys/cddl/contrib/ 
opensolaris/uts/common/rpc/xdr_array.c
 head/sys/cddl/contrib/opensolaris/uts/common/rpc/ 
opensolaris_xdr_mem.c   (props changed)
- copied unchanged from r191983, head/sys/cddl/contrib/ 
opensolaris/uts/common/rpc/xdr_mem.c

Deleted:
 head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.c
 head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr_array.c
 head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr_mem.c
Modified:
 head/sys/modules/zfs/Makefile

Copied: head/sys/cddl/contrib/opensolaris/uts/common/rpc/ 
opensolaris_xdr.c (from r191983, head/sys/cddl/contrib/opensolaris/ 
uts/common/rpc/xdr.c)
= 
= 
= 
= 
= 
= 
= 
= 
==

--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/cddl/contrib/opensolaris/uts/common/rpc/ 
opensolaris_xdr.c	Mon May 11 04:18:58 2009	(r191984, copy of  
r191983, head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.c)

@@ -0,0 +1,621 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/ 
OPENSOLARIS.LICENSE

+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own  
identifying

+ * information: Portions Copyright [] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
+/*   All Rights Reserved   */
+
+/*
+ * Portions of this source code were derived from Berkeley 4.3 BSD
+ * under license from the Regents of the University of California.
+ */
+
+/*
+ * xdr.c, generic XDR routines implementation.
+ * These are the "generic" xdr routines used to serialize and de- 
serialize
+ * most common data items.  See xdr.h for more info on the  
interface to

+ * xdr.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#pragma weak xdr_int32_t = xdr_int
+#pragma weak xdr_uint32_t = xdr_u_int
+#pragma weak xdr_int64_t = xdr_longlong_t
+#pragma weak xdr_uint64_t = xdr_u_longlong_t
+
+#if defined(sun)
+#if !defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
+#error "Exactly one of _BIG_ENDIAN or _LITTLE_ENDIAN must be defined"
+#elif defined(_BIG_ENDIAN) && defined(_LITTLE_ENDIAN)
+#error "Only one of _BIG_ENDIAN or _LITTLE_ENDIAN may be defined"
+#endif
+#endif
+
+/*
+ * constants specific to the xdr "protocol"
+ */
+#defineXDR_FALSE   ((int32_t)0)
+#defineXDR_TRUE((int32_t)1)
+#defineLASTUNSIGNED((uint_t)0-1)
+
+/*
+ * for unit alignment
+ */
+static char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 };
+
+/*
+ * Free a data structure using XDR
+ * Not a filter, but a convenient utility nonetheless
+ */
+void
+xdr_free(xdrproc_t proc, char *objp)
+{
+   XDR x;
+
+   x.x_op = XDR_FREE;
+   (*proc)(&x, objp);
+}
+
+/*
+ * XDR nothing
+ */
+bool_t
+xdr_void(void)
+{
+   return (TRUE);
+}
+
+/*
+ * XDR integers
+ *
+ * PSARC 2003/523 Contract Private Interface
+ * xdr_int
+ * Changes must be reviewed by Solaris File Sharing
+ * Changes must be communicated to contract-2003-...@sun.com
+ */
+bool_t
+xdr_int(XDR *xdrs, int *ip)
+{
+   if (xdrs->x_op == XDR_ENCODE)
+   return (XDR_PUTINT32(xdrs, ip));
+
+   if (xdrs->x_op == XDR_DECODE)
+   return (XDR_GETINT32(xdrs, ip));
+
+   if (xdrs->x_op == XDR_FREE)
+   return (TRUE);
+
+   return (FALSE);
+}
+
+/*
+ * XDR unsigned integers
+ *
+ * PSARC 2003/523 Contract Private Interface
+ * xdr_u_int
+ * Changes must be reviewed by Solaris File Sharing
+ * Changes mus

svn commit: r191998 - head/sys/fs/nfsserver

2009-05-11 Thread Rick Macklem
Author: rmacklem
Date: Mon May 11 18:45:04 2009
New Revision: 191998
URL: http://svn.freebsd.org/changeset/base/191998

Log:
Modify nfsvno_fhtovp() to ensure that it always sets the credp
argument. Returning without credp set could result in a caller
doing crfree() on garbage.
  
  Reviewed by:  kan
  Approved by:  kib (mentor)

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

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cMon May 11 18:20:34 2009
(r191997)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cMon May 11 18:45:04 2009
(r191998)
@@ -2422,6 +2422,7 @@ nfsvno_fhtovp(struct mount *mp, fhandle_
int error;
int numsecflavor, *secflavors;
 
+   *credp = NULL;
error = VFS_FHTOVP(mp, &fhp->fh_fid, vpp);
if (nam && !error) {
error = VFS_CHECKEXP(mp, nam, &exp->nes_exflag, credp,
___
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: r191999 - head/sys/dev/snp

2009-05-11 Thread Ed Schouten
Author: ed
Date: Mon May 11 18:52:46 2009
New Revision: 191999
URL: http://svn.freebsd.org/changeset/base/191999

Log:
  Add macros around the sx operations in snp(4).
  
  As an experiment, I changed snp(4) to use a mutex instead of an sx lock.
  We can't enable this right now, because Syscons still picks up Giant.
  It's nice to already have the framework there.

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

Modified: head/sys/dev/snp/snp.c
==
--- head/sys/dev/snp/snp.c  Mon May 11 18:45:04 2009(r191998)
+++ head/sys/dev/snp/snp.c  Mon May 11 18:52:46 2009(r191999)
@@ -43,11 +43,22 @@ __FBSDID("$FreeBSD$");
 #include 
 
 static struct cdev *snp_dev;
+static MALLOC_DEFINE(M_SNP, "snp", "tty snoop device");
+
 /* XXX: should be mtx, but TTY can be locked by Giant. */
+#if 0
+static struct mtx  snp_register_lock;
+MTX_SYSINIT(snp_register_lock, &snp_register_lock,
+"tty snoop registration", MTX_DEF);
+#defineSNP_LOCK()  mtx_lock(&snp_register_lock)
+#defineSNP_UNLOCK()mtx_unlock(&snp_register_lock)
+#else
 static struct sx   snp_register_lock;
 SX_SYSINIT(snp_register_lock, &snp_register_lock,
 "tty snoop registration");
-static MALLOC_DEFINE(M_SNP, "snp", "tty snoop device");
+#defineSNP_LOCK()  sx_xlock(&snp_register_lock)
+#defineSNP_UNLOCK()sx_xunlock(&snp_register_lock)
+#endif
 
 /*
  * There is no need to have a big input buffer. In most typical setups,
@@ -241,14 +252,14 @@ snp_ioctl(struct cdev *dev, u_long cmd, 
switch (cmd) {
case SNPSTTY:
/* Bind TTY to snoop instance. */
-   sx_xlock(&snp_register_lock);
+   SNP_LOCK();
if (ss->snp_tty != NULL) {
-   sx_xunlock(&snp_register_lock);
+   SNP_UNLOCK();
return (EBUSY);
}
error = ttyhook_register(&ss->snp_tty, td->td_proc, *(int 
*)data,
&snp_hook, ss);
-   sx_xunlock(&snp_register_lock);
+   SNP_UNLOCK();
if (error != 0)
return (error);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


AT&T Wireless PC Aircard Offer (new price

2009-05-11 Thread Moshe with Copa International


Probably something similar to:  If you are seeing this message it it probably 
because your email client in unable to view html.  to view our html newsletter 
either change the html viewing option from within your email client or else you 
may laos view our newsletter online by clicking here: 
http://www.yourdomain/yournewsletter.html





*To prevent us from future contact unsubscribe using the link below:
unsubscribe me 
mailto:sa...@copatrade.com?subject=unsubscribe.me.xt:$$9ad27cee-dc47-4914-b079-ae5ce8098cff$34$$&body=Please
 remove me




xt:$$9ad27cee-dc47-4914-b079-ae5ce8098cff$34$$
___
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: r191984 - in head/sys: cddl/contrib/opensolaris/uts/common/rpc modules/zfs

2009-05-11 Thread Kip Macy
On Mon, May 11, 2009 at 11:21 AM, Doug Rabson  wrote:
> The XDR support code that is in the main kernel should have a very similar
> API to the opensolaris bits, possibly identical. Perhaps the opensolaris
> compat could use the main kernel's XDR implementation?

I tried that. The label reads end up failing when ZFS uses the libkern
implementation. Somewhere in there, there is a behavioral difference
between the two implementations.


At some point I'll track down the offending function.

-Kip


>
> On 11 May 2009, at 05:18, Kip Macy wrote:
>
>> Author: kmacy
>> Date: Mon May 11 04:18:58 2009
>> New Revision: 191984
>> URL: http://svn.freebsd.org/changeset/base/191984
>>
>> Log:
>>  rename xdr support files to avoid conflicts when linking in to the kernel
>>
>> Added:
>>  head/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr.c
>> (props changed)
>>    - copied unchanged from r191983,
>> head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.c
>>  head/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr_array.c
>>   (props changed)
>>    - copied unchanged from r191983,
>> head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr_array.c
>>  head/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr_mem.c
>> (props changed)
>>    - copied unchanged from r191983,
>> head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr_mem.c
>> Deleted:
>>  head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.c
>>  head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr_array.c
>>  head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr_mem.c
>> Modified:
>>  head/sys/modules/zfs/Makefile
>>
>> Copied: head/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr.c
>> (from r191983, head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.c)
>>
>> ==
>> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
>> +++ head/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr.c
>>   Mon May 11 04:18:58 2009        (r191984, copy of r191983,
>> head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.c)
>> @@ -0,0 +1,621 @@
>> +/*
>> + * CDDL HEADER START
>> + *
>> + * The contents of this file are subject to the terms of the
>> + * Common Development and Distribution License (the "License").
>> + * You may not use this file except in compliance with the License.
>> + *
>> + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
>> + * or http://www.opensolaris.org/os/licensing.
>> + * See the License for the specific language governing permissions
>> + * and limitations under the License.
>> + *
>> + * When distributing Covered Code, include this CDDL HEADER in each
>> + * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
>> + * If applicable, add the following below this CDDL HEADER, with the
>> + * fields enclosed by brackets "[]" replaced with your own identifying
>> + * information: Portions Copyright [] [name of copyright owner]
>> + *
>> + * CDDL HEADER END
>> + */
>> +/*
>> + * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
>> + * Use is subject to license terms.
>> + */
>> +
>> +/*     Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T     */
>> +/*       All Rights Reserved   */
>> +
>> +/*
>> + * Portions of this source code were derived from Berkeley 4.3 BSD
>> + * under license from the Regents of the University of California.
>> + */
>> +
>> +/*
>> + * xdr.c, generic XDR routines implementation.
>> + * These are the "generic" xdr routines used to serialize and
>> de-serialize
>> + * most common data items.  See xdr.h for more info on the interface to
>> + * xdr.
>> + */
>> +
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#include 
>> +#include 
>> +
>> +#pragma weak xdr_int32_t = xdr_int
>> +#pragma weak xdr_uint32_t = xdr_u_int
>> +#pragma weak xdr_int64_t = xdr_longlong_t
>> +#pragma weak xdr_uint64_t = xdr_u_longlong_t
>> +
>> +#if defined(sun)
>> +#if !defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
>> +#error "Exactly one of _BIG_ENDIAN or _LITTLE_ENDIAN must be defined"
>> +#elif defined(_BIG_ENDIAN) && defined(_LITTLE_ENDIAN)
>> +#error "Only one of _BIG_ENDIAN or _LITTLE_ENDIAN may be defined"
>> +#endif
>> +#endif
>> +
>> +/*
>> + * constants specific to the xdr "protocol"
>> + */
>> +#define        XDR_FALSE       ((int32_t)0)
>> +#define        XDR_TRUE        ((int32_t)1)
>> +#define        LASTUNSIGNED    ((uint_t)0-1)
>> +
>> +/*
>> + * for unit alignment
>> + */
>> +static char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 };
>> +
>> +/*
>> + * Free a data structure using XDR
>> + * Not a filter, but a convenient utility nonetheless
>> + */
>> +void
>> +xdr_free(xdrproc_t proc, char *objp)
>> +{
>> +       XDR x;
>> +
>> +       x.x_op = XDR_FREE;
>> +       (*proc)(&x, objp);
>> +}
>> +
>> +/*
>> + * XDR nothing
>> + */
>> +bool_t
>> +xdr_void(void)
>> +{
>> +       return (TRUE);
>> +}
>> +
>> +/*
>> + * XDR integers
>> + *
>>

svn commit: r192000 - in head/sys/fs: nfs nfsserver

2009-05-11 Thread Rick Macklem
Author: rmacklem
Date: Mon May 11 19:37:05 2009
New Revision: 192000
URL: http://svn.freebsd.org/changeset/base/192000

Log:
Change the name of the nfs server addsock structure from nfsd_args
to nfsd_addsock_args, so that it is consistent with the one in
sys/nfsserver/nfs.h.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/fs/nfs/nfs.h
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfs/nfs.h
==
--- head/sys/fs/nfs/nfs.h   Mon May 11 18:52:46 2009(r191999)
+++ head/sys/fs/nfs/nfs.h   Mon May 11 19:37:05 2009(r192000)
@@ -157,7 +157,7 @@
  * Structures for the nfssvc(2) syscall. Not that anyone but nfsd, mount_nfs
  * and nfsloaduser should ever try and use it.
  */
-struct nfsd_args {
+struct nfsd_addsock_args {
int sock;   /* Socket to serve */
caddr_t name;   /* Client addr for connection based sockets */
int namelen;/* Length of name */

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cMon May 11 18:52:46 2009
(r191999)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cMon May 11 19:37:05 2009
(r192000)
@@ -2866,7 +2866,7 @@ static int
 nfssvc_nfsd(struct thread *td, struct nfssvc_args *uap)
 {
struct file *fp;
-   struct nfsd_args nfsdarg;
+   struct nfsd_addsock_args nfsdarg;
int error;
 
if (uap->flag & NFSSVC_NFSDADDSOCK) {
___
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: r192001 - head/sys/kern

2009-05-11 Thread Konstantin Belousov
Author: kib
Date: Mon May 11 19:58:03 2009
New Revision: 192001
URL: http://svn.freebsd.org/changeset/base/192001

Log:
  Prevent overflow of uio_resid.
  
  Noted by: jhb
  MFC after:3 days

Modified:
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cMon May 11 19:37:05 2009
(r192000)
+++ head/sys/kern/vfs_syscalls.cMon May 11 19:58:03 2009
(r192001)
@@ -2596,6 +2596,9 @@ kern_readlinkat(struct thread *td, int f
struct nameidata nd;
int vfslocked;
 
+   if (count > INT_MAX)
+   return (EINVAL);
+
NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE |
AUDITVNODE1, pathseg, path, fd, td);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192002 - head/sys/sys

2009-05-11 Thread John Baldwin
Author: jhb
Date: Mon May 11 21:13:00 2009
New Revision: 192002
URL: http://svn.freebsd.org/changeset/base/192002

Log:
  *sigh*, while the kernel built, userland C did not.  Revert the previous
  commit and fix it correctly by removing the _KERNEL check entirely.  Now
  the kernel always sees the same value of NULL as userland meaning that it
  sees __null, 0, or 0L when compiled as C++, and '(void *)0' when compiled
  as C.

Modified:
  head/sys/sys/_null.h

Modified: head/sys/sys/_null.h
==
--- head/sys/sys/_null.hMon May 11 19:58:03 2009(r192001)
+++ head/sys/sys/_null.hMon May 11 21:13:00 2009(r192002)
@@ -28,18 +28,18 @@
 
 #ifndef NULL
 
+#if !defined(__cplusplus)
+#defineNULL((void *)0)
+#else
 #if defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4
 #defineNULL__null
 #else
-#if defined(_KERNEL) && !defined(__cplusplus)
-#defineNULL((void *)0)
-#else
 #if defined(__LP64__)
 #defineNULL(0L)
 #else
 #defineNULL0
 #endif /* __LP64__ */
-#endif /* _KERNEL && !__cplusplus */
 #endif /* __GNUG__ */
+#endif /* !__cplusplus */
 
 #endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r192003 - head/sys/dev/xen/console

2009-05-11 Thread Kip Macy
Author: kmacy
Date: Mon May 11 22:55:49 2009
New Revision: 192003
URL: http://svn.freebsd.org/changeset/base/192003

Log:
  xen console lock needs to be a spin lock in case it is acquired from an 
interrupt context

Modified:
  head/sys/dev/xen/console/console.c
  head/sys/dev/xen/console/xencons_ring.c
  head/sys/dev/xen/console/xencons_ring.h

Modified: head/sys/dev/xen/console/console.c
==
--- head/sys/dev/xen/console/console.c  Mon May 11 21:13:00 2009
(r192002)
+++ head/sys/dev/xen/console/console.c  Mon May 11 22:55:49 2009
(r192003)
@@ -76,17 +76,17 @@ static unsigned int wc, wp; /* write_con
 #defineXCUNIT(x)   (dev2unit(x))
 #define ISTTYOPEN(tp)  ((tp) && ((tp)->t_state & TS_ISOPEN))
 #define CN_LOCK_INIT(x, _name) \
-mtx_init(&x, _name, NULL, MTX_DEF|MTX_RECURSE)
+mtx_init(&x, _name, NULL, MTX_SPIN|MTX_RECURSE)
 
 #define CN_LOCK(l) 
\
do {
\
if (panicstr == NULL)   
\
-mtx_lock(&(l));\
+mtx_lock_spin(&(l));   \
} while (0)
 #define CN_UNLOCK(l)   
\
do {
\
if (panicstr == NULL)   
\
-mtx_unlock(&(l));  \
+mtx_unlock_spin(&(l)); \
} while (0)
 #define CN_LOCK_ASSERT(x)mtx_assert(&x, MA_OWNED)
 #define CN_LOCK_DESTROY(x)   mtx_destroy(&x)

Modified: head/sys/dev/xen/console/xencons_ring.c
==
--- head/sys/dev/xen/console/xencons_ring.c Mon May 11 21:13:00 2009
(r192002)
+++ head/sys/dev/xen/console/xencons_ring.c Mon May 11 22:55:49 2009
(r192003)
@@ -89,7 +89,7 @@ xencons_handle_input(void *unused)
struct xencons_interface *intf;
XENCONS_RING_IDX cons, prod;
 
-   mtx_lock(&cn_mtx);
+   CN_LOCK(cn_mtx);
intf = xencons_interface();
 
cons = intf->in_cons;
@@ -107,7 +107,7 @@ xencons_handle_input(void *unused)
notify_remote_via_evtchn(xen_start_info->console_evtchn);
 
xencons_tx();
-   mtx_unlock(&cn_mtx);
+   CN_UNLOCK(cn_mtx);
 }
 
 void 

Modified: head/sys/dev/xen/console/xencons_ring.h
==
--- head/sys/dev/xen/console/xencons_ring.h Mon May 11 21:13:00 2009
(r192002)
+++ head/sys/dev/xen/console/xencons_ring.h Mon May 11 22:55:49 2009
(r192003)
@@ -5,6 +5,17 @@
 #ifndef _XENCONS_RING_H
 #define _XENCONS_RING_H
 
+#define CN_LOCK(l) 
\
+   do {
\
+   if (panicstr == NULL)   
\
+mtx_lock_spin(&(l));   \
+   } while (0)
+#define CN_UNLOCK(l)   
\
+   do {
\
+   if (panicstr == NULL)   
\
+mtx_unlock_spin(&(l)); \
+   } while (0)
+
 int xencons_ring_init(void);
 int xencons_ring_send(const char *data, unsigned len);
 void xencons_rx(char *buf, unsigned len);
___
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: r192004 - head/sys/dev/xen/console

2009-05-11 Thread Kip Macy
Author: kmacy
Date: Mon May 11 23:03:15 2009
New Revision: 192004
URL: http://svn.freebsd.org/changeset/base/192004

Log:
  don't acquire tty lock with console lock held

Modified:
  head/sys/dev/xen/console/console.c
  head/sys/dev/xen/console/xencons_ring.c

Modified: head/sys/dev/xen/console/console.c
==
--- head/sys/dev/xen/console/console.c  Mon May 11 22:55:49 2009
(r192003)
+++ head/sys/dev/xen/console/console.c  Mon May 11 23:03:15 2009
(r192004)
@@ -287,8 +287,10 @@ xencons_rx(char *buf, unsigned len)
ttydisc_rint_done(tp);
tty_unlock(tp);
} else {
+   CN_LOCK(cn_mtx);
for (i = 0; i < len; i++)
rbuf[RBUF_MASK(rp++)] = buf[i];
+   CN_UNLOCK(cn_mtx);
}
 }
 

Modified: head/sys/dev/xen/console/xencons_ring.c
==
--- head/sys/dev/xen/console/xencons_ring.c Mon May 11 22:55:49 2009
(r192003)
+++ head/sys/dev/xen/console/xencons_ring.c Mon May 11 23:03:15 2009
(r192004)
@@ -94,7 +94,8 @@ xencons_handle_input(void *unused)
 
cons = intf->in_cons;
prod = intf->in_prod;
-
+   CN_UNLOCK(cn_mtx);
+   
/* XXX needs locking */
while (cons != prod) {
xencons_rx(intf->in + MASK_XENCONS_IDX(cons, intf->in), 1);
@@ -104,6 +105,7 @@ xencons_handle_input(void *unused)
mb();
intf->in_cons = cons;
 
+   CN_LOCK(cn_mtx);
notify_remote_via_evtchn(xen_start_info->console_evtchn);
 
xencons_tx();
___
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: r192006 - head/sys/dev/usb

2009-05-11 Thread Weongyo Jeong
Author: weongyo
Date: Tue May 12 02:05:42 2009
New Revision: 192006
URL: http://svn.freebsd.org/changeset/base/192006

Log:
  Add WUSB54AG and XM142 entries for upgt(4)

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsTue May 12 01:00:30 2009(r192005)
+++ head/sys/dev/usb/usbdevsTue May 12 02:05:42 2009(r192006)
@@ -1023,6 +1023,7 @@ product CHPRODUCTS FIGHTERSTICK 0x00f3F
 product CHPRODUCTS FLIGHTYOKE  0x00ff  Flight Sim Yoke
 
 /* Cisco-Linksys products */
+product CISCOLINKSYS WUSB54AG  0x000c  WUSB54AG Wireless Adapter
 product CISCOLINKSYS WUSB54G   0x000d  WUSB54G Wireless Adapter
 product CISCOLINKSYS WUSB54GP  0x0011  WUSB54GP Wireless Adapter
 product CISCOLINKSYS USB200MV2 0x0018  USB200M v2
@@ -2516,6 +2517,7 @@ product ZCOM XG703A   0x0008  PrismGT USB 
 product ZCOM ZD12110x0011  ZD1211
 product ZCOM AR55230x0012  AR5523
 product ZCOM AR5523_NF 0x0013  AR5523 driver (no firmware)
+product ZCOM XM142 0x0015  XM-142
 product ZCOM ZD1211B   0x001a  ZD1211B
 
 /* Zinwell products */
___
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: r192007 - head/sys/modules/usb

2009-05-11 Thread Weongyo Jeong
Author: weongyo
Date: Tue May 12 02:08:56 2009
New Revision: 192007
URL: http://svn.freebsd.org/changeset/base/192007

Log:
  connect upgt(4) to the build.  It should work on all architectures.

Modified:
  head/sys/modules/usb/Makefile

Modified: head/sys/modules/usb/Makefile
==
--- head/sys/modules/usb/Makefile   Tue May 12 02:05:42 2009
(r192006)
+++ head/sys/modules/usb/Makefile   Tue May 12 02:08:56 2009
(r192007)
@@ -28,7 +28,7 @@
 SUBDIR = usb
 #SUBDIR += ubt bluetooth_ng ubtfw
 SUBDIR += ehci musb ohci uhci uss820dci ${_at91dci} ${_atmegadci}
-SUBDIR += rum uath ural zyd
+SUBDIR += rum uath upgt ural zyd
 SUBDIR += uhid ukbd ums udbp ufm
 SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt 
\
  umct umodem umoscom uplcom uslcom uvisor uvscom
___
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: r192008 - stable/7/libexec/rtld-elf

2009-05-11 Thread Xin LI
Author: delphij
Date: Tue May 12 02:17:25 2009
New Revision: 192008
URL: http://svn.freebsd.org/changeset/base/192008

Log:
  MFC r190324:
  
  Support for a new environment variable, LD_ELF_HINTS_PATH for overriding
  the rtld hints file.  This environment variable would be unset if the
  process is considered as tainted with setuid/setgid.  This feature gives
  a convenient way of using a custom set of shared library that is not
  located in the default location and switch back.
  
  Feature requested by: iXsystems
  Original patch by:John Hixson
  MFC after:2 weeks

Modified:
  stable/7/libexec/rtld-elf/   (props changed)
  stable/7/libexec/rtld-elf/rtld.1
  stable/7/libexec/rtld-elf/rtld.c

Modified: stable/7/libexec/rtld-elf/rtld.1
==
--- stable/7/libexec/rtld-elf/rtld.1Tue May 12 02:08:56 2009
(r192007)
+++ stable/7/libexec/rtld-elf/rtld.1Tue May 12 02:17:25 2009
(r192008)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 27, 2006
+.Dd March 23, 2009
 .Dt RTLD 1
 .Os
 .Sh NAME
@@ -116,6 +116,11 @@ If set, disables the use of
 and
 .Ev LD_LIBMAP .
 This variable is unset for set-user-ID and set-group-ID programs.
+.It Ev LD_ELF_HINTS_PATH
+This variable will override the default location of
+.Dq hints
+file.
+This variable is unset for set-user-ID and set-group-ID programs.
 .It Ev LD_LIBRARY_PATH
 A colon separated list of directories, overriding the default search path
 for shared libraries.

Modified: stable/7/libexec/rtld-elf/rtld.c
==
--- stable/7/libexec/rtld-elf/rtld.cTue May 12 02:08:56 2009
(r192007)
+++ stable/7/libexec/rtld-elf/rtld.cTue May 12 02:17:25 2009
(r192008)
@@ -157,6 +157,7 @@ static char *ld_debug;  /* Environment v
 static char *ld_library_path;  /* Environment variable for search path */
 static char *ld_preload;   /* Environment variable for libraries to
   load first */
+static char *ld_elf_hints_path;/* Environment variable for alternative 
hints path */
 static char *ld_tracing;   /* Called from ldd to print libs */
 static char *ld_utrace;/* Use utrace() to log events. */
 static Obj_Entry *obj_list;/* Head of linked list of shared objects */
@@ -365,17 +366,23 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
 unsetenv(LD_ "LIBRARY_PATH");
 unsetenv(LD_ "LIBMAP_DISABLE");
 unsetenv(LD_ "DEBUG");
+unsetenv(LD_ "ELF_HINTS_PATH");
 }
 ld_debug = getenv(LD_ "DEBUG");
 libmap_disable = getenv(LD_ "LIBMAP_DISABLE") != NULL;
 libmap_override = getenv(LD_ "LIBMAP");
 ld_library_path = getenv(LD_ "LIBRARY_PATH");
 ld_preload = getenv(LD_ "PRELOAD");
+ld_elf_hints_path = getenv(LD_ "ELF_HINTS_PATH");
 dangerous_ld_env = libmap_disable || (libmap_override != NULL) ||
-   (ld_library_path != NULL) || (ld_preload != NULL);
+   (ld_library_path != NULL) || (ld_preload != NULL) ||
+   (ld_elf_hints_path != NULL);
 ld_tracing = getenv(LD_ "TRACE_LOADED_OBJECTS");
 ld_utrace = getenv(LD_ "UTRACE");
 
+if ((ld_elf_hints_path == NULL) || strlen(ld_elf_hints_path) == 0)
+   ld_elf_hints_path = _PATH_ELF_HINTS;
+
 if (ld_debug != NULL && *ld_debug != '\0')
debug = 1;
 dbg("%s is initialized, base address = %p", __progname,
@@ -1094,7 +1101,7 @@ gethints(void)
/* Keep from trying again in case the hints file is bad. */
hints = "";
 
-   if ((fd = open(_PATH_ELF_HINTS, O_RDONLY)) == -1)
+   if ((fd = open(ld_elf_hints_path, O_RDONLY)) == -1)
return NULL;
if (read(fd, &hdr, sizeof hdr) != sizeof hdr ||
  hdr.magic != ELFHINTS_MAGIC ||
___
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: r192009 - head/sys/dev/cxgb

2009-05-11 Thread Kip Macy
Author: kmacy
Date: Tue May 12 03:30:25 2009
New Revision: 192009
URL: http://svn.freebsd.org/changeset/base/192009

Log:
  fix bug introduced by last change
  
  Submitted by: Navdeep Parhar

Modified:
  head/sys/dev/cxgb/cxgb_multiq.c

Modified: head/sys/dev/cxgb/cxgb_multiq.c
==
--- head/sys/dev/cxgb/cxgb_multiq.c Tue May 12 02:17:25 2009
(r192008)
+++ head/sys/dev/cxgb/cxgb_multiq.c Tue May 12 03:30:25 2009
(r192009)
@@ -296,7 +296,7 @@ cxgb_pcpu_start_(struct sge_qset *qs, st
}
 
stopped = isset(&qs->txq_stopped, TXQ_ETH);
-   flush = ((drbr_empty(pi->ifp, txq->txq_mr)
+   flush = ((!drbr_empty(pi->ifp, txq->txq_mr)
 && !stopped) || txq->immpkt); 
max_desc = tx_flush ? TX_ETH_Q_SIZE : TX_START_MAX_DESC;

___
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: r191984 - in head/sys: cddl/contrib/opensolaris/uts/common/rpc modules/zfs

2009-05-11 Thread Kip Macy
Here is the problem, FreeBSD is sloppy about 32-bit vs. 64-bit for xdr
whereas in the kernel, Solaris is not.



Solaris:
bool_t
xdr_int(XDR *xdrs, int *ip)
{
if (xdrs->x_op == XDR_ENCODE)
return (XDR_PUTINT32(xdrs, ip));

if (xdrs->x_op == XDR_DECODE)
return (XDR_GETINT32(xdrs, ip));

if (xdrs->x_op == XDR_FREE)
return (TRUE);

return (FALSE);
}


#if !defined(_LP64) && !defined(_KERNEL)

/*
 * For binary compatability on ILP32 we do not change the shape
 * of the XDR structure and the GET/PUTINT32 functions just use
 * the get/putlong vectors which operate on identically-sized
 * units of data.
 */

#define XDR_GETINT32(xdrs, int32p)  \
(*(xdrs)->x_ops->x_getlong)(xdrs, (long *)int32p)
#define xdr_getint32(xdrs, int32p)  \
(*(xdrs)->x_ops->x_getlong)(xdrs, (long *)int32p)

#define XDR_PUTINT32(xdrs, int32p)  \
(*(xdrs)->x_ops->x_putlong)(xdrs, (long *)int32p)
#define xdr_putint32(xdrs, int32p)  \
(*(xdrs)->x_ops->x_putlong)(xdrs, (long *)int32p)

#else /* !_LP64 && !_KERNEL */

#define XDR_GETINT32(xdrs, int32p)  \
(*(xdrs)->x_ops->x_getint32)(xdrs, int32p)
#define xdr_getint32(xdrs, int32p)  \
(*(xdrs)->x_ops->x_getint32)(xdrs, int32p)

#define XDR_PUTINT32(xdrs, int32p)  \
(*(xdrs)->x_ops->x_putint32)(xdrs, int32p)
#define xdr_putint32(xdrs, int32p)  \
(*(xdrs)->x_ops->x_putint32)(xdrs, int32p)

#endif /* !_LP64 && !_KERNEL */

FreeBSD:

bool_t
xdr_int(XDR *xdrs, int *ip)
{
long l;

switch (xdrs->x_op) {

case XDR_ENCODE:
l = (long) *ip;
return (XDR_PUTLONG(xdrs, &l));

case XDR_DECODE:
if (!XDR_GETLONG(xdrs, &l)) {
return (FALSE);
}
*ip = (int) l;
return (TRUE);

case XDR_FREE:
return (TRUE);
}
/* NOTREACHED */
return (FALSE);
}

On Mon, May 11, 2009 at 12:23 PM, Kip Macy  wrote:
> On Mon, May 11, 2009 at 11:21 AM, Doug Rabson  wrote:
>> The XDR support code that is in the main kernel should have a very similar
>> API to the opensolaris bits, possibly identical. Perhaps the opensolaris
>> compat could use the main kernel's XDR implementation?
>
> I tried that. The label reads end up failing when ZFS uses the libkern
> implementation. Somewhere in there, there is a behavioral difference
> between the two implementations.
>
>
> At some point I'll track down the offending function.
>
> -Kip
>
>
>>
>> On 11 May 2009, at 05:18, Kip Macy wrote:
>>
>>> Author: kmacy
>>> Date: Mon May 11 04:18:58 2009
>>> New Revision: 191984
>>> URL: http://svn.freebsd.org/changeset/base/191984
>>>
>>> Log:
>>>  rename xdr support files to avoid conflicts when linking in to the kernel
>>>
>>> Added:
>>>  head/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr.c
>>> (props changed)
>>>    - copied unchanged from r191983,
>>> head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.c
>>>  head/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr_array.c
>>>   (props changed)
>>>    - copied unchanged from r191983,
>>> head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr_array.c
>>>  head/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr_mem.c
>>> (props changed)
>>>    - copied unchanged from r191983,
>>> head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr_mem.c
>>> Deleted:
>>>  head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.c
>>>  head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr_array.c
>>>  head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr_mem.c
>>> Modified:
>>>  head/sys/modules/zfs/Makefile
>>>
>>> Copied: head/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr.c
>>> (from r191983, head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.c)
>>>
>>> ==
>>> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
>>> +++ head/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr.c
>>>   Mon May 11 04:18:58 2009        (r191984, copy of r191983,
>>> head/sys/cddl/contrib/opensolaris/uts/common/rpc/xdr.c)
>>> @@ -0,0 +1,621 @@
>>> +/*
>>> + * CDDL HEADER START
>>> + *
>>> + * The contents of this file are subject to the terms of the
>>> + * Common Development and Distribution License (the "License").
>>> + * You may not use this file except in compliance with the License.
>>> + *
>>> + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
>>> + * or http://www.opensolaris.org/os/licensing.
>>> + * See the License for the specific language governing permissions
>>> + * and limitations under the License.
>>> + *
>>> + * When distributing Covered Code, include this CDDL HEADER in each

svn commit: r192010 - in head/sys: fs/smbfs nfsclient vm

2009-05-11 Thread Alan Cox
Author: alc
Date: Tue May 12 05:49:02 2009
New Revision: 192010
URL: http://svn.freebsd.org/changeset/base/192010

Log:
  Eliminate gratuitous clearing of the page's dirty mask.

Modified:
  head/sys/fs/smbfs/smbfs_io.c
  head/sys/nfsclient/nfs_bio.c
  head/sys/vm/vnode_pager.c

Modified: head/sys/fs/smbfs/smbfs_io.c
==
--- head/sys/fs/smbfs/smbfs_io.cTue May 12 03:30:25 2009
(r192009)
+++ head/sys/fs/smbfs/smbfs_io.cTue May 12 05:49:02 2009
(r192010)
@@ -517,7 +517,8 @@ smbfs_getpages(ap)
 * Read operation filled an entire page
 */
m->valid = VM_PAGE_BITS_ALL;
-   vm_page_undirty(m);
+   KASSERT(m->dirty == 0,
+   ("smbfs_getpages: page %p is dirty", m));
} else if (size > toff) {
/*
 * Read operation filled a partial page.

Modified: head/sys/nfsclient/nfs_bio.c
==
--- head/sys/nfsclient/nfs_bio.cTue May 12 03:30:25 2009
(r192009)
+++ head/sys/nfsclient/nfs_bio.cTue May 12 05:49:02 2009
(r192010)
@@ -209,7 +209,8 @@ nfs_getpages(struct vop_getpages_args *a
 * Read operation filled an entire page
 */
m->valid = VM_PAGE_BITS_ALL;
-   vm_page_undirty(m);
+   KASSERT(m->dirty == 0,
+   ("nfs_getpages: page %p is dirty", m));
} else if (size > toff) {
/*
 * Read operation filled a partial page.

Modified: head/sys/vm/vnode_pager.c
==
--- head/sys/vm/vnode_pager.c   Tue May 12 03:30:25 2009(r192009)
+++ head/sys/vm/vnode_pager.c   Tue May 12 05:49:02 2009(r192010)
@@ -762,7 +762,8 @@ vnode_pager_generic_getpages(vp, m, byte
return VM_PAGER_OK;
} else if (reqblock == -1) {
pmap_zero_page(m[reqpage]);
-   vm_page_undirty(m[reqpage]);
+   KASSERT(m[reqpage]->dirty == 0,
+   ("vnode_pager_generic_getpages: page %p is dirty", m));
m[reqpage]->valid = VM_PAGE_BITS_ALL;
vm_page_lock_queues();
for (i = 0; i < count; i++)
___
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"