PERFORCE change 136693 for review
Marcel Moolenaar
marcel at FreeBSD.org
Sun Mar 2 21:45:47 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=136693
Change 136693 by marcel at marcel_xcllnt on 2008/03/02 21:45:19
IFC @136692
Affected files ...
.. //depot/projects/e500/lib/msun/ld128/s_nanl.c#3 integrate
.. //depot/projects/e500/share/man/man9/lock.9#8 integrate
.. //depot/projects/e500/sys/fs/nwfs/nwfs_node.c#5 integrate
.. //depot/projects/e500/sys/fs/smbfs/smbfs.h#2 integrate
.. //depot/projects/e500/sys/fs/smbfs/smbfs_node.c#6 integrate
.. //depot/projects/e500/sys/fs/smbfs/smbfs_vfsops.c#4 integrate
.. //depot/projects/e500/sys/kern/sched_4bsd.c#8 integrate
.. //depot/projects/e500/sys/security/audit/audit_trigger.c#4 integrate
.. //depot/projects/e500/tools/regression/lib/msun/test-trig.c#2 integrate
Differences ...
==== //depot/projects/e500/lib/msun/ld128/s_nanl.c#3 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/lib/msun/ld128/s_nanl.c,v 1.2 2007/12/18 23:46:31 das Exp $
+ * $FreeBSD: src/lib/msun/ld128/s_nanl.c,v 1.3 2008/03/02 20:16:55 das Exp $
*/
#include <math.h>
@@ -41,6 +41,6 @@
_scan_nan(u.bits, 4, s);
u.ieee.bits.exp = 0x7fff;
- u.ieee.bits.manh |= 1 << 47; /* make it a quiet NaN */
+ u.ieee.bits.manh |= 1ULL << 47; /* make it a quiet NaN */
return (u.ieee.e);
}
==== //depot/projects/e500/share/man/man9/lock.9#8 (text+ko) ====
@@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
.\" DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man9/lock.9,v 1.29 2008/03/01 21:24:07 attilio Exp $
+.\" $FreeBSD: src/share/man/man9/lock.9,v 1.30 2008/03/02 20:07:48 brueffer Exp $
.\"
.Dd March 1, 2008
.Dt LOCK 9
@@ -193,7 +193,8 @@
.Fa timo
and
.Fa prio
-on a per-instance basis. The specified values will override the default
+on a per-instance basis.
+The specified values will override the default
ones, but this can still be used passing, respectively,
.Dv LK_WMESG_DEFAULT ,
.Dv LK_PRIO_DEFAULT
==== //depot/projects/e500/sys/fs/nwfs/nwfs_node.c#5 (text+ko) ====
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/fs/nwfs/nwfs_node.c,v 1.42 2008/02/24 16:38:56 attilio Exp $
+ * $FreeBSD: src/sys/fs/nwfs/nwfs_node.c,v 1.43 2008/03/02 19:02:30 rwatson Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
@@ -40,6 +40,7 @@
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/queue.h>
+#include <sys/sx.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/vnode.h>
@@ -62,7 +63,7 @@
static LIST_HEAD(nwnode_hash_head,nwnode) *nwhashtbl;
static u_long nwnodehash;
-static struct lock nwhashlock;
+static struct sx nwhashlock;
static MALLOC_DEFINE(M_NWNODE, "nwfs_node", "NWFS vnode private part");
static MALLOC_DEFINE(M_NWFSHASH, "nwfs_hash", "NWFS has table");
@@ -77,12 +78,12 @@
void
nwfs_hash_init(void) {
nwhashtbl = hashinit(desiredvnodes, M_NWFSHASH, &nwnodehash);
- lockinit(&nwhashlock, PVFS, "nwfshl", 0, 0);
+ sx_init(&nwhashlock, "nwfshl");
}
void
nwfs_hash_free(void) {
- lockdestroy(&nwhashlock);
+ sx_destroy(&nwhashlock);
free(nwhashtbl, M_NWFSHASH);
}
@@ -118,6 +119,8 @@
struct nwnode *np;
struct nwnode_hash_head *nhpp;
+ sx_assert(&nwhashlock, SA_XLOCKED);
+
nhpp = NWNOHASH(fid);
LIST_FOREACH(np, nhpp, n_hash) {
if (nmp != np->n_mount || !NWCMPF(&fid, &np->n_fid))
@@ -144,12 +147,12 @@
int error;
loop:
- lockmgr(&nwhashlock, LK_EXCLUSIVE, NULL);
+ sx_xlock(&nwhashlock);
rescan:
if (nwfs_hashlookup(nmp, fid, &np) == 0) {
vp = NWTOV(np);
mtx_lock(&vp->v_interlock);
- lockmgr(&nwhashlock, LK_RELEASE, NULL);
+ sx_xunlock(&nwhashlock);
if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, curthread))
goto loop;
if (fap)
@@ -157,7 +160,7 @@
*vpp = vp;
return(0);
}
- lockmgr(&nwhashlock, LK_RELEASE, NULL);
+ sx_xunlock(&nwhashlock);
if (fap == NULL || ((fap->attributes & aDIR) == 0 && dvp == NULL))
panic("nwfs_allocvp: fap = %p, dvp = %p\n", fap, dvp);
@@ -189,7 +192,7 @@
np->n_parent = VTONW(dvp)->n_fid;
}
VN_LOCK_AREC(vp);
- lockmgr(&nwhashlock, LK_EXCLUSIVE, NULL);
+ sx_xlock(&nwhashlock);
/*
* Another process can create vnode while we blocked in malloc() or
* getnewvnode(). Rescan list again.
@@ -205,7 +208,7 @@
nhpp = NWNOHASH(fid);
LIST_INSERT_HEAD(nhpp, np, n_hash);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
- lockmgr(&nwhashlock, LK_RELEASE, NULL);
+ sx_xunlock(&nwhashlock);
ASSERT_VOP_LOCKED(dvp, "nwfs_allocvp");
if (vp->v_type == VDIR && dvp && (dvp->v_vflag & VV_ROOT) == 0) {
@@ -238,9 +241,9 @@
{
int error;
- lockmgr(&nwhashlock, LK_EXCLUSIVE, NULL);
+ sx_xlock(&nwhashlock);
error = nwfs_hashlookup(nmp, fid, npp);
- lockmgr(&nwhashlock, LK_RELEASE, NULL);
+ sx_xunlock(&nwhashlock);
return error;
}
@@ -273,9 +276,9 @@
NCPVNDEBUG("%s: has no parent ?\n",np->n_name);
}
}
- lockmgr(&nwhashlock, LK_EXCLUSIVE, NULL);
+ sx_xlock(&nwhashlock);
LIST_REMOVE(np, n_hash);
- lockmgr(&nwhashlock, LK_RELEASE, NULL);
+ sx_xunlock(&nwhashlock);
if (nmp->n_root == np) {
nmp->n_root = NULL;
}
==== //depot/projects/e500/sys/fs/smbfs/smbfs.h#2 (text+ko) ====
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/fs/smbfs/smbfs.h,v 1.12 2005/01/14 08:52:55 phk Exp $
+ * $FreeBSD: src/sys/fs/smbfs/smbfs.h,v 1.13 2008/03/02 18:56:13 rwatson Exp $
*/
#ifndef _SMBFS_SMBFS_H_
#define _SMBFS_SMBFS_H_
@@ -65,6 +65,8 @@
#ifdef _KERNEL
+#include <sys/_sx.h>
+
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_SMBFSMNT);
#endif
@@ -90,7 +92,7 @@
/* struct simplelock sm_npslock;*/
struct smbnode * sm_npstack[SMBFS_MAXPATHCOMP];
int sm_caseopt;
- struct lock sm_hashlock;
+ struct sx sm_hashlock;
LIST_HEAD(smbnode_hashhead, smbnode) *sm_hash;
u_long sm_hashlen;
int sm_didrele;
==== //depot/projects/e500/sys/fs/smbfs/smbfs_node.c#6 (text+ko) ====
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/fs/smbfs/smbfs_node.c,v 1.37 2008/02/24 16:38:57 attilio Exp $
+ * $FreeBSD: src/sys/fs/smbfs/smbfs_node.c,v 1.38 2008/03/02 18:56:13 rwatson Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
@@ -40,6 +40,7 @@
#include <sys/proc.h>
#include <sys/queue.h>
#include <sys/stat.h>
+#include <sys/sx.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/vnode.h>
@@ -58,11 +59,8 @@
#include <fs/smbfs/smbfs_subr.h>
#define SMBFS_NOHASH(smp, hval) (&(smp)->sm_hash[(hval) & (smp)->sm_hashlen])
-#define smbfs_hash_lock(smp, td) \
- lockmgr(&smp->sm_hashlock, LK_EXCLUSIVE, NULL)
-#define smbfs_hash_unlock(smp, td) \
- lockmgr(&smp->sm_hashlock, LK_RELEASE, NULL)
-
+#define smbfs_hash_lock(smp, td) sx_xlock(&smp->sm_hashlock)
+#define smbfs_hash_unlock(smp, td) sx_xunlock(&smp->sm_hashlock)
extern struct vop_vector smbfs_vnodeops; /* XXX -> .h file */
==== //depot/projects/e500/sys/fs/smbfs/smbfs_vfsops.c#4 (text+ko) ====
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/fs/smbfs/smbfs_vfsops.c,v 1.43 2008/01/13 14:44:05 attilio Exp $
+ * $FreeBSD: src/sys/fs/smbfs/smbfs_vfsops.c,v 1.44 2008/03/02 18:56:13 rwatson Exp $
*/
#include <sys/param.h>
@@ -44,6 +44,7 @@
#include <sys/stat.h>
#include <sys/malloc.h>
#include <sys/module.h>
+#include <sys/sx.h>
#include <netsmb/smb.h>
@@ -192,7 +193,7 @@
smp->sm_hash = hashinit(desiredvnodes, M_SMBFSHASH, &smp->sm_hashlen);
if (smp->sm_hash == NULL)
goto bad;
- lockinit(&smp->sm_hashlock, PVFS, "smbfsh", 0, 0);
+ sx_init(&smp->sm_hashlock, "smbfsh");
smp->sm_share = ssp;
smp->sm_root = NULL;
if (1 != vfs_scanopt(mp->mnt_optnew,
@@ -264,7 +265,7 @@
if (smp) {
if (smp->sm_hash)
free(smp->sm_hash, M_SMBFSHASH);
- lockdestroy(&smp->sm_hashlock);
+ sx_destroy(&smp->sm_hashlock);
#ifdef SMBFS_USEZONE
zfree(smbfsmount_zone, smp);
#else
@@ -312,7 +313,7 @@
if (smp->sm_hash)
free(smp->sm_hash, M_SMBFSHASH);
- lockdestroy(&smp->sm_hashlock);
+ sx_destroy(&smp->sm_hashlock);
#ifdef SMBFS_USEZONE
zfree(smbfsmount_zone, smp);
#else
==== //depot/projects/e500/sys/kern/sched_4bsd.c#8 (text+ko) ====
@@ -33,12 +33,13 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/sched_4bsd.c,v 1.113 2008/03/02 07:19:35 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/sched_4bsd.c,v 1.114 2008/03/02 21:34:57 marcel Exp $");
#include "opt_hwpmc_hooks.h"
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/cpuset.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/lock.h>
@@ -646,6 +647,7 @@
{
childtd->td_estcpu = td->td_estcpu;
childtd->td_lock = &sched_lock;
+ childtd->td_cpuset = cpuset_ref(td->td_cpuset);
sched_newthread(childtd);
}
==== //depot/projects/e500/sys/security/audit/audit_trigger.c#4 (text) ====
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/security/audit/audit_trigger.c,v 1.6 2008/03/01 11:04:04 rwatson Exp $
+ * $FreeBSD: src/sys/security/audit/audit_trigger.c,v 1.7 2008/03/02 21:34:17 rwatson Exp $
*/
#include <sys/param.h>
@@ -113,7 +113,7 @@
}
mtx_unlock(&audit_trigger_mtx);
if (!error) {
- error = uiomove(ti, sizeof *ti, uio);
+ error = uiomove(&ti->trigger, sizeof(ti->trigger), uio);
free(ti, M_AUDITTRIGGER);
}
return (error);
==== //depot/projects/e500/tools/regression/lib/msun/test-trig.c#2 (text+ko) ====
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/tools/regression/lib/msun/test-trig.c,v 1.1 2008/02/18 02:00:16 das Exp $");
+__FBSDID("$FreeBSD: src/tools/regression/lib/msun/test-trig.c,v 1.2 2008/03/02 20:49:24 das Exp $");
#include <assert.h>
#include <fenv.h>
@@ -65,16 +65,23 @@
#define test(func, x, result, exceptmask, excepts) do { \
volatile long double _d = x; \
assert(feclearexcept(FE_ALL_EXCEPT) == 0); \
- assert(fpequal((func)(_d), (result))); \
+ assert(fpequal((func)(_d), (result))); \
assert(((func), fetestexcept(exceptmask) == (excepts))); \
} while (0)
#define testall(prefix, x, result, exceptmask, excepts) do { \
- test(prefix, x, (double)result, exceptmask, excepts); \
+ test(prefix, x, (double)result, exceptmask, excepts); \
test(prefix##f, x, (float)result, exceptmask, excepts); \
test(prefix##l, x, result, exceptmask, excepts); \
} while (0)
+#define testdf(prefix, x, result, exceptmask, excepts) do { \
+ test(prefix, x, (double)result, exceptmask, excepts); \
+ test(prefix##f, x, (float)result, exceptmask, excepts); \
+} while (0)
+
+
+
/*
* Determine whether x and y are equal, with two special rules:
* +0.0 != -0.0
@@ -238,17 +245,22 @@
* These tests should pass for f32, d64, and ld80 as long as
* the error is <= 0.75 ulp (round to nearest)
*/
- testall(sin, 0.17255452780841205174L, 0.17169949801444412683L,
+#if LDBL_MANT_DIG <= 64
+#define testacc testall
+#else
+#define testacc testdf
+#endif
+ testacc(sin, 0.17255452780841205174L, 0.17169949801444412683L,
ALL_STD_EXCEPT, FE_INEXACT);
- testall(sin, -0.75431944555904520893L, -0.68479288156557286353L,
+ testacc(sin, -0.75431944555904520893L, -0.68479288156557286353L,
ALL_STD_EXCEPT, FE_INEXACT);
- testall(cos, 0.70556358769838947292L, 0.76124620693117771850L,
+ testacc(cos, 0.70556358769838947292L, 0.76124620693117771850L,
ALL_STD_EXCEPT, FE_INEXACT);
- testall(cos, -0.34061437849088045332L, 0.94254960031831729956L,
+ testacc(cos, -0.34061437849088045332L, 0.94254960031831729956L,
ALL_STD_EXCEPT, FE_INEXACT);
- testall(tan, -0.15862817413325692897L, -0.15997221861309522115L,
+ testacc(tan, -0.15862817413325692897L, -0.15997221861309522115L,
ALL_STD_EXCEPT, FE_INEXACT);
- testall(tan, 0.38374784931303813530L, 0.40376500259976759951L,
+ testacc(tan, 0.38374784931303813530L, 0.40376500259976759951L,
ALL_STD_EXCEPT, FE_INEXACT);
/*
More information about the p4-projects
mailing list