CVS commit: src/x11/bin/xinit

2010-10-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Oct 10 07:03:28 UTC 2010

Modified Files:
src/x11/bin/xinit: Makefile

Log Message:
Disable USE_PAM on ports which have legacy non-XFree86 servers.
With this change, xinit(1) can properly quit Xserver after
xinitrc script exits.

Tested on dreamcast (-current) and hpcmips (netbsd-5).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/x11/bin/xinit/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/x11/bin/xinit/Makefile
diff -u src/x11/bin/xinit/Makefile:1.7 src/x11/bin/xinit/Makefile:1.8
--- src/x11/bin/xinit/Makefile:1.7	Wed Mar  2 01:06:15 2005
+++ src/x11/bin/xinit/Makefile	Sun Oct 10 07:03:28 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2005/03/02 01:06:15 christos Exp $
+#	$NetBSD: Makefile,v 1.8 2010/10/10 07:03:28 tsutsui Exp $
 
 .include bsd.own.mk
 
@@ -13,8 +13,23 @@
 
 CPPFLAGS+=	-DXFREE86
 .if (${USE_PAM} != no)
+# XXX: Legacy non-XFree86 servers don't handle PAM
+.if \
+${MACHINE} != alpha	 \
+${MACHINE} != amiga	 \
+${MACHINE} != dreamcast	 \
+${MACHINE} != ews4800mips	 \
+${MACHINE} != hpcarm	 \
+${MACHINE} != hpcmips	 \
+${MACHINE} != hpcsh	 \
+${MACHINE} != newsmips	 \
+${MACHINE} != pmax	 \
+${MACHINE} != sun3	 \
+${MACHINE} != x68k	 \
+1
 CPPFLAGS+=	-DUSE_PAM
 .endif
+.endif
 
 CPPSCRIPTS=	startx xinitrc
 CPPSCRIPTFLAGS_xinitrc=	-DXINITDIR=${XINITDIR} -DBINDIR=${X11BINDIR}



CVS commit: [yamt-nfs-mp] src/sys/nfs

2010-10-10 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Sun Oct 10 08:29:40 UTC 2010

Modified Files:
src/sys/nfs [yamt-nfs-mp]: nfs_bio.c nfs_clntsubs.c nfs_node.c
nfs_subs.c nfs_vnops.c nfsnode.h

Log Message:
some locking changes


To generate a diff of this commit:
cvs rdiff -u -r1.175.2.3 -r1.175.2.4 src/sys/nfs/nfs_bio.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/nfs/nfs_clntsubs.c
cvs rdiff -u -r1.101.10.5 -r1.101.10.6 src/sys/nfs/nfs_node.c
cvs rdiff -u -r1.201.4.6 -r1.201.4.7 src/sys/nfs/nfs_subs.c
cvs rdiff -u -r1.266.10.8 -r1.266.10.9 src/sys/nfs/nfs_vnops.c
cvs rdiff -u -r1.67.10.4 -r1.67.10.5 src/sys/nfs/nfsnode.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/nfs/nfs_bio.c
diff -u src/sys/nfs/nfs_bio.c:1.175.2.3 src/sys/nfs/nfs_bio.c:1.175.2.4
--- src/sys/nfs/nfs_bio.c:1.175.2.3	Sun Sep 26 03:58:54 2010
+++ src/sys/nfs/nfs_bio.c	Sun Oct 10 08:29:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_bio.c,v 1.175.2.3 2010/09/26 03:58:54 yamt Exp $	*/
+/*	$NetBSD: nfs_bio.c,v 1.175.2.4 2010/10/10 08:29:39 yamt Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_bio.c,v 1.175.2.3 2010/09/26 03:58:54 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_bio.c,v 1.175.2.4 2010/10/10 08:29:39 yamt Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_nfs.h
@@ -93,6 +93,7 @@
 	int advice;
 	struct lwp *l = curlwp;
 
+	KASSERT(VOP_ISLOCKED(vp));
 #ifdef DIAGNOSTIC
 	if (uio-uio_rw != UIO_READ)
 		panic(nfs_read mode);
@@ -215,12 +216,15 @@
 uio-uio_offset, 0, 0);
 		}
 
-		if (NFS_EOFVALID(np) 
+		mutex_enter(np-n_attrlock);
+		if (np-n_direofvalid 
 		ndp-dc_cookie == np-n_direofoffset) {
+			mutex_exit(np-n_attrlock);
 			nfs_putdircache(np, ndp);
 			nfsstats.direofcache_hits++;
 			return (0);
 		}
+		mutex_exit(np-n_attrlock);
 
 		bp = nfs_getcacheblk(vp, NFSDC_BLKNO(ndp), NFS_DIRBLKSIZ, l);
 		if (!bp)
@@ -257,15 +261,18 @@
 		 * also, empty block implies EOF.
 		 */
 
+		mutex_enter(np-n_attrlock);
 		if (bp-b_bcount == bp-b_resid ||
-		(NFS_EOFVALID(np) 
+		(np-n_direofvalid 
 		ndp-dc_blkcookie == np-n_direofoffset)) {
+			mutex_exit(np-n_attrlock);
 			KASSERT(bp-b_bcount != bp-b_resid ||
 			ndp-dc_blkcookie == bp-b_dcookie);
 			nfs_putdircache(np, ndp);
 			brelse(bp, BC_NOCACHE);
 			return 0;
 		}
+		mutex_exit(np-n_attrlock);
 
 		/*
 		 * Find the entry we were looking for in the block.
@@ -386,8 +393,10 @@
 		 * (You need the current block first, so that you have the
 		 *  directory offset cookie of the next block.)
 		 */
+		mutex_enter(np-n_attrlock);
 		if (nfs_numasync  0  nmp-nm_readahead  0 
-		!NFS_EOFVALID(np)) {
+		!np-n_direofvalid) {
+			mutex_exit(np-n_attrlock);
 			rabp = nfs_getcacheblk(vp, NFSDC_BLKNO(nndp),
 		NFS_DIRBLKSIZ, l);
 			if (rabp) {
@@ -400,6 +409,8 @@
 			} else
 brelse(rabp, 0);
 			}
+		} else {
+			mutex_exit(np-n_attrlock);
 		}
 		nfs_putdircache(np, nndp);
 		got_buf = 1;
@@ -705,6 +716,10 @@
 		if (error)
 			return error;
 		if (timespeccmp(np-n_mtime, vattr.va_mtime, !=)) {
+			/*
+			 * the file seems modified on the server.
+			 * flush our cache.
+			 */
 			if (vp-v_type == VDIR) {
 nfs_invaldircache(vp, 0);
 			}

Index: src/sys/nfs/nfs_clntsubs.c
diff -u src/sys/nfs/nfs_clntsubs.c:1.1.2.3 src/sys/nfs/nfs_clntsubs.c:1.1.2.4
--- src/sys/nfs/nfs_clntsubs.c:1.1.2.3	Sun Sep 26 03:58:55 2010
+++ src/sys/nfs/nfs_clntsubs.c	Sun Oct 10 08:29:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_clntsubs.c,v 1.1.2.3 2010/09/26 03:58:55 yamt Exp $	*/
+/*	$NetBSD: nfs_clntsubs.c,v 1.1.2.4 2010/10/10 08:29:39 yamt Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_clntsubs.c,v 1.1.2.3 2010/09/26 03:58:55 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_clntsubs.c,v 1.1.2.4 2010/10/10 08:29:39 yamt Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_nfs.h
@@ -370,6 +370,7 @@
 {
 	struct nfsnode *np = VTONFS(vp);
 
+	KASSERT(VOP_ISLOCKED(vp));
 	if (np-n_flag  NTRUNCDELAYED) {
 		np-n_flag = ~NTRUNCDELAYED;
 		genfs_node_wrlock(vp);

Index: src/sys/nfs/nfs_node.c
diff -u src/sys/nfs/nfs_node.c:1.101.10.5 src/sys/nfs/nfs_node.c:1.101.10.6
--- src/sys/nfs/nfs_node.c:1.101.10.5	Sat Oct  9 03:32:39 2010
+++ src/sys/nfs/nfs_node.c	Sun Oct 10 08:29:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_node.c,v 1.101.10.5 2010/10/09 03:32:39 yamt Exp $	*/
+/*	$NetBSD: nfs_node.c,v 1.101.10.6 2010/10/10 08:29:39 yamt Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_node.c,v 1.101.10.5 2010/10/09 03:32:39 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_node.c,v 1.101.10.6 2010/10/10 08:29:39 yamt Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_nfs.h
@@ -261,7 +261,7 @@
 		nfs_vinvalbuf(vp, 0, sp-s_cred, curlwp, 1);
 	*ap-a_recycle = (np-n_flag  NREMOVED) != 0;

CVS commit: src/sys/net/npf

2010-10-10 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Oct 10 15:29:01 UTC 2010

Modified Files:
src/sys/net/npf: npf_handler.c

Log Message:
npf_packet_handler: clear M_CANFASTFWD flag, so inspection would work when
fast forwarding is enabled (e.g. with GATEWAY kernel option).  Thanks matt@
for the tip.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/net/npf/npf_handler.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/npf/npf_handler.c
diff -u src/sys/net/npf/npf_handler.c:1.2 src/sys/net/npf/npf_handler.c:1.3
--- src/sys/net/npf/npf_handler.c:1.2	Thu Sep 16 04:53:27 2010
+++ src/sys/net/npf/npf_handler.c	Sun Oct 10 15:29:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_handler.c,v 1.2 2010/09/16 04:53:27 rmind Exp $	*/
+/*	$NetBSD: npf_handler.c,v 1.3 2010/10/10 15:29:01 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2009-2010 The NetBSD Foundation, Inc.
@@ -33,13 +33,11 @@
  * NPF packet handler.
  */
 
-#ifdef _KERNEL
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: npf_handler.c,v 1.2 2010/09/16 04:53:27 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: npf_handler.c,v 1.3 2010/10/10 15:29:01 rmind Exp $);
 
 #include sys/param.h
 #include sys/systm.h
-#endif
 
 #include sys/mbuf.h
 #include sys/mutex.h
@@ -152,6 +150,12 @@
 		}
 		m_freem(*mp);
 		*mp = NULL;
+	} else {
+		/*
+		 * XXX: Disable for now, it will be set accordingly later,
+		 * for optimisations (to reduce inspection).
+		 */
+		(*mp)-m_flags = ~M_CANFASTFWD;
 	}
 	return error;
 }



CVS commit: src/sys/dev/pci

2010-10-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 10 21:24:35 UTC 2010

Modified Files:
src/sys/dev/pci: agp.c

Log Message:
restore binary compatibility for amd64; requested by joerg.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/pci/agp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/agp.c
diff -u src/sys/dev/pci/agp.c:1.74 src/sys/dev/pci/agp.c:1.75
--- src/sys/dev/pci/agp.c:1.74	Sat Oct  2 17:52:15 2010
+++ src/sys/dev/pci/agp.c	Sun Oct 10 17:24:34 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: agp.c,v 1.74 2010/10/02 21:52:15 jym Exp $	*/
+/*	$NetBSD: agp.c,v 1.75 2010/10/10 21:24:34 christos Exp $	*/
 
 /*-
  * Copyright (c) 2000 Doug Rabson
@@ -65,7 +65,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: agp.c,v 1.74 2010/10/02 21:52:15 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: agp.c,v 1.75 2010/10/10 21:24:34 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -944,6 +944,41 @@
 	case AGPIOC_SETUP:
 		return agp_setup_user(sc, (agp_setup *)data);
 
+#ifdef __x86_64__
+{
+	/*
+	 * Handle paddr_t change from 32 bit for non PAE kernels
+	 * to 64 bit.
+	 */
+#define AGPIOC_OALLOCATE  _IOWR(AGPIOC_BASE, 6, agp_oallocate)
+
+	typedef struct _agp_oallocate {
+		int key;		/* tag of allocation*/
+		size_t pg_count;	/* number of pages  */
+		uint32_t type;		/* 0 == normal, other devspec   */
+		u_long physical;	/* device specific (some devices
+	 * need a phys address of the
+	 * actual page behind the gatt
+	 * table)*/
+	} agp_oallocate;
+
+	case AGPIOC_OALLOCATE: {
+		int ret;
+		agp_allocate aga;
+		agp_oallocate *oaga = data;
+
+		aga.type = oaga-type;
+		aga.pg_count = oaga-pg_count;
+
+		if ((ret = agp_allocate_user(sc, aga)) == 0) {
+			oaga-key = aga.key;
+			oaga-physical = (u_long)aga.physical;
+		}
+
+		return ret;
+	}
+}
+#endif
 	case AGPIOC_ALLOCATE:
 		return agp_allocate_user(sc, (agp_allocate *)data);
 



CVS commit: src/libexec/ld.elf_so

2010-10-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 10 21:27:16 UTC 2010

Modified Files:
src/libexec/ld.elf_so: rtld.h

Log Message:
restore binary compatibility for pre-2.0 binaries, requested by skrll and core.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/libexec/ld.elf_so/rtld.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/ld.elf_so/rtld.h
diff -u src/libexec/ld.elf_so/rtld.h:1.93 src/libexec/ld.elf_so/rtld.h:1.94
--- src/libexec/ld.elf_so/rtld.h:1.93	Thu Sep 30 05:11:18 2010
+++ src/libexec/ld.elf_so/rtld.h	Sun Oct 10 17:27:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.h,v 1.93 2010/09/30 09:11:18 skrll Exp $	 */
+/*	$NetBSD: rtld.h,v 1.94 2010/10/10 21:27:16 christos Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -116,6 +116,9 @@
  *
  * Items marked with (%) are dynamically allocated, and must be freed
  * when the structure is destroyed.
+ *
+ * The layout of this structure needs to be preserved because pre-2.0 binaries
+ * hard-coded the location of dlopen() and friends.
  */
 
 #define RTLD_MAGIC	0xd550b87a
@@ -162,10 +165,7 @@
 #endif
 
 	const Elf_Symindx *buckets;	/* Hash table buckets array */
-	uint32_tnbuckets;	/* Number of buckets */
-	uint32_tnbuckets_m;	/* Precomputed for fast remainder */
-	uint8_t nbuckets_s1;
-	uint8_t nbuckets_s2;
+	unsigned long	unused1;	/* Used to be nbuckets */
 	const Elf_Symindx *chains;	/* Hash table chain array */
 	unsigned long   nchains;	/* Number of chains */
 
@@ -210,6 +210,11 @@
 	ino_t   ino;		/* Object's inode number */
 
 	void		*ehdr;
+
+	uint32_tnbuckets;	/* Number of buckets */
+	uint32_tnbuckets_m;	/* Precomputed for fast remainder */
+	uint8_t nbuckets_s1;
+	uint8_t nbuckets_s2;
 } Obj_Entry;
 
 typedef struct Struct_DoneList {



CVS commit: src/usr.sbin/perfused

2010-10-10 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Mon Oct 11 01:12:26 UTC 2010

Modified Files:
src/usr.sbin/perfused: msg.c

Log Message:
Interm hack raising buffers for /dev/fuse socket used in the filesystem.
This works around read(2) system callsfailing with ENOBUFS.

This is a hack bedause there is no way to know that 4 * FUSE_BUFSIZE
will be enough to hold queued FUSE frames. It seems good enough at
mine.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/perfused/msg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/perfused/msg.c
diff -u src/usr.sbin/perfused/msg.c:1.7 src/usr.sbin/perfused/msg.c:1.8
--- src/usr.sbin/perfused/msg.c:1.7	Mon Sep 20 06:45:38 2010
+++ src/usr.sbin/perfused/msg.c	Mon Oct 11 01:12:25 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: msg.c,v 1.7 2010/09/20 06:45:38 manu Exp $ */
+/*  $NetBSD: msg.c,v 1.8 2010/10/11 01:12:25 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -68,14 +68,15 @@
 	(void)strcpy(sun.sun_path, _PATH_FUSE); 
 
 	/*
-	 * Set a buffer lentgh large enough so that any FUSE packet
-	 * will fit.
+	 * Set a buffer lentgh large enough so that a few FUSE packets
+	 * will fit. 
+	 * XXX We will have to find how many packets we need
 	 */
-	opt = FUSE_BUFSIZE;
+	opt = 4 * FUSE_BUFSIZE;
 	if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, opt, sizeof(opt)) != 0)
 		DWARN(%s: setsockopt SO_SNDBUF to %d failed, __func__, opt);
 
-	opt = FUSE_BUFSIZE;
+	opt = 4 * FUSE_BUFSIZE;
 	if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, opt, sizeof(opt)) != 0)
 		DWARN(%s: setsockopt SO_RCVBUF to %d failed, __func__, opt);
 



CVS commit: src/lib/libperfuse

2010-10-10 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Mon Oct 11 01:52:05 UTC 2010

Modified Files:
src/lib/libperfuse: ops.c

Log Message:
FUSE filesystems' readlink returns a resolved link with a NUL trailing
character, and PUFFS do not want it. This fixes this bug, that returned
stat the informations for x instead of reporting ENOENT:
mkdir x  ln x z  stat -x z/whatever/you/want


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libperfuse/ops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.21 src/lib/libperfuse/ops.c:1.22
--- src/lib/libperfuse/ops.c:1.21	Mon Oct 11 01:08:26 2010
+++ src/lib/libperfuse/ops.c	Mon Oct 11 01:52:05 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.21 2010/10/11 01:08:26 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.22 2010/10/11 01:52:05 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -2410,12 +2410,18 @@
 		goto out;
 
 	foh = GET_OUTHDR(ps, pm);
-	len = foh-len - sizeof(*foh) + 1;
+	len = foh-len - sizeof(*foh);
 	if (len  *linklen)
 		DERRX(EX_PROTOCOL, path len = %zd too long, len);
+	if (len == 0)
+		DERRX(EX_PROTOCOL, path len = %zd too short, len);
 		
-	*linklen = len;
-	(void)strlcpy(linkname, _GET_OUTPAYLOAD(ps, pm, char *), len);
+	/*
+	 * FUSE filesystems return a NUL terminated string, we 
+	 * do not want to trailing \0
+	 */
+	*linklen = len - 1;
+	(void)memcpy(linkname, _GET_OUTPAYLOAD(ps, pm, char *), len);
 out:
 	ps-ps_destroy_msg(pm);
 



CVS commit: src

2010-10-10 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Mon Oct 11 05:37:59 UTC 2010

Modified Files:
src/lib/libperfuse: ops.c perfuse.c perfuse_if.h perfuse_priv.h subr.c
src/usr.sbin/perfused: msg.c perfused.c

Log Message:
Remove code supporting SOCK_STREAM, as SOCK_DGRAM works fine


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/lib/libperfuse/ops.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libperfuse/perfuse.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libperfuse/perfuse_if.h \
src/lib/libperfuse/subr.c
cvs rdiff -u -r1.15 -r1.16 src/lib/libperfuse/perfuse_priv.h
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/perfused/msg.c
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/perfused/perfused.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.22 src/lib/libperfuse/ops.c:1.23
--- src/lib/libperfuse/ops.c:1.22	Mon Oct 11 01:52:05 2010
+++ src/lib/libperfuse/ops.c	Mon Oct 11 05:37:58 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.22 2010/10/11 01:52:05 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.23 2010/10/11 05:37:58 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.

Index: src/lib/libperfuse/perfuse.c
diff -u src/lib/libperfuse/perfuse.c:1.10 src/lib/libperfuse/perfuse.c:1.11
--- src/lib/libperfuse/perfuse.c:1.10	Sun Oct  3 05:46:47 2010
+++ src/lib/libperfuse/perfuse.c	Mon Oct 11 05:37:58 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse.c,v 1.10 2010/10/03 05:46:47 manu Exp $ */
+/*  $NetBSD: perfuse.c,v 1.11 2010/10/11 05:37:58 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -115,7 +115,7 @@
 	if (strcmp(path, _PATH_FUSE) != 0)
 		return open(path, flags, mode);
 
-	if ((sv[0] = socket(PF_LOCAL, PERFUSE_SOCKTYPE, 0)) == -1) {
+	if ((sv[0] = socket(PF_LOCAL, SOCK_DGRAM, 0)) == -1) {
 #ifdef PERFUSE_DEBUG
 		DWARN(%s:%d socket failed: %s, __func__, __LINE__);
 #endif
@@ -149,7 +149,7 @@
 	 * we will talk using a socketpair 
 	 * instead of /dev/fuse.
 	 */
-	if (socketpair(PF_LOCAL, PERFUSE_SOCKTYPE, 0, sv) != 0) {
+	if (socketpair(PF_LOCAL, SOCK_DGRAM, 0, sv) != 0) {
 		DWARN(%s:%d: socketpair failed, __func__, __LINE__);
 		return -1;
 	}
@@ -218,12 +218,10 @@
 	int s;
 	size_t len;
 	struct perfuse_mount_out *pmo;
-#if (PERFUSE_SOCKTYPE == SOCK_DGRAM)
 	struct sockaddr_storage ss;
 	struct sockaddr_un *sun;
 	struct sockaddr *sa;
 	socklen_t sa_len;
-#endif
 	size_t sock_len;
 	char *frame;
 	char *cp;
@@ -244,7 +242,6 @@
 	 * XXX This socket is not removed at exit time yet
 	 */
 	sock_len = 0;
-#if (PERFUSE_SOCKTYPE == SOCK_DGRAM)
 	sa = (struct sockaddr *)(void *)ss;
 	sun = (struct sockaddr_un *)(void *)ss;
 	sa_len = sizeof(ss);
@@ -263,7 +260,6 @@
 
 		sock_len = strlen(sun-sun_path) + 1;
 	}
-#endif /* PERFUSE_SOCKTYPE */
 		
 	len = sizeof(*pmo);
 	len += source ? (uint32_t)strlen(source) + 1 : 0;

Index: src/lib/libperfuse/perfuse_if.h
diff -u src/lib/libperfuse/perfuse_if.h:1.9 src/lib/libperfuse/perfuse_if.h:1.10
--- src/lib/libperfuse/perfuse_if.h:1.9	Thu Sep 23 16:02:34 2010
+++ src/lib/libperfuse/perfuse_if.h	Mon Oct 11 05:37:58 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse_if.h,v 1.9 2010/09/23 16:02:34 manu Exp $ */
+/*  $NetBSD: perfuse_if.h,v 1.10 2010/10/11 05:37:58 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -36,7 +36,6 @@
 #define PERFUSE_MOUNT_MAGIC noFuseRq
 #define PERFUSE_UNKNOWN_INO 0x
 
-#define PERFUSE_SOCKTYPE SOCK_DGRAM
 /* 
  * Diagnostic flags. This global is used only for DPRINTF/DERR/DWARN
  */
Index: src/lib/libperfuse/subr.c
diff -u src/lib/libperfuse/subr.c:1.9 src/lib/libperfuse/subr.c:1.10
--- src/lib/libperfuse/subr.c:1.9	Mon Oct 11 01:08:26 2010
+++ src/lib/libperfuse/subr.c	Mon Oct 11 05:37:58 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: subr.c,v 1.9 2010/10/11 01:08:26 manu Exp $ */
+/*  $NetBSD: subr.c,v 1.10 2010/10/11 05:37:58 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved.
@@ -44,12 +44,9 @@
 	const char *name;
 	struct puffs_node *parent;
 {
-	struct perfuse_state *ps;
 	struct puffs_node *pn;
 	struct perfuse_node_data *pnd;
 
-	ps = puffs_getspecific(pu);
-
 	if ((pnd = malloc(sizeof(*pnd))) == NULL)
 		DERR(EX_OSERR, malloc failed);
 
@@ -84,10 +81,8 @@
 	struct puffs_usermount *pu;
 	struct puffs_node *pn;
 {
-	struct perfuse_state *ps;
 	struct perfuse_node_data *pnd;
 
-	ps = puffs_getspecific(pu);
 	pnd = PERFUSE_NODE_DATA(pn);
 
 	if (pnd-pnd_parent != NULL) {

Index: src/lib/libperfuse/perfuse_priv.h
diff -u src/lib/libperfuse/perfuse_priv.h:1.15 src/lib/libperfuse/perfuse_priv.h:1.16
--- src/lib/libperfuse/perfuse_priv.h:1.15	Mon Oct 11 01:08:26 2010
+++ src/lib/libperfuse/perfuse_priv.h	Mon Oct 11 05:37:58 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse_priv.h,v 1.15 2010/10/11 01:08:26 manu Exp $ */
+/*  $NetBSD: perfuse_priv.h,v 1.16 2010/10/11 05:37:58 manu Exp