From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 00:18:19 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4773106564A; Sun, 2 Nov 2008 00:18:19 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B22BE8FC17; Sun, 2 Nov 2008 00:18:19 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA20IJ3G023711; Sun, 2 Nov 2008 00:18:19 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA20IJtR023710; Sun, 2 Nov 2008 00:18:19 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811020018.mA20IJtR023710@svn.freebsd.org> From: Robert Watson Date: Sun, 2 Nov 2008 00:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184544 - head/sys/security/audit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 00:18:19 -0000 Author: rwatson Date: Sun Nov 2 00:18:19 2008 New Revision: 184544 URL: http://svn.freebsd.org/changeset/base/184544 Log: Remove stale comment about filtering in audit pipe ioctl routine: we do support filtering now, although we may want to make it more interesting in the future. MFC after: 2 months Sponsored by: Apple, Inc. Modified: head/sys/security/audit/audit_pipe.c Modified: head/sys/security/audit/audit_pipe.c ============================================================================== --- head/sys/security/audit/audit_pipe.c Sun Nov 2 00:14:54 2008 (r184543) +++ head/sys/security/audit/audit_pipe.c Sun Nov 2 00:18:19 2008 (r184544) @@ -732,9 +732,6 @@ audit_pipe_close(struct cdev *dev, int f /* * Audit pipe ioctl() routine. Handle file descriptor and audit pipe layer * commands. - * - * Would be desirable to support filtering, although perhaps something simple - * like an event mask, as opposed to something complicated like BPF. */ static int audit_pipe_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 00:25:49 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D0B41065697; Sun, 2 Nov 2008 00:25:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AE408FC1B; Sun, 2 Nov 2008 00:25:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA20PnJK023885; Sun, 2 Nov 2008 00:25:49 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA20PnMp023884; Sun, 2 Nov 2008 00:25:49 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811020025.mA20PnMp023884@svn.freebsd.org> From: Robert Watson Date: Sun, 2 Nov 2008 00:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184545 - head/sys/security/audit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 00:25:49 -0000 Author: rwatson Date: Sun Nov 2 00:25:48 2008 New Revision: 184545 URL: http://svn.freebsd.org/changeset/base/184545 Log: Update introductory comment for audit pipes. MFC after: 2 months Sponsored by: Apple, Inc. Modified: head/sys/security/audit/audit_pipe.c Modified: head/sys/security/audit/audit_pipe.c ============================================================================== --- head/sys/security/audit/audit_pipe.c Sun Nov 2 00:18:19 2008 (r184544) +++ head/sys/security/audit/audit_pipe.c Sun Nov 2 00:25:48 2008 (r184545) @@ -57,10 +57,10 @@ __FBSDID("$FreeBSD$"); /* * Implementation of a clonable special device providing a live stream of BSM - * audit data. This is a "tee" of the data going to the file. It provides - * unreliable but timely access to audit events. Consumers of this interface - * should be very careful to avoid introducing event cycles. Consumers may - * express interest via a set of preselection ioctls. + * audit data. Consumers receive a "tee" of the system audit trail by + * default, but may also define alternative event selections using ioctls. + * This interface provides unreliable but timely access to audit events. + * Consumers should be very careful to avoid introducing event cycles. */ /* From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 00:41:27 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60791106567A; Sun, 2 Nov 2008 00:41:27 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D5FA8FC26; Sun, 2 Nov 2008 00:41:27 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA20fRnk024182; Sun, 2 Nov 2008 00:41:27 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA20fQCt024181; Sun, 2 Nov 2008 00:41:26 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200811020041.mA20fQCt024181@svn.freebsd.org> From: Giorgos Keramidas Date: Sun, 2 Nov 2008 00:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184546 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 00:41:27 -0000 Author: keramida (doc committer) Date: Sun Nov 2 00:41:26 2008 New Revision: 184546 URL: http://svn.freebsd.org/changeset/base/184546 Log: Various comment nits, and typos. Modified: head/sys/vm/uma.h Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Sun Nov 2 00:25:48 2008 (r184545) +++ head/sys/vm/uma.h Sun Nov 2 00:41:26 2008 (r184546) @@ -39,7 +39,7 @@ #include /* For NULL */ #include /* For M_* */ -/* User visable parameters */ +/* User visible parameters */ #define UMA_SMALLEST_UNIT (PAGE_SIZE / 256) /* Smallest item allocated */ /* Types and type defs */ @@ -101,7 +101,8 @@ typedef void (*uma_dtor)(void *mem, int * * Discussion: * The initializer is called when the memory is cached in the uma zone. - * this should be the same state that the destructor leaves the object in. + * The initializer and the destructor should leave the object in the same + * state. */ typedef int (*uma_init)(void *mem, int size, int flags); @@ -118,7 +119,7 @@ typedef int (*uma_init)(void *mem, int s * * Discussion: * This routine is called when memory leaves a zone and is returned to the - * system for other uses. It is the counter part to the init function. + * system for other uses. It is the counter-part to the init function. */ typedef void (*uma_fini)(void *mem, int size); @@ -131,7 +132,7 @@ typedef void (*uma_fini)(void *mem, int * utilizing a known, stable state. This differs from the constructor which * will be called on EVERY allocation. * - * For example, in the initializer you may want to initialize embeded locks, + * For example, in the initializer you may want to initialize embedded locks, * NULL list pointers, set up initial states, magic numbers, etc. This way if * the object is held in the allocator and re-used it won't be necessary to * re-initialize it. @@ -148,17 +149,17 @@ typedef void (*uma_fini)(void *mem, int * Create a new uma zone * * Arguments: - * name The text name of the zone for debugging and stats, this memory + * name The text name of the zone for debugging and stats. This memory * should not be freed until the zone has been deallocated. * size The size of the object that is being created. - * ctor The constructor that is called when the object is allocated + * ctor The constructor that is called when the object is allocated. * dtor The destructor that is called when the object is freed. * init An initializer that sets up the initial state of the memory. * fini A discard function that undoes initialization done by init. * ctor/dtor/init/fini may all be null, see notes above. - * align A bitmask that corisponds to the requested alignment + * align A bitmask that corresponds to the requested alignment * eg 4 would be 0x3 - * flags A set of parameters that control the behavior of the zone + * flags A set of parameters that control the behavior of the zone. * * Returns: * A pointer to a structure which is intended to be opaque to users of @@ -172,9 +173,9 @@ uma_zone_t uma_zcreate(char *name, size_ * Create a secondary uma zone * * Arguments: - * name The text name of the zone for debugging and stats, this memory + * name The text name of the zone for debugging and stats. This memory * should not be freed until the zone has been deallocated. - * ctor The constructor that is called when the object is allocated + * ctor The constructor that is called when the object is allocated. * dtor The destructor that is called when the object is freed. * zinit An initializer that sets up the initial state of the memory * as the object passes from the Keg's slab to the Zone's cache. @@ -212,7 +213,7 @@ uma_zone_t uma_zsecond_create(char *name #define UMA_ZONE_PAGEABLE 0x0001 /* Return items not fully backed by physical memory XXX Not yet */ #define UMA_ZONE_ZINIT 0x0002 /* Initialize with zeros */ -#define UMA_ZONE_STATIC 0x0004 /* Staticly sized zone */ +#define UMA_ZONE_STATIC 0x0004 /* Statically sized zone */ #define UMA_ZONE_OFFPAGE 0x0008 /* Force the slab structure allocation off of the real memory */ #define UMA_ZONE_MALLOC 0x0010 /* For use by malloc(9) only! */ @@ -256,9 +257,9 @@ void uma_zdestroy(uma_zone_t zone); * flags See sys/malloc.h for available flags. * * Returns: - * A non null pointer to an initialized element from the zone is - * garanteed if the wait flag is M_WAITOK, otherwise a null pointer may be - * returned if the zone is empty or the ctor failed. + * A non-null pointer to an initialized element from the zone is + * guaranteed if the wait flag is M_WAITOK. Otherwise a null pointer + * may be returned if the zone is empty or the ctor failed. */ void *uma_zalloc_arg(uma_zone_t zone, void *arg, int flags); @@ -314,13 +315,13 @@ uma_zfree(uma_zone_t zone, void *item) * Backend page supplier routines * * Arguments: - * zone The zone that is requesting pages - * size The number of bytes being requested + * zone The zone that is requesting pages. + * size The number of bytes being requested. * pflag Flags for these memory pages, see below. * wait Indicates our willingness to block. * * Returns: - * A pointer to the alloced memory or NULL on failure. + * A pointer to the allocated memory or NULL on failure. */ typedef void *(*uma_alloc)(uma_zone_t zone, int size, u_int8_t *pflag, int wait); @@ -329,9 +330,9 @@ typedef void *(*uma_alloc)(uma_zone_t zo * Backend page free routines * * Arguments: - * item A pointer to the previously allocated pages - * size The original size of the allocation - * pflag The flags for the slab. See UMA_SLAB_* below + * item A pointer to the previously allocated pages. + * size The original size of the allocation. + * pflag The flags for the slab. See UMA_SLAB_* below. * * Returns: * None @@ -403,9 +404,9 @@ void uma_set_align(int align); * Switches the backing object of a zone * * Arguments: - * zone The zone to update - * obj The obj to use for future allocations - * size The size of the object to allocate + * zone The zone to update. + * obj The VM object to use for future allocations. + * size The size of the object to allocate. * * Returns: * 0 if kva space can not be allocated @@ -435,7 +436,7 @@ void uma_zone_set_max(uma_zone_t zone, i * are used to set the backend init/fini pair which acts on an * object as it becomes allocated and is placed in a slab within * the specified zone's backing keg. These should probably not - * be changed once allocations have already begun and only + * be changed once allocations have already begun, but only be set * immediately upon zone creation. */ void uma_zone_set_init(uma_zone_t zone, uma_init uminit); @@ -446,8 +447,8 @@ void uma_zone_set_fini(uma_zone_t zone, * used to set the zinit/zfini pair which acts on an object as * it passes from the backing Keg's slab cache to the * specified Zone's bucket cache. These should probably not - * be changed once allocations have already begun and - * only immediately upon zone creation. + * be changed once allocations have already begun, but only be set + * immediately upon zone creation. */ void uma_zone_set_zinit(uma_zone_t zone, uma_init zinit); void uma_zone_set_zfini(uma_zone_t zone, uma_fini zfini); @@ -456,7 +457,7 @@ void uma_zone_set_zfini(uma_zone_t zone, * Replaces the standard page_alloc or obj_alloc functions for this zone * * Arguments: - * zone The zone whos back end allocator is being changed. + * zone The zone whose backend allocator is being changed. * allocf A pointer to the allocation function * * Returns: @@ -484,7 +485,7 @@ void uma_zone_set_allocf(uma_zone_t zone void uma_zone_set_freef(uma_zone_t zone, uma_free freef); /* - * These flags are setable in the allocf and visable in the freef. + * These flags are setable in the allocf and visible in the freef. */ #define UMA_SLAB_BOOT 0x01 /* Slab alloced from boot pages */ #define UMA_SLAB_KMEM 0x02 /* Slab alloced from kmem_map */ @@ -537,9 +538,8 @@ int uma_zone_exhausted_nolock(uma_zone_t /* * Exported statistics structures to be used by user space monitoring tools. - * Statistics stream consusts of a uma_stream_header, followed by a series of - * alternative uma_type_header and uma_type_stat structures. Statistics - * structures + * Statistics stream consists of a uma_stream_header, followed by a series of + * alternative uma_type_header and uma_type_stat structures. */ #define UMA_STREAM_VERSION 0x00000001 struct uma_stream_header { @@ -577,7 +577,7 @@ struct uma_type_header { }; struct uma_percpu_stat { - u_int64_t ups_allocs; /* Cache: number of alloctions. */ + u_int64_t ups_allocs; /* Cache: number of allocations. */ u_int64_t ups_frees; /* Cache: number of frees. */ u_int64_t ups_cache_free; /* Cache: free items in cache. */ u_int64_t _ups_reserved[5]; /* Reserved. */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 01:10:56 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C3AB106564A; Sun, 2 Nov 2008 01:10:56 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 286638FC13; Sun, 2 Nov 2008 01:10:56 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA21Auae024812; Sun, 2 Nov 2008 01:10:56 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA21At7Y024785; Sun, 2 Nov 2008 01:10:55 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <200811020110.mA21At7Y024785@svn.freebsd.org> From: Peter Wemm Date: Sun, 2 Nov 2008 01:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184547 - in head/lib/libc/amd64: . gen stdlib string sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 01:10:56 -0000 Author: peter Date: Sun Nov 2 01:10:54 2008 New Revision: 184547 URL: http://svn.freebsd.org/changeset/base/184547 Log: We've been lax about matching END() macros in asm code for some time. This is used to set the ELF size attribute for functions. It isn't normally critical but some things can make use of it (gdb for stack traces). Valgrind needs it so I'm adding it in. The problem is present on all branches and on both i386 and amd64. Modified: head/lib/libc/amd64/SYS.h head/lib/libc/amd64/gen/_setjmp.S head/lib/libc/amd64/gen/fabs.S head/lib/libc/amd64/gen/modf.S head/lib/libc/amd64/gen/rfork_thread.S head/lib/libc/amd64/gen/setjmp.S head/lib/libc/amd64/gen/sigsetjmp.S head/lib/libc/amd64/stdlib/div.S head/lib/libc/amd64/stdlib/ldiv.S head/lib/libc/amd64/stdlib/lldiv.S head/lib/libc/amd64/string/bcmp.S head/lib/libc/amd64/string/bcopy.S head/lib/libc/amd64/string/bzero.S head/lib/libc/amd64/string/memcmp.S head/lib/libc/amd64/string/memset.S head/lib/libc/amd64/string/strcat.S head/lib/libc/amd64/string/strcmp.S head/lib/libc/amd64/string/strcpy.S head/lib/libc/amd64/sys/brk.S head/lib/libc/amd64/sys/exect.S head/lib/libc/amd64/sys/getcontext.S head/lib/libc/amd64/sys/pipe.S head/lib/libc/amd64/sys/ptrace.S head/lib/libc/amd64/sys/reboot.S head/lib/libc/amd64/sys/sbrk.S head/lib/libc/amd64/sys/setlogin.S head/lib/libc/amd64/sys/vfork.S Modified: head/lib/libc/amd64/SYS.h ============================================================================== --- head/lib/libc/amd64/SYS.h Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/SYS.h Sun Nov 2 01:10:54 2008 (r184547) @@ -43,13 +43,15 @@ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \ - 2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx + 2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx; \ + END(__CONCAT(__sys_,x)) #define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret ; \ - 2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx + 2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx; \ + END(__CONCAT(__sys_,x)) #else #define RSYSCALL(x) ENTRY(__CONCAT(__sys_,x)); \ .weak CNAME(x); \ @@ -57,13 +59,15 @@ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \ - 2: jmp HIDENAME(cerror) + 2: jmp HIDENAME(cerror); \ + END(__CONCAT(__sys_,x)) #define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \ - 2: jmp HIDENAME(cerror) + 2: jmp HIDENAME(cerror); \ + END(__CONCAT(__sys_,x)) #endif #define KERNCALL movq %rcx, %r10; syscall Modified: head/lib/libc/amd64/gen/_setjmp.S ============================================================================== --- head/lib/libc/amd64/gen/_setjmp.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/gen/_setjmp.S Sun Nov 2 01:10:54 2008 (r184547) @@ -61,6 +61,7 @@ ENTRY(_setjmp) stmxcsr 68(%rax) /* and mxcsr */ xorq %rax,%rax ret +END(_setjmp) .weak CNAME(_longjmp) .set CNAME(_longjmp),CNAME(___longjmp) @@ -90,3 +91,4 @@ ENTRY(___longjmp) incq %rax 1: movq %rcx,0(%rsp) ret +END(___longjmp) Modified: head/lib/libc/amd64/gen/fabs.S ============================================================================== --- head/lib/libc/amd64/gen/fabs.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/gen/fabs.S Sun Nov 2 01:10:54 2008 (r184547) @@ -37,6 +37,7 @@ ENTRY(fabs) movsd signbit(%rip), %xmm0 andnpd %xmm1, %xmm0 ret +END(fabs) .data signbit: Modified: head/lib/libc/amd64/gen/modf.S ============================================================================== --- head/lib/libc/amd64/gen/modf.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/gen/modf.S Sun Nov 2 01:10:54 2008 (r184547) @@ -86,3 +86,4 @@ ENTRY(modf) movsd -8(%rsp),%xmm0 ret +END(modf) Modified: head/lib/libc/amd64/gen/rfork_thread.S ============================================================================== --- head/lib/libc/amd64/gen/rfork_thread.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/gen/rfork_thread.S Sun Nov 2 01:10:54 2008 (r184547) @@ -99,3 +99,4 @@ ENTRY(rfork_thread) #else jmp HIDENAME(cerror) #endif +END(rfork_thread) Modified: head/lib/libc/amd64/gen/setjmp.S ============================================================================== --- head/lib/libc/amd64/gen/setjmp.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/gen/setjmp.S Sun Nov 2 01:10:54 2008 (r184547) @@ -70,6 +70,7 @@ ENTRY(setjmp) stmxcsr 68(%rcx) /* and mxcsr */ xorq %rax,%rax ret +END(setjmp) .weak CNAME(longjmp) .set CNAME(longjmp),CNAME(__longjmp) @@ -108,3 +109,4 @@ ENTRY(__longjmp) incq %rax 1: movq %rcx,0(%rsp) ret +END(__longjmp) Modified: head/lib/libc/amd64/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/amd64/gen/sigsetjmp.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/gen/sigsetjmp.S Sun Nov 2 01:10:54 2008 (r184547) @@ -77,6 +77,7 @@ ENTRY(sigsetjmp) fnstcw 64(%rcx) /* 8; fpu cw */ xorq %rax,%rax ret +END(sigsetjmp) .weak CNAME(siglongjmp) .set CNAME(siglongjmp),CNAME(__siglongjmp) @@ -109,3 +110,4 @@ ENTRY(__siglongjmp) incq %rax 1: movq %rcx,0(%rsp) ret +END(__siglongjmp) Modified: head/lib/libc/amd64/stdlib/div.S ============================================================================== --- head/lib/libc/amd64/stdlib/div.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/stdlib/div.S Sun Nov 2 01:10:54 2008 (r184547) @@ -15,3 +15,4 @@ ENTRY(div) salq $32,%rdx orq %rdx,%rax ret +END(div) Modified: head/lib/libc/amd64/stdlib/ldiv.S ============================================================================== --- head/lib/libc/amd64/stdlib/ldiv.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/stdlib/ldiv.S Sun Nov 2 01:10:54 2008 (r184547) @@ -13,3 +13,4 @@ ENTRY(ldiv) cqto idivq %rsi ret +END(ldiv) Modified: head/lib/libc/amd64/stdlib/lldiv.S ============================================================================== --- head/lib/libc/amd64/stdlib/lldiv.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/stdlib/lldiv.S Sun Nov 2 01:10:54 2008 (r184547) @@ -13,3 +13,4 @@ ENTRY(lldiv) cqto idivq %rsi ret +END(lldiv) Modified: head/lib/libc/amd64/string/bcmp.S ============================================================================== --- head/lib/libc/amd64/string/bcmp.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/bcmp.S Sun Nov 2 01:10:54 2008 (r184547) @@ -22,3 +22,4 @@ L1: setne %al movsbl %al,%eax ret +END(bcmp) Modified: head/lib/libc/amd64/string/bcopy.S ============================================================================== --- head/lib/libc/amd64/string/bcopy.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/bcopy.S Sun Nov 2 01:10:54 2008 (r184547) @@ -86,3 +86,12 @@ ENTRY(bcopy) movsq cld ret +#ifdef MEMCOPY +END(memcpy) +#else +#ifdef MEMMOVE +END(memmove) +#else +END(bcopy) +#endif +#endif Modified: head/lib/libc/amd64/string/bzero.S ============================================================================== --- head/lib/libc/amd64/string/bzero.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/bzero.S Sun Nov 2 01:10:54 2008 (r184547) @@ -41,3 +41,4 @@ L1: movq %rsi,%rcx /* zero remainder by stosb ret +END(bzero) Modified: head/lib/libc/amd64/string/memcmp.S ============================================================================== --- head/lib/libc/amd64/string/memcmp.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/memcmp.S Sun Nov 2 01:10:54 2008 (r184547) @@ -39,3 +39,4 @@ L6: xorl %eax,%eax /* Perform unsigned movb -1(%rsi),%dl subl %edx,%eax ret +END(memcmp) Modified: head/lib/libc/amd64/string/memset.S ============================================================================== --- head/lib/libc/amd64/string/memset.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/memset.S Sun Nov 2 01:10:54 2008 (r184547) @@ -58,3 +58,4 @@ L1: rep movq %r11,%rax ret +END(memset) Modified: head/lib/libc/amd64/string/strcat.S ============================================================================== --- head/lib/libc/amd64/string/strcat.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/strcat.S Sun Nov 2 01:10:54 2008 (r184547) @@ -163,3 +163,4 @@ ENTRY(strcat) .Ldone: ret +END(strcat) Modified: head/lib/libc/amd64/string/strcmp.S ============================================================================== --- head/lib/libc/amd64/string/strcmp.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/strcmp.S Sun Nov 2 01:10:54 2008 (r184547) @@ -71,3 +71,4 @@ ENTRY(strcmp) movzbq %dl,%rdx subq %rdx,%rax ret +END(strcmp) Modified: head/lib/libc/amd64/string/strcpy.S ============================================================================== --- head/lib/libc/amd64/string/strcpy.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/string/strcpy.S Sun Nov 2 01:10:54 2008 (r184547) @@ -109,3 +109,4 @@ ENTRY(strcpy) .Ldone: ret +END(strcpy) Modified: head/lib/libc/amd64/sys/brk.S ============================================================================== --- head/lib/libc/amd64/sys/brk.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/brk.S Sun Nov 2 01:10:54 2008 (r184547) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); ENTRY(_brk) pushq %rdi jmp ok +END(_brk) ENTRY(brk) pushq %rdi @@ -81,3 +82,4 @@ err: #else jmp HIDENAME(cerror) #endif +END(brk) Modified: head/lib/libc/amd64/sys/exect.S ============================================================================== --- head/lib/libc/amd64/sys/exect.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/exect.S Sun Nov 2 01:10:54 2008 (r184547) @@ -53,3 +53,4 @@ ENTRY(exect) #else jmp HIDENAME(cerror) #endif +END(exect) Modified: head/lib/libc/amd64/sys/getcontext.S ============================================================================== --- head/lib/libc/amd64/sys/getcontext.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/getcontext.S Sun Nov 2 01:10:54 2008 (r184547) @@ -52,3 +52,4 @@ ENTRY(__sys_getcontext) #else jmp HIDENAME(cerror) #endif +END(__sys_getcontext) Modified: head/lib/libc/amd64/sys/pipe.S ============================================================================== --- head/lib/libc/amd64/sys/pipe.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/pipe.S Sun Nov 2 01:10:54 2008 (r184547) @@ -57,3 +57,4 @@ ENTRY(__sys_pipe) #else jmp HIDENAME(cerror) #endif +END(__sys_pipe) Modified: head/lib/libc/amd64/sys/ptrace.S ============================================================================== --- head/lib/libc/amd64/sys/ptrace.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/ptrace.S Sun Nov 2 01:10:54 2008 (r184547) @@ -57,3 +57,4 @@ err: #else jmp HIDENAME(cerror) #endif +END(ptrace) Modified: head/lib/libc/amd64/sys/reboot.S ============================================================================== --- head/lib/libc/amd64/sys/reboot.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/reboot.S Sun Nov 2 01:10:54 2008 (r184547) @@ -54,3 +54,4 @@ ENTRY(__sys_reboot) #else jmp HIDENAME(cerror) #endif +END(__sys_reboot) Modified: head/lib/libc/amd64/sys/sbrk.S ============================================================================== --- head/lib/libc/amd64/sys/sbrk.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/sbrk.S Sun Nov 2 01:10:54 2008 (r184547) @@ -85,3 +85,4 @@ err: #else jmp HIDENAME(cerror) #endif +END(sbrk) Modified: head/lib/libc/amd64/sys/setlogin.S ============================================================================== --- head/lib/libc/amd64/sys/setlogin.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/setlogin.S Sun Nov 2 01:10:54 2008 (r184547) @@ -62,3 +62,4 @@ ENTRY(__sys_setlogin) #else jmp HIDENAME(cerror) #endif +END(__sys_setlogin) Modified: head/lib/libc/amd64/sys/vfork.S ============================================================================== --- head/lib/libc/amd64/sys/vfork.S Sun Nov 2 00:41:26 2008 (r184546) +++ head/lib/libc/amd64/sys/vfork.S Sun Nov 2 01:10:54 2008 (r184547) @@ -56,3 +56,4 @@ ENTRY(__sys_vfork) #else jmp HIDENAME(cerror) #endif +END(__sys_vfork) From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 01:28:49 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D8B11065675; Sun, 2 Nov 2008 01:28:49 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 498558FC0C; Sun, 2 Nov 2008 01:28:49 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA21SnwP025230; Sun, 2 Nov 2008 01:28:49 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA21Sl2D025187; Sun, 2 Nov 2008 01:28:47 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <200811020128.mA21Sl2D025187@svn.freebsd.org> From: Peter Wemm Date: Sun, 2 Nov 2008 01:28:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184548 - in head/lib/libc/i386: . gen stdlib string sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 01:28:49 -0000 Author: peter Date: Sun Nov 2 01:28:47 2008 New Revision: 184548 URL: http://svn.freebsd.org/changeset/base/184548 Log: Add missing END() macros, as per rev 184547 for amd64. The lack of these is mostly harmless, but it does upset some of valgrind's functionality. Modified: head/lib/libc/i386/SYS.h head/lib/libc/i386/gen/_ctx_start.S head/lib/libc/i386/gen/_setjmp.S head/lib/libc/i386/gen/fabs.S head/lib/libc/i386/gen/modf.S head/lib/libc/i386/gen/rfork_thread.S head/lib/libc/i386/gen/setjmp.S head/lib/libc/i386/gen/sigsetjmp.S head/lib/libc/i386/stdlib/abs.S head/lib/libc/i386/stdlib/div.S head/lib/libc/i386/stdlib/labs.S head/lib/libc/i386/stdlib/ldiv.S head/lib/libc/i386/string/bcmp.S head/lib/libc/i386/string/bcopy.S head/lib/libc/i386/string/bzero.S head/lib/libc/i386/string/ffs.S head/lib/libc/i386/string/index.S head/lib/libc/i386/string/memchr.S head/lib/libc/i386/string/memcmp.S head/lib/libc/i386/string/memset.S head/lib/libc/i386/string/rindex.S head/lib/libc/i386/string/strcat.S head/lib/libc/i386/string/strchr.S head/lib/libc/i386/string/strcmp.S head/lib/libc/i386/string/strcpy.S head/lib/libc/i386/string/strlen.S head/lib/libc/i386/string/strncmp.S head/lib/libc/i386/string/strrchr.S head/lib/libc/i386/string/swab.S head/lib/libc/i386/string/wcschr.S head/lib/libc/i386/string/wcscmp.S head/lib/libc/i386/string/wcslen.S head/lib/libc/i386/string/wmemchr.S head/lib/libc/i386/sys/Ovfork.S head/lib/libc/i386/sys/brk.S head/lib/libc/i386/sys/exect.S head/lib/libc/i386/sys/getcontext.S head/lib/libc/i386/sys/pipe.S head/lib/libc/i386/sys/ptrace.S head/lib/libc/i386/sys/reboot.S head/lib/libc/i386/sys/sbrk.S head/lib/libc/i386/sys/setlogin.S head/lib/libc/i386/sys/syscall.S Modified: head/lib/libc/i386/SYS.h ============================================================================== --- head/lib/libc/i386/SYS.h Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/SYS.h Sun Nov 2 01:28:47 2008 (r184548) @@ -44,13 +44,14 @@ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ mov __CONCAT($SYS_,x),%eax; KERNCALL; jb 2b -#define RSYSCALL(x) SYSCALL(x); ret +#define RSYSCALL(x) SYSCALL(x); ret; END(__CONCAT(__sys_,x)) #define PSEUDO(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \ ENTRY(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%eax; KERNCALL; jb 2b; ret + mov __CONCAT($SYS_,x),%eax; KERNCALL; jb 2b; ret; \ + END(__CONCAT(__sys_,x)) /* gas messes up offset -- although we don't currently need it, do for BCS */ #define LCALL(x,y) .byte 0x9a ; .long y; .word x Modified: head/lib/libc/i386/gen/_ctx_start.S ============================================================================== --- head/lib/libc/i386/gen/_ctx_start.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/gen/_ctx_start.S Sun Nov 2 01:28:47 2008 (r184548) @@ -49,3 +49,4 @@ ENTRY(_ctx_start) call PIC_PLT(_ctx_done) /* should never return */ call PIC_PLT(abort) /* fubar */ ret +END(_ctx_start) Modified: head/lib/libc/i386/gen/_setjmp.S ============================================================================== --- head/lib/libc/i386/gen/_setjmp.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/gen/_setjmp.S Sun Nov 2 01:28:47 2008 (r184548) @@ -58,6 +58,7 @@ ENTRY(_setjmp) fnstcw 24(%eax) xorl %eax,%eax ret +END(_setjmp) .weak CNAME(_longjmp) .set CNAME(_longjmp),CNAME(___longjmp) @@ -76,3 +77,4 @@ ENTRY(___longjmp) incl %eax 1: movl %ecx,0(%esp) ret +END(___longjmp) Modified: head/lib/libc/i386/gen/fabs.S ============================================================================== --- head/lib/libc/i386/gen/fabs.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/gen/fabs.S Sun Nov 2 01:28:47 2008 (r184548) @@ -40,3 +40,4 @@ ENTRY(fabs) fldl 4(%esp) fabs ret +END(fabs) Modified: head/lib/libc/i386/gen/modf.S ============================================================================== --- head/lib/libc/i386/gen/modf.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/gen/modf.S Sun Nov 2 01:28:47 2008 (r184548) @@ -82,3 +82,4 @@ ENTRY(modf) fdivp /* return +/- 0 for +/- Inf, NaN for NaN */ leave ret +END(modf) Modified: head/lib/libc/i386/gen/rfork_thread.S ============================================================================== --- head/lib/libc/i386/gen/rfork_thread.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/gen/rfork_thread.S Sun Nov 2 01:28:47 2008 (r184548) @@ -115,3 +115,4 @@ ENTRY(rfork_thread) popl %ebp PIC_PROLOGUE jmp PIC_PLT(HIDENAME(cerror)) +END(rfork_thread) Modified: head/lib/libc/i386/gen/setjmp.S ============================================================================== --- head/lib/libc/i386/gen/setjmp.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/gen/setjmp.S Sun Nov 2 01:28:47 2008 (r184548) @@ -69,6 +69,7 @@ ENTRY(setjmp) fnstcw 24(%ecx) xorl %eax,%eax ret +END(setjmp) .weak CNAME(longjmp) .set CNAME(longjmp),CNAME(__longjmp) @@ -96,3 +97,4 @@ ENTRY(__longjmp) incl %eax 1: movl %ecx,0(%esp) ret +END(__longjmp) Modified: head/lib/libc/i386/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/i386/gen/sigsetjmp.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/gen/sigsetjmp.S Sun Nov 2 01:28:47 2008 (r184548) @@ -78,10 +78,11 @@ ENTRY(sigsetjmp) fnstcw 24(%ecx) xorl %eax,%eax ret +END(sigsetjmp) .weak CNAME(siglongjmp); - .set CNAME(siglongjmp),CNAME(__siglongjmp); -ENTRY(__siglongjmp); + .set CNAME(siglongjmp),CNAME(__siglongjmp) +ENTRY(__siglongjmp) movl 4(%esp),%edx cmpl $0,44(%edx) jz 2f @@ -108,3 +109,4 @@ ENTRY(__siglongjmp); incl %eax 1: movl %ecx,0(%esp) ret +END(__siglongjmp) Modified: head/lib/libc/i386/stdlib/abs.S ============================================================================== --- head/lib/libc/i386/stdlib/abs.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/stdlib/abs.S Sun Nov 2 01:28:47 2008 (r184548) @@ -44,3 +44,4 @@ ENTRY(abs) jns 1f negl %eax 1: ret +END(abs) Modified: head/lib/libc/i386/stdlib/div.S ============================================================================== --- head/lib/libc/i386/stdlib/div.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/stdlib/div.S Sun Nov 2 01:28:47 2008 (r184548) @@ -36,3 +36,4 @@ ENTRY(div) movl %eax,4(%esp) movl %edx,8(%esp) ret +END(div) Modified: head/lib/libc/i386/stdlib/labs.S ============================================================================== --- head/lib/libc/i386/stdlib/labs.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/stdlib/labs.S Sun Nov 2 01:28:47 2008 (r184548) @@ -44,3 +44,4 @@ ENTRY(labs) jns 1f negl %eax 1: ret +END(labs) Modified: head/lib/libc/i386/stdlib/ldiv.S ============================================================================== --- head/lib/libc/i386/stdlib/ldiv.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/stdlib/ldiv.S Sun Nov 2 01:28:47 2008 (r184548) @@ -39,3 +39,4 @@ ENTRY(ldiv) movl %eax,4(%esp) movl %edx,8(%esp) ret +END(ldiv) Modified: head/lib/libc/i386/string/bcmp.S ============================================================================== --- head/lib/libc/i386/string/bcmp.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/bcmp.S Sun Nov 2 01:28:47 2008 (r184548) @@ -61,3 +61,4 @@ L1: popl %esi popl %edi ret +END(bcmp) Modified: head/lib/libc/i386/string/bcopy.S ============================================================================== --- head/lib/libc/i386/string/bcopy.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/bcopy.S Sun Nov 2 01:28:47 2008 (r184548) @@ -97,3 +97,12 @@ ENTRY(bcopy) popl %esi cld ret +#ifdef MEMCOPY +END(memcpy) +#else +#ifdef MEMMOVE +END(memmove) +#else +END(bcopy) +#endif +#endif Modified: head/lib/libc/i386/string/bzero.S ============================================================================== --- head/lib/libc/i386/string/bzero.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/bzero.S Sun Nov 2 01:28:47 2008 (r184548) @@ -79,3 +79,4 @@ L1: rep popl %ebx popl %edi ret +END(bzero) Modified: head/lib/libc/i386/string/ffs.S ============================================================================== --- head/lib/libc/i386/string/ffs.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/ffs.S Sun Nov 2 01:28:47 2008 (r184548) @@ -51,3 +51,4 @@ ENTRY(ffs) .align 2 L1: xorl %eax,%eax /* clear result */ ret +END(ffs) Modified: head/lib/libc/i386/string/index.S ============================================================================== --- head/lib/libc/i386/string/index.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/index.S Sun Nov 2 01:28:47 2008 (r184548) @@ -61,3 +61,4 @@ L1: L2: popl %ebx ret +END(index) Modified: head/lib/libc/i386/string/memchr.S ============================================================================== --- head/lib/libc/i386/string/memchr.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/memchr.S Sun Nov 2 01:28:47 2008 (r184548) @@ -56,3 +56,4 @@ ENTRY(memchr) L1: xorl %eax,%eax popl %edi ret +END(memchr) Modified: head/lib/libc/i386/string/memcmp.S ============================================================================== --- head/lib/libc/i386/string/memcmp.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/memcmp.S Sun Nov 2 01:28:47 2008 (r184548) @@ -73,3 +73,4 @@ L6: movzbl -1(%edi),%eax /* Perform un popl %esi popl %edi ret +END(memcmp) Modified: head/lib/libc/i386/string/memset.S ============================================================================== --- head/lib/libc/i386/string/memset.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/memset.S Sun Nov 2 01:28:47 2008 (r184548) @@ -87,3 +87,4 @@ L1: rep popl %ebx popl %edi ret +END(memset) Modified: head/lib/libc/i386/string/rindex.S ============================================================================== --- head/lib/libc/i386/string/rindex.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/rindex.S Sun Nov 2 01:28:47 2008 (r184548) @@ -62,3 +62,4 @@ L2: jne L1 popl %ebx ret +END(rindex) Modified: head/lib/libc/i386/string/strcat.S ============================================================================== --- head/lib/libc/i386/string/strcat.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/strcat.S Sun Nov 2 01:28:47 2008 (r184548) @@ -98,3 +98,4 @@ L1: movb (%edx),%al /* unroll loop, but L2: popl %eax /* pop destination address */ popl %edi /* restore edi */ ret +END(strcat) Modified: head/lib/libc/i386/string/strchr.S ============================================================================== --- head/lib/libc/i386/string/strchr.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/strchr.S Sun Nov 2 01:28:47 2008 (r184548) @@ -61,3 +61,4 @@ L1: L2: popl %ebx ret +END(strchr) Modified: head/lib/libc/i386/string/strcmp.S ============================================================================== --- head/lib/libc/i386/string/strcmp.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/strcmp.S Sun Nov 2 01:28:47 2008 (r184548) @@ -117,3 +117,4 @@ L3: movzbl (%eax),%eax movzbl (%edx),%edx subl %edx,%eax ret +END(strcmp) Modified: head/lib/libc/i386/string/strcpy.S ============================================================================== --- head/lib/libc/i386/string/strcpy.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/strcpy.S Sun Nov 2 01:28:47 2008 (r184548) @@ -87,3 +87,4 @@ L1: movb (%edx),%al /* unroll loop, but jne L1 L2: popl %eax /* pop dst address */ ret +END(strcpy) Modified: head/lib/libc/i386/string/strlen.S ============================================================================== --- head/lib/libc/i386/string/strlen.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/strlen.S Sun Nov 2 01:28:47 2008 (r184548) @@ -51,3 +51,4 @@ ENTRY(strlen) leal -1(%ecx),%eax /* and subtracting one */ popl %edi ret +END(strlen) Modified: head/lib/libc/i386/string/strncmp.S ============================================================================== --- head/lib/libc/i386/string/strncmp.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/strncmp.S Sun Nov 2 01:28:47 2008 (r184548) @@ -164,3 +164,4 @@ L3: movzbl (%eax),%eax /* unsigned comp L4: xorl %eax,%eax popl %ebx ret +END(strncmp) Modified: head/lib/libc/i386/string/strrchr.S ============================================================================== --- head/lib/libc/i386/string/strrchr.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/strrchr.S Sun Nov 2 01:28:47 2008 (r184548) @@ -62,3 +62,4 @@ L2: jne L1 popl %ebx ret +END(strrchr) Modified: head/lib/libc/i386/string/swab.S ============================================================================== --- head/lib/libc/i386/string/swab.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/swab.S Sun Nov 2 01:28:47 2008 (r184548) @@ -97,3 +97,4 @@ L3: lodsw L4: popl %edi popl %esi ret +END(swab) Modified: head/lib/libc/i386/string/wcschr.S ============================================================================== --- head/lib/libc/i386/string/wcschr.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/wcschr.S Sun Nov 2 01:28:47 2008 (r184548) @@ -74,3 +74,4 @@ found0: popl %ebx no: popl %ebx xorl %eax,%eax ret +END(wcschr) Modified: head/lib/libc/i386/string/wcscmp.S ============================================================================== --- head/lib/libc/i386/string/wcscmp.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/wcscmp.S Sun Nov 2 01:28:47 2008 (r184548) @@ -77,3 +77,4 @@ no0: subl (%esi),%eax popl %esi popl %edi ret +END(wcscmp) Modified: head/lib/libc/i386/string/wcslen.S ============================================================================== --- head/lib/libc/i386/string/wcslen.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/wcslen.S Sun Nov 2 01:28:47 2008 (r184548) @@ -66,3 +66,4 @@ found2: incl %eax found1: incl %eax found0: popl %ebx ret +END(wcslen) Modified: head/lib/libc/i386/string/wmemchr.S ============================================================================== --- head/lib/libc/i386/string/wmemchr.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/string/wmemchr.S Sun Nov 2 01:28:47 2008 (r184548) @@ -103,3 +103,4 @@ no: xorl %eax,%eax popl %ebx popl %edi ret +END(wmemchr) Modified: head/lib/libc/i386/sys/Ovfork.S ============================================================================== --- head/lib/libc/i386/sys/Ovfork.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/sys/Ovfork.S Sun Nov 2 01:28:47 2008 (r184548) @@ -52,3 +52,4 @@ ENTRY(__sys_vfork) pushl %ecx PIC_PROLOGUE jmp PIC_PLT(HIDENAME(cerror)) +END(__sys_vfork) Modified: head/lib/libc/i386/sys/brk.S ============================================================================== --- head/lib/libc/i386/sys/brk.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/sys/brk.S Sun Nov 2 01:28:47 2008 (r184548) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); .globl HIDENAME(minbrk) ENTRY(_brk) jmp ok +END(_brk) ENTRY(brk) #ifdef PIC @@ -84,3 +85,4 @@ ok: err: jmp HIDENAME(cerror) #endif +END(brk) Modified: head/lib/libc/i386/sys/exect.S ============================================================================== --- head/lib/libc/i386/sys/exect.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/sys/exect.S Sun Nov 2 01:28:47 2008 (r184548) @@ -49,3 +49,4 @@ ENTRY(exect) KERNCALL PIC_PROLOGUE jmp PIC_PLT(HIDENAME(cerror)) /* exect(file, argv, env); */ +END(exect) Modified: head/lib/libc/i386/sys/getcontext.S ============================================================================== --- head/lib/libc/i386/sys/getcontext.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/sys/getcontext.S Sun Nov 2 01:28:47 2008 (r184548) @@ -48,3 +48,4 @@ ENTRY(__sys_getcontext) 1: PIC_PROLOGUE jmp PIC_PLT(HIDENAME(cerror)) +END(__sys_getcontext) Modified: head/lib/libc/i386/sys/pipe.S ============================================================================== --- head/lib/libc/i386/sys/pipe.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/sys/pipe.S Sun Nov 2 01:28:47 2008 (r184548) @@ -44,3 +44,4 @@ SYSCALL(pipe) movl %edx,4(%ecx) movl $0,%eax ret +END(pipe) Modified: head/lib/libc/i386/sys/ptrace.S ============================================================================== --- head/lib/libc/i386/sys/ptrace.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/sys/ptrace.S Sun Nov 2 01:28:47 2008 (r184548) @@ -55,3 +55,4 @@ ENTRY(ptrace) err: PIC_PROLOGUE jmp PIC_PLT(HIDENAME(cerror)) +END(ptrace) Modified: head/lib/libc/i386/sys/reboot.S ============================================================================== --- head/lib/libc/i386/sys/reboot.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/sys/reboot.S Sun Nov 2 01:28:47 2008 (r184548) @@ -40,3 +40,4 @@ __FBSDID("$FreeBSD$"); SYSCALL(reboot) iret +END(reboot) Modified: head/lib/libc/i386/sys/sbrk.S ============================================================================== --- head/lib/libc/i386/sys/sbrk.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/sys/sbrk.S Sun Nov 2 01:28:47 2008 (r184548) @@ -88,3 +88,4 @@ back: err: jmp HIDENAME(cerror) #endif /* PIC */ +END(sbrk) Modified: head/lib/libc/i386/sys/setlogin.S ============================================================================== --- head/lib/libc/i386/sys/setlogin.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/sys/setlogin.S Sun Nov 2 01:28:47 2008 (r184548) @@ -52,3 +52,4 @@ SYSCALL(setlogin) movl $0,CNAME(_logname_valid) #endif ret /* setlogin(name) */ +END(setlogin) Modified: head/lib/libc/i386/sys/syscall.S ============================================================================== --- head/lib/libc/i386/sys/syscall.S Sun Nov 2 01:10:54 2008 (r184547) +++ head/lib/libc/i386/sys/syscall.S Sun Nov 2 01:28:47 2008 (r184548) @@ -50,3 +50,4 @@ ENTRY(syscall) 1: PIC_PROLOGUE jmp PIC_PLT(HIDENAME(cerror)) +END(syscall) From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 02:58:24 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7080B106564A; Sun, 2 Nov 2008 02:58:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EBDB8FC17; Sun, 2 Nov 2008 02:58:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA22wOtI026857; Sun, 2 Nov 2008 02:58:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA22wOAI026856; Sun, 2 Nov 2008 02:58:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811020258.mA22wOAI026856@svn.freebsd.org> From: Warner Losh Date: Sun, 2 Nov 2008 02:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184550 - head/sys/mips/idt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 02:58:24 -0000 Author: imp Date: Sun Nov 2 02:58:24 2008 New Revision: 184550 URL: http://svn.freebsd.org/changeset/base/184550 Log: Remove cardbus attachment. It likely was a cut-n-paste left over from whatever template was used to create this driver. It is not necessary, and wouldn't work anyway since (a) this device will never be in a cardbus tin-can and (b) the driver isn't even PCI, but instead a built-in NIC on the IDT RC32434 on its internal bus. Modified: head/sys/mips/idt/if_kr.c Modified: head/sys/mips/idt/if_kr.c ============================================================================== --- head/sys/mips/idt/if_kr.c Sun Nov 2 02:56:16 2008 (r184549) +++ head/sys/mips/idt/if_kr.c Sun Nov 2 02:58:24 2008 (r184550) @@ -139,7 +139,6 @@ static driver_t kr_driver = { static devclass_t kr_devclass; DRIVER_MODULE(kr, obio, kr_driver, kr_devclass, 0, 0); -DRIVER_MODULE(kr, cardbus, kr_driver, kr_devclass, 0, 0); DRIVER_MODULE(miibus, kr, miibus_driver, miibus_devclass, 0, 0); static int From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 03:00:36 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB0F31065673; Sun, 2 Nov 2008 03:00:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9E8A8FC1E; Sun, 2 Nov 2008 03:00:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA230aQY026952; Sun, 2 Nov 2008 03:00:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA230aPT026951; Sun, 2 Nov 2008 03:00:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811020300.mA230aPT026951@svn.freebsd.org> From: Warner Losh Date: Sun, 2 Nov 2008 03:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184551 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 03:00:37 -0000 Author: imp Date: Sun Nov 2 03:00:36 2008 New Revision: 184551 URL: http://svn.freebsd.org/changeset/base/184551 Log: Merge some minor deltas from p4 newcard tree: (1) Belkin F5D7050_V4000 was also sold as 'Ativa 802.11g wireless card' (document) (2) Add HP Office Jet 4215 Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Nov 2 02:58:24 2008 (r184550) +++ head/sys/dev/usb/usbdevs Sun Nov 2 03:00:36 2008 (r184551) @@ -944,6 +944,7 @@ product BELKIN F5D5055 0x5055 F5D5055 product BELKIN F5D7050 0x7050 F5D7050 Wireless Adapter product BELKIN F5D7051 0x7051 F5D7051 54g USB Network Adapter product BELKIN F5D7050A 0x705a F5D7050A Wireless Adapter +/* Also sold as 'Ativa 802.11g wireless card' */ product BELKIN F5D7050_V4000 0x705c F5D7050 v4000 Wireless Adapter product BELKIN F5D9050V3 0x905b F5D9050 ver 3 Wireless Adapter product BELKIN2 F5U002 0x0002 F5U002 Parallel printer @@ -1424,6 +1425,7 @@ product HP P2000U 0x1801 Inkjet P-2000U product HP 640C 0x2004 DeskJet 640c product HP 4670V 0x3005 ScanJet 4670v product HP P1100 0x3102 Photosmart P1100 +product HP OJ4215 0x3d11 OfficeJet 4215 product HP HN210E 0x811c Ethernet HN210E product HP2 C500 0x6002 PhotoSmart C500 From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 03:02:56 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A18491065689; Sun, 2 Nov 2008 03:02:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F4CA8FC17; Sun, 2 Nov 2008 03:02:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA232ukF027134; Sun, 2 Nov 2008 03:02:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA232uDa027133; Sun, 2 Nov 2008 03:02:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811020302.mA232uDa027133@svn.freebsd.org> From: Warner Losh Date: Sun, 2 Nov 2008 03:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184552 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 03:02:56 -0000 Author: imp Date: Sun Nov 2 03:02:56 2008 New Revision: 184552 URL: http://svn.freebsd.org/changeset/base/184552 Log: Add support for reading Tivo Series 1 partitioning. This likely needs a little refinement, but is good enough to commit as is. # Should look to see if I should move swab(3) into the kernel or just # provide the unoptimized routine here. Reviewed by: marcel@ Modified: head/sys/geom/part/g_part_apm.c Modified: head/sys/geom/part/g_part_apm.c ============================================================================== --- head/sys/geom/part/g_part_apm.c Sun Nov 2 03:00:36 2008 (r184551) +++ head/sys/geom/part/g_part_apm.c Sun Nov 2 03:02:56 2008 (r184552) @@ -50,6 +50,7 @@ struct g_part_apm_table { struct g_part_table base; struct apm_ddr ddr; struct apm_ent self; + int tivo_series1; }; struct g_part_apm_entry { @@ -99,6 +100,19 @@ static struct g_part_scheme g_part_apm_s }; G_PART_SCHEME_DECLARE(g_part_apm); +static void +swab(char *buf, size_t bufsz) +{ + int i; + char ch; + + for (i = 0; i < bufsz; i += 2) { + ch = buf[i]; + buf[i] = buf[i + 1]; + buf[i + 1] = ch; + } +} + static int apm_parse_type(const char *type, char *buf, size_t bufsz) { @@ -143,7 +157,8 @@ apm_parse_type(const char *type, char *b } static int -apm_read_ent(struct g_consumer *cp, uint32_t blk, struct apm_ent *ent) +apm_read_ent(struct g_consumer *cp, uint32_t blk, struct apm_ent *ent, + int tivo_series1) { struct g_provider *pp; char *buf; @@ -153,6 +168,8 @@ apm_read_ent(struct g_consumer *cp, uint buf = g_read_data(cp, pp->sectorsize * blk, pp->sectorsize, &error); if (buf == NULL) return (error); + if (tivo_series1) + swab(buf, pp->sectorsize); ent->ent_sig = be16dec(buf); ent->ent_pmblkcnt = be32dec(buf + 4); ent->ent_start = be32dec(buf + 8); @@ -316,6 +333,7 @@ g_part_apm_probe(struct g_part_table *ba return (ENXIO); table = (struct g_part_apm_table *)basetable; + table->tivo_series1 = 0; pp = cp->provider; /* Sanity-check the provider. */ @@ -323,21 +341,38 @@ g_part_apm_probe(struct g_part_table *ba return (ENOSPC); /* Check that there's a Driver Descriptor Record (DDR). */ - /* XXX Tivo APM drives do not have a DDR */ buf = g_read_data(cp, 0L, pp->sectorsize, &error); if (buf == NULL) return (error); - table->ddr.ddr_sig = be16dec(buf); - table->ddr.ddr_blksize = be16dec(buf + 2); - table->ddr.ddr_blkcount = be32dec(buf + 4); - g_free(buf); - if (table->ddr.ddr_sig != APM_DDR_SIG) - return (ENXIO); - if (table->ddr.ddr_blksize != pp->sectorsize) - return (ENXIO); + if (be16dec(buf) == be16toh(APM_DDR_SIG)) { + /* Normal Apple DDR */ + table->ddr.ddr_sig = be16dec(buf); + table->ddr.ddr_blksize = be16dec(buf + 2); + table->ddr.ddr_blkcount = be32dec(buf + 4); + g_free(buf); + if (table->ddr.ddr_blksize != pp->sectorsize) + return (ENXIO); + } else { + /* + * Check for Tivo drives, which have no DDR and a different + * signature. Those whose first two bytes are 14 92 are + * Series 2 drives, and aren't supported. Those that start + * with 92 14 are series 1 drives and are supported. + */ + if (be16dec(buf) != 0x9214) { + /* If this is 0x1492 it could be a series 2 drive */ + g_free(buf); + return (ENXIO); + } + table->ddr.ddr_sig = APM_DDR_SIG; /* XXX */ + table->ddr.ddr_blksize = pp->sectorsize; /* XXX */ + table->ddr.ddr_blkcount = pp->mediasize / pp->sectorsize;/* XXX */ + table->tivo_series1 = 1; + g_free(buf); + } /* Check that there's a Partition Map. */ - error = apm_read_ent(cp, 1, &table->self); + error = apm_read_ent(cp, 1, &table->self, table->tivo_series1); if (error) return (error); if (table->self.ent_sig != APM_ENT_SIG) @@ -364,7 +399,7 @@ g_part_apm_read(struct g_part_table *bas basetable->gpt_entries = table->self.ent_pmblkcnt - 1; for (index = table->self.ent_pmblkcnt - 1; index > 0; index--) { - error = apm_read_ent(cp, index + 1, &ent); + error = apm_read_ent(cp, index + 1, &ent, table->tivo_series1); if (error) continue; if (!strcmp(ent.ent_type, APM_ENT_TYPE_UNUSED)) @@ -414,6 +449,11 @@ g_part_apm_write(struct g_part_table *ba int error, index; table = (struct g_part_apm_table *)basetable; + /* + * Tivo Series 1 disk partitions are currently read-only. + */ + if (table->tivo_series1) + return (EOPNOTSUPP); bzero(buf, sizeof(buf)); /* Write the DDR and 'self' entry only when we're newly created. */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 10:15:43 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A2591065675; Sun, 2 Nov 2008 10:15:43 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA7288FC0C; Sun, 2 Nov 2008 10:15:42 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2AFgks036190; Sun, 2 Nov 2008 10:15:42 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2AFgim036178; Sun, 2 Nov 2008 10:15:42 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200811021015.mA2AFgim036178@svn.freebsd.org> From: Attilio Rao Date: Sun, 2 Nov 2008 10:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184554 - in head/sys: geom/journal gnu/fs/ext2fs kern nfsclient sys ufs/ffs ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 10:15:43 -0000 Author: attilio Date: Sun Nov 2 10:15:42 2008 New Revision: 184554 URL: http://svn.freebsd.org/changeset/base/184554 Log: Improve VFS locking: - Implement real draining for vfs consumers by not relying on the mnt_lock and using instead a refcount in order to keep track of lock requesters. - Due to the change above, remove the mnt_lock lockmgr because it is now useless. - Due to the change above, vfs_busy() is no more linked to a lockmgr. Change so its KPI by removing the interlock argument and defining 2 new flags for it: MBF_NOWAIT which basically replaces the LK_NOWAIT of the old version (which was unlinked from the lockmgr alredy) and MBF_MNTLSTLOCK which provides the ability to drop the mountlist_mtx once the mnt interlock is held (ability still desired by most consumers). - The stub used into vfs_mount_destroy(), that allows to override the mnt_ref if running for more than 3 seconds, make it totally useless. Remove it as it was thought to work into older versions. If a problem of "refcount held never going away" should appear, we will need to fix properly instead than trust on such hackish solution. - Fix a bug where returning (with an error) from dounmount() was still leaving the MNTK_MWAIT flag on even if it the waiters were actually woken up. Just a place in vfs_mount_destroy() is left because it is going to recycle the structure in any case, so it doesn't matter. - Remove the markercnt refcount as it is useless. This patch modifies VFS ABI and breaks KPI for vfs_busy() so manpages and __FreeBSD_version will be modified accordingly. Discussed with: kib Tested by: pho Modified: head/sys/geom/journal/g_journal.c head/sys/gnu/fs/ext2fs/ext2_vfsops.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/nfsclient/nfs_socket.c head/sys/nfsclient/nfs_vfsops.c head/sys/sys/mount.h head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ufs/ufs_vfsops.c Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Sun Nov 2 06:40:33 2008 (r184553) +++ head/sys/geom/journal/g_journal.c Sun Nov 2 10:15:42 2008 (r184554) @@ -2879,7 +2879,7 @@ g_journal_do_switch(struct g_class *clas desc = g_journal_find_desc(mp->mnt_stat.f_fstypename); if (desc == NULL) continue; - if (vfs_busy(mp, LK_NOWAIT, &mountlist_mtx)) + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) continue; /* mtx_unlock(&mountlist_mtx) was done inside vfs_busy() */ Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Nov 2 06:40:33 2008 (r184553) +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Nov 2 10:15:42 2008 (r184554) @@ -171,7 +171,7 @@ ext2_mount(mp, td) flags = WRITECLOSE; if (mp->mnt_flag & MNT_FORCE) flags |= FORCECLOSE; - if (vfs_busy(mp, LK_NOWAIT, 0)) + if (vfs_busy(mp, MBF_NOWAIT)) return (EBUSY); error = ext2_flushfiles(mp, flags, td); vfs_unbusy(mp); Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sun Nov 2 06:40:33 2008 (r184553) +++ head/sys/kern/vfs_lookup.c Sun Nov 2 10:15:42 2008 (r184554) @@ -684,7 +684,7 @@ unionlookup: */ while (dp->v_type == VDIR && (mp = dp->v_mountedhere) && (cnp->cn_flags & NOCROSSMOUNT) == 0) { - if (vfs_busy(mp, 0, 0)) + if (vfs_busy(mp, 0)) continue; vput(dp); VFS_UNLOCK_GIANT(vfslocked); Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sun Nov 2 06:40:33 2008 (r184553) +++ head/sys/kern/vfs_mount.c Sun Nov 2 10:15:42 2008 (r184554) @@ -450,7 +450,6 @@ mount_init(void *mem, int size, int flag mp = (struct mount *)mem; mtx_init(&mp->mnt_mtx, "struct mount mtx", NULL, MTX_DEF); - lockinit(&mp->mnt_lock, PVFS, "vfslock", 0, 0); lockinit(&mp->mnt_explock, PVFS, "explock", 0, 0); return (0); } @@ -462,7 +461,6 @@ mount_fini(void *mem, int size) mp = (struct mount *)mem; lockdestroy(&mp->mnt_explock); - lockdestroy(&mp->mnt_lock); mtx_destroy(&mp->mnt_mtx); } @@ -481,7 +479,7 @@ vfs_mount_alloc(struct vnode *vp, struct TAILQ_INIT(&mp->mnt_nvnodelist); mp->mnt_nvnodelistsize = 0; mp->mnt_ref = 0; - (void) vfs_busy(mp, LK_NOWAIT, 0); + (void) vfs_busy(mp, MBF_NOWAIT); mp->mnt_op = vfsp->vfc_vfsops; mp->mnt_vfc = vfsp; vfsp->vfc_refcount++; /* XXX Unlocked */ @@ -507,19 +505,10 @@ vfs_mount_alloc(struct vnode *vp, struct void vfs_mount_destroy(struct mount *mp) { - int i; MNT_ILOCK(mp); - for (i = 0; mp->mnt_ref && i < 3; i++) - msleep(mp, MNT_MTX(mp), PVFS, "mntref", hz); - /* - * This will always cause a 3 second delay in rebooting due to - * refs on the root mountpoint that never go away. Most of these - * are held by init which never exits. - */ - if (i == 3 && (!rebooting || bootverbose)) - printf("Mount point %s had %d dangling refs\n", - mp->mnt_stat.f_mntonname, mp->mnt_ref); + 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) { @@ -928,7 +917,7 @@ vfs_domount( vput(vp); return (error); } - if (vfs_busy(mp, LK_NOWAIT, 0)) { + if (vfs_busy(mp, MBF_NOWAIT)) { vput(vp); return (EBUSY); } @@ -1245,19 +1234,31 @@ dounmount(mp, flags, td) /* Allow filesystems to detect that a forced unmount is in progress. */ if (flags & MNT_FORCE) mp->mnt_kern_flag |= MNTK_UNMOUNTF; - error = lockmgr(&mp->mnt_lock, LK_DRAIN | LK_INTERLOCK | - ((flags & MNT_FORCE) ? 0 : LK_NOWAIT), MNT_MTX(mp)); - if (error) { - MNT_ILOCK(mp); - mp->mnt_kern_flag &= ~(MNTK_UNMOUNT | MNTK_NOINSMNTQ | - MNTK_UNMOUNTF); - if (mp->mnt_kern_flag & MNTK_MWAIT) - wakeup(mp); - MNT_IUNLOCK(mp); - if (coveredvp) - VOP_UNLOCK(coveredvp, 0); - return (error); + error = 0; + if (mp->mnt_lockref) { + if (flags & MNT_FORCE) { + mp->mnt_kern_flag &= ~(MNTK_UNMOUNT | MNTK_NOINSMNTQ | + MNTK_UNMOUNTF); + if (mp->mnt_kern_flag & MNTK_MWAIT) { + mp->mnt_kern_flag &= ~MNTK_MWAIT; + wakeup(mp); + } + MNT_IUNLOCK(mp); + if (coveredvp) + VOP_UNLOCK(coveredvp, 0); + return (EBUSY); + } + mp->mnt_kern_flag |= MNTK_DRAINING; + error = msleep(&mp->mnt_lockref, MNT_MTX(mp), PVFS, + "mount drain", 0); } + MNT_IUNLOCK(mp); + KASSERT(mp->mnt_lockref == 0, + ("%s: invalid lock refcount in the drain path @ %s:%d", + __func__, __FILE__, __LINE__)); + KASSERT(error == 0, + ("%s: invalid return value for msleep in the drain path @ %s:%d", + __func__, __FILE__, __LINE__)); vn_start_write(NULL, &mp, V_WAIT); if (mp->mnt_flag & MNT_EXPUBLIC) @@ -1321,9 +1322,10 @@ dounmount(mp, flags, td) mp->mnt_flag |= async_flag; if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) mp->mnt_kern_flag |= MNTK_ASYNC; - lockmgr(&mp->mnt_lock, LK_RELEASE, NULL); - if (mp->mnt_kern_flag & MNTK_MWAIT) + if (mp->mnt_kern_flag & MNTK_MWAIT) { + mp->mnt_kern_flag &= ~MNTK_MWAIT; wakeup(mp); + } MNT_IUNLOCK(mp); if (coveredvp) VOP_UNLOCK(coveredvp, 0); @@ -1337,7 +1339,6 @@ dounmount(mp, flags, td) vput(coveredvp); } vfs_event_signal(NULL, VQ_UNMOUNT, 0); - lockmgr(&mp->mnt_lock, LK_RELEASE, NULL); vfs_mount_destroy(mp); return (0); } @@ -2070,7 +2071,6 @@ __mnt_vnode_first(struct vnode **mvp, st wakeup(&mp->mnt_holdcnt); return (NULL); } - mp->mnt_markercnt++; (*mvp)->v_mount = mp; TAILQ_INSERT_AFTER(&mp->mnt_nvnodelist, vp, *mvp, v_nmntvnodes); return (vp); @@ -2093,7 +2093,6 @@ __mnt_vnode_markerfree(struct vnode **mv MNT_ILOCK(mp); *mvp = NULL; - mp->mnt_markercnt--; mp->mnt_holdcnt--; if (mp->mnt_holdcnt == 0 && mp->mnt_holdcntwaiters != 0) wakeup(&mp->mnt_holdcnt); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Nov 2 06:40:33 2008 (r184553) +++ head/sys/kern/vfs_subr.c Sun Nov 2 10:15:42 2008 (r184554) @@ -335,42 +335,36 @@ SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, /* * Mark a mount point as busy. Used to synchronize access and to delay - * unmounting. Interlock is not released on failure. + * unmounting. Eventually, mountlist_mtx is not released on failure. */ int -vfs_busy(struct mount *mp, int flags, struct mtx *interlkp) +vfs_busy(struct mount *mp, int flags) { - int lkflags; + + MPASS((flags & ~MBF_MASK) == 0); MNT_ILOCK(mp); MNT_REF(mp); if (mp->mnt_kern_flag & MNTK_UNMOUNT) { - if (flags & LK_NOWAIT) { + if (flags & MBF_NOWAIT) { MNT_REL(mp); MNT_IUNLOCK(mp); return (ENOENT); } - if (interlkp) - mtx_unlock(interlkp); + if (flags & MBF_MNTLSTLOCK) + mtx_unlock(&mountlist_mtx); mp->mnt_kern_flag |= MNTK_MWAIT; - /* - * Since all busy locks are shared except the exclusive - * lock granted when unmounting, the only place that a - * wakeup needs to be done is at the release of the - * exclusive lock at the end of dounmount. - */ msleep(mp, MNT_MTX(mp), PVFS, "vfs_busy", 0); MNT_REL(mp); MNT_IUNLOCK(mp); - if (interlkp) - mtx_lock(interlkp); + if (flags & MBF_MNTLSTLOCK) + mtx_lock(&mountlist_mtx); return (ENOENT); } - if (interlkp) - mtx_unlock(interlkp); - lkflags = LK_SHARED | LK_INTERLOCK | LK_NOWAIT; - if (lockmgr(&mp->mnt_lock, lkflags, MNT_MTX(mp))) - panic("vfs_busy: unexpected lock failure"); + if (flags & MBF_MNTLSTLOCK) + mtx_unlock(&mountlist_mtx); + mp->mnt_lockref++; + MNT_IUNLOCK(mp); return (0); } @@ -381,8 +375,15 @@ void vfs_unbusy(struct mount *mp) { - lockmgr(&mp->mnt_lock, LK_RELEASE, NULL); - vfs_rel(mp); + MNT_ILOCK(mp); + MNT_REL(mp); + mp->mnt_lockref--; + if (mp->mnt_lockref == 0 && (mp->mnt_kern_flag & MNTK_DRAINING) != 0) { + MPASS(mp->mnt_kern_flag & MNTK_UNMOUNT); + mp->mnt_kern_flag &= ~MNTK_DRAINING; + wakeup(&mp->mnt_lockref); + } + MNT_IUNLOCK(mp); } /* @@ -747,7 +748,7 @@ vnlru_proc(void) mtx_lock(&mountlist_mtx); for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { int vfsunlocked; - if (vfs_busy(mp, LK_NOWAIT, &mountlist_mtx)) { + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) { nmp = TAILQ_NEXT(mp, mnt_list); continue; } @@ -2837,7 +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_markercnt = %d\n", mp->mnt_markercnt); 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); @@ -2999,7 +2999,7 @@ sysctl_vnode(SYSCTL_HANDLER_ARGS) n = 0; mtx_lock(&mountlist_mtx); TAILQ_FOREACH(mp, &mountlist, mnt_list) { - if (vfs_busy(mp, LK_NOWAIT, &mountlist_mtx)) + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) continue; MNT_ILOCK(mp); TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) { @@ -3361,7 +3361,7 @@ sync_fsync(struct vop_fsync_args *ap) * not already on the sync list. */ mtx_lock(&mountlist_mtx); - if (vfs_busy(mp, LK_EXCLUSIVE | LK_NOWAIT, &mountlist_mtx) != 0) { + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK) != 0) { mtx_unlock(&mountlist_mtx); return (0); } Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sun Nov 2 06:40:33 2008 (r184553) +++ head/sys/kern/vfs_syscalls.c Sun Nov 2 10:15:42 2008 (r184554) @@ -124,7 +124,7 @@ sync(td, uap) mtx_lock(&mountlist_mtx); for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { - if (vfs_busy(mp, LK_NOWAIT, &mountlist_mtx)) { + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) { nmp = TAILQ_NEXT(mp, mnt_list); continue; } @@ -197,7 +197,7 @@ quotactl(td, uap) vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); mp = nd.ni_vp->v_mount; - if ((error = vfs_busy(mp, 0, NULL))) { + if ((error = vfs_busy(mp, 0))) { vrele(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); return (error); @@ -479,7 +479,7 @@ kern_getfsstat(struct thread *td, struct continue; } #endif - if (vfs_busy(mp, LK_NOWAIT, &mountlist_mtx)) { + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) { nmp = TAILQ_NEXT(mp, mnt_list); continue; } @@ -741,7 +741,7 @@ fchdir(td, uap) error = change_dir(vp, td); while (!error && (mp = vp->v_mountedhere) != NULL) { int tvfslocked; - if (vfs_busy(mp, 0, 0)) + if (vfs_busy(mp, 0)) continue; tvfslocked = VFS_LOCK_GIANT(mp); error = VFS_ROOT(mp, LK_EXCLUSIVE, &tdp, td); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sun Nov 2 06:40:33 2008 (r184553) +++ head/sys/kern/vfs_vnops.c Sun Nov 2 10:15:42 2008 (r184554) @@ -957,9 +957,18 @@ vn_start_write(vp, mpp, flags) } if ((mp = *mpp) == NULL) return (0); + + /* + * VOP_GETWRITEMOUNT() returns with the mp refcount held through + * a vfs_ref(). + * As long as a vnode is not provided we need to acquire a + * refcount for the provided mountpoint too, in order to + * emulate a vfs_ref(). + */ MNT_ILOCK(mp); if (vp == NULL) MNT_REF(mp); + /* * Check on status of suspension. */ @@ -1021,6 +1030,14 @@ vn_start_secondary_write(vp, mpp, flags) */ if ((mp = *mpp) == NULL) return (0); + + /* + * VOP_GETWRITEMOUNT() returns with the mp refcount held through + * a vfs_ref(). + * As long as a vnode is not provided we need to acquire a + * refcount for the provided mountpoint too, in order to + * emulate a vfs_ref(). + */ MNT_ILOCK(mp); if (vp == NULL) MNT_REF(mp); Modified: head/sys/nfsclient/nfs_socket.c ============================================================================== --- head/sys/nfsclient/nfs_socket.c Sun Nov 2 06:40:33 2008 (r184553) +++ head/sys/nfsclient/nfs_socket.c Sun Nov 2 10:15:42 2008 (r184554) @@ -1429,8 +1429,8 @@ nfs_timer(void *arg) /* * Terminate request if force-unmount in progress. * Note that NFS could have vfs_busy'ed the mount, - * causing the unmount to wait for the mnt_lock, making - * this bit of logic necessary. + * causing the unmount to wait and making this bit + * of logic necessary. */ if (rep->r_nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF) { nfs_softterm(rep); Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Sun Nov 2 06:40:33 2008 (r184553) +++ head/sys/nfsclient/nfs_vfsops.c Sun Nov 2 10:15:42 2008 (r184554) @@ -258,7 +258,7 @@ nfs_statfs(struct mount *mp, struct stat #ifndef nolint sfp = NULL; #endif - error = vfs_busy(mp, LK_NOWAIT, NULL); + error = vfs_busy(mp, MBF_NOWAIT); if (error) return (error); error = nfs_nget(mp, (nfsfh_t *)nmp->nm_fh, nmp->nm_fhsize, &np, LK_EXCLUSIVE); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sun Nov 2 06:40:33 2008 (r184553) +++ head/sys/sys/mount.h Sun Nov 2 10:15:42 2008 (r184554) @@ -142,13 +142,11 @@ struct vfsopt; * Lock reference: * m - mountlist_mtx * i - interlock - * l - mnt_lock * * Unmarked fields are considered stable as long as a ref is held. * */ struct mount { - struct lock mnt_lock; /* mount structure lock */ struct mtx mnt_mtx; /* mount structure interlock */ int mnt_gen; /* struct mount generation */ #define mnt_startzero mnt_list @@ -175,7 +173,7 @@ struct mount { struct netexport *mnt_export; /* export list */ struct label *mnt_label; /* MAC label for the fs */ u_int mnt_hashseed; /* Random seed for vfs_hash */ - int mnt_markercnt; /* marker vnodes in use */ + 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 */ @@ -319,6 +317,7 @@ void __mnt_vnode_markerfree(str #define MNTK_ASYNC 0x00000002 /* filtered async flag */ #define MNTK_SOFTDEP 0x00000004 /* async disabled by softdep */ #define MNTK_NOINSMNTQ 0x00000008 /* insmntque is not allowed */ +#define MNTK_DRAINING 0x00000010 /* lock draining is happening */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ #define MNTK_SUSPEND 0x08000000 /* request write suspension */ @@ -506,6 +505,13 @@ struct uio; #ifdef _KERNEL +/* + * vfs_busy specific flags and mask. + */ +#define MBF_NOWAIT 0x01 +#define MBF_MNTLSTLOCK 0x02 +#define MBF_MASK (MBF_NOWAIT | MBF_MNTLSTLOCK) + #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_MOUNT); #endif @@ -686,7 +692,7 @@ int vfs_scanopt(struct vfsoptlist *opts, int vfs_setpublicfs /* set publicly exported fs */ (struct mount *, struct netexport *, struct export_args *); void vfs_msync(struct mount *, int); -int vfs_busy(struct mount *, int, struct mtx *); +int vfs_busy(struct mount *, int); int vfs_export /* process mount export info */ (struct mount *, struct export_args *); int vfs_allocate_syncvnode(struct mount *); Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sun Nov 2 06:40:33 2008 (r184553) +++ head/sys/ufs/ffs/ffs_softdep.c Sun Nov 2 10:15:42 2008 (r184554) @@ -745,7 +745,7 @@ softdep_flush(void) nmp = TAILQ_NEXT(mp, mnt_list); if ((mp->mnt_flag & MNT_SOFTDEP) == 0) continue; - if (vfs_busy(mp, LK_NOWAIT, &mountlist_mtx)) + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) continue; vfslocked = VFS_LOCK_GIANT(mp); softdep_process_worklist(mp, 0); Modified: head/sys/ufs/ufs/ufs_vfsops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vfsops.c Sun Nov 2 06:40:33 2008 (r184553) +++ head/sys/ufs/ufs/ufs_vfsops.c Sun Nov 2 10:15:42 2008 (r184554) @@ -118,7 +118,7 @@ ufs_quotactl(mp, cmds, id, arg, td) if ((u_int)type >= MAXQUOTAS) return (EINVAL); - if (vfs_busy(mp, LK_NOWAIT, 0)) + if (vfs_busy(mp, MBF_NOWAIT)) return (0); switch (cmd) { From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 10:20:19 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B6A1106568A; Sun, 2 Nov 2008 10:20:19 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69F098FC0A; Sun, 2 Nov 2008 10:20:19 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2AKJNb036299; Sun, 2 Nov 2008 10:20:19 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2AKJGx036298; Sun, 2 Nov 2008 10:20:19 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200811021020.mA2AKJGx036298@svn.freebsd.org> From: Attilio Rao Date: Sun, 2 Nov 2008 10:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184555 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 10:20:19 -0000 Author: attilio Date: Sun Nov 2 10:20:18 2008 New Revision: 184555 URL: http://svn.freebsd.org/changeset/base/184555 Log: Bump __FreeBSD_version in order to reflect vfs_busy() prototype changing and its flags (MBF_NOWAIT, MBF_MNTLSTLOCK) introduction. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Nov 2 10:15:42 2008 (r184554) +++ head/sys/sys/param.h Sun Nov 2 10:20:18 2008 (r184555) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800052 /* Master, propagated to newvers */ +#define __FreeBSD_version 800053 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 10:25:10 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B26E5106567C; Sun, 2 Nov 2008 10:25:10 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id 6850E8FC65; Sun, 2 Nov 2008 10:25:08 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id CB31241C735; Sun, 2 Nov 2008 11:25:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id AXSTUGzEKN7n; Sun, 2 Nov 2008 11:25:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id F373E41C733; Sun, 2 Nov 2008 11:25:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 499AF444888; Sun, 2 Nov 2008 10:22:23 +0000 (UTC) Date: Sun, 2 Nov 2008 10:22:22 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Attilio Rao In-Reply-To: <200811021015.mA2AFgim036178@svn.freebsd.org> Message-ID: <20081102102108.B41609@maildrop.int.zabbadoz.net> References: <200811021015.mA2AFgim036178@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184554 - in head/sys: geom/journal gnu/fs/ext2fs kern nfsclient sys ufs/ffs ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 10:25:11 -0000 On Sun, 2 Nov 2008, Attilio Rao wrote: > Author: attilio > Date: Sun Nov 2 10:15:42 2008 > New Revision: 184554 > URL: http://svn.freebsd.org/changeset/base/184554 > > Log: > Improve VFS locking: > - Implement real draining for vfs consumers by not relying on the > mnt_lock and using instead a refcount in order to keep track of lock > requesters. > - Due to the change above, remove the mnt_lock lockmgr because it is now > useless. > - Due to the change above, vfs_busy() is no more linked to a lockmgr. > Change so its KPI by removing the interlock argument and defining 2 new > flags for it: MBF_NOWAIT which basically replaces the LK_NOWAIT of the > old version (which was unlinked from the lockmgr alredy) and > MBF_MNTLSTLOCK which provides the ability to drop the mountlist_mtx > once the mnt interlock is held (ability still desired by most consumers). > - The stub used into vfs_mount_destroy(), that allows to override the > mnt_ref if running for more than 3 seconds, make it totally useless. > Remove it as it was thought to work into older versions. > If a problem of "refcount held never going away" should appear, we will > need to fix properly instead than trust on such hackish solution. > - Fix a bug where returning (with an error) from dounmount() was still > leaving the MNTK_MWAIT flag on even if it the waiters were actually > woken up. Just a place in vfs_mount_destroy() is left because it is > going to recycle the structure in any case, so it doesn't matter. > - Remove the markercnt refcount as it is useless. > > This patch modifies VFS ABI and breaks KPI for vfs_busy() so manpages and > __FreeBSD_version will be modified accordingly. So why didn't you update __FreeBSD_version with the same commit that changed the KPI? > Discussed with: kib > Tested by: pho > > Modified: > head/sys/geom/journal/g_journal.c > head/sys/gnu/fs/ext2fs/ext2_vfsops.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/nfsclient/nfs_socket.c > head/sys/nfsclient/nfs_vfsops.c > head/sys/sys/mount.h > head/sys/ufs/ffs/ffs_softdep.c > head/sys/ufs/ufs/ufs_vfsops.c > > Modified: head/sys/geom/journal/g_journal.c > ============================================================================== > --- head/sys/geom/journal/g_journal.c Sun Nov 2 06:40:33 2008 (r184553) > +++ head/sys/geom/journal/g_journal.c Sun Nov 2 10:15:42 2008 (r184554) > @@ -2879,7 +2879,7 @@ g_journal_do_switch(struct g_class *clas > desc = g_journal_find_desc(mp->mnt_stat.f_fstypename); > if (desc == NULL) > continue; > - if (vfs_busy(mp, LK_NOWAIT, &mountlist_mtx)) > + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) > continue; > /* mtx_unlock(&mountlist_mtx) was done inside vfs_busy() */ > > > Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c > ============================================================================== > --- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Nov 2 06:40:33 2008 (r184553) > +++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Sun Nov 2 10:15:42 2008 (r184554) > @@ -171,7 +171,7 @@ ext2_mount(mp, td) > flags = WRITECLOSE; > if (mp->mnt_flag & MNT_FORCE) > flags |= FORCECLOSE; > - if (vfs_busy(mp, LK_NOWAIT, 0)) > + if (vfs_busy(mp, MBF_NOWAIT)) > return (EBUSY); > error = ext2_flushfiles(mp, flags, td); > vfs_unbusy(mp); > > Modified: head/sys/kern/vfs_lookup.c > ============================================================================== > --- head/sys/kern/vfs_lookup.c Sun Nov 2 06:40:33 2008 (r184553) > +++ head/sys/kern/vfs_lookup.c Sun Nov 2 10:15:42 2008 (r184554) > @@ -684,7 +684,7 @@ unionlookup: > */ > while (dp->v_type == VDIR && (mp = dp->v_mountedhere) && > (cnp->cn_flags & NOCROSSMOUNT) == 0) { > - if (vfs_busy(mp, 0, 0)) > + if (vfs_busy(mp, 0)) > continue; > vput(dp); > VFS_UNLOCK_GIANT(vfslocked); > > Modified: head/sys/kern/vfs_mount.c > ============================================================================== > --- head/sys/kern/vfs_mount.c Sun Nov 2 06:40:33 2008 (r184553) > +++ head/sys/kern/vfs_mount.c Sun Nov 2 10:15:42 2008 (r184554) > @@ -450,7 +450,6 @@ mount_init(void *mem, int size, int flag > > mp = (struct mount *)mem; > mtx_init(&mp->mnt_mtx, "struct mount mtx", NULL, MTX_DEF); > - lockinit(&mp->mnt_lock, PVFS, "vfslock", 0, 0); > lockinit(&mp->mnt_explock, PVFS, "explock", 0, 0); > return (0); > } > @@ -462,7 +461,6 @@ mount_fini(void *mem, int size) > > mp = (struct mount *)mem; > lockdestroy(&mp->mnt_explock); > - lockdestroy(&mp->mnt_lock); > mtx_destroy(&mp->mnt_mtx); > } > > @@ -481,7 +479,7 @@ vfs_mount_alloc(struct vnode *vp, struct > TAILQ_INIT(&mp->mnt_nvnodelist); > mp->mnt_nvnodelistsize = 0; > mp->mnt_ref = 0; > - (void) vfs_busy(mp, LK_NOWAIT, 0); > + (void) vfs_busy(mp, MBF_NOWAIT); > mp->mnt_op = vfsp->vfc_vfsops; > mp->mnt_vfc = vfsp; > vfsp->vfc_refcount++; /* XXX Unlocked */ > @@ -507,19 +505,10 @@ vfs_mount_alloc(struct vnode *vp, struct > void > vfs_mount_destroy(struct mount *mp) > { > - int i; > > MNT_ILOCK(mp); > - for (i = 0; mp->mnt_ref && i < 3; i++) > - msleep(mp, MNT_MTX(mp), PVFS, "mntref", hz); > - /* > - * This will always cause a 3 second delay in rebooting due to > - * refs on the root mountpoint that never go away. Most of these > - * are held by init which never exits. > - */ > - if (i == 3 && (!rebooting || bootverbose)) > - printf("Mount point %s had %d dangling refs\n", > - mp->mnt_stat.f_mntonname, mp->mnt_ref); > + 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) { > @@ -928,7 +917,7 @@ vfs_domount( > vput(vp); > return (error); > } > - if (vfs_busy(mp, LK_NOWAIT, 0)) { > + if (vfs_busy(mp, MBF_NOWAIT)) { > vput(vp); > return (EBUSY); > } > @@ -1245,19 +1234,31 @@ dounmount(mp, flags, td) > /* Allow filesystems to detect that a forced unmount is in progress. */ > if (flags & MNT_FORCE) > mp->mnt_kern_flag |= MNTK_UNMOUNTF; > - error = lockmgr(&mp->mnt_lock, LK_DRAIN | LK_INTERLOCK | > - ((flags & MNT_FORCE) ? 0 : LK_NOWAIT), MNT_MTX(mp)); > - if (error) { > - MNT_ILOCK(mp); > - mp->mnt_kern_flag &= ~(MNTK_UNMOUNT | MNTK_NOINSMNTQ | > - MNTK_UNMOUNTF); > - if (mp->mnt_kern_flag & MNTK_MWAIT) > - wakeup(mp); > - MNT_IUNLOCK(mp); > - if (coveredvp) > - VOP_UNLOCK(coveredvp, 0); > - return (error); > + error = 0; > + if (mp->mnt_lockref) { > + if (flags & MNT_FORCE) { > + mp->mnt_kern_flag &= ~(MNTK_UNMOUNT | MNTK_NOINSMNTQ | > + MNTK_UNMOUNTF); > + if (mp->mnt_kern_flag & MNTK_MWAIT) { > + mp->mnt_kern_flag &= ~MNTK_MWAIT; > + wakeup(mp); > + } > + MNT_IUNLOCK(mp); > + if (coveredvp) > + VOP_UNLOCK(coveredvp, 0); > + return (EBUSY); > + } > + mp->mnt_kern_flag |= MNTK_DRAINING; > + error = msleep(&mp->mnt_lockref, MNT_MTX(mp), PVFS, > + "mount drain", 0); > } > + MNT_IUNLOCK(mp); > + KASSERT(mp->mnt_lockref == 0, > + ("%s: invalid lock refcount in the drain path @ %s:%d", > + __func__, __FILE__, __LINE__)); > + KASSERT(error == 0, > + ("%s: invalid return value for msleep in the drain path @ %s:%d", > + __func__, __FILE__, __LINE__)); > vn_start_write(NULL, &mp, V_WAIT); > > if (mp->mnt_flag & MNT_EXPUBLIC) > @@ -1321,9 +1322,10 @@ dounmount(mp, flags, td) > mp->mnt_flag |= async_flag; > if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) > mp->mnt_kern_flag |= MNTK_ASYNC; > - lockmgr(&mp->mnt_lock, LK_RELEASE, NULL); > - if (mp->mnt_kern_flag & MNTK_MWAIT) > + if (mp->mnt_kern_flag & MNTK_MWAIT) { > + mp->mnt_kern_flag &= ~MNTK_MWAIT; > wakeup(mp); > + } > MNT_IUNLOCK(mp); > if (coveredvp) > VOP_UNLOCK(coveredvp, 0); > @@ -1337,7 +1339,6 @@ dounmount(mp, flags, td) > vput(coveredvp); > } > vfs_event_signal(NULL, VQ_UNMOUNT, 0); > - lockmgr(&mp->mnt_lock, LK_RELEASE, NULL); > vfs_mount_destroy(mp); > return (0); > } > @@ -2070,7 +2071,6 @@ __mnt_vnode_first(struct vnode **mvp, st > wakeup(&mp->mnt_holdcnt); > return (NULL); > } > - mp->mnt_markercnt++; > (*mvp)->v_mount = mp; > TAILQ_INSERT_AFTER(&mp->mnt_nvnodelist, vp, *mvp, v_nmntvnodes); > return (vp); > @@ -2093,7 +2093,6 @@ __mnt_vnode_markerfree(struct vnode **mv > MNT_ILOCK(mp); > *mvp = NULL; > > - mp->mnt_markercnt--; > mp->mnt_holdcnt--; > if (mp->mnt_holdcnt == 0 && mp->mnt_holdcntwaiters != 0) > wakeup(&mp->mnt_holdcnt); > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Sun Nov 2 06:40:33 2008 (r184553) > +++ head/sys/kern/vfs_subr.c Sun Nov 2 10:15:42 2008 (r184554) > @@ -335,42 +335,36 @@ SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, > > /* > * Mark a mount point as busy. Used to synchronize access and to delay > - * unmounting. Interlock is not released on failure. > + * unmounting. Eventually, mountlist_mtx is not released on failure. > */ > int > -vfs_busy(struct mount *mp, int flags, struct mtx *interlkp) > +vfs_busy(struct mount *mp, int flags) > { > - int lkflags; > + > + MPASS((flags & ~MBF_MASK) == 0); > > MNT_ILOCK(mp); > MNT_REF(mp); > if (mp->mnt_kern_flag & MNTK_UNMOUNT) { > - if (flags & LK_NOWAIT) { > + if (flags & MBF_NOWAIT) { > MNT_REL(mp); > MNT_IUNLOCK(mp); > return (ENOENT); > } > - if (interlkp) > - mtx_unlock(interlkp); > + if (flags & MBF_MNTLSTLOCK) > + mtx_unlock(&mountlist_mtx); > mp->mnt_kern_flag |= MNTK_MWAIT; > - /* > - * Since all busy locks are shared except the exclusive > - * lock granted when unmounting, the only place that a > - * wakeup needs to be done is at the release of the > - * exclusive lock at the end of dounmount. > - */ > msleep(mp, MNT_MTX(mp), PVFS, "vfs_busy", 0); > MNT_REL(mp); > MNT_IUNLOCK(mp); > - if (interlkp) > - mtx_lock(interlkp); > + if (flags & MBF_MNTLSTLOCK) > + mtx_lock(&mountlist_mtx); > return (ENOENT); > } > - if (interlkp) > - mtx_unlock(interlkp); > - lkflags = LK_SHARED | LK_INTERLOCK | LK_NOWAIT; > - if (lockmgr(&mp->mnt_lock, lkflags, MNT_MTX(mp))) > - panic("vfs_busy: unexpected lock failure"); > + if (flags & MBF_MNTLSTLOCK) > + mtx_unlock(&mountlist_mtx); > + mp->mnt_lockref++; > + MNT_IUNLOCK(mp); > return (0); > } > > @@ -381,8 +375,15 @@ void > vfs_unbusy(struct mount *mp) > { > > - lockmgr(&mp->mnt_lock, LK_RELEASE, NULL); > - vfs_rel(mp); > + MNT_ILOCK(mp); > + MNT_REL(mp); > + mp->mnt_lockref--; > + if (mp->mnt_lockref == 0 && (mp->mnt_kern_flag & MNTK_DRAINING) != 0) { > + MPASS(mp->mnt_kern_flag & MNTK_UNMOUNT); > + mp->mnt_kern_flag &= ~MNTK_DRAINING; > + wakeup(&mp->mnt_lockref); > + } > + MNT_IUNLOCK(mp); > } > > /* > @@ -747,7 +748,7 @@ vnlru_proc(void) > mtx_lock(&mountlist_mtx); > for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { > int vfsunlocked; > - if (vfs_busy(mp, LK_NOWAIT, &mountlist_mtx)) { > + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) { > nmp = TAILQ_NEXT(mp, mnt_list); > continue; > } > @@ -2837,7 +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_markercnt = %d\n", mp->mnt_markercnt); > 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); > @@ -2999,7 +2999,7 @@ sysctl_vnode(SYSCTL_HANDLER_ARGS) > n = 0; > mtx_lock(&mountlist_mtx); > TAILQ_FOREACH(mp, &mountlist, mnt_list) { > - if (vfs_busy(mp, LK_NOWAIT, &mountlist_mtx)) > + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) > continue; > MNT_ILOCK(mp); > TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) { > @@ -3361,7 +3361,7 @@ sync_fsync(struct vop_fsync_args *ap) > * not already on the sync list. > */ > mtx_lock(&mountlist_mtx); > - if (vfs_busy(mp, LK_EXCLUSIVE | LK_NOWAIT, &mountlist_mtx) != 0) { > + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK) != 0) { > mtx_unlock(&mountlist_mtx); > return (0); > } > > Modified: head/sys/kern/vfs_syscalls.c > ============================================================================== > --- head/sys/kern/vfs_syscalls.c Sun Nov 2 06:40:33 2008 (r184553) > +++ head/sys/kern/vfs_syscalls.c Sun Nov 2 10:15:42 2008 (r184554) > @@ -124,7 +124,7 @@ sync(td, uap) > > mtx_lock(&mountlist_mtx); > for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { > - if (vfs_busy(mp, LK_NOWAIT, &mountlist_mtx)) { > + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) { > nmp = TAILQ_NEXT(mp, mnt_list); > continue; > } > @@ -197,7 +197,7 @@ quotactl(td, uap) > vfslocked = NDHASGIANT(&nd); > NDFREE(&nd, NDF_ONLY_PNBUF); > mp = nd.ni_vp->v_mount; > - if ((error = vfs_busy(mp, 0, NULL))) { > + if ((error = vfs_busy(mp, 0))) { > vrele(nd.ni_vp); > VFS_UNLOCK_GIANT(vfslocked); > return (error); > @@ -479,7 +479,7 @@ kern_getfsstat(struct thread *td, struct > continue; > } > #endif > - if (vfs_busy(mp, LK_NOWAIT, &mountlist_mtx)) { > + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) { > nmp = TAILQ_NEXT(mp, mnt_list); > continue; > } > @@ -741,7 +741,7 @@ fchdir(td, uap) > error = change_dir(vp, td); > while (!error && (mp = vp->v_mountedhere) != NULL) { > int tvfslocked; > - if (vfs_busy(mp, 0, 0)) > + if (vfs_busy(mp, 0)) > continue; > tvfslocked = VFS_LOCK_GIANT(mp); > error = VFS_ROOT(mp, LK_EXCLUSIVE, &tdp, td); > > Modified: head/sys/kern/vfs_vnops.c > ============================================================================== > --- head/sys/kern/vfs_vnops.c Sun Nov 2 06:40:33 2008 (r184553) > +++ head/sys/kern/vfs_vnops.c Sun Nov 2 10:15:42 2008 (r184554) > @@ -957,9 +957,18 @@ vn_start_write(vp, mpp, flags) > } > if ((mp = *mpp) == NULL) > return (0); > + > + /* > + * VOP_GETWRITEMOUNT() returns with the mp refcount held through > + * a vfs_ref(). > + * As long as a vnode is not provided we need to acquire a > + * refcount for the provided mountpoint too, in order to > + * emulate a vfs_ref(). > + */ > MNT_ILOCK(mp); > if (vp == NULL) > MNT_REF(mp); > + > /* > * Check on status of suspension. > */ > @@ -1021,6 +1030,14 @@ vn_start_secondary_write(vp, mpp, flags) > */ > if ((mp = *mpp) == NULL) > return (0); > + > + /* > + * VOP_GETWRITEMOUNT() returns with the mp refcount held through > + * a vfs_ref(). > + * As long as a vnode is not provided we need to acquire a > + * refcount for the provided mountpoint too, in order to > + * emulate a vfs_ref(). > + */ > MNT_ILOCK(mp); > if (vp == NULL) > MNT_REF(mp); > > Modified: head/sys/nfsclient/nfs_socket.c > ============================================================================== > --- head/sys/nfsclient/nfs_socket.c Sun Nov 2 06:40:33 2008 (r184553) > +++ head/sys/nfsclient/nfs_socket.c Sun Nov 2 10:15:42 2008 (r184554) > @@ -1429,8 +1429,8 @@ nfs_timer(void *arg) > /* > * Terminate request if force-unmount in progress. > * Note that NFS could have vfs_busy'ed the mount, > - * causing the unmount to wait for the mnt_lock, making > - * this bit of logic necessary. > + * causing the unmount to wait and making this bit > + * of logic necessary. > */ > if (rep->r_nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF) { > nfs_softterm(rep); > > Modified: head/sys/nfsclient/nfs_vfsops.c > ============================================================================== > --- head/sys/nfsclient/nfs_vfsops.c Sun Nov 2 06:40:33 2008 (r184553) > +++ head/sys/nfsclient/nfs_vfsops.c Sun Nov 2 10:15:42 2008 (r184554) > @@ -258,7 +258,7 @@ nfs_statfs(struct mount *mp, struct stat > #ifndef nolint > sfp = NULL; > #endif > - error = vfs_busy(mp, LK_NOWAIT, NULL); > + error = vfs_busy(mp, MBF_NOWAIT); > if (error) > return (error); > error = nfs_nget(mp, (nfsfh_t *)nmp->nm_fh, nmp->nm_fhsize, &np, LK_EXCLUSIVE); > > Modified: head/sys/sys/mount.h > ============================================================================== > --- head/sys/sys/mount.h Sun Nov 2 06:40:33 2008 (r184553) > +++ head/sys/sys/mount.h Sun Nov 2 10:15:42 2008 (r184554) > @@ -142,13 +142,11 @@ struct vfsopt; > * Lock reference: > * m - mountlist_mtx > * i - interlock > - * l - mnt_lock > * > * Unmarked fields are considered stable as long as a ref is held. > * > */ > struct mount { > - struct lock mnt_lock; /* mount structure lock */ > struct mtx mnt_mtx; /* mount structure interlock */ > int mnt_gen; /* struct mount generation */ > #define mnt_startzero mnt_list > @@ -175,7 +173,7 @@ struct mount { > struct netexport *mnt_export; /* export list */ > struct label *mnt_label; /* MAC label for the fs */ > u_int mnt_hashseed; /* Random seed for vfs_hash */ > - int mnt_markercnt; /* marker vnodes in use */ > + 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 */ > @@ -319,6 +317,7 @@ void __mnt_vnode_markerfree(str > #define MNTK_ASYNC 0x00000002 /* filtered async flag */ > #define MNTK_SOFTDEP 0x00000004 /* async disabled by softdep */ > #define MNTK_NOINSMNTQ 0x00000008 /* insmntque is not allowed */ > +#define MNTK_DRAINING 0x00000010 /* lock draining is happening */ > #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ > #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ > #define MNTK_SUSPEND 0x08000000 /* request write suspension */ > @@ -506,6 +505,13 @@ struct uio; > > #ifdef _KERNEL > > +/* > + * vfs_busy specific flags and mask. > + */ > +#define MBF_NOWAIT 0x01 > +#define MBF_MNTLSTLOCK 0x02 > +#define MBF_MASK (MBF_NOWAIT | MBF_MNTLSTLOCK) > + > #ifdef MALLOC_DECLARE > MALLOC_DECLARE(M_MOUNT); > #endif > @@ -686,7 +692,7 @@ int vfs_scanopt(struct vfsoptlist *opts, > int vfs_setpublicfs /* set publicly exported fs */ > (struct mount *, struct netexport *, struct export_args *); > void vfs_msync(struct mount *, int); > -int vfs_busy(struct mount *, int, struct mtx *); > +int vfs_busy(struct mount *, int); > int vfs_export /* process mount export info */ > (struct mount *, struct export_args *); > int vfs_allocate_syncvnode(struct mount *); > > Modified: head/sys/ufs/ffs/ffs_softdep.c > ============================================================================== > --- head/sys/ufs/ffs/ffs_softdep.c Sun Nov 2 06:40:33 2008 (r184553) > +++ head/sys/ufs/ffs/ffs_softdep.c Sun Nov 2 10:15:42 2008 (r184554) > @@ -745,7 +745,7 @@ softdep_flush(void) > nmp = TAILQ_NEXT(mp, mnt_list); > if ((mp->mnt_flag & MNT_SOFTDEP) == 0) > continue; > - if (vfs_busy(mp, LK_NOWAIT, &mountlist_mtx)) > + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) > continue; > vfslocked = VFS_LOCK_GIANT(mp); > softdep_process_worklist(mp, 0); > > Modified: head/sys/ufs/ufs/ufs_vfsops.c > ============================================================================== > --- head/sys/ufs/ufs/ufs_vfsops.c Sun Nov 2 06:40:33 2008 (r184553) > +++ head/sys/ufs/ufs/ufs_vfsops.c Sun Nov 2 10:15:42 2008 (r184554) > @@ -118,7 +118,7 @@ ufs_quotactl(mp, cmds, id, arg, td) > if ((u_int)type >= MAXQUOTAS) > return (EINVAL); > > - if (vfs_busy(mp, LK_NOWAIT, 0)) > + if (vfs_busy(mp, MBF_NOWAIT)) > return (0); > > switch (cmd) { > -- Bjoern A. Zeeb Stop bit received. Insert coin for new game. From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 10:33:58 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31F5B106564A; Sun, 2 Nov 2008 10:33:58 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 205408FC20; Sun, 2 Nov 2008 10:33:58 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2AXwoW036566; Sun, 2 Nov 2008 10:33:58 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2AXwH4036565; Sun, 2 Nov 2008 10:33:58 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200811021033.mA2AXwH4036565@svn.freebsd.org> From: Attilio Rao Date: Sun, 2 Nov 2008 10:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184556 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 10:33:58 -0000 Author: attilio Date: Sun Nov 2 10:33:57 2008 New Revision: 184556 URL: http://svn.freebsd.org/changeset/base/184556 Log: Reflect changes for the vfs_busy() prototype. Modified: head/share/man/man9/vfs_busy.9 Modified: head/share/man/man9/vfs_busy.9 ============================================================================== --- head/share/man/man9/vfs_busy.9 Sun Nov 2 10:20:18 2008 (r184555) +++ head/share/man/man9/vfs_busy.9 Sun Nov 2 10:33:57 2008 (r184556) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 29, 2008 +.Dd November 2, 2008 .Dt VFS_BUSY 9 .Os .Sh NAME @@ -36,7 +36,7 @@ .In sys/param.h .In sys/mount.h .Ft int -.Fn vfs_busy "struct mount *mp" "int flags" "struct mtx *interlkp" +.Fn vfs_busy "struct mount *mp" "int flags" .Sh DESCRIPTION The .Fn vfs_busy @@ -56,33 +56,22 @@ flag is set. .Pp Its arguments are: -.Bl -tag -width ".Fa interlkp" +.Bl -tag -width ".Fa flags" .It Fa mp The mount point to busy. .It Fa flags Flags controlling how .Fn vfs_busy should act. -.Bl -tag -width ".Dv LK_NOWAIT" -.It Dv LK_NOWAIT +.Bl -tag -width ".Dv MBF_MNTLSTLOCK" +.It Dv MBF_NOWAIT do not sleep if .Dv MNTK_UNMOUNT is set. +.It Dv MBF_MNTLSTLOCK +drop the mountlist_mtx in the critical path. .El -.It Fa interlkp -The interlock mutex for -.Fa mp->mount_lock . -If there is any chance -the mount point is being unmounted and -.Dv LK_NOWAIT -is not set then -interlock must be valid locked mutex. .El -.Sh LOCKS -If -.Fa interlkp -is a valid pointer it must be locked on entry, -and it will not be unlocked even in the case of an error. .Sh RETURN VALUES A 0 value is returned on success. If the mount point is being From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 10:34:55 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92A911065673; Sun, 2 Nov 2008 10:34:55 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id B61798FC31; Sun, 2 Nov 2008 10:34:54 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1627500fgb.35 for ; Sun, 02 Nov 2008 02:34:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=rdGImoeqSeQhDee4g7TpSdOHGc1WPyrHlUETRHW9paQ=; b=j83IjEOeAbeHD2seJT6SLVc5mRallg1VaA1RA96WDnDhZDM+qS1iKxm0UDmvPTsfHs h3tdQiLSkueT6ofs4/KUaX6MznEG2L5cyIuMpo51ETfqpdpDcRx6IxtdbE+ohYMBeL8e fWYGrZYcshdk2K38dZ1bz03HaWGvFnzpJEy0A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=dcS4KRq5eBwJyTb+lQzlhzR4q2Z8gkQ2JRhMtdHzSUTVbApfASS/NcAo3hiDU+NfON 2WxK2URU6JJyY+lwwTNR/m/cEg9QjHi/TG0wnBTrWxYMVBLB6tkSkwev2UO6DbnXN0li e7Ml++tnt6Vdyr6aT+dKeZg9ipJ/N8Wjkbs3U= Received: by 10.103.193.12 with SMTP id v12mr6494750mup.87.1225622093091; Sun, 02 Nov 2008 02:34:53 -0800 (PST) Received: by 10.103.239.14 with HTTP; Sun, 2 Nov 2008 02:34:52 -0800 (PST) Message-ID: <3bbf2fe10811020234n14f554b3ld60eca8527e2647b@mail.gmail.com> Date: Sun, 2 Nov 2008 11:34:52 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Bjoern A. Zeeb" In-Reply-To: <20081102102108.B41609@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811021015.mA2AFgim036178@svn.freebsd.org> <20081102102108.B41609@maildrop.int.zabbadoz.net> X-Google-Sender-Auth: 2636d8c535ef211c Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184554 - in head/sys: geom/journal gnu/fs/ext2fs kern nfsclient sys ufs/ffs ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 10:34:55 -0000 2008/11/2, Bjoern A. Zeeb : > On Sun, 2 Nov 2008, Attilio Rao wrote: > > > > Author: attilio > > Date: Sun Nov 2 10:15:42 2008 > > New Revision: 184554 > > URL: http://svn.freebsd.org/changeset/base/184554 > > > > Log: > > Improve VFS locking: > > - Implement real draining for vfs consumers by not relying on the > > mnt_lock and using instead a refcount in order to keep track of lock > > requesters. > > - Due to the change above, remove the mnt_lock lockmgr because it is now > > useless. > > - Due to the change above, vfs_busy() is no more linked to a lockmgr. > > Change so its KPI by removing the interlock argument and defining 2 new > > flags for it: MBF_NOWAIT which basically replaces the LK_NOWAIT of the > > old version (which was unlinked from the lockmgr alredy) and > > MBF_MNTLSTLOCK which provides the ability to drop the mountlist_mtx > > once the mnt interlock is held (ability still desired by most > consumers). > > - The stub used into vfs_mount_destroy(), that allows to override the > > mnt_ref if running for more than 3 seconds, make it totally useless. > > Remove it as it was thought to work into older versions. > > If a problem of "refcount held never going away" should appear, we will > > need to fix properly instead than trust on such hackish solution. > > - Fix a bug where returning (with an error) from dounmount() was still > > leaving the MNTK_MWAIT flag on even if it the waiters were actually > > woken up. Just a place in vfs_mount_destroy() is left because it is > > going to recycle the structure in any case, so it doesn't matter. > > - Remove the markercnt refcount as it is useless. > > > > This patch modifies VFS ABI and breaks KPI for vfs_busy() so manpages and > > __FreeBSD_version will be modified accordingly. > > > > So why didn't you update __FreeBSD_version with the same commit that > changed the KPI? I just prefer to split "managing" stuff from the tecnical content. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 10:40:06 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBB6D1065676; Sun, 2 Nov 2008 10:40:06 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id 7EF5F8FC23; Sun, 2 Nov 2008 10:40:06 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id A6C2241C749; Sun, 2 Nov 2008 11:40:05 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id sj+PeyK2H1vQ; Sun, 2 Nov 2008 11:40:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 2883641C756; Sun, 2 Nov 2008 11:40:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 1EF7A444888; Sun, 2 Nov 2008 10:38:03 +0000 (UTC) Date: Sun, 2 Nov 2008 10:38:02 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Attilio Rao In-Reply-To: <3bbf2fe10811020234n14f554b3ld60eca8527e2647b@mail.gmail.com> Message-ID: <20081102103546.S41609@maildrop.int.zabbadoz.net> References: <200811021015.mA2AFgim036178@svn.freebsd.org> <20081102102108.B41609@maildrop.int.zabbadoz.net> <3bbf2fe10811020234n14f554b3ld60eca8527e2647b@mail.gmail.com> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184554 - in head/sys: geom/journal gnu/fs/ext2fs kern nfsclient sys ufs/ffs ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 10:40:06 -0000 On Sun, 2 Nov 2008, Attilio Rao wrote: >>> This patch modifies VFS ABI and breaks KPI for vfs_busy() so manpages and >>> __FreeBSD_version will be modified accordingly. >>> >> >> So why didn't you update __FreeBSD_version with the same commit that >> changed the KPI? > > I just prefer to split "managing" stuff from the tecnical content. Well we have changesets with SVN and looking at the FreeBSD version bump I have no idea what changeset(s) it's actually refering to. I think we should exploit the features SVN gives us and either do it in the same commit (if possible because it's a single commit) or reference the relevant SVN revisions in the bump in the future so that the xPI change and the bump can be easily linked together. /bz -- Bjoern A. Zeeb Stop bit received. Insert coin for new game. From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 11:41:37 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4030106568C; Sun, 2 Nov 2008 11:41:37 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id 0BC698FC20; Sun, 2 Nov 2008 11:41:36 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1641273fgb.35 for ; Sun, 02 Nov 2008 03:41:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=VWeGzU9HsAqa92K61Oz7M7yxbAPe8w+q/Tol721QQys=; b=PAAMa8DkgFcfSp7R0d/IsdqZoZ2zWGZmawJBJ9H88O+TMfFrrvwzmJ4XhiP7HY2g8W SRotK8sCUuBS6QDPogrNQfT3HdqbkkUKEUojwUs38qFsrZlmxwgrQYozUsYsB5OVv/Rc kZs0IL0vkJPAhV4UX2NaGuYTrA1Bb0cfeLfXE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=Ku878+vBcCw2dBOjFKyfY8pDqxjDN+rNBERNgOsyKxbHbAEe29truGOFd18inboSow neSbO8N15GMXkUL8Hd/stCvMArNXlfLZ98CQFvrOh2HsTokmpQt/MLvITlYquDBOosMJ qatud9ONJZhaCJOBj8tTi+YIS5eVpx40/wJIY= Received: by 10.103.214.13 with SMTP id r13mr6531098muq.4.1225626094972; Sun, 02 Nov 2008 03:41:34 -0800 (PST) Received: by 10.103.239.14 with HTTP; Sun, 2 Nov 2008 03:41:34 -0800 (PST) Message-ID: <3bbf2fe10811020341y4ae59546jb073b42945356b8c@mail.gmail.com> Date: Sun, 2 Nov 2008 12:41:34 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Bjoern A. Zeeb" In-Reply-To: <20081102103546.S41609@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811021015.mA2AFgim036178@svn.freebsd.org> <20081102102108.B41609@maildrop.int.zabbadoz.net> <3bbf2fe10811020234n14f554b3ld60eca8527e2647b@mail.gmail.com> <20081102103546.S41609@maildrop.int.zabbadoz.net> X-Google-Sender-Auth: e6415fbfa33d815b Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184554 - in head/sys: geom/journal gnu/fs/ext2fs kern nfsclient sys ufs/ffs ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 11:41:37 -0000 2008/11/2, Bjoern A. Zeeb : > On Sun, 2 Nov 2008, Attilio Rao wrote: > > > > > > > > > > > This patch modifies VFS ABI and breaks KPI for vfs_busy() so manpages > and > > > > __FreeBSD_version will be modified accordingly. > > > > > > > > > > > > > > So why didn't you update __FreeBSD_version with the same commit that > > > changed the KPI? > > > > > > > I just prefer to split "managing" stuff from the tecnical content. > > > > Well we have changesets with SVN and looking at the FreeBSD version > bump I have no idea what changeset(s) it's actually refering to. I > think we should exploit the features SVN gives us and either do it in > the same commit (if possible because it's a single commit) or > reference the relevant SVN revisions in the bump in the future so that > the xPI change and the bump can be easily linked together. I totally didn't take into consideration that. Thanks for pointing out, it is a good point, and will try to follow in next KPI modifies. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 11:49:19 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7FDA1065675; Sun, 2 Nov 2008 11:49:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6AD28FC16; Sun, 2 Nov 2008 11:49:19 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2BnJ4J037892; Sun, 2 Nov 2008 11:49:19 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2BnJ1c037891; Sun, 2 Nov 2008 11:49:19 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200811021149.mA2BnJ1c037891@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 2 Nov 2008 11:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184557 - head/sys/fs/ntfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 11:49:19 -0000 Author: trasz Date: Sun Nov 2 11:49:19 2008 New Revision: 184557 URL: http://svn.freebsd.org/changeset/base/184557 Log: Remove the call to getinoquota() from ntfs_access. How did it get there?! Approved by: rwatson (mentor) Modified: head/sys/fs/ntfs/ntfs_vnops.c Modified: head/sys/fs/ntfs/ntfs_vnops.c ============================================================================== --- head/sys/fs/ntfs/ntfs_vnops.c Sun Nov 2 10:33:57 2008 (r184556) +++ head/sys/fs/ntfs/ntfs_vnops.c Sun Nov 2 11:49:19 2008 (r184557) @@ -394,9 +394,6 @@ ntfs_access(ap) struct vnode *vp = ap->a_vp; struct ntnode *ip = VTONT(vp); accmode_t accmode = ap->a_accmode; -#ifdef QUOTA - int error; -#endif dprintf(("ntfs_access: %d\n",ip->i_number)); @@ -412,10 +409,6 @@ ntfs_access(ap) case VREG: if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); -#ifdef QUOTA - if (error = getinoquota(ip)) - return (error); -#endif break; } } From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 12:50:16 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F06CA1065679; Sun, 2 Nov 2008 12:50:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF62A8FC14; Sun, 2 Nov 2008 12:50:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2CoG2w038958; Sun, 2 Nov 2008 12:50:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2CoGs1038957; Sun, 2 Nov 2008 12:50:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200811021250.mA2CoGs1038957@svn.freebsd.org> From: Alexander Motin Date: Sun, 2 Nov 2008 12:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184558 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 12:50:17 -0000 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); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 16:50:58 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEA701065677; Sun, 2 Nov 2008 16:50:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FE558FC0C; Sun, 2 Nov 2008 16:50:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2GowJp043369; Sun, 2 Nov 2008 16:50:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2GowCr043365; Sun, 2 Nov 2008 16:50:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811021650.mA2GowCr043365@svn.freebsd.org> From: Warner Losh Date: Sun, 2 Nov 2008 16:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184559 - in head/sys: conf modules/rl pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 16:50:59 -0000 Author: imp Date: Sun Nov 2 16:50:57 2008 New Revision: 184559 URL: http://svn.freebsd.org/changeset/base/184559 Log: Make RL_TWISTER_ENABLE a tunable/sysctl. Eliminate it as an option. Fix module build. Submitted by: Kostik Belousov Modified: head/sys/conf/options head/sys/modules/rl/Makefile head/sys/pci/if_rl.c head/sys/pci/if_rlreg.h Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Nov 2 12:50:16 2008 (r184558) +++ head/sys/conf/options Sun Nov 2 16:50:57 2008 (r184559) @@ -672,9 +672,6 @@ ED_SIC opt_ed.h # bce driver BCE_DEBUG opt_bce.h -# rl driver -RL_TWISTER_ENABLE opt_rl.h - SOCKBUF_DEBUG opt_global.h # options for ubsec driver Modified: head/sys/modules/rl/Makefile ============================================================================== --- head/sys/modules/rl/Makefile Sun Nov 2 12:50:16 2008 (r184558) +++ head/sys/modules/rl/Makefile Sun Nov 2 16:50:57 2008 (r184559) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../pci KMOD= if_rl -SRCS= if_rl.c device_if.h bus_if.h pci_if.h opt_rl.h +SRCS= if_rl.c device_if.h bus_if.h pci_if.h SRCS+= miibus_if.h .include Modified: head/sys/pci/if_rl.c ============================================================================== --- head/sys/pci/if_rl.c Sun Nov 2 12:50:16 2008 (r184558) +++ head/sys/pci/if_rl.c Sun Nov 2 16:50:57 2008 (r184559) @@ -85,7 +85,6 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" -#include "opt_rl.h" #endif #include @@ -97,6 +96,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -801,14 +801,25 @@ rl_attach(device_t dev) struct ifnet *ifp; struct rl_softc *sc; struct rl_type *t; + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *children; int error = 0, i, rid; int unit; uint16_t rl_did = 0; + char tn[32]; sc = device_get_softc(dev); unit = device_get_unit(dev); sc->rl_dev = dev; + sc->rl_twister_enable = 0; + snprintf(tn, sizeof(tn), "dev.rl.%d.twister_enable", unit); + TUNABLE_INT_FETCH(tn, &sc->rl_twister_enable); + ctx = device_get_sysctl_ctx(sc->rl_dev); + children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->rl_dev)); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "twister_enable", CTLFLAG_RD, + &sc->rl_twister_enable, 0, ""); + mtx_init(&sc->rl_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&sc->rl_stat_callout, &sc->rl_mtx, 0); @@ -1384,7 +1395,6 @@ rl_txeof(struct rl_softc *sc) sc->rl_watchdog_timer = 0; } -#ifdef RL_TWISTER_ENABLE static void rl_twister_update(struct rl_softc *sc) { @@ -1483,7 +1493,6 @@ rl_twister_update(struct rl_softc *sc) } } -#endif static void rl_tick(void *xsc) @@ -1506,19 +1515,19 @@ rl_tick(void *xsc) */ mii = device_get_softc(sc->rl_miibus); mii_tick(mii); -#ifdef RL_TWISTER_ENABLE - if (sc->rl_twister == DONE) + if (sc->rl_twister_enable) { + if (sc->rl_twister == DONE) + rl_watchdog(sc); + else + rl_twister_update(sc); + if (sc->rl_twister == DONE) + ticks = hz; + else + ticks = hz / 10; + } else { rl_watchdog(sc); - else - rl_twister_update(sc); - if (sc->rl_twister == DONE) ticks = hz; - else - ticks = hz / 10; -#else - rl_watchdog(sc); - ticks = hz; -#endif + } callout_reset(&sc->rl_stat_callout, ticks, rl_tick, sc); } @@ -1768,14 +1777,15 @@ rl_init_locked(struct rl_softc *sc) rl_stop(sc); rl_reset(sc); -#ifdef RL_TWISTER_ENABLE - /* - * Reset twister register tuning state. The twister registers - * and their tuning are undocumented, but are necessary to cope - * with bad links. rl_twister = DONE here will disable this entirely. - */ - sc->rl_twister = CHK_LINK; -#endif + if (sc->rl_twister_enable) { + /* + * Reset twister register tuning state. The twister + * registers and their tuning are undocumented, but + * are necessary to cope with bad links. rl_twister = + * DONE here will disable this entirely. + */ + sc->rl_twister = CHK_LINK; + } /* * Init our MAC address. Even though the chipset Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Sun Nov 2 12:50:16 2008 (r184558) +++ head/sys/pci/if_rlreg.h Sun Nov 2 16:50:57 2008 (r184559) @@ -830,9 +830,7 @@ struct rl_list_data { bus_addr_t rl_tx_list_addr; }; -#ifdef RL_TWISTER_ENABLE enum rl_twist { DONE, CHK_LINK, FIND_ROW, SET_PARAM, RECHK_LONG, RETUNE }; -#endif struct rl_softc { struct ifnet *rl_ifp; /* interface info */ @@ -862,11 +860,10 @@ struct rl_softc { uint32_t rl_rxlenmask; int rl_testmode; int rl_if_flags; -#ifdef RL_TWISTER_ENABLE + int rl_twister_enable; enum rl_twist rl_twister; int rl_twist_row; int rl_twist_col; -#endif int suspended; /* 0 = normal 1 = suspended */ #ifdef DEVICE_POLLING int rxcycles; From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 16:51:57 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BBD21065675; Sun, 2 Nov 2008 16:51:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A8FE8FC20; Sun, 2 Nov 2008 16:51:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2GpvmU043421; Sun, 2 Nov 2008 16:51:57 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2Gpv5b043420; Sun, 2 Nov 2008 16:51:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811021651.mA2Gpv5b043420@svn.freebsd.org> From: Warner Losh Date: Sun, 2 Nov 2008 16:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184560 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 16:51:57 -0000 Author: imp Date: Sun Nov 2 16:51:57 2008 New Revision: 184560 URL: http://svn.freebsd.org/changeset/base/184560 Log: Document dev.rl.%unit.twister_enable sysctl/tunable. Submitted by: Kostik Belousov Modified: head/share/man/man4/rl.4 Modified: head/share/man/man4/rl.4 ============================================================================== --- head/share/man/man4/rl.4 Sun Nov 2 16:50:57 2008 (r184559) +++ head/share/man/man4/rl.4 Sun Nov 2 16:51:57 2008 (r184560) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 28, 2007 +.Dd November 1, 2008 .Dt RL 4 .Os .Sh NAME @@ -201,6 +201,12 @@ SMC EZ Card 10/100 PCI 1211-TX .It SOHO (PRAGMATIC) UE-1211C .El +.Sh LOADER TUNABLES +.Bl -tag -width indent +.It Va dev.rl.%unit.twister_enable +Non-zero value enables the long cable tuning on the specified device. +Disabled by default. +.El .Sh DIAGNOSTICS .Bl -diag .It "rl%d: couldn't map memory" From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:00:23 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A164B106564A; Sun, 2 Nov 2008 17:00:23 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EC0E8FC08; Sun, 2 Nov 2008 17:00:23 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2H0Nrm043630; Sun, 2 Nov 2008 17:00:23 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2H0Nlr043624; Sun, 2 Nov 2008 17:00:23 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200811021700.mA2H0Nlr043624@svn.freebsd.org> From: Tom Rhodes Date: Sun, 2 Nov 2008 17:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184561 - in head/sys: nfsclient nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 17:00:23 -0000 Author: trhodes Date: Sun Nov 2 17:00:23 2008 New Revision: 184561 URL: http://svn.freebsd.org/changeset/base/184561 Log: Document a few sysctls in the NFS client and server code. Minor style(9) where applicable. Approved by: alfred (slightly older version) Modified: head/sys/nfsclient/nfs_nfsiod.c head/sys/nfsclient/nfs_socket.c head/sys/nfsclient/nfs_subs.c head/sys/nfsclient/nfs_vfsops.c head/sys/nfsserver/nfs_serv.c head/sys/nfsserver/nfs_syscalls.c Modified: head/sys/nfsclient/nfs_nfsiod.c ============================================================================== --- head/sys/nfsclient/nfs_nfsiod.c Sun Nov 2 16:51:57 2008 (r184560) +++ head/sys/nfsclient/nfs_nfsiod.c Sun Nov 2 17:00:23 2008 (r184561) @@ -84,7 +84,8 @@ SYSCTL_DECL(_vfs_nfs); /* Maximum number of seconds a nfsiod kthread will sleep before exiting */ static unsigned int nfs_iodmaxidle = 120; -SYSCTL_UINT(_vfs_nfs, OID_AUTO, iodmaxidle, CTLFLAG_RW, &nfs_iodmaxidle, 0, ""); +SYSCTL_UINT(_vfs_nfs, OID_AUTO, iodmaxidle, CTLFLAG_RW, &nfs_iodmaxidle, 0, + "Max number of seconds an nfsiod kthread will sleep before exiting"); /* Maximum number of nfsiod kthreads */ unsigned int nfs_iodmax = 20; @@ -121,7 +122,8 @@ out: return (0); } SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, CTLTYPE_UINT | CTLFLAG_RW, 0, - sizeof (nfs_iodmin), sysctl_iodmin, "IU", ""); + sizeof (nfs_iodmin), sysctl_iodmin, "IU", + "Min number of nfsiod kthreads to keep as spares"); static int @@ -157,7 +159,8 @@ out: return (0); } SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, CTLTYPE_UINT | CTLFLAG_RW, 0, - sizeof (nfs_iodmax), sysctl_iodmax, "IU", ""); + sizeof (nfs_iodmax), sysctl_iodmax, "IU", + "Max number of nfsiod kthreads"); int nfs_nfsiodnew(void) @@ -208,7 +211,8 @@ nfsiod_setup(void *dummy) SYSINIT(nfsiod, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, nfsiod_setup, NULL); static int nfs_defect = 0; -SYSCTL_INT(_vfs_nfs, OID_AUTO, defect, CTLFLAG_RW, &nfs_defect, 0, ""); +SYSCTL_INT(_vfs_nfs, OID_AUTO, defect, CTLFLAG_RW, &nfs_defect, 0, + "Allow nfsiods to migrate serving different mounts"); /* * Asynchronous I/O daemons for client nfs. Modified: head/sys/nfsclient/nfs_socket.c ============================================================================== --- head/sys/nfsclient/nfs_socket.c Sun Nov 2 16:51:57 2008 (r184560) +++ head/sys/nfsclient/nfs_socket.c Sun Nov 2 17:00:23 2008 (r184561) @@ -87,14 +87,18 @@ static int fake_wchan; SYSCTL_DECL(_vfs_nfs); -SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RW, &nfs_realign_test, 0, ""); -SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_count, CTLFLAG_RW, &nfs_realign_count, 0, ""); -SYSCTL_INT(_vfs_nfs, OID_AUTO, bufpackets, CTLFLAG_RW, &nfs_bufpackets, 0, ""); +SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RW, &nfs_realign_test, 0, + "Number of realign tests done"); +SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_count, CTLFLAG_RW, &nfs_realign_count, 0, + "Number of mbuf realignments done"); +SYSCTL_INT(_vfs_nfs, OID_AUTO, bufpackets, CTLFLAG_RW, &nfs_bufpackets, 0, + "Buffer reservation size 2 < x < 64"); SYSCTL_INT(_vfs_nfs, OID_AUTO, reconnects, CTLFLAG_RD, &nfs_reconnects, 0, - "number of times the nfs client has had to reconnect"); + "Number of times the nfs client has had to reconnect"); SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs3_jukebox_delay, CTLFLAG_RW, &nfs3_jukebox_delay, 0, - "number of seconds to delay a retry after receiving EJUKEBOX"); -SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_data_onerr, 0, ""); + "Number of seconds to delay a retry after receiving EJUKEBOX"); +SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_data_onerr, 0, + "Disable weak cache consistency checking when server returns an error"); /* * There is a congestion window for outstanding rpcs maintained per mount Modified: head/sys/nfsclient/nfs_subs.c ============================================================================== --- head/sys/nfsclient/nfs_subs.c Sun Nov 2 16:51:57 2008 (r184560) +++ head/sys/nfsclient/nfs_subs.c Sun Nov 2 17:00:23 2008 (r184561) @@ -730,7 +730,8 @@ nfs_loadattrcache(struct vnode **vpp, st #include SYSCTL_DECL(_vfs_nfs); static int nfs_acdebug; -SYSCTL_INT(_vfs_nfs, OID_AUTO, acdebug, CTLFLAG_RW, &nfs_acdebug, 0, ""); +SYSCTL_INT(_vfs_nfs, OID_AUTO, acdebug, CTLFLAG_RW, &nfs_acdebug, 0, + "Toggle acdebug (access cache debug) flag"); #endif /* Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Sun Nov 2 16:51:57 2008 (r184560) +++ head/sys/nfsclient/nfs_vfsops.c Sun Nov 2 17:00:23 2008 (r184561) @@ -92,18 +92,22 @@ SYSCTL_STRUCT(_vfs_nfs, NFS_NFSSTATS, nf &nfsstats, nfsstats, "S,nfsstats"); static int nfs_ip_paranoia = 1; SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_ip_paranoia, CTLFLAG_RW, - &nfs_ip_paranoia, 0, ""); + &nfs_ip_paranoia, 0, + "Disallow accepting replies from IPs which differ from those sent"); #ifdef NFS_DEBUG int nfs_debug; -SYSCTL_INT(_vfs_nfs, OID_AUTO, debug, CTLFLAG_RW, &nfs_debug, 0, ""); +SYSCTL_INT(_vfs_nfs, OID_AUTO, debug, CTLFLAG_RW, &nfs_debug, 0, + "Toggle debug flag"); #endif static int nfs_tprintf_initial_delay = NFS_TPRINTF_INITIAL_DELAY; SYSCTL_INT(_vfs_nfs, NFS_TPRINTF_INITIAL_DELAY, - downdelayinitial, CTLFLAG_RW, &nfs_tprintf_initial_delay, 0, ""); + downdelayinitial, CTLFLAG_RW, &nfs_tprintf_initial_delay, 0, + "Delay before printing \"nfs server not responding\" messages"); /* how long between console messages "nfs server foo not responding" */ static int nfs_tprintf_delay = NFS_TPRINTF_DELAY; SYSCTL_INT(_vfs_nfs, NFS_TPRINTF_DELAY, - downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0, ""); + downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0, + "Delay between printing \"nfs server not responding\" messages"); static void nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp, const char *hostname); @@ -158,14 +162,15 @@ struct nfsv3_diskless nfsv3_diskless = { int nfs_diskless_valid = 0; SYSCTL_INT(_vfs_nfs, OID_AUTO, diskless_valid, CTLFLAG_RD, - &nfs_diskless_valid, 0, ""); + &nfs_diskless_valid, 0, + "Has the diskless struct been filled correctly"); SYSCTL_STRING(_vfs_nfs, OID_AUTO, diskless_rootpath, CTLFLAG_RD, - nfsv3_diskless.root_hostnam, 0, ""); + nfsv3_diskless.root_hostnam, 0, "Path to nfs root"); SYSCTL_OPAQUE(_vfs_nfs, OID_AUTO, diskless_rootaddr, CTLFLAG_RD, - &nfsv3_diskless.root_saddr, sizeof nfsv3_diskless.root_saddr, - "%Ssockaddr_in", ""); + &nfsv3_diskless.root_saddr, sizeof nfsv3_diskless.root_saddr, + "%Ssockaddr_in", "Diskless root nfs address"); void nfsargs_ntoh(struct nfs_args *); Modified: head/sys/nfsserver/nfs_serv.c ============================================================================== --- head/sys/nfsserver/nfs_serv.c Sun Nov 2 16:51:57 2008 (r184560) +++ head/sys/nfsserver/nfs_serv.c Sun Nov 2 17:00:23 2008 (r184561) @@ -130,8 +130,10 @@ SYSCTL_NODE(_vfs, OID_AUTO, nfsrv, CTLFL static int nfs_async; static int nfs_commit_blks; static int nfs_commit_miss; -SYSCTL_INT(_vfs_nfsrv, OID_AUTO, async, CTLFLAG_RW, &nfs_async, 0, ""); -SYSCTL_INT(_vfs_nfsrv, OID_AUTO, commit_blks, CTLFLAG_RW, &nfs_commit_blks, 0, ""); +SYSCTL_INT(_vfs_nfsrv, OID_AUTO, async, CTLFLAG_RW, &nfs_async, 0, + "Tell client that writes were synced even though they were not"); +SYSCTL_INT(_vfs_nfsrv, OID_AUTO, commit_blks, CTLFLAG_RW, &nfs_commit_blks, 0, + "Number of completed commits"); SYSCTL_INT(_vfs_nfsrv, OID_AUTO, commit_miss, CTLFLAG_RW, &nfs_commit_miss, 0, ""); struct nfsrvstats nfsrvstats; Modified: head/sys/nfsserver/nfs_syscalls.c ============================================================================== --- head/sys/nfsserver/nfs_syscalls.c Sun Nov 2 16:51:57 2008 (r184560) +++ head/sys/nfsserver/nfs_syscalls.c Sun Nov 2 17:00:23 2008 (r184561) @@ -89,11 +89,14 @@ static int notstarted = 1; static int nfs_privport = 0; SYSCTL_INT(_vfs_nfsrv, NFS_NFSPRIVPORT, nfs_privport, CTLFLAG_RW, - &nfs_privport, 0, ""); + &nfs_privport, 0, + "Only allow clients using a privileged port"); SYSCTL_INT(_vfs_nfsrv, OID_AUTO, gatherdelay, CTLFLAG_RW, - &nfsrvw_procrastinate, 0, ""); + &nfsrvw_procrastinate, 0, + "Delay value for write gathering"); SYSCTL_INT(_vfs_nfsrv, OID_AUTO, gatherdelay_v3, CTLFLAG_RW, - &nfsrvw_procrastinate_v3, 0, ""); + &nfsrvw_procrastinate_v3, 0, + "Delay in seconds for NFSv3 write gathering"); static int nfssvc_addsock(struct file *, struct sockaddr *); static void nfsrv_zapsock(struct nfssvc_sock *slp); From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:04:55 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4137D106567F; Sun, 2 Nov 2008 17:04:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E5B58FC0A; Sun, 2 Nov 2008 17:04:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2H4tBH043748; Sun, 2 Nov 2008 17:04:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2H4txm043746; Sun, 2 Nov 2008 17:04:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811021704.mA2H4txm043746@svn.freebsd.org> From: Warner Losh Date: Sun, 2 Nov 2008 17:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184562 - in head/sys: conf dev/mn pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 17:04:55 -0000 Author: imp Date: Sun Nov 2 17:04:54 2008 New Revision: 184562 URL: http://svn.freebsd.org/changeset/base/184562 Log: Move mn over. One of the last stragglers in sys/pci. There's no module built for this hardware, so no changes needed. Added: head/sys/dev/mn/ head/sys/dev/mn/if_mn.c (props changed) - copied unchanged from r184514, head/sys/pci/if_mn.c Deleted: head/sys/pci/if_mn.c Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Nov 2 17:00:23 2008 (r184561) +++ head/sys/conf/files Sun Nov 2 17:04:54 2008 (r184562) @@ -961,6 +961,7 @@ dev/mmc/mmc.c optional mmc dev/mmc/mmcbr_if.m standard dev/mmc/mmcbus_if.m standard dev/mmc/mmcsd.c optional mmcsd +dev/mn/if_mn.c optional mn pci dev/mpt/mpt.c optional mpt dev/mpt/mpt_cam.c optional mpt dev/mpt/mpt_debug.c optional mpt @@ -2137,7 +2138,6 @@ opencrypto/xform.c optional crypto pci/alpm.c optional alpm pci pci/amdpm.c optional amdpm pci | nfpm pci pci/amdsmb.c optional amdsmb pci -pci/if_mn.c optional mn pci pci/if_rl.c optional rl pci pci/intpm.c optional intpm pci pci/ncr.c optional ncr pci Copied: head/sys/dev/mn/if_mn.c (from r184514, head/sys/pci/if_mn.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mn/if_mn.c Sun Nov 2 17:04:54 2008 (r184562, copy of r184514, head/sys/pci/if_mn.c) @@ -0,0 +1,1450 @@ +/*- + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp + * ---------------------------------------------------------------------------- + */ + +/* + * Driver for Siemens reference design card "Easy321-R1". + * + * This card contains a FALC54 E1/T1 framer and a MUNICH32X 32-channel HDLC + * controller. + * + * The driver supports E1 mode with up to 31 channels. We send CRC4 but don't + * check it coming in. + * + * The FALC54 and MUNICH32X have far too many registers and weird modes for + * comfort, so I have not bothered typing it all into a "fooreg.h" file, + * you will (badly!) need the documentation anyway if you want to mess with + * this gadget. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Stuff to describe the MUNIC32X and FALC54 chips. + */ + +#define M32_CHAN 32 /* We have 32 channels */ +#define M32_TS 32 /* We have 32 timeslots */ + +#define NG_MN_NODE_TYPE "mn" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "pci_if.h" + +#include +#include + +#include + +#include +#include + +#include +#include + + +static int mn_maxlatency = 1000; +SYSCTL_INT(_debug, OID_AUTO, mn_maxlatency, CTLFLAG_RW, + &mn_maxlatency, 0, + "The number of milliseconds a packet is allowed to spend in the output queue. " + "If the output queue is longer than this number of milliseconds when the packet " + "arrives for output, the packet will be dropped." +); + +#ifndef NMN +/* Most machines don't support more than 4 busmaster PCI slots, if even that many */ +#define NMN 4 +#endif + +/* From: PEB 20321 data sheet, p187, table 22 */ +struct m32xreg { + u_int32_t conf, cmd, stat, imask; + u_int32_t fill10, piqba, piql, fill1c; + u_int32_t mode1, mode2, ccba, txpoll; + u_int32_t tiqba, tiql, riqba, riql; + u_int32_t lconf, lccba, fill48, ltran; + u_int32_t ltiqba, ltiql, lriqba, lriql; + u_int32_t lreg0, lreg1, lreg2, lreg3; + u_int32_t lreg4, lreg5, lre6, lstat; + u_int32_t gpdir, gpdata, gpod, fill8c; + u_int32_t ssccon, sscbr, ssctb, sscrb; + u_int32_t ssccse, sscim, fillab, fillac; + u_int32_t iomcon1, iomcon2, iomstat, fillbc; + u_int32_t iomcit0, iomcit1, iomcir0, iomcir1; + u_int32_t iomtmo, iomrmo, filld8, filldc; + u_int32_t mbcmd, mbdata1, mbdata2, mbdata3; + u_int32_t mbdata4, mbdata5, mbdata6, mbdata7; +}; + +/* From: PEB 2254 data sheet, p80, table 10 */ +struct f54wreg { + u_int16_t xfifo; + u_int8_t cmdr, mode, rah1, rah2, ral1, ral2; + u_int8_t ipc, ccr1, ccr3, pre, rtr1, rtr2, rtr3, rtr4; + u_int8_t ttr1, ttr2, ttr3, ttr4, imr0, imr1, imr2, imr3; + u_int8_t imr4, fill19, fmr0, fmr1, fmr2, loop, xsw, xsp; + u_int8_t xc0, xc1, rc0, rc1, xpm0, xpm1, xpm2, tswm; + u_int8_t test1, idle, xsa4, xsa5, xsa6, xsa7, xsa8, fmr3; + u_int8_t icb1, icb2, icb3, icb4, lim0, lim1, pcd, pcr; + u_int8_t lim2, fill39[7]; + u_int8_t fill40[8]; + u_int8_t fill48[8]; + u_int8_t fill50[8]; + u_int8_t fill58[8]; + u_int8_t dec, fill61, test2, fill63[5]; + u_int8_t fill68[8]; + u_int8_t xs[16]; +}; + +/* From: PEB 2254 data sheet, p117, table 10 */ +struct f54rreg { + u_int16_t rfifo; + u_int8_t fill2, mode, rah1, rah2, ral1, ral2; + u_int8_t ipc, ccr1, ccr3, pre, rtr1, rtr2, rtr3, rtr4; + u_int8_t ttr1, ttr2, ttr3, ttr4, imr0, imr1, imr2, imr3; + u_int8_t imr4, fill19, fmr0, fmr1, fmr2, loop, xsw, xsp; + u_int8_t xc0, xc1, rc0, rc1, xpm0, xpm1, xpm2, tswm; + u_int8_t test, idle, xsa4, xsa5, xsa6, xsa7, xsa8, fmr13; + u_int8_t icb1, icb2, icb3, icb4, lim0, lim1, pcd, pcr; + u_int8_t lim2, fill39[7]; + u_int8_t fill40[8]; + u_int8_t fill48[4], frs0, frs1, rsw, rsp; + u_int16_t fec, cvc, cec1, ebc; + u_int16_t cec2, cec3; + u_int8_t rsa4, rsa5, rsa6, rsa7; + u_int8_t rsa8, rsa6s, tsr0, tsr1, sis, rsis; + u_int16_t rbc; + u_int8_t isr0, isr1, isr2, isr3, fill6c, fill6d, gis, vstr; + u_int8_t rs[16]; +}; + +/* Transmit & receive descriptors */ +struct trxd { + u_int32_t flags; + vm_offset_t next; + vm_offset_t data; + u_int32_t status; /* only used for receive */ + struct mbuf *m; /* software use only */ + struct trxd *vnext; /* software use only */ +}; + +/* Channel specification */ +struct cspec { + u_int32_t flags; + vm_offset_t rdesc; + vm_offset_t tdesc; + u_int32_t itbs; +}; + +struct m32_mem { + vm_offset_t csa; + u_int32_t ccb; + u_int32_t reserve1[2]; + u_int32_t ts[M32_TS]; + struct cspec cs[M32_CHAN]; + vm_offset_t crxd[M32_CHAN]; + vm_offset_t ctxd[M32_CHAN]; +}; + +struct mn_softc; +struct sockaddr; +struct rtentry; + +static int mn_probe(device_t self); +static int mn_attach(device_t self); +static void mn_create_channel(struct mn_softc *sc, int chan); +static int mn_reset(struct mn_softc *sc); +static struct trxd * mn_alloc_desc(void); +static void mn_free_desc(struct trxd *dp); +static void mn_intr(void *xsc); +static u_int32_t mn_parse_ts(const char *s, int *nbit); +#ifdef notyet +static void m32_dump(struct mn_softc *sc); +static void f54_dump(struct mn_softc *sc); +static void mn_fmt_ts(char *p, u_int32_t ts); +#endif /* notyet */ +static void f54_init(struct mn_softc *sc); + +static ng_constructor_t ngmn_constructor; +static ng_rcvmsg_t ngmn_rcvmsg; +static ng_shutdown_t ngmn_shutdown; +static ng_newhook_t ngmn_newhook; +static ng_connect_t ngmn_connect; +static ng_rcvdata_t ngmn_rcvdata; +static ng_disconnect_t ngmn_disconnect; + +static struct ng_type mntypestruct = { + .version = NG_ABI_VERSION, + .name = NG_MN_NODE_TYPE, + .constructor = ngmn_constructor, + .rcvmsg = ngmn_rcvmsg, + .shutdown = ngmn_shutdown, + .newhook = ngmn_newhook, + .connect = ngmn_connect, + .rcvdata = ngmn_rcvdata, + .disconnect = ngmn_disconnect, +}; + +static MALLOC_DEFINE(M_MN, "mn", "Mx driver related"); + +#define NIQB 64 + +struct schan { + enum {DOWN, UP} state; + struct mn_softc *sc; + int chan; + u_int32_t ts; + char name[8]; + struct trxd *r1, *rl; + struct trxd *x1, *xl; + hook_p hook; + + time_t last_recv; + time_t last_rxerr; + time_t last_xmit; + + u_long rx_error; + + u_long short_error; + u_long crc_error; + u_long dribble_error; + u_long long_error; + u_long abort_error; + u_long overflow_error; + + int last_error; + int prev_error; + + u_long tx_pending; + u_long tx_limit; +}; + +enum framing {WHOKNOWS, E1, E1U, T1, T1U}; + +struct mn_softc { + int unit; + device_t dev; + struct resource *irq; + void *intrhand; + enum framing framing; + int nhooks; + void *m0v, *m1v; + vm_offset_t m0p, m1p; + struct m32xreg *m32x; + struct f54wreg *f54w; + struct f54rreg *f54r; + struct m32_mem m32_mem; + u_int32_t tiqb[NIQB]; + u_int32_t riqb[NIQB]; + u_int32_t piqb[NIQB]; + u_int32_t ltiqb[NIQB]; + u_int32_t lriqb[NIQB]; + char name[8]; + u_int32_t falc_irq, falc_state, framer_state; + struct schan *ch[M32_CHAN]; + char nodename[NG_NODESIZ]; + node_p node; + + u_long cnt_fec; + u_long cnt_cvc; + u_long cnt_cec1; + u_long cnt_ebc; + u_long cnt_cec2; + u_long cnt_cec3; + u_long cnt_rbc; +}; + +static int +ngmn_constructor(node_p node) +{ + + return (EINVAL); +} + +static int +ngmn_shutdown(node_p nodep) +{ + + return (EINVAL); +} + +static void +ngmn_config(node_p node, char *set, char *ret) +{ + struct mn_softc *sc; + enum framing wframing; + + sc = NG_NODE_PRIVATE(node); + + if (set != NULL) { + if (!strncmp(set, "line ", 5)) { + wframing = sc->framing; + if (!strcmp(set, "line e1")) { + wframing = E1; + } else if (!strcmp(set, "line e1u")) { + wframing = E1U; + } else { + strcat(ret, "ENOGROK\n"); + return; + } + if (wframing == sc->framing) + return; + if (sc->nhooks > 0) { + sprintf(ret, "Cannot change line when %d hooks open\n", sc->nhooks); + return; + } + sc->framing = wframing; +#if 1 + f54_init(sc); +#else + mn_reset(sc); +#endif + } else { + printf("%s CONFIG SET [%s]\n", sc->nodename, set); + strcat(ret, "ENOGROK\n"); + return; + } + } + +} + +static int +ngmn_rcvmsg(node_p node, item_p item, hook_p lasthook) +{ + struct mn_softc *sc; + struct ng_mesg *resp = NULL; + struct schan *sch; + char *s, *r; + int pos, i; + struct ng_mesg *msg; + + NGI_GET_MSG(item, msg); + sc = NG_NODE_PRIVATE(node); + + if (msg->header.typecookie != NGM_GENERIC_COOKIE) { + NG_FREE_ITEM(item); + NG_FREE_MSG(msg); + return (EINVAL); + } + + if (msg->header.cmd != NGM_TEXT_CONFIG && + msg->header.cmd != NGM_TEXT_STATUS) { + NG_FREE_ITEM(item); + NG_FREE_MSG(msg); + return (EINVAL); + } + + NG_MKRESPONSE(resp, msg, sizeof(struct ng_mesg) + NG_TEXTRESPONSE, + M_NOWAIT); + if (resp == NULL) { + NG_FREE_ITEM(item); + NG_FREE_MSG(msg); + return (ENOMEM); + } + + if (msg->header.arglen) + s = (char *)msg->data; + else + s = NULL; + r = (char *)resp->data; + *r = '\0'; + + if (msg->header.cmd == NGM_TEXT_CONFIG) { + ngmn_config(node, s, r); + resp->header.arglen = strlen(r) + 1; + NG_RESPOND_MSG(i, node, item, resp); + NG_FREE_MSG(msg); + return (0); + } + pos = 0; + pos += sprintf(pos + r,"Framer status %b;\n", sc->framer_state, "\20" + "\40LOS\37AIS\36LFA\35RRA" + "\34AUXP\33NMF\32LMFA\31frs0.0" + "\30frs1.7\27TS16RA\26TS16LOS\25TS16AIS" + "\24TS16LFA\23frs1.2\22XLS\21XLO" + "\20RS1\17rsw.6\16RRA\15RY0" + "\14RY1\13RY2\12RY3\11RY4" + "\10SI1\7SI2\6rsp.5\5rsp.4" + "\4rsp.3\3RSIF\2RS13\1RS15"); + pos += sprintf(pos + r," Framing errors: %lu", sc->cnt_fec); + pos += sprintf(pos + r," Code Violations: %lu\n", sc->cnt_cvc); + + pos += sprintf(pos + r," Falc State %b;\n", sc->falc_state, "\20" + "\40LOS\37AIS\36LFA\35RRA" + "\34AUXP\33NMF\32LMFA\31frs0.0" + "\30frs1.7\27TS16RA\26TS16LOS\25TS16AIS" + "\24TS16LFA\23frs1.2\22XLS\21XLO" + "\20RS1\17rsw.6\16RRA\15RY0" + "\14RY1\13RY2\12RY3\11RY4" + "\10SI1\7SI2\6rsp.5\5rsp.4" + "\4rsp.3\3RSIF\2RS13\1RS15"); + pos += sprintf(pos + r, " Falc IRQ %b\n", sc->falc_irq, "\20" + "\40RME\37RFS\36T8MS\35RMB\34CASC\33CRC4\32SA6SC\31RPF" + "\30b27\27RDO\26ALLS\25XDU\24XMB\23b22\22XLSC\21XPR" + "\20FAR\17LFA\16MFAR\15T400MS\14AIS\13LOS\12RAR\11RA" + "\10ES\7SEC\6LMFA16\5AIS16\4RA16\3API\2SLN\1SLP"); + for (i = 0; i < M32_CHAN; i++) { + if (!sc->ch[i]) + continue; + sch = sc->ch[i]; + + pos += sprintf(r + pos, " Chan %d <%s> ", + i, NG_HOOK_NAME(sch->hook)); + + pos += sprintf(r + pos, " Last Rx: "); + if (sch->last_recv) + pos += sprintf(r + pos, "%lu s", + (unsigned long)(time_second - sch->last_recv)); + else + pos += sprintf(r + pos, "never"); + + pos += sprintf(r + pos, ", last RxErr: "); + if (sch->last_rxerr) + pos += sprintf(r + pos, "%lu s", + (unsigned long)(time_second - sch->last_rxerr)); + else + pos += sprintf(r + pos, "never"); + + pos += sprintf(r + pos, ", last Tx: "); + if (sch->last_xmit) + pos += sprintf(r + pos, "%lu s\n", + (unsigned long)(time_second - sch->last_xmit)); + else + pos += sprintf(r + pos, "never\n"); + + pos += sprintf(r + pos, " RX error(s) %lu", sch->rx_error); + pos += sprintf(r + pos, " Short: %lu", sch->short_error); + pos += sprintf(r + pos, " CRC: %lu", sch->crc_error); + pos += sprintf(r + pos, " Mod8: %lu", sch->dribble_error); + pos += sprintf(r + pos, " Long: %lu", sch->long_error); + pos += sprintf(r + pos, " Abort: %lu", sch->abort_error); + pos += sprintf(r + pos, " Overflow: %lu\n", sch->overflow_error); + + pos += sprintf(r + pos, " Last error: %b Prev error: %b\n", + sch->last_error, "\20\7SHORT\5CRC\4MOD8\3LONG\2ABORT\1OVERRUN", + sch->prev_error, "\20\7SHORT\5CRC\4MOD8\3LONG\2ABORT\1OVERRUN"); + pos += sprintf(r + pos, " Xmit bytes pending %ld\n", + sch->tx_pending); + } + resp->header.arglen = pos + 1; + + /* Take care of synchronous response, if any */ + NG_RESPOND_MSG(i, node, item, resp); + NG_FREE_MSG(msg); + return (0); +} + +static int +ngmn_newhook(node_p node, hook_p hook, const char *name) +{ + u_int32_t ts, chan; + struct mn_softc *sc; + int nbit; + + sc = NG_NODE_PRIVATE(node); + + if (name[0] != 't' || name[1] != 's') + return (EINVAL); + + ts = mn_parse_ts(name + 2, &nbit); + printf("%d bits %x\n", nbit, ts); + if (sc->framing == E1 && (ts & 1)) + return (EINVAL); + if (sc->framing == E1U && nbit != 32) + return (EINVAL); + if (ts == 0) + return (EINVAL); + if (sc->framing == E1) + chan = ffs(ts) - 1; + else + chan = 1; + if (!sc->ch[chan]) + mn_create_channel(sc, chan); + else if (sc->ch[chan]->state == UP) + return (EBUSY); + sc->ch[chan]->ts = ts; + sc->ch[chan]->hook = hook; + sc->ch[chan]->tx_limit = nbit * 8; + NG_HOOK_SET_PRIVATE(hook, sc->ch[chan]); + sc->nhooks++; + return(0); +} + + +static struct trxd *mn_desc_free; + +static struct trxd * +mn_alloc_desc(void) +{ + struct trxd *dp; + + dp = mn_desc_free; + if (dp) + mn_desc_free = dp->vnext; + else + dp = (struct trxd *)malloc(sizeof *dp, M_MN, M_NOWAIT); + return (dp); +} + +static void +mn_free_desc(struct trxd *dp) +{ + dp->vnext = mn_desc_free; + mn_desc_free = dp; +} + +static u_int32_t +mn_parse_ts(const char *s, int *nbit) +{ + unsigned r; + int i, j; + char *p; + + r = 0; + j = -1; + *nbit = 0; + while(*s) { + i = strtol(s, &p, 0); + if (i < 0 || i > 31) + return (0); + while (j != -1 && j < i) { + r |= 1 << j++; + (*nbit)++; + } + j = -1; + r |= 1 << i; + (*nbit)++; + if (*p == ',') { + s = p + 1; + continue; + } else if (*p == '-') { + j = i + 1; + s = p + 1; + continue; + } else if (!*p) { + break; + } else { + return (0); + } + } + return (r); +} + +#ifdef notyet +static void +mn_fmt_ts(char *p, u_int32_t ts) +{ + char *s; + int j; + + s = ""; + ts &= 0xffffffff; + for (j = 0; j < 32; j++) { + if (!(ts & (1 << j))) + continue; + sprintf(p, "%s%d", s, j); + p += strlen(p); + s = ","; + if (!(ts & (1 << (j+1)))) + continue; + for (; j < 32; j++) + if (!(ts & (1 << (j+1)))) + break; + sprintf(p, "-%d", j); + p += strlen(p); + s = ","; + } +} +#endif /* notyet */ + +/* + * OUTPUT + */ + +static int +ngmn_rcvdata(hook_p hook, item_p item) +{ + struct mbuf *m2; + struct trxd *dp, *dp2; + struct schan *sch; + struct mn_softc *sc; + int chan, pitch, len; + struct mbuf *m; + + sch = NG_HOOK_PRIVATE(hook); + sc = sch->sc; + chan = sch->chan; + + if (sch->state != UP) { + NG_FREE_ITEM(item); + return (0); + } + NGI_GET_M(item, m); + if (sch->tx_pending + m->m_pkthdr.len > sch->tx_limit * mn_maxlatency) { + NG_FREE_M(m); + NG_FREE_ITEM(item); + return (0); + } + NG_FREE_ITEM(item); + pitch = 0; + m2 = m; + dp2 = sc->ch[chan]->xl; + len = m->m_pkthdr.len; + while (len) { + dp = mn_alloc_desc(); + if (!dp) { + pitch++; + m_freem(m); + sc->ch[chan]->xl = dp2; + dp = dp2->vnext; + while (dp) { + dp2 = dp->vnext; + mn_free_desc(dp); + dp = dp2; + } + sc->ch[chan]->xl->vnext = 0; + break; + } + dp->data = vtophys(m2->m_data); + dp->flags = m2->m_len << 16; + dp->flags += 1; + len -= m2->m_len; + dp->next = vtophys(dp); + dp->vnext = 0; + sc->ch[chan]->xl->next = vtophys(dp); + sc->ch[chan]->xl->vnext = dp; + sc->ch[chan]->xl = dp; + if (!len) { + dp->m = m; + dp->flags |= 0xc0000000; + dp2->flags &= ~0x40000000; + } else { + dp->m = 0; + m2 = m2->m_next; + } + } + if (pitch) + printf("%s%d: Short on mem, pitched %d packets\n", + sc->name, chan, pitch); + else { +#if 0 + printf("%d = %d + %d (%p)\n", + sch->tx_pending + m->m_pkthdr.len, + sch->tx_pending , m->m_pkthdr.len, m); +#endif + sch->tx_pending += m->m_pkthdr.len; + sc->m32x->txpoll &= ~(1 << chan); + } + return (0); +} + +/* + * OPEN + */ +static int +ngmn_connect(hook_p hook) +{ + int i, nts, chan; + struct trxd *dp, *dp2; + struct mbuf *m; + struct mn_softc *sc; + struct schan *sch; + u_int32_t u; + + sch = NG_HOOK_PRIVATE(hook); + chan = sch->chan; + sc = sch->sc; + + if (sch->state == UP) + return (0); + sch->state = UP; + + /* Count and configure the timeslots for this channel */ + for (nts = i = 0; i < 32; i++) + if (sch->ts & (1 << i)) { + sc->m32_mem.ts[i] = 0x00ff00ff | + (chan << 24) | (chan << 8); + nts++; + } + + /* Init the receiver & xmitter to HDLC */ + sc->m32_mem.cs[chan].flags = 0x80e90006; + /* Allocate two buffers per timeslot */ + if (nts == 32) + sc->m32_mem.cs[chan].itbs = 63; + else + sc->m32_mem.cs[chan].itbs = nts * 2; + + /* Setup a transmit chain with one descriptor */ + /* XXX: we actually send a 1 byte packet */ + dp = mn_alloc_desc(); + MGETHDR(m, M_WAIT, MT_DATA); + m->m_pkthdr.len = 0; + dp->m = m; + dp->flags = 0xc0000000 + (1 << 16); + dp->next = vtophys(dp); + dp->vnext = 0; + dp->data = vtophys(sc->name); + sc->m32_mem.cs[chan].tdesc = vtophys(dp); + sc->ch[chan]->x1 = dp; + sc->ch[chan]->xl = dp; + + /* Setup a receive chain with 5 + NTS descriptors */ + + dp = mn_alloc_desc(); + m = NULL; + MGETHDR(m, M_WAIT, MT_DATA); + MCLGET(m, M_WAIT); + dp->m = m; + dp->data = vtophys(m->m_data); + dp->flags = 0x40000000; + dp->flags += 1600 << 16; + dp->next = vtophys(dp); + dp->vnext = 0; + sc->ch[chan]->rl = dp; + + for (i = 0; i < (nts + 10); i++) { + dp2 = dp; + dp = mn_alloc_desc(); + m = NULL; + MGETHDR(m, M_WAIT, MT_DATA); + MCLGET(m, M_WAIT); + dp->m = m; + dp->data = vtophys(m->m_data); + dp->flags = 0x00000000; + dp->flags += 1600 << 16; + dp->next = vtophys(dp2); + dp->vnext = dp2; + } + sc->m32_mem.cs[chan].rdesc = vtophys(dp); + sc->ch[chan]->r1 = dp; + + /* Initialize this channel */ + sc->m32_mem.ccb = 0x00008000 + (chan << 8); + sc->m32x->cmd = 0x1; + DELAY(1000); + u = sc->m32x->stat; + if (!(u & 1)) + printf("%s: init chan %d stat %08x\n", sc->name, chan, u); + sc->m32x->stat = 1; + /* probably not at splnet, force outward queueing */ + NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook)); + + return (0); +} + +/* + * CLOSE + */ +static int +ngmn_disconnect(hook_p hook) +{ + int chan, i; + struct mn_softc *sc; + struct schan *sch; + struct trxd *dp, *dp2; + u_int32_t u; + + sch = NG_HOOK_PRIVATE(hook); + chan = sch->chan; + sc = sch->sc; + + if (sch->state == DOWN) + return (0); + sch->state = DOWN; + + /* Set receiver & transmitter off */ + sc->m32_mem.cs[chan].flags = 0x80920006; + sc->m32_mem.cs[chan].itbs = 0; + + /* free the timeslots */ + for (i = 0; i < 32; i++) + if (sc->ch[chan]->ts & (1 << i)) + sc->m32_mem.ts[i] = 0x20002000; + + /* Initialize this channel */ + sc->m32_mem.ccb = 0x00008000 + (chan << 8); + sc->m32x->cmd = 0x1; + DELAY(30); + u = sc->m32x->stat; + if (!(u & 1)) + printf("%s: zap chan %d stat %08x\n", sc->name, chan, u); + sc->m32x->stat = 1; + + /* Free all receive descriptors and mbufs */ + for (dp = sc->ch[chan]->r1; dp ; dp = dp2) { + if (dp->m) + m_freem(dp->m); + sc->ch[chan]->r1 = dp2 = dp->vnext; + mn_free_desc(dp); + } + + /* Free all transmit descriptors and mbufs */ + for (dp = sc->ch[chan]->x1; dp ; dp = dp2) { + if (dp->m) { + sc->ch[chan]->tx_pending -= dp->m->m_pkthdr.len; + m_freem(dp->m); + } + sc->ch[chan]->x1 = dp2 = dp->vnext; + mn_free_desc(dp); + } + sc->nhooks--; + return(0); +} + +/* + * Create a new channel. + */ +static void +mn_create_channel(struct mn_softc *sc, int chan) +{ + struct schan *sch; + + sch = sc->ch[chan] = (struct schan *)malloc(sizeof *sc->ch[chan], + M_MN, M_WAITOK | M_ZERO); + sch->sc = sc; + sch->state = DOWN; + sch->chan = chan; + sprintf(sch->name, "%s%d", sc->name, chan); + return; +} + +#ifdef notyet +/* + * Dump Munich32x state + */ +static void +m32_dump(struct mn_softc *sc) +{ + u_int32_t *tp4; + int i, j; + + printf("mn%d: MUNICH32X dump\n", sc->unit); + tp4 = (u_int32_t *)sc->m0v; + for(j = 0; j < 64; j += 8) { + printf("%02x", j * sizeof *tp4); + for(i = 0; i < 8; i++) + printf(" %08x", tp4[i+j]); + printf("\n"); + } + for(j = 0; j < M32_CHAN; j++) { + if (!sc->ch[j]) + continue; + printf("CH%d: state %d ts %08x", + j, sc->ch[j]->state, sc->ch[j]->ts); + printf(" %08x %08x %08x %08x %08x %08x\n", + sc->m32_mem.cs[j].flags, + sc->m32_mem.cs[j].rdesc, + sc->m32_mem.cs[j].tdesc, + sc->m32_mem.cs[j].itbs, + sc->m32_mem.crxd[j], + sc->m32_mem.ctxd[j] ); + } +} + +/* + * Dump Falch54 state + */ +static void +f54_dump(struct mn_softc *sc) +{ + u_int8_t *tp1; + int i, j; + + printf("%s: FALC54 dump\n", sc->name); + tp1 = (u_int8_t *)sc->m1v; + for(j = 0; j < 128; j += 16) { + printf("%s: %02x |", sc->name, j * sizeof *tp1); + for(i = 0; i < 16; i++) + printf(" %02x", tp1[i+j]); + printf("\n"); + } +} +#endif /* notyet */ + +/* + * Init Munich32x + */ +static void +m32_init(struct mn_softc *sc) +{ + + sc->m32x->conf = 0x00000000; + sc->m32x->mode1 = 0x81048000 + 1600; /* XXX: temp */ +#if 1 + sc->m32x->mode2 = 0x00000081; + sc->m32x->txpoll = 0xffffffff; +#elif 1 + sc->m32x->mode2 = 0x00000081; + sc->m32x->txpoll = 0xffffffff; +#else + sc->m32x->mode2 = 0x00000101; +#endif + sc->m32x->lconf = 0x6060009B; + sc->m32x->imask = 0x00000000; +} + +/* + * Init the Falc54 + */ +static void +f54_init(struct mn_softc *sc) +{ + sc->f54w->ipc = 0x07; + + sc->f54w->xpm0 = 0xbd; + sc->f54w->xpm1 = 0x03; + sc->f54w->xpm2 = 0x00; + + sc->f54w->imr0 = 0x18; /* RMB, CASC */ + sc->f54w->imr1 = 0x08; /* XMB */ + sc->f54w->imr2 = 0x00; + sc->f54w->imr3 = 0x38; /* LMFA16, AIS16, RA16 */ + sc->f54w->imr4 = 0x00; + + sc->f54w->fmr0 = 0xf0; /* X: HDB3, R: HDB3 */ + sc->f54w->fmr1 = 0x0e; /* Send CRC4, 2Mbit, ECM */ + if (sc->framing == E1) + sc->f54w->fmr2 = 0x03; /* Auto Rem-Alarm, Auto resync */ + else if (sc->framing == E1U) + sc->f54w->fmr2 = 0x33; /* dais, rtm, Auto Rem-Alarm, Auto resync */ + + sc->f54w->lim1 = 0xb0; /* XCLK=8kHz, .62V threshold */ + sc->f54w->pcd = 0x0a; + sc->f54w->pcr = 0x15; + sc->f54w->xsw = 0x9f; /* fmr4 */ + if (sc->framing == E1) + sc->f54w->xsp = 0x1c; /* fmr5 */ + else if (sc->framing == E1U) + sc->f54w->xsp = 0x3c; /* tt0, fmr5 */ + sc->f54w->xc0 = 0x07; + sc->f54w->xc1 = 0x3d; + sc->f54w->rc0 = 0x05; + sc->f54w->rc1 = 0x00; + sc->f54w->cmdr = 0x51; +} + +static int +mn_reset(struct mn_softc *sc) +{ + u_int32_t u; + int i; + + sc->m32x->ccba = vtophys(&sc->m32_mem.csa); + sc->m32_mem.csa = vtophys(&sc->m32_mem.ccb); + + bzero(sc->tiqb, sizeof sc->tiqb); + sc->m32x->tiqba = vtophys(&sc->tiqb); + sc->m32x->tiql = NIQB / 16 - 1; + + bzero(sc->riqb, sizeof sc->riqb); + sc->m32x->riqba = vtophys(&sc->riqb); + sc->m32x->riql = NIQB / 16 - 1; + + bzero(sc->ltiqb, sizeof sc->ltiqb); + sc->m32x->ltiqba = vtophys(&sc->ltiqb); + sc->m32x->ltiql = NIQB / 16 - 1; + + bzero(sc->lriqb, sizeof sc->lriqb); + sc->m32x->lriqba = vtophys(&sc->lriqb); + sc->m32x->lriql = NIQB / 16 - 1; + + bzero(sc->piqb, sizeof sc->piqb); + sc->m32x->piqba = vtophys(&sc->piqb); + sc->m32x->piql = NIQB / 16 - 1; + + m32_init(sc); + f54_init(sc); + + u = sc->m32x->stat; + sc->m32x->stat = u; + sc->m32_mem.ccb = 0x4; + sc->m32x->cmd = 0x1; + DELAY(1000); + u = sc->m32x->stat; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:35:15 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90D3E1065675; Sun, 2 Nov 2008 17:35:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7478F8FC13; Sun, 2 Nov 2008 17:35:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2HZFJU044308; Sun, 2 Nov 2008 17:35:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2HZFNT044307; Sun, 2 Nov 2008 17:35:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811021735.mA2HZFNT044307@svn.freebsd.org> From: Warner Losh Date: Sun, 2 Nov 2008 17:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184563 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 17:35:15 -0000 Author: imp Date: Sun Nov 2 17:35:15 2008 New Revision: 184563 URL: http://svn.freebsd.org/changeset/base/184563 Log: Make the no driver stuff an ifdef. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sun Nov 2 17:04:54 2008 (r184562) +++ head/sys/dev/acpica/acpi.c Sun Nov 2 17:35:15 2008 (r184563) @@ -789,8 +789,9 @@ acpi_print_child(device_t bus, device_t static void acpi_probe_nomatch(device_t bus, device_t child) { - - /* pci_set_powerstate(child, PCI_POWERSTATE_D3); */ +#ifdef ACPI_ENABLE_POWERDOWN_NODRIVER + pci_set_powerstate(child, PCI_POWERSTATE_D3); +#endif } /* @@ -810,9 +811,13 @@ acpi_driver_added(device_t dev, driver_t for (i = 0; i < numdevs; i++) { child = devlist[i]; if (device_get_state(child) == DS_NOTPRESENT) { - /* pci_set_powerstate(child, PCI_POWERSTATE_D0); */ +#ifdef ACPI_ENABLE_POWERDOWN_NODRIVER + pci_set_powerstate(child, PCI_POWERSTATE_D0); if (device_probe_and_attach(child) != 0) - ; /* pci_set_powerstate(child, PCI_POWERSTATE_D3); */ + pci_set_powerstate(child, PCI_POWERSTATE_D3); +#else + device_probe_and_attach(child); +#endif } } free(devlist, M_TEMP); From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 18:48:54 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88B5E106567E; Sun, 2 Nov 2008 18:48:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 767DE8FC1A; Sun, 2 Nov 2008 18:48:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2Ims7O045606; Sun, 2 Nov 2008 18:48:54 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2Ims7Y045601; Sun, 2 Nov 2008 18:48:54 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811021848.mA2Ims7Y045601@svn.freebsd.org> From: Warner Losh Date: Sun, 2 Nov 2008 18:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184564 - in head/sys: i386/i386 isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 18:48:54 -0000 Author: imp Date: Sun Nov 2 18:48:54 2008 New Revision: 184564 URL: http://svn.freebsd.org/changeset/base/184564 Log: MFp4: Make the ISA bus keep track of more PNP details. Plus a minor style fix while I'm here. More could be done here, but except for some SBCs that don't have ACPI, there's limited value to anybody in doing so. Modified: head/sys/i386/i386/bios.c head/sys/isa/isa_common.c head/sys/isa/isa_common.h head/sys/isa/isavar.h head/sys/isa/pnp.c Modified: head/sys/i386/i386/bios.c ============================================================================== --- head/sys/i386/i386/bios.c Sun Nov 2 17:35:15 2008 (r184563) +++ head/sys/i386/i386/bios.c Sun Nov 2 18:48:54 2008 (r184564) @@ -699,9 +699,10 @@ pnpbios_identify(driver_t *driver, devic (!(pd->attrib & PNPATTR_NOCONFIG) && PNPATTR_CONFIG(pd->attrib) != PNPATTR_CONFIG_STATIC) ? ISACFGATTR_DYNAMIC : 0); + isa_set_pnpbios_handle(dev, pd->handle); ISA_SET_CONFIG_CALLBACK(parent, dev, pnpbios_set_config, 0); pnp_parse_resources(dev, &pd->devdata[0], - pd->size - sizeof(struct pnp_sysdev), 0); + pd->size - sizeof(struct pnp_sysdev), 0); if (!device_get_desc(dev)) device_set_desc_copy(dev, pnp_eisaformat(pd->devid)); Modified: head/sys/isa/isa_common.c ============================================================================== --- head/sys/isa/isa_common.c Sun Nov 2 17:35:15 2008 (r184563) +++ head/sys/isa/isa_common.c Sun Nov 2 18:48:54 2008 (r184564) @@ -467,9 +467,6 @@ isa_assign_resources(device_t child) return (0); } -/* - * Called after other devices have initialised to probe for isa devices. - */ void isa_probe_children(device_t dev) { @@ -762,6 +759,18 @@ isa_read_ivar(device_t bus, device_t dev *result = idev->id_config_attr; break; + case ISA_IVAR_PNP_CSN: + *result = idev->id_pnp_csn; + break; + + case ISA_IVAR_PNP_LDN: + *result = idev->id_pnp_ldn; + break; + + case ISA_IVAR_PNPBIOS_HANDLE: + *result = idev->id_pnpbios_handle; + break; + default: return (ENOENT); } @@ -1026,6 +1035,13 @@ static int isa_child_location_str(device_t bus, device_t child, char *buf, size_t buflen) { +#if 0 + /* id_pnphandle isn't there yet */ + struct isa_device *idev = DEVTOISA(child); + + if (idev->id_vendorid) + snprintf(buf, buflen, "pnphandle=%d", idev->id_pnphandle); +#endif /* Nothing here yet */ *buf = '\0'; return (0); Modified: head/sys/isa/isa_common.h ============================================================================== --- head/sys/isa/isa_common.h Sun Nov 2 17:35:15 2008 (r184563) +++ head/sys/isa/isa_common.h Sun Nov 2 18:48:54 2008 (r184564) @@ -56,6 +56,9 @@ struct isa_device { isa_config_cb *id_config_cb; /* callback function */ void *id_config_arg; /* callback argument */ int id_config_attr; /* pnp config attributes */ + int id_pnpbios_handle; /* pnp handle, if any */ + int id_pnp_csn; /* pnp Card Number */ + int id_pnp_ldn; /* pnp Logical device on card */ }; #define DEVTOISA(dev) ((struct isa_device *) device_get_ivars(dev)) Modified: head/sys/isa/isavar.h ============================================================================== --- head/sys/isa/isavar.h Sun Nov 2 17:35:15 2008 (r184563) +++ head/sys/isa/isavar.h Sun Nov 2 18:48:54 2008 (r184564) @@ -48,7 +48,7 @@ typedef void isa_config_cb(void *arg, st #define ISA_ORDER_PNPBIOS 10 /* plug-and-play BIOS inflexible hardware */ #define ISA_ORDER_SENSITIVE 20 /* legacy sensitive hardware */ #define ISA_ORDER_SPECULATIVE 30 /* legacy non-sensitive hardware */ -#define ISA_ORDER_PNP 40 /* plug-and-play hardware */ +#define ISA_ORDER_PNP 40 /* plug-and-play flexible hardware */ /* * Limits on resources that we can manage @@ -125,7 +125,10 @@ enum isa_device_ivars { ISA_IVAR_SERIAL, ISA_IVAR_LOGICALID, ISA_IVAR_COMPATID, - ISA_IVAR_CONFIGATTR + ISA_IVAR_CONFIGATTR, + ISA_IVAR_PNP_CSN, + ISA_IVAR_PNP_LDN, + ISA_IVAR_PNPBIOS_HANDLE }; /* @@ -152,6 +155,9 @@ ISA_ACCESSOR(serial, SERIAL, int) ISA_ACCESSOR(logicalid, LOGICALID, int) ISA_ACCESSOR(compatid, COMPATID, int) ISA_ACCESSOR(configattr, CONFIGATTR, int) +ISA_ACCESSOR(pnp_csn, PNP_CSN, int) +ISA_ACCESSOR(pnp_ldn, PNP_LDN, int) +ISA_ACCESSOR(pnpbios_handle, PNPBIOS_HANDLE, int) /* Device class for ISA bridges. */ extern devclass_t isab_devclass; Modified: head/sys/isa/pnp.c ============================================================================== --- head/sys/isa/pnp.c Sun Nov 2 17:35:15 2008 (r184563) +++ head/sys/isa/pnp.c Sun Nov 2 18:48:54 2008 (r184564) @@ -522,6 +522,8 @@ pnp_create_devices(device_t parent, pnp_ csnldn->ldn = ldn; ISA_SET_CONFIG_CALLBACK(parent, dev, pnp_set_config, csnldn); + isa_set_pnp_csn(dev, csn); + isa_set_pnp_ldn(dev, ldn); ldn++; startres = resp; break; From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:08:10 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A7571065687; Sun, 2 Nov 2008 19:08:10 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68CC18FC1A; Sun, 2 Nov 2008 19:08:10 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2J8A5g045952; Sun, 2 Nov 2008 19:08:10 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2J8Axn045951; Sun, 2 Nov 2008 19:08:10 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200811021908.mA2J8Axn045951@svn.freebsd.org> From: Ed Schouten Date: Sun, 2 Nov 2008 19:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184565 - head/sys/dev/adb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 19:08:10 -0000 Author: ed Date: Sun Nov 2 19:08:10 2008 New Revision: 184565 URL: http://svn.freebsd.org/changeset/base/184565 Log: Make the touch pad on my PowerBook G4 12" a little more usable. For an unknown reason the touch pad of my PowerBook generates button 5 events when you operate it. This causes the adb_mouse code to convert them to button 2 events, which is not what we want. Add a new flag, AMS_TOUCHPAD, which is used to distinguish the touch pad. When set, don't convert button events of unknown buttons to the last button. There are still three problems left with respect to user input: - The mouse button events are not properly processed when the touch pad isn't touched. - The arrow keys on the keyboard don't work inside X11. - The power button isn't handled by the kernel, similar to the ACPI power button on i386/amd64. Approved by: nwhitehorn Modified: head/sys/dev/adb/adb_mouse.c Modified: head/sys/dev/adb/adb_mouse.c ============================================================================== --- head/sys/dev/adb/adb_mouse.c Sun Nov 2 18:48:54 2008 (r184564) +++ head/sys/dev/adb/adb_mouse.c Sun Nov 2 19:08:10 2008 (r184565) @@ -67,7 +67,9 @@ struct adb_mouse_softc { struct mtx sc_mtx; struct cv sc_cv; - int extended; + int flags; +#define AMS_EXTENDED 0x1 +#define AMS_TOUCHPAD 0x2 uint16_t dpi; mousehw_t hw; @@ -150,7 +152,7 @@ adb_mouse_attach(device_t dev) mtx_init(&sc->sc_mtx,"ams",MTX_DEF,0); cv_init(&sc->sc_cv,"ams"); - sc->extended = 0; + sc->flags = 0; sc->hw.buttons = 2; sc->hw.iftype = MOUSE_IF_UNKNOWN; @@ -183,7 +185,7 @@ adb_mouse_attach(device_t dev) if (r1_len < 8) break; - sc->extended = 1; + sc->flags |= AMS_EXTENDED; memcpy(&sc->hw.hwid,r1,4); sc->mode.resolution = (r1[4] << 8) | r1[5]; @@ -200,6 +202,11 @@ adb_mouse_attach(device_t dev) sc->hw.type = MOUSE_TRACKBALL; description = "Trackball"; break; + case 3: + sc->flags |= AMS_TOUCHPAD; + sc->hw.type = MOUSE_PAD; + description = "Touchpad"; + break; } sc->hw.buttons = r1[7]; @@ -219,7 +226,7 @@ adb_mouse_attach(device_t dev) if (adb_get_device_handler(dev) == 0x42) { device_printf(dev, "MacAlly 2-Button Mouse\n"); - sc->extended = 0; + sc->flags &= ~AMS_EXTENDED; } } @@ -272,7 +279,7 @@ adb_mouse_receive_packet(device_t dev, u buttons |= !(data[0] & 0x80); buttons |= !(data[1] & 0x80) << 1; - if (sc->extended) { + if (sc->flags & AMS_EXTENDED) { for (i = 2; i < len && i < 5; i++) { xdelta |= (data[i] & 0x07) << (3*i + 1); ydelta |= (data[i] & 0x70) << (3*i - 3); @@ -294,12 +301,16 @@ adb_mouse_receive_packet(device_t dev, u * Some mice report high-numbered buttons on the wrong button number, * so set the highest-numbered real button as pressed if there are * mysterious high-numbered ones set. + * + * Don't do this for touchpads, because touchpads also trigger + * high button events when they are touched. */ - if (buttons & ~((1 << sc->hw.buttons) - 1)) { + if (buttons & ~((1 << sc->hw.buttons) - 1) + && !(sc->flags & AMS_TOUCHPAD)) { buttons |= 1 << (sc->hw.buttons - 1); - buttons &= (1 << sc->hw.buttons) - 1; } + buttons &= (1 << sc->hw.buttons) - 1; mtx_lock(&sc->sc_mtx); From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:40:24 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8B991065686; Sun, 2 Nov 2008 19:40:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B76AA8FC20; Sun, 2 Nov 2008 19:40:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2JeOJp046541; Sun, 2 Nov 2008 19:40:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2JeOnv046540; Sun, 2 Nov 2008 19:40:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200811021940.mA2JeOnv046540@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 2 Nov 2008 19:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184566 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 19:40:24 -0000 Author: kib Date: Sun Nov 2 19:40:24 2008 New Revision: 184566 URL: http://svn.freebsd.org/changeset/base/184566 Log: Revert r184516. Option RL_TWISTER_ENABLE is no more after it became loader tunable. Pointy hat to: me Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Nov 2 19:08:10 2008 (r184565) +++ head/sys/conf/NOTES Sun Nov 2 19:40:24 2008 (r184566) @@ -1875,7 +1875,6 @@ device my # Myson Fast Ethernet (MTD80 device nge # NatSemi DP83820 gigabit Ethernet device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 -options RL_TWISTER_ENABLE # Enable long cable compensation code device pcn # AMD Am79C97x PCI 10/100 NICs device sf # Adaptec AIC-6915 (``Starfire'') device sis # Silicon Integrated Systems SiS 900/SiS 7016 From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:48:15 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4B07106564A; Sun, 2 Nov 2008 19:48:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2E068FC0A; Sun, 2 Nov 2008 19:48:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2JmF0c046703; Sun, 2 Nov 2008 19:48:15 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2JmFtl046702; Sun, 2 Nov 2008 19:48:15 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811021948.mA2JmFtl046702@svn.freebsd.org> From: Robert Watson Date: Sun, 2 Nov 2008 19:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184567 - head/contrib/smbfs/lib/smb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 19:48:15 -0000 Author: rwatson Date: Sun Nov 2 19:48:15 2008 New Revision: 184567 URL: http://svn.freebsd.org/changeset/base/184567 Log: When encoding an smb name, truncate one byte earlier in order than we did previously in order to ensure it fit properly in the bufer when encoded. This prevents a debugging printf from firing if a source or destination host name for an smb mount exceeds 15 characters. MFC after: 3 days Obtained from: Apple, Inc. Modified: head/contrib/smbfs/lib/smb/nb_name.c Modified: head/contrib/smbfs/lib/smb/nb_name.c ============================================================================== --- head/contrib/smbfs/lib/smb/nb_name.c Sun Nov 2 19:40:24 2008 (r184566) +++ head/contrib/smbfs/lib/smb/nb_name.c Sun Nov 2 19:48:15 2008 (r184567) @@ -169,7 +169,7 @@ nb_name_encode(struct nb_name *np, u_cha memsetw(cp + 2, NB_NAMELEN - 1, NBENCODE(' ')); cp += NB_ENCNAMELEN; } else { - for (i = 0; *name && i < NB_NAMELEN; i++, cp += 2, name++) + for (i = 0; *name && i < NB_NAMELEN - 1; i++, cp += 2, name++) *(u_short*)cp = NBENCODE(toupper(*name)); i = NB_NAMELEN - i - 1; if (i > 0) { From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:50:41 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25444106564A; Sun, 2 Nov 2008 19:50:41 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: from acme.spoerlein.net (cl-43.dus-01.de.sixxs.net [IPv6:2a01:198:200:2a::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9D5CF8FC0C; Sun, 2 Nov 2008 19:50:40 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: from roadrunner.spoerlein.net (e180143147.adsl.alicedsl.de [85.180.143.147]) by acme.spoerlein.net (8.14.2/8.14.2) with ESMTP id mA2Joakt042376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 2 Nov 2008 20:50:37 +0100 (CET) (envelope-from uspoerlein@gmail.com) Received: from roadrunner.spoerlein.net (localhost [127.0.0.1]) by roadrunner.spoerlein.net (8.14.2/8.14.2) with ESMTP id mA2JBSXi049212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Nov 2008 20:11:28 +0100 (CET) (envelope-from uspoerlein@gmail.com) Received: (from uqs@localhost) by roadrunner.spoerlein.net (8.14.2/8.14.2/Submit) id mA2JBRHe049211; Sun, 2 Nov 2008 20:11:27 +0100 (CET) (envelope-from uspoerlein@gmail.com) Date: Sun, 2 Nov 2008 20:11:27 +0100 From: Ulrich Spoerlein To: Ivan Voras Message-ID: <20081102191127.GB1487@roadrunner.spoerlein.net> References: <200810301405.m9UE5wwZ053250@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200810301405.m9UE5wwZ053250@svn.freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184471 - in head/bin: cat cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 19:50:41 -0000 On Thu, 30.10.2008 at 14:05:58 +0000, Ivan Voras wrote: > Author: ivoras > Date: Thu Oct 30 14:05:57 2008 > New Revision: 184471 > URL: http://svn.freebsd.org/changeset/base/184471 > > Log: > Teach cat(1) and cp(1) to use a larger buffer if enough memory is present > in the system. A simple heuristics is used to detect what is "enough" > memory: if number of physmem pages is greater than 32k (equalling 128 MB > on machines with 4 kB pages). Hi Ivan, curiosity speaking: Isn't amd64 and the superpages work by alc@ making it possible, to have pages of dynamic size, and of sizes > 1MB. If so, how are these static (?) macros affected. Not that it would matter performance wise ... Cheers, Ulrich Spoerlein -- It is better to remain silent and be thought a fool, than to speak, and remove all doubt. From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 20:22:25 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BDD41065673; Sun, 2 Nov 2008 20:22:25 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A19D8FC1F; Sun, 2 Nov 2008 20:22:25 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2KMO9N047395; Sun, 2 Nov 2008 20:22:24 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2KMOCC047394; Sun, 2 Nov 2008 20:22:24 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811022022.mA2KMOCC047394@svn.freebsd.org> From: Robert Watson Date: Sun, 2 Nov 2008 20:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184568 - head/sys/netsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 20:22:25 -0000 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.c Sun Nov 2 19:48:15 2008 (r184567) +++ head/sys/netsmb/smb_conn.c Sun 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; } From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 22:43:38 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CB1C1065673; Sun, 2 Nov 2008 22:43:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2ABAB8FC13; Sun, 2 Nov 2008 22:43:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2MhcP7049861; Sun, 2 Nov 2008 22:43:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2MhcRf049860; Sun, 2 Nov 2008 22:43:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200811022243.mA2MhcRf049860@svn.freebsd.org> From: Xin LI Date: Sun, 2 Nov 2008 22:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184569 - in stable/7/sys: . dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 22:43:38 -0000 Author: delphij Date: Sun Nov 2 22:43:37 2008 New Revision: 184569 URL: http://svn.freebsd.org/changeset/base/184569 Log: MFC revisions 180072 and 182967 by emaste: Add explicit PCI IDs for the following Adaptec RAID Series 2 adapters: Adaptec RAID 2045 Adaptec RAID 2405 Adaptec RAID 2445 Adaptec RAID 2805 Without this change these devices are supported by the driver's family support, but they then appear as "Adaptec RAID Controller" in boot messages and the dev.aac.0.%desc sysctl. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/dev/aac/aac_pci.c Modified: stable/7/sys/dev/aac/aac_pci.c ============================================================================== --- stable/7/sys/dev/aac/aac_pci.c Sun Nov 2 20:22:24 2008 (r184568) +++ stable/7/sys/dev/aac/aac_pci.c Sun Nov 2 22:43:37 2008 (r184569) @@ -245,7 +245,15 @@ struct aac_ident {0x9005, 0x0285, 0x9005, 0x02d0, AAC_HWIF_I960RX, 0, "Adaptec RAID 52445"}, {0x9005, 0x0285, 0x9005, 0x02d1, AAC_HWIF_I960RX, 0, - "Adaptec RAID 5405"}, + "Adaptec RAID 5405"}, + {0x9005, 0x0285, 0x9005, 0x02d4, AAC_HWIF_I960RX, 0, + "Adaptec RAID 2045"}, + {0x9005, 0x0285, 0x9005, 0x02d5, AAC_HWIF_I960RX, 0, + "Adaptec RAID 2405"}, + {0x9005, 0x0285, 0x9005, 0x02d6, AAC_HWIF_I960RX, 0, + "Adaptec RAID 2445"}, + {0x9005, 0x0285, 0x9005, 0x02d7, AAC_HWIF_I960RX, 0, + "Adaptec RAID 2805"}, {0x9005, 0x0286, 0x1014, 0x9580, AAC_HWIF_RKT, 0, "IBM ServeRAID-8k"}, {0x9005, 0x0285, 0x1014, 0x034d, AAC_HWIF_I960RX, 0, From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 23:11:20 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9300106568C; Sun, 2 Nov 2008 23:11:20 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7F1A8FC0C; Sun, 2 Nov 2008 23:11:20 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2NBKsq050515; Sun, 2 Nov 2008 23:11:20 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2NBKj2050514; Sun, 2 Nov 2008 23:11:20 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <200811022311.mA2NBKj2050514@svn.freebsd.org> From: Ivan Voras Date: Sun, 2 Nov 2008 23:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184570 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 23:11:21 -0000 Author: ivoras Date: Sun Nov 2 23:11:20 2008 New Revision: 184570 URL: http://svn.freebsd.org/changeset/base/184570 Log: Increase the initial sbuf size for CPU topology dump to something more usable for newer CPUs. The new value allows 2 x quad core configuration dumps to fit within the initial buffer without reallocations. Approved by: gnn (mentor) (older version) Pointed out by: rdivacky Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sun Nov 2 22:43:37 2008 (r184569) +++ head/sys/kern/sched_ule.c Sun Nov 2 23:11:20 2008 (r184570) @@ -2665,7 +2665,7 @@ sysctl_kern_sched_topology_spec(SYSCTL_H KASSERT(cpu_top != NULL, ("cpu_top isn't initialized")); - topo = sbuf_new(NULL, NULL, 100, SBUF_AUTOEXTEND); + topo = sbuf_new(NULL, NULL, 500, SBUF_AUTOEXTEND); if (topo == NULL) return (ENOMEM); From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 23:15:32 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C0FD1065673; Sun, 2 Nov 2008 23:15:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79B3B8FC12; Sun, 2 Nov 2008 23:15:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2NFWio050619; Sun, 2 Nov 2008 23:15:32 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2NFWdD050617; Sun, 2 Nov 2008 23:15:32 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811022315.mA2NFWdD050617@svn.freebsd.org> From: Robert Watson Date: Sun, 2 Nov 2008 23:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184571 - head/sys/netsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 23:15:32 -0000 Author: rwatson Date: Sun Nov 2 23:15:32 2008 New Revision: 184571 URL: http://svn.freebsd.org/changeset/base/184571 Log: Catch up internal locking routines in netsmb with lockmgr changes -- explicit thread arguments are no longer required in many places. Modified: head/sys/netsmb/smb_conn.c head/sys/netsmb/smb_conn.h Modified: head/sys/netsmb/smb_conn.c ============================================================================== --- head/sys/netsmb/smb_conn.c Sun Nov 2 23:11:20 2008 (r184570) +++ head/sys/netsmb/smb_conn.c Sun Nov 2 23:15:32 2008 (r184571) @@ -63,9 +63,9 @@ SYSCTL_NODE(_net, OID_AUTO, smb, CTLFLAG MALLOC_DEFINE(M_SMBCONN, "smb_conn", "SMB connection"); static void smb_co_init(struct smb_connobj *cp, int level, char *ilockname, - char *lockname, struct thread *td); + char *lockname); static void smb_co_done(struct smb_connobj *cp); -static int smb_co_lockstatus(struct smb_connobj *cp, struct thread *td); +static int smb_co_lockstatus(struct smb_connobj *cp); static int smb_vc_disconnect(struct smb_vc *vcp); static void smb_vc_free(struct smb_connobj *cp); @@ -82,8 +82,8 @@ int smb_sm_init(void) { - smb_co_init(&smb_vclist, SMBL_SM, "smbsm ilock", "smbsm", curthread); - smb_co_unlock(&smb_vclist, 0, curthread); + smb_co_init(&smb_vclist, SMBL_SM, "smbsm ilock", "smbsm"); + smb_co_unlock(&smb_vclist, 0); return 0; } @@ -96,30 +96,29 @@ smb_sm_done(void) SMBERROR("%d connections still active\n", smb_vclist.co_usecount - 1); return EBUSY; } - lockmgr(&smb_vclist.co_lock, LK_DRAIN, 0); + lockmgr(&smb_vclist.co_lock, LK_DRAIN, NULL); smb_co_done(&smb_vclist); return 0; } static int -smb_sm_lockvclist(int flags, struct thread *td) +smb_sm_lockvclist(int flags) { - return smb_co_lock(&smb_vclist, flags | LK_CANRECURSE, td); + return smb_co_lock(&smb_vclist, flags | LK_CANRECURSE); } static void -smb_sm_unlockvclist(struct thread *td) +smb_sm_unlockvclist(void) { - smb_co_unlock(&smb_vclist, LK_RELEASE, td); + smb_co_unlock(&smb_vclist, LK_RELEASE); } static int smb_sm_lookupint(struct smb_vcspec *vcspec, struct smb_sharespec *shspec, struct smb_cred *scred, struct smb_vc **vcpp) { - struct thread *td = scred->scr_td; struct smb_connobj *scp; struct smb_vc *vcp; int exact = 1; @@ -130,7 +129,7 @@ smb_sm_lookupint(struct smb_vcspec *vcsp vcp = NULL; SMBCO_FOREACH(scp, &smb_vclist) { vcp = (struct smb_vc *)scp; - error = smb_vc_lock(vcp, LK_EXCLUSIVE, td); + error = smb_vc_lock(vcp, LK_EXCLUSIVE); if (error) continue; @@ -167,7 +166,7 @@ smb_sm_lookupint(struct smb_vcspec *vcsp err1: error = 1; fail: - smb_vc_unlock(vcp, 0, td); + smb_vc_unlock(vcp, 0); } if (vcp) { smb_vc_ref(vcp); @@ -180,19 +179,18 @@ int smb_sm_lookup(struct smb_vcspec *vcspec, struct smb_sharespec *shspec, struct smb_cred *scred, struct smb_vc **vcpp) { - struct thread *td = scred->scr_td; struct smb_vc *vcp; struct smb_share *ssp = NULL; int error; *vcpp = vcp = NULL; - error = smb_sm_lockvclist(LK_EXCLUSIVE, td); + error = smb_sm_lockvclist(LK_EXCLUSIVE); if (error) return error; error = smb_sm_lookupint(vcspec, shspec, scred, vcpp); if (error == 0 || (vcspec->flags & SMBV_CREATE) == 0) { - smb_sm_unlockvclist(td); + smb_sm_unlockvclist(); return error; } error = smb_sm_lookupint(vcspec, NULL, scred, &vcp); @@ -215,11 +213,11 @@ smb_sm_lookup(struct smb_vcspec *vcspec, else smb_share_put(ssp, scred); out: - smb_sm_unlockvclist(td); + smb_sm_unlockvclist(); if (error == 0) *vcpp = vcp; else if (vcp) { - smb_vc_lock(vcp, LK_EXCLUSIVE, scred->scr_td); + smb_vc_lock(vcp, LK_EXCLUSIVE); smb_vc_put(vcp, scred); } return error; @@ -229,15 +227,14 @@ out: * Common code for connection object */ static void -smb_co_init(struct smb_connobj *cp, int level, char *ilockname, char *lockname, - struct thread *td) +smb_co_init(struct smb_connobj *cp, int level, char *ilockname, char *lockname) { SLIST_INIT(&cp->co_children); smb_sl_init(&cp->co_interlock, ilockname); lockinit(&cp->co_lock, PZERO, lockname, 0, 0); cp->co_level = level; cp->co_usecount = 1; - if (smb_co_lock(cp, LK_EXCLUSIVE, td) != 0) + if (smb_co_lock(cp, LK_EXCLUSIVE) != 0) panic("smb_co_init: lock failed"); } @@ -245,7 +242,7 @@ static void smb_co_done(struct smb_connobj *cp) { smb_sl_destroy(&cp->co_interlock); - lockmgr(&cp->co_lock, LK_RELEASE, 0); + lockmgr(&cp->co_lock, LK_RELEASE, NULL); lockdestroy(&cp->co_lock); } @@ -258,7 +255,7 @@ smb_co_gone(struct smb_connobj *cp, stru cp->co_gone(cp, scred); parent = cp->co_parent; if (parent) { - smb_co_lock(parent, LK_EXCLUSIVE, scred->scr_td); + smb_co_lock(parent, LK_EXCLUSIVE); SLIST_REMOVE(&parent->co_children, cp, smb_connobj, co_next); smb_co_put(parent, scred); } @@ -305,7 +302,7 @@ smb_co_get(struct smb_connobj *cp, int f if ((flags & LK_INTERLOCK) == 0) SMB_CO_LOCK(cp); cp->co_usecount++; - error = smb_co_lock(cp, flags | LK_INTERLOCK, scred->scr_td); + error = smb_co_lock(cp, flags | LK_INTERLOCK); if (error) { SMB_CO_LOCK(cp); cp->co_usecount--; @@ -336,20 +333,20 @@ smb_co_put(struct smb_connobj *cp, struc } int -smb_co_lockstatus(struct smb_connobj *cp, struct thread *td) +smb_co_lockstatus(struct smb_connobj *cp) { return lockstatus(&cp->co_lock); } int -smb_co_lock(struct smb_connobj *cp, int flags, struct thread *td) +smb_co_lock(struct smb_connobj *cp, int flags) { if (cp->co_flags & SMBO_GONE) return EINVAL; if ((flags & LK_TYPE_MASK) == 0) flags |= LK_EXCLUSIVE; - if (smb_co_lockstatus(cp, td) == LK_EXCLUSIVE && + if (smb_co_lockstatus(cp) == LK_EXCLUSIVE && (flags & LK_CANRECURSE) == 0) { SMBERROR("recursive lock for object %d\n", cp->co_level); return 0; @@ -358,7 +355,7 @@ smb_co_lock(struct smb_connobj *cp, int } void -smb_co_unlock(struct smb_connobj *cp, int flags, struct thread *td) +smb_co_unlock(struct smb_connobj *cp, int flags) { (void)lockmgr(&cp->co_lock, flags | LK_RELEASE, &cp->co_interlock); } @@ -366,8 +363,11 @@ smb_co_unlock(struct smb_connobj *cp, in static void smb_co_addchild(struct smb_connobj *parent, struct smb_connobj *child) { - KASSERT(smb_co_lockstatus(parent, curthread) == LK_EXCLUSIVE, ("smb_co_addchild: parent not locked")); - KASSERT(smb_co_lockstatus(child, curthread) == LK_EXCLUSIVE, ("smb_co_addchild: child not locked")); + + KASSERT(smb_co_lockstatus(parent) == LK_EXCLUSIVE, + ("smb_co_addchild: parent not locked")); + KASSERT(smb_co_lockstatus(child) == LK_EXCLUSIVE, + ("smb_co_addchild: child not locked")); smb_co_ref(parent); SLIST_INSERT_HEAD(&parent->co_children, child, co_next); @@ -383,7 +383,6 @@ smb_vc_create(struct smb_vcspec *vcspec, struct smb_cred *scred, struct smb_vc **vcpp) { struct smb_vc *vcp; - struct thread *td = scred->scr_td; struct ucred *cred = scred->scr_cred; uid_t uid = vcspec->owner; gid_t gid = vcspec->group; @@ -401,7 +400,7 @@ smb_vc_create(struct smb_vcspec *vcspec, return EPERM; vcp = smb_zmalloc(sizeof(*vcp), M_SMBCONN, M_WAITOK); - smb_co_init(VCTOCP(vcp), SMBL_VC, "smb_vc ilock", "smb_vc", td); + smb_co_init(VCTOCP(vcp), SMBL_VC, "smb_vc ilock", "smb_vc"); vcp->obj.co_free = smb_vc_free; vcp->obj.co_gone = smb_vc_gone; vcp->vc_number = smb_vcnext++; @@ -538,15 +537,15 @@ smb_vc_put(struct smb_vc *vcp, struct sm } int -smb_vc_lock(struct smb_vc *vcp, int flags, struct thread *td) +smb_vc_lock(struct smb_vc *vcp, int flags) { - return smb_co_lock(VCTOCP(vcp), flags, td); + return smb_co_lock(VCTOCP(vcp), flags); } void -smb_vc_unlock(struct smb_vc *vcp, int flags, struct thread *td) +smb_vc_unlock(struct smb_vc *vcp, int flags) { - smb_co_unlock(VCTOCP(vcp), flags, td); + smb_co_unlock(VCTOCP(vcp), flags); } int @@ -598,7 +597,6 @@ int smb_vc_lookupshare(struct smb_vc *vcp, struct smb_sharespec *dp, struct smb_cred *scred, struct smb_share **sspp) { - struct thread *td = scred->scr_td; struct smb_connobj *scp = NULL; struct smb_share *ssp = NULL; int error; @@ -607,12 +605,12 @@ smb_vc_lookupshare(struct smb_vc *vcp, s dp->scred = scred; SMBCO_FOREACH(scp, VCTOCP(vcp)) { ssp = (struct smb_share *)scp; - error = smb_share_lock(ssp, LK_EXCLUSIVE, td); + error = smb_share_lock(ssp, LK_EXCLUSIVE); if (error) continue; if (smb_vc_cmpshare(ssp, dp) == 0) break; - smb_share_unlock(ssp, 0, td); + smb_share_unlock(ssp, 0); } if (ssp) { smb_share_ref(ssp); @@ -694,7 +692,6 @@ smb_share_create(struct smb_vc *vcp, str struct smb_cred *scred, struct smb_share **sspp) { struct smb_share *ssp; - struct thread *td = scred->scr_td; struct ucred *cred = scred->scr_cred; uid_t realuid = cred->cr_uid; uid_t uid = shspec->owner; @@ -719,7 +716,7 @@ smb_share_create(struct smb_vc *vcp, str if (gid == SMBM_ANY_GROUP) gid = cred->cr_groups[0]; ssp = smb_zmalloc(sizeof(*ssp), M_SMBCONN, M_WAITOK); - smb_co_init(SSTOCP(ssp), SMBL_SHARE, "smbss ilock", "smbss", td); + smb_co_init(SSTOCP(ssp), SMBL_SHARE, "smbss ilock", "smbss"); ssp->obj.co_free = smb_share_free; ssp->obj.co_gone = smb_share_gone; smb_sl_init(&ssp->ss_stlock, "ssstlock"); @@ -781,15 +778,15 @@ smb_share_put(struct smb_share *ssp, str } int -smb_share_lock(struct smb_share *ssp, int flags, struct thread *td) +smb_share_lock(struct smb_share *ssp, int flags) { - return smb_co_lock(SSTOCP(ssp), flags, td); + return smb_co_lock(SSTOCP(ssp), flags); } void -smb_share_unlock(struct smb_share *ssp, int flags, struct thread *td) +smb_share_unlock(struct smb_share *ssp, int flags) { - smb_co_unlock(SSTOCP(ssp), flags, td); + smb_co_unlock(SSTOCP(ssp), flags); } int @@ -866,34 +863,34 @@ smb_sysctl_treedump(SYSCTL_HANDLER_ARGS) error = sysctl_wire_old_buffer(req, 0); if (error) return (error); - error = smb_sm_lockvclist(LK_SHARED, td); + error = smb_sm_lockvclist(LK_SHARED); if (error) return error; SMBCO_FOREACH(scp1, &smb_vclist) { vcp = (struct smb_vc *)scp1; - error = smb_vc_lock(vcp, LK_SHARED, td); + error = smb_vc_lock(vcp, LK_SHARED); if (error) continue; smb_vc_getinfo(vcp, &vci); error = SYSCTL_OUT(req, &vci, sizeof(struct smb_vc_info)); if (error) { - smb_vc_unlock(vcp, 0, td); + smb_vc_unlock(vcp, 0); break; } SMBCO_FOREACH(scp2, VCTOCP(vcp)) { ssp = (struct smb_share *)scp2; - error = smb_share_lock(ssp, LK_SHARED, td); + error = smb_share_lock(ssp, LK_SHARED); if (error) { error = 0; continue; } smb_share_getinfo(ssp, &ssi); - smb_share_unlock(ssp, 0, td); + smb_share_unlock(ssp, 0); error = SYSCTL_OUT(req, &ssi, sizeof(struct smb_share_info)); if (error) break; } - smb_vc_unlock(vcp, 0, td); + smb_vc_unlock(vcp, 0); if (error) break; } @@ -901,6 +898,6 @@ smb_sysctl_treedump(SYSCTL_HANDLER_ARGS) itype = SMB_INFO_NONE; error = SYSCTL_OUT(req, &itype, sizeof(itype)); } - smb_sm_unlockvclist(td); + smb_sm_unlockvclist(); return error; } Modified: head/sys/netsmb/smb_conn.h ============================================================================== --- head/sys/netsmb/smb_conn.h Sun Nov 2 23:11:20 2008 (r184570) +++ head/sys/netsmb/smb_conn.h Sun Nov 2 23:15:32 2008 (r184571) @@ -363,8 +363,8 @@ void smb_co_ref(struct smb_connobj *cp); void smb_co_rele(struct smb_connobj *cp, struct smb_cred *scred); int smb_co_get(struct smb_connobj *cp, int flags, struct smb_cred *scred); void smb_co_put(struct smb_connobj *cp, struct smb_cred *scred); -int smb_co_lock(struct smb_connobj *cp, int flags, struct thread *td); -void smb_co_unlock(struct smb_connobj *cp, int flags, struct thread *td); +int smb_co_lock(struct smb_connobj *cp, int flags); +void smb_co_unlock(struct smb_connobj *cp, int flags); /* * session level functions @@ -377,8 +377,8 @@ int smb_vc_get(struct smb_vc *vcp, int void smb_vc_put(struct smb_vc *vcp, struct smb_cred *scred); void smb_vc_ref(struct smb_vc *vcp); void smb_vc_rele(struct smb_vc *vcp, struct smb_cred *scred); -int smb_vc_lock(struct smb_vc *vcp, int flags, struct thread *td); -void smb_vc_unlock(struct smb_vc *vcp, int flags, struct thread *td); +int smb_vc_lock(struct smb_vc *vcp, int flags); +void smb_vc_unlock(struct smb_vc *vcp, int flags); int smb_vc_lookupshare(struct smb_vc *vcp, struct smb_sharespec *shspec, struct smb_cred *scred, struct smb_share **sspp); const char * smb_vc_getpass(struct smb_vc *vcp); @@ -394,8 +394,8 @@ void smb_share_ref(struct smb_share *ssp void smb_share_rele(struct smb_share *ssp, struct smb_cred *scred); int smb_share_get(struct smb_share *ssp, int flags, struct smb_cred *scred); void smb_share_put(struct smb_share *ssp, struct smb_cred *scred); -int smb_share_lock(struct smb_share *ssp, int flags, struct thread *td); -void smb_share_unlock(struct smb_share *ssp, int flags, struct thread *td); +int smb_share_lock(struct smb_share *ssp, int flags); +void smb_share_unlock(struct smb_share *ssp, int flags); void smb_share_invalidate(struct smb_share *ssp); int smb_share_valid(struct smb_share *ssp); const char * smb_share_getpass(struct smb_share *ssp); From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 23:20:28 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48C76106568C; Sun, 2 Nov 2008 23:20:28 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 370D58FC22; Sun, 2 Nov 2008 23:20:28 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA2NKSSO050736; Sun, 2 Nov 2008 23:20:28 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA2NKSe7050734; Sun, 2 Nov 2008 23:20:28 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811022320.mA2NKSe7050734@svn.freebsd.org> From: Robert Watson Date: Sun, 2 Nov 2008 23:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184572 - in head/sys: fs/smbfs netsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 23:20:28 -0000 Author: rwatson Date: Sun Nov 2 23:20:27 2008 New Revision: 184572 URL: http://svn.freebsd.org/changeset/base/184572 Log: Catch up with netsmb locking: explicit thread arguments no longer required. Modified: head/sys/fs/smbfs/smbfs_vfsops.c head/sys/netsmb/smb_dev.c Modified: head/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vfsops.c Sun Nov 2 23:15:32 2008 (r184571) +++ head/sys/fs/smbfs/smbfs_vfsops.c Sun Nov 2 23:20:27 2008 (r184572) @@ -173,7 +173,7 @@ smbfs_mount(struct mount *mp, struct thr return error; } vcp = SSTOVC(ssp); - smb_share_unlock(ssp, 0, td); + smb_share_unlock(ssp, 0); mp->mnt_stat.f_iosize = SSTOVC(ssp)->vc_txmax; #ifdef SMBFS_USEZONE @@ -305,7 +305,7 @@ smbfs_unmount(struct mount *mp, int mntf if (error) return error; smb_makescred(&scred, td, td->td_ucred); - error = smb_share_lock(smp->sm_share, LK_EXCLUSIVE, td); + error = smb_share_lock(smp->sm_share, LK_EXCLUSIVE); if (error) return error; smb_share_put(smp->sm_share, &scred); Modified: head/sys/netsmb/smb_dev.c ============================================================================== --- head/sys/netsmb/smb_dev.c Sun Nov 2 23:15:32 2008 (r184571) +++ head/sys/netsmb/smb_dev.c Sun Nov 2 23:20:27 2008 (r184572) @@ -204,7 +204,7 @@ nsmb_dev_ioctl(struct cdev *dev, u_long if (error) break; sdp->sd_vc = vcp; - smb_vc_unlock(vcp, 0, td); + smb_vc_unlock(vcp, 0); sdp->sd_level = SMBL_VC; break; case SMBIOC_OPENSHARE: @@ -217,7 +217,7 @@ nsmb_dev_ioctl(struct cdev *dev, u_long if (error) break; sdp->sd_share = ssp; - smb_share_unlock(ssp, 0, td); + smb_share_unlock(ssp, 0); sdp->sd_level = SMBL_SHARE; break; case SMBIOC_REQUEST: @@ -287,12 +287,12 @@ nsmb_dev_ioctl(struct cdev *dev, u_long break; if (vcp) { sdp->sd_vc = vcp; - smb_vc_unlock(vcp, 0, td); + smb_vc_unlock(vcp, 0); sdp->sd_level = SMBL_VC; } if (ssp) { sdp->sd_share = ssp; - smb_share_unlock(ssp, 0, td); + smb_share_unlock(ssp, 0); sdp->sd_level = SMBL_SHARE; } break; From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 23:34:49 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B507106567B; Sun, 2 Nov 2008 23:34:49 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.187]) by mx1.freebsd.org (Postfix) with ESMTP id 95CB18FC0C; Sun, 2 Nov 2008 23:34:48 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by fk-out-0910.google.com with SMTP id k31so2633342fkk.11 for ; Sun, 02 Nov 2008 15:34:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=nKCfvk3zTG9Q9PJ5dHy4qxepaA0pLmZmsrjW2TVD60Y=; b=o785SX5OzwT+9VNOjHZJFCEOum8eiX/jJInQyeFsh1hV6eGIsJKHPP5BLPfYOh1ABw p8/64H8ndg/kjnI01ME7oFzn2qo1LUmVEC4hg7YRwAEW7B6kSnnNlHaMIf/t1b54mvVI cCUPH7dqbNkyOVYWKK7DpfaAckXE3GSP34DBE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=xqWH3uqgKIuHyysqCNKmiBj01sKw9YHNXCSbvdIMuiViXZ5ZM2m8zZyQKoEvczFH00 Nlmmtvz6tBmfI/MoFL2cj7yU4d2DPgGYtxNam9j737peM/HPEOUysPdnj5Rd6KvxsyqL +CN9pPjiNyOa0a/beqAY6RVNGW3rtF+jyP/lE= Received: by 10.181.144.10 with SMTP id w10mr4014237bkn.30.1225668887307; Sun, 02 Nov 2008 15:34:47 -0800 (PST) Received: by 10.181.145.4 with HTTP; Sun, 2 Nov 2008 15:34:47 -0800 (PST) Message-ID: <9bbcef730811021534gb114db9x16a2d6c9a3ecee8b@mail.gmail.com> Date: Mon, 3 Nov 2008 00:34:47 +0100 From: "Ivan Voras" Sender: ivoras@gmail.com To: "Giorgos Keramidas" In-Reply-To: <877i7pdzva.fsf@kobe.laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200810301405.m9UE5wwZ053250@svn.freebsd.org> <877i7pdzva.fsf@kobe.laptop> X-Google-Sender-Auth: 6bee4d96ae049a8c X-Mailman-Approved-At: Sun, 02 Nov 2008 23:38:06 +0000 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184471 - in head/bin: cat cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 23:34:49 -0000 2008/10/31 Giorgos Keramidas : > Nice :) > > I didn't notice this in -hackers, but it may be worth letting the buffer > size grow above 1 MB when we have more than, say, 512 MB of memory. By > running dd(1) with buffer sizes of 1, 2, 4, 6, 8, 10, 12, 14, and 16 MB > there are larger buffer sizes that reduce involuntary context switches > even more. > > My laptop (with more than 2 GB or memory), with powerd disabled, running > in single user mode, and copying a file of 200 MB using the script: >... > got the following results for sizes < 10 MB: >... As I read it, for x memory you have y context switches: 64 kB - 11194 (old, pre-patch behaviour) 1 MB - 1493 2 MB - 1381 4 MB - 1342 6 MB - 1292 8 MB - 1275 16 MB - 1246 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? :) I have no strong reason against increasing the buffer for cp to even 8 MB but I really think it's not worth it at this point. In the patch, I've actually allowed the buffer size to grow to 2 MB if MAXPHYS ever gets bumped up (and would gladly increase *this* limit up). I think that, at this point, increasing MAXPHYS will give better performance than increasing this particular buffer. From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 23:47:15 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63F78106568F for ; Sun, 2 Nov 2008 23:47:15 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by mx1.freebsd.org (Postfix) with ESMTP id E3B288FC17 for ; Sun, 2 Nov 2008 23:47:14 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1910874fgb.35 for ; Sun, 02 Nov 2008 15:47:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=ZMFm0QkJ7bvut+cwFmUgcPSU5H7TJ45BOm0xu+gTXGg=; b=pnkR2rmKeUAAkKrw5jszNpNpJ5sLoG12SD7DZHJdhIpQA0oq/7jJtPCj0cfWusM/KK b1lPGu1ZCcOkzQ8e4v72uSO9PudfoNl8P34WYkYTvMdrN2cDQfVXhBSho7GgnWTe8aeb YXq27zSMYNZ3vClk7voDSZpLNDHxTQcMMtK14= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=wePAgCZYm5samLAkjexzrkRgVUwuqyOuiGE35eRdbkc6D/6vLrjgxVyvkdq9hHpyz5 qdwHPRwL7Sseeoffv5qAzSUv5wU7o37Qpkc3qaN23Bd+UblAmCqGo4Rac5BJVYZmEEWp YaBDcYUhap9IZcxeUACXIhydHg8NZyWfNlZVw= Received: by 10.181.59.19 with SMTP id m19mr4009405bkk.38.1225668174595; Sun, 02 Nov 2008 15:22:54 -0800 (PST) Received: by 10.181.145.4 with HTTP; Sun, 2 Nov 2008 15:22:54 -0800 (PST) Message-ID: <9bbcef730811021522l54efd4c7l8f34e6e285894aaa@mail.gmail.com> Date: Mon, 3 Nov 2008 00:22:54 +0100 From: "Ivan Voras" Sender: ivoras@gmail.com To: "Ulrich Spoerlein" In-Reply-To: <20081102191127.GB1487@roadrunner.spoerlein.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200810301405.m9UE5wwZ053250@svn.freebsd.org> <20081102191127.GB1487@roadrunner.spoerlein.net> X-Google-Sender-Auth: bdcadabc77ecbd30 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184471 - in head/bin: cat cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2008 23:47:15 -0000 2008/11/2 Ulrich Spoerlein : > On Thu, 30.10.2008 at 14:05:58 +0000, Ivan Voras wrote: >> Author: ivoras >> Date: Thu Oct 30 14:05:57 2008 >> New Revision: 184471 >> URL: http://svn.freebsd.org/changeset/base/184471 >> >> Log: >> Teach cat(1) and cp(1) to use a larger buffer if enough memory is present >> in the system. A simple heuristics is used to detect what is "enough" >> memory: if number of physmem pages is greater than 32k (equalling 128 MB >> on machines with 4 kB pages). > > Hi Ivan, > > curiosity speaking: Isn't amd64 and the superpages work by alc@ making > it possible, to have pages of dynamic size, and of sizes > 1MB. If so, > how are these static (?) macros affected. I think the base page size of the architecture (which amd64 inherited from i386) will always stay at 4 kB. For architectures with bigger page size (as returned by sysconf(_SC_PAGESIZE)), it's forseeable they will have more than 32k pages of active RAM in any case so it doesn't really matter what the threshold is (assuming, of course, there will be no architectures with *smaller* page size :) ). The reason I introduced this threshold at all is to support old or embedded (small) hardware in which 1 MB could be thought of as a "big" buffer. I think 1 MB is "good enough" for all larger machines. From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 00:53:55 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DAD51065676; Mon, 3 Nov 2008 00:53:55 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF7198FC16; Mon, 3 Nov 2008 00:53:54 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA30rsEC052360; Mon, 3 Nov 2008 00:53:54 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA30rsdg052353; Mon, 3 Nov 2008 00:53:54 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200811030053.mA30rsdg052353@svn.freebsd.org> From: Scott Long Date: Mon, 3 Nov 2008 00:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184573 - in head/sys: conf dev/amr i386/conf modules/amr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 00:53:55 -0000 Author: scottl Date: Mon Nov 3 00:53:54 2008 New Revision: 184573 URL: http://svn.freebsd.org/changeset/base/184573 Log: Move the CAM passthrough code into a true module so that it doesn't have to be compiled into the main AMR driver. It's code that is nice to have but not required for normal operation, and it is reported to cause problems for some people. Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/dev/amr/amr.c head/sys/dev/amr/amr_cam.c head/sys/dev/amr/amrvar.h head/sys/i386/conf/XEN head/sys/modules/amr/Makefile Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Nov 2 23:20:27 2008 (r184572) +++ head/sys/conf/NOTES Mon Nov 3 00:53:54 2008 (r184573) @@ -1579,6 +1579,7 @@ device mly device ida # Compaq Smart RAID device mlx # Mylex DAC960 device amr # AMI MegaRAID +device amrp # SCSI Passthrough interface (optional, CAM req.) device mfi # LSI MegaRAID SAS device mfip # LSI MegaRAID SAS passthrough, requires CAM options MFI_DEBUG Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Nov 2 23:20:27 2008 (r184572) +++ head/sys/conf/files Mon Nov 3 00:53:54 2008 (r184573) @@ -450,7 +450,7 @@ dev/aic7xxx/aic7xxx_osm.c optional ahc dev/aic7xxx/aic7xxx_pci.c optional ahc pci dev/amd/amd.c optional amd dev/amr/amr.c optional amr -dev/amr/amr_cam.c optional amr +dev/amr/amr_cam.c optional amrp amr dev/amr/amr_disk.c optional amr dev/amr/amr_linux.c optional amr compat_linux dev/amr/amr_pci.c optional amr pci Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Sun Nov 2 23:20:27 2008 (r184572) +++ head/sys/dev/amr/amr.c Mon Nov 3 00:53:54 2008 (r184573) @@ -88,13 +88,6 @@ __FBSDID("$FreeBSD$"); #define AMR_DEFINE_TABLES #include -/* - * The CAM interface appears to be completely broken. Disable it. - */ -#ifndef AMR_ENABLE_CAM -#define AMR_ENABLE_CAM 1 -#endif - SYSCTL_NODE(_hw, OID_AUTO, amr, CTLFLAG_RD, 0, "AMR driver parameters"); static d_open_t amr_open; @@ -202,6 +195,7 @@ MALLOC_DEFINE(M_AMR, "amr", "AMR memory" int amr_attach(struct amr_softc *sc) { + device_t child; debug_called(1); @@ -259,14 +253,16 @@ amr_attach(struct amr_softc *sc) */ amr_init_sysctl(sc); -#if AMR_ENABLE_CAM != 0 /* * Attach our 'real' SCSI channels to CAM. */ - if (amr_cam_attach(sc)) - return(ENXIO); - debug(2, "CAM attach done"); -#endif + child = device_add_child(sc->amr_dev, "amrp", -1); + sc->amr_pass = child; + if (child != NULL) { + device_set_softc(child, sc); + device_set_desc(child, "SCSI Passthrough Bus"); + bus_generic_attach(sc->amr_dev); + } /* * Create the control device. @@ -391,10 +387,9 @@ amr_free(struct amr_softc *sc) { struct amr_command_cluster *acc; -#if AMR_ENABLE_CAM != 0 /* detach from CAM */ - amr_cam_detach(sc); -#endif + if (sc->amr_pass != NULL) + device_delete_child(sc->amr_dev, sc->amr_pass); /* cancel status timeout */ untimeout(amr_periodic, sc, sc->amr_timeout); @@ -1240,11 +1235,9 @@ amr_startio(struct amr_softc *sc) if (ac == NULL) (void)amr_bio_command(sc, &ac); -#if AMR_ENABLE_CAM != 0 /* if that failed, build a command from a ccb */ - if (ac == NULL) - (void)amr_cam_command(sc, &ac); -#endif + if ((ac == NULL) && (sc->amr_cam_command != NULL)) + sc->amr_cam_command(sc, &ac); /* if we don't have anything to do, give up */ if (ac == NULL) Modified: head/sys/dev/amr/amr_cam.c ============================================================================== --- head/sys/dev/amr/amr_cam.c Sun Nov 2 23:20:27 2008 (r184572) +++ head/sys/dev/amr/amr_cam.c Mon Nov 3 00:53:54 2008 (r184573) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -82,9 +83,31 @@ __FBSDID("$FreeBSD$"); #include #include +static int amr_cam_probe(device_t dev); +static int amr_cam_attach(device_t dev); +static int amr_cam_detach(device_t dev); static void amr_cam_action(struct cam_sim *sim, union ccb *ccb); static void amr_cam_poll(struct cam_sim *sim); static void amr_cam_complete(struct amr_command *ac); +static int amr_cam_command(struct amr_softc *sc, struct amr_command **acp); + +static devclass_t amr_pass_devclass; + +static device_method_t amr_pass_methods[] = { + DEVMETHOD(device_probe, amr_cam_probe), + DEVMETHOD(device_attach, amr_cam_attach), + DEVMETHOD(device_detach, amr_cam_detach), + { 0, 0 } +}; + +static driver_t amr_pass_driver = { + "amrp", + amr_pass_methods, + 0 +}; + +DRIVER_MODULE(amrp, amr, amr_pass_driver, amr_pass_devclass, 0, 0); +MODULE_DEPEND(amrp, cam, 1, 1, 1); MALLOC_DEFINE(M_AMRCAM, "amrcam", "AMR CAM memory"); @@ -115,14 +138,23 @@ amr_dequeue_ccb(struct amr_softc *sc) return(ccb); } +static int +amr_cam_probe(device_t dev) +{ + return (0); +} + /******************************************************************************** * Attach our 'real' SCSI channels to CAM */ -int -amr_cam_attach(struct amr_softc *sc) +static int +amr_cam_attach(device_t dev) { + struct amr_softc *sc; struct cam_devq *devq; - int chn, error; + int chn, error; + + sc = device_get_softc(dev); /* initialise the ccb queue */ TAILQ_INIT(&sc->amr_cam_ccbq); @@ -134,7 +166,7 @@ amr_cam_attach(struct amr_softc *sc) * during detach. */ if ((devq = cam_simq_alloc(AMR_MAX_SCSI_CMDS)) == NULL) - return(ENOMEM); + return(ENOMEM); sc->amr_cam_devq = devq; /* @@ -165,17 +197,20 @@ amr_cam_attach(struct amr_softc *sc) * XXX we should scan the config and work out which devices are * actually protected. */ + sc->amr_cam_command = amr_cam_command; return(0); } /******************************************************************************** * Disconnect ourselves from CAM */ -void -amr_cam_detach(struct amr_softc *sc) +static int +amr_cam_detach(device_t dev) { + struct amr_softc *sc; int chn; + sc = device_get_softc(dev); mtx_lock(&sc->amr_list_lock); for (chn = 0; chn < sc->amr_maxchan; chn++) { /* @@ -191,6 +226,8 @@ amr_cam_detach(struct amr_softc *sc) /* Now free the devq */ if (sc->amr_cam_devq != NULL) cam_simq_free(sc->amr_cam_devq); + + return (0); } /*********************************************************************** @@ -379,7 +416,7 @@ amr_cam_action(struct cam_sim *sim, unio * Convert a CAM CCB off the top of the CCB queue to a passthrough SCSI * command. */ -int +static int amr_cam_command(struct amr_softc *sc, struct amr_command **acp) { struct amr_command *ac; Modified: head/sys/dev/amr/amrvar.h ============================================================================== --- head/sys/dev/amr/amrvar.h Sun Nov 2 23:20:27 2008 (r184572) +++ head/sys/dev/amr/amrvar.h Mon Nov 3 00:53:54 2008 (r184573) @@ -253,6 +253,8 @@ struct amr_softc int support_ext_cdb; /* greater than 10 byte cdb support */ /* misc glue */ + device_t amr_pass; + int (*amr_cam_command)(struct amr_softc *sc, struct amr_command **acp); struct intr_config_hook amr_ich; /* wait-for-interrupts probe hook */ struct callout_handle amr_timeout; /* periodic status check */ int amr_allow_vol_config; @@ -277,13 +279,6 @@ extern struct amr_command *amr_alloccmd( extern void amr_releasecmd(struct amr_command *ac); /* - * CAM interface - */ -extern int amr_cam_attach(struct amr_softc *sc); -extern void amr_cam_detach(struct amr_softc *sc); -extern int amr_cam_command(struct amr_softc *sc, struct amr_command **acp); - -/* * MegaRAID logical disk driver */ struct amrd_softc Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Sun Nov 2 23:20:27 2008 (r184572) +++ head/sys/i386/conf/XEN Mon Nov 3 00:53:54 2008 (r184573) @@ -1,28 +1,10 @@ # -# GENERIC -- Generic kernel configuration file for FreeBSD/i386 -# -# For more information on this file, please read the handbook section on -# Kernel Configuration Files: -# -# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. +# XEN -- Kernel configuration for i386 XEN DomU # # $FreeBSD$ cpu I686_CPU -ident GENERIC - -# To statically compile in device wiring instead of /boot/device.hints -#hints "GENERIC.hints" # Default places to look for devices. +ident XEN makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions MODULES_OVERRIDE="" @@ -39,7 +21,6 @@ options SOFTUPDATES # Enable FFS soft options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling -options MD_ROOT # MD is a potential root device options NFSCLIENT # Network Filesystem Client options NFSSERVER # Network Filesystem Server options NFSLOCKD # Network Lock Manager @@ -55,7 +36,6 @@ options COMPAT_FREEBSD4 # Compatible w options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options COMPAT_FREEBSD7 # Compatible with FreeBSD7 -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory @@ -63,7 +43,6 @@ options SYSVMSG # SYSV-style message options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing # Debugging for use in -current @@ -86,53 +65,8 @@ options MCLSHIFT=12 options SMP # Symmetric MultiProcessor Kernel device apic # I/O APIC -# CPU frequency control -#device cpufreq - -# atkbdc0 controls both the keyboard and the PS/2 mouse -device atkbdc # AT keyboard controller -device atkbd # AT keyboard -device psm # PS/2 mouse - device kbdmux # keyboard multiplexer -#device vga # VGA video card driver - -device splash # Splash screen and screen saver support - -# syscons is the default console driver, resembling an SCO console -#device sc - -# Power management support (see NOTES for more options) -#device apm -# Add suspend/resume support for the i8254. -device pmtimer - - -device pci - -# PCCARD (PCMCIA) support -# PCMCIA and cardbus bridge support -#device cbb # cardbus (yenta) bridge -#device pccard # PC Card (16-bit) bus -#device cardbus # CardBus (32-bit) bus - -# Serial (COM) ports -device uart # Generic UART driver - -# Parallel port -device ppc -device ppbus # Parallel port bus (required) -device lpt # Printer -device plip # TCP/IP over parallel -device ppi # Parallel port interface device -#device vpo # Requires scbus and da - -# If you've got a "dumb" serial or parallel PCI card that is -# supported by the puc(4) glue driver, uncomment the following -# line to enable it (connects to sio, uart and/or ppc drivers): -#device puc - # Pseudo devices. device loop # Network loopback device random # Entropy device @@ -142,7 +76,6 @@ device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device faith # IPv6-to-IPv4 relaying (translation) -device firmware # firmware assist module # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! Modified: head/sys/modules/amr/Makefile ============================================================================== --- head/sys/modules/amr/Makefile Sun Nov 2 23:20:27 2008 (r184572) +++ head/sys/modules/amr/Makefile Mon Nov 3 00:53:54 2008 (r184573) @@ -2,15 +2,16 @@ .PATH: ${.CURDIR}/../../dev/amr +SUBDIR= amr_cam .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" -SUBDIR= amr_linux +SUBDIR+= amr_linux .endif KMOD= amr SRCS= amr.c amr_pci.c amr_disk.c device_if.h bus_if.h pci_if.h # SCSI passthrough support for non-disk devices -SRCS+= amr_cam.c opt_cam.h opt_scsi.h +#SRCS+= amr_cam.c opt_cam.h opt_scsi.h # Enable a questionable optimisation for newer adapters #CFLAGS+= -DAMR_QUARTZ_GOFASTER From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 04:13:28 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A5E11065676; Mon, 3 Nov 2008 04:13:28 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 183088FC0C; Mon, 3 Nov 2008 04:13:28 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA34DRP4056210; Mon, 3 Nov 2008 04:13:27 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA34DROB056208; Mon, 3 Nov 2008 04:13:27 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200811030413.mA34DROB056208@svn.freebsd.org> From: Scott Long Date: Mon, 3 Nov 2008 04:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184577 - in head/sys/modules/amr: . amr_cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 04:13:28 -0000 Author: scottl Date: Mon Nov 3 04:13:27 2008 New Revision: 184577 URL: http://svn.freebsd.org/changeset/base/184577 Log: Add amr_cam module directory that was missed in the previous commit. Added: head/sys/modules/amr/amr_cam/ head/sys/modules/amr/amr_cam/Makefile (contents, props changed) Modified: head/sys/modules/amr/Makefile Modified: head/sys/modules/amr/Makefile ============================================================================== --- head/sys/modules/amr/Makefile Mon Nov 3 03:18:29 2008 (r184576) +++ head/sys/modules/amr/Makefile Mon Nov 3 04:13:27 2008 (r184577) @@ -10,9 +10,6 @@ SUBDIR+= amr_linux KMOD= amr SRCS= amr.c amr_pci.c amr_disk.c device_if.h bus_if.h pci_if.h -# SCSI passthrough support for non-disk devices -#SRCS+= amr_cam.c opt_cam.h opt_scsi.h - # Enable a questionable optimisation for newer adapters #CFLAGS+= -DAMR_QUARTZ_GOFASTER Added: head/sys/modules/amr/amr_cam/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/amr/amr_cam/Makefile Mon Nov 3 04:13:27 2008 (r184577) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/amr + +KMOD= amr_cam +SRCS= amr_cam.c device_if.h bus_if.h +SRCS+= opt_cam.h opt_scsi.h + +.include From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 05:19:46 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 402F21065674; Mon, 3 Nov 2008 05:19:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CAA68FC0C; Mon, 3 Nov 2008 05:19:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA35JkL7057373; Mon, 3 Nov 2008 05:19:46 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA35JkBo057371; Mon, 3 Nov 2008 05:19:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200811030519.mA35JkBo057371@svn.freebsd.org> From: Xin LI Date: Mon, 3 Nov 2008 05:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184578 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 05:19:46 -0000 Author: delphij Date: Mon Nov 3 05:19:45 2008 New Revision: 184578 URL: http://svn.freebsd.org/changeset/base/184578 Log: Sync with OpenBSD's dirname(3) - license change, avoid strcpy() over string constant, use memcpy() instead of strncpy() and improve code readibility. No functional change. Modified: head/lib/libc/gen/dirname.3 head/lib/libc/gen/dirname.c Modified: head/lib/libc/gen/dirname.3 ============================================================================== --- head/lib/libc/gen/dirname.3 Mon Nov 3 04:13:27 2008 (r184577) +++ head/lib/libc/gen/dirname.3 Mon Nov 3 05:19:45 2008 (r184578) @@ -1,30 +1,19 @@ +.\" $OpenBSD: dirname.3,v 1.17 2007/05/31 19:19:28 jmc Exp $ .\" .\" Copyright (c) 1997 Todd C. Miller -.\" All rights reserved. .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. .\" -.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.\" $OpenBSD: dirname.3,v 1.9 2000/04/18 03:01:25 aaron Exp $ .\" $FreeBSD$ .\" .Dd October 12, 2006 @@ -40,8 +29,7 @@ .Sh DESCRIPTION The .Fn dirname -function -is the converse of +function is the converse of .Xr basename 3 ; it returns a pointer to the parent directory of the pathname pointed to by .Fa path . @@ -108,4 +96,4 @@ function first appeared in and .Fx 4.2 . .Sh AUTHORS -.An "Todd C. Miller" Aq Todd.Miller@courtesan.com +.An "Todd C. Miller" Modified: head/lib/libc/gen/dirname.c ============================================================================== --- head/lib/libc/gen/dirname.c Mon Nov 3 04:13:27 2008 (r184577) +++ head/lib/libc/gen/dirname.c Mon Nov 3 05:19:45 2008 (r184578) @@ -1,35 +1,21 @@ +/* $OpenBSD: dirname.c,v 1.13 2005/08/08 08:05:33 espie Exp $ */ + /* - * Copyright (c) 1997 Todd C. Miller - * All rights reserved. + * Copyright (c) 1997, 2004 Todd C. Miller * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#if 0 -#ifndef lint -static char rcsid[] = "$OpenBSD: dirname.c,v 1.4 1999/05/30 17:10:30 espie Exp $"; -#endif /* not lint */ -#endif #include __FBSDID("$FreeBSD$"); @@ -40,25 +26,26 @@ __FBSDID("$FreeBSD$"); #include char * -dirname(path) - const char *path; +dirname(const char *path) { - static char *bname = NULL; + static char *dname = NULL; + size_t len; const char *endp; - if (bname == NULL) { - bname = (char *)malloc(MAXPATHLEN); - if (bname == NULL) + if (dname == NULL) { + dname = (char *)malloc(MAXPATHLEN); + if (dname == NULL) return(NULL); } /* Empty or NULL string gets treated as "." */ if (path == NULL || *path == '\0') { - (void)strcpy(bname, "."); - return(bname); + dname[0] = '.'; + dname[1] = '\0'; + return (dname); } - /* Strip trailing slashes */ + /* Strip any trailing slashes */ endp = path + strlen(path) - 1; while (endp > path && *endp == '/') endp--; @@ -69,19 +56,22 @@ dirname(path) /* Either the dir is "/" or there are no slashes */ if (endp == path) { - (void)strcpy(bname, *endp == '/' ? "/" : "."); - return(bname); + dname[0] = *endp == '/' ? '/' : '.'; + dname[1] = '\0'; + return (dname); } else { + /* Move forward past the separating slashes */ do { endp--; } while (endp > path && *endp == '/'); } - if (endp - path + 2 > MAXPATHLEN) { + len = endp - path + 1; + if (len >= MAXPATHLEN) { errno = ENAMETOOLONG; - return(NULL); + return (NULL); } - (void)strncpy(bname, path, endp - path + 1); - bname[endp - path + 1] = '\0'; - return(bname); + memcpy(dname, path, len); + dname[len] = '\0'; + return (dname); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 05:52:43 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98E1E1065689; Mon, 3 Nov 2008 05:52:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86F068FC1F; Mon, 3 Nov 2008 05:52:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA35qhPk057963; Mon, 3 Nov 2008 05:52:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA35qhCb057962; Mon, 3 Nov 2008 05:52:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811030552.mA35qhCb057962@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Nov 2008 05:52:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184579 - head/sys/dev/cardbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 05:52:43 -0000 Author: imp Date: Mon Nov 3 05:52:43 2008 New Revision: 184579 URL: http://svn.freebsd.org/changeset/base/184579 Log: We can't mask out the higher order bits and have the size come out right... Good thing the size was ignored... Where this macro is used, there's no reason to do it anyway. There seems to have been some old-time confusion between the CIS pointer definition, and the BAR definitions at the base of this bug. Modified: head/sys/dev/cardbus/cardbusreg.h Modified: head/sys/dev/cardbus/cardbusreg.h ============================================================================== --- head/sys/dev/cardbus/cardbusreg.h Mon Nov 3 05:19:45 2008 (r184578) +++ head/sys/dev/cardbus/cardbusreg.h Mon Nov 3 05:52:43 2008 (r184579) @@ -45,7 +45,7 @@ #define CARDBUS_EXROM_DATA_CODE_TYPE 0x14 /* Code Type */ #define CARDBUS_EXROM_DATA_INDICATOR 0x15 /* Indicator */ -#define CARDBUS_MAPREG_MEM_ADDR_MASK 0x0ffffff0 +#define CARDBUS_MAPREG_MEM_ADDR_MASK 0xfffffff0 #define CARDBUS_MAPREG_MEM_ADDR(mr) \ ((mr) & CARDBUS_MAPREG_MEM_ADDR_MASK) #define CARDBUS_MAPREG_MEM_SIZE(mr) \ From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 06:06:23 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20CC2106564A; Mon, 3 Nov 2008 06:06:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0ECAB8FC19; Mon, 3 Nov 2008 06:06:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA366M8I058287; Mon, 3 Nov 2008 06:06:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA366Mlf058286; Mon, 3 Nov 2008 06:06:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811030606.mA366Mlf058286@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Nov 2008 06:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184581 - head/sys/dev/cardbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 06:06:23 -0000 Author: imp Date: Mon Nov 3 06:06:22 2008 New Revision: 184581 URL: http://svn.freebsd.org/changeset/base/184581 Log: Use child (the card) in preference to cbdev (the bridge) when allocating resources to read the CIS. I'm not sure when this changed, but it is totally wrong. Also, add a minor improvement to the debugging. This should help everybody trying to run dumpcis on atheros wireless card as well. MFC after: 2 days Modified: head/sys/dev/cardbus/cardbus_cis.c Modified: head/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- head/sys/dev/cardbus/cardbus_cis.c Mon Nov 3 05:53:10 2008 (r184580) +++ head/sys/dev/cardbus/cardbus_cis.c Mon Nov 3 06:06:22 2008 (r184581) @@ -511,7 +511,7 @@ cardbus_read_tuple_init(device_t cbdev, device_printf(cbdev, "Bad header in rom %d: " "[%x] %04x\n", romnum, imagebase + CARDBUS_EXROM_SIGNATURE, romsig); - bus_release_resource(cbdev, SYS_RES_MEMORY, + bus_release_resource(child, SYS_RES_MEMORY, *rid, res); *rid = 0; return (NULL); @@ -548,7 +548,7 @@ cardbus_read_tuple_init(device_t cbdev, CARDBUS_EXROM_DATA_INDICATOR) & 0x80) != 0) { device_printf(cbdev, "Cannot find CIS in " "Option ROM\n"); - bus_release_resource(cbdev, SYS_RES_MEMORY, + bus_release_resource(child, SYS_RES_MEMORY, *rid, res); *rid = 0; return (NULL); @@ -559,6 +559,8 @@ cardbus_read_tuple_init(device_t cbdev, } else { *start = *start & PCIM_CIS_ADDR_MASK; } + if (cardbus_cis_debug) + device_printf(cbdev, "CIS offset is %#x\n", *start); return (res); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 06:38:00 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B6EC10656A6; Mon, 3 Nov 2008 06:38:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE5E58FC4B; Mon, 3 Nov 2008 06:37:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA36bxHl058961; Mon, 3 Nov 2008 06:37:59 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA36bxRR058960; Mon, 3 Nov 2008 06:37:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811030637.mA36bxRR058960@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Nov 2008 06:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184584 - head/sys/dev/cardbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 06:38:00 -0000 Author: imp Date: Mon Nov 3 06:37:59 2008 New Revision: 184584 URL: http://svn.freebsd.org/changeset/base/184584 Log: Turns out this isn't even used at all... The bogon that I was tracing was in code from my p4 tree, not -current. Delete it here. Modified: head/sys/dev/cardbus/cardbusreg.h Modified: head/sys/dev/cardbus/cardbusreg.h ============================================================================== --- head/sys/dev/cardbus/cardbusreg.h Mon Nov 3 06:26:26 2008 (r184583) +++ head/sys/dev/cardbus/cardbusreg.h Mon Nov 3 06:37:59 2008 (r184584) @@ -44,9 +44,3 @@ #define CARDBUS_EXROM_DATA_DATA_REV 0x12 /* Revision Level of Code/Data */ #define CARDBUS_EXROM_DATA_CODE_TYPE 0x14 /* Code Type */ #define CARDBUS_EXROM_DATA_INDICATOR 0x15 /* Indicator */ - -#define CARDBUS_MAPREG_MEM_ADDR_MASK 0xfffffff0 -#define CARDBUS_MAPREG_MEM_ADDR(mr) \ - ((mr) & CARDBUS_MAPREG_MEM_ADDR_MASK) -#define CARDBUS_MAPREG_MEM_SIZE(mr) \ - (CARDBUS_MAPREG_MEM_ADDR(mr) & (~CARDBUS_MAPREG_MEM_ADDR(mr) + 1)) From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:14:48 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D88E1065675; Mon, 3 Nov 2008 10:14:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D78FB8FC08; Mon, 3 Nov 2008 10:14:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3AElUC062873; Mon, 3 Nov 2008 10:14:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3AElQU062872; Mon, 3 Nov 2008 10:14:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200811031014.mA3AElQU062872@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 3 Nov 2008 10:14:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184586 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 10:14:48 -0000 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); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:22:20 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 851F8106564A; Mon, 3 Nov 2008 10:22:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 731AA8FC12; Mon, 3 Nov 2008 10:22:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3AMKw1064083; Mon, 3 Nov 2008 10:22:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3AMJcI064077; Mon, 3 Nov 2008 10:22:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200811031022.mA3AMJcI064077@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 3 Nov 2008 10:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184587 - in head: include lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 10:22:20 -0000 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.c Mon 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 __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 (0); for (bit = 1; !(mask & 1); bit++) - mask = (unsigned int)mask >> 1; + mask = (unsigned long long)mask >> 1; return (bit); } Copied and modified: head/lib/libc/string/flsll.c (from r184585, head/lib/libc/string/fls.c) ============================================================================== --- head/lib/libc/string/fls.c Mon Nov 3 07:52:18 2008 (r184585, copy source) +++ head/lib/libc/string/flsll.c Mon Nov 3 10:22:19 2008 (r184587) @@ -36,13 +36,13 @@ __FBSDID("$FreeBSD$"); * Find Last Set bit */ int -fls(int mask) +flsll(long long mask) { int bit; if (mask == 0) return (0); for (bit = 1; mask != 1; bit++) - mask = (unsigned int)mask >> 1; + mask = (unsigned long long)mask >> 1; return (bit); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:38:01 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C1601065680; Mon, 3 Nov 2008 10:38:01 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65D1B8FC08; Mon, 3 Nov 2008 10:38:01 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3Ac14Y064409; Mon, 3 Nov 2008 10:38:01 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3Ac0UR064387; Mon, 3 Nov 2008 10:38:00 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811031038.mA3Ac0UR064387@svn.freebsd.org> From: Doug Rabson Date: Mon, 3 Nov 2008 10:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: 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/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 10:38:01 -0000 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 server with the newer RPC implementation originally developed (actually ported from the userland sunrpc code) to support the NFS Lock Manager. I have tested this code extensively and I believe it is stable and that performance is at least equal to the legacy RPC implementation. The NFS code currently contains support for both the new RPC implementation and the older legacy implementation inherited from the original NFS codebase. The default is to use the new implementation - add the NFS_LEGACYRPC option to fall back to the old code. When I merge this support back to RELENG_7, I will probably change this so that users have to 'opt in' to get the new code. To use RPCSEC_GSS on either client or server, you must build a kernel which includes the KGSSAPI option and the crypto device. On the userland side, you must build at least a new libc, mountd, mount_nfs and gssd. You must install new versions of /etc/rc.d/gssd and /etc/rc.d/nfsd and add 'gssd_enable=YES' to /etc/rc.conf. As long as gssd is running, you should be able to mount an NFS filesystem from a server that requires RPCSEC_GSS authentication. The mount itself can happen without any kerberos credentials but all access to the filesystem will be denied unless the accessing user has a valid ticket file in the standard place (/tmp/krb5cc_). There is currently no support for situations where the ticket file is in a different place, such as when the user logged in via SSH and has delegated credentials from that login. This restriction is also present in Solaris and Linux. In theory, we could improve this in future, possibly using Brooks Davis' implementation of variant symlinks. Supporting RPCSEC_GSS on a server is nearly as simple. You must create service creds for the server in the form 'nfs/@' and install them in /etc/krb5.keytab. The standard heimdal utility ktutil makes this fairly easy. After the service creds have been created, you can add a '-sec=krb5' option to /etc/exports and restart both mountd and nfsd. The only other difference an administrator should notice is that nfsd doesn't fork to create service threads any more. In normal operation, there will be two nfsd processes, one in userland waiting for TCP connections and one in the kernel handling requests. The latter process will create as many kthreads as required - these should be visible via 'top -H'. The code has some support for varying the number of service threads according to load but initially at least, nfsd uses a fixed number of threads according to the value supplied to its '-n' option. Sponsored by: Isilon Systems MFC after: 1 month Added: head/etc/rc.d/gssd (contents, props changed) head/sys/kgssapi/ head/sys/kgssapi/gss_accept_sec_context.c (contents, props changed) head/sys/kgssapi/gss_acquire_cred.c (contents, props changed) head/sys/kgssapi/gss_add_oid_set_member.c (contents, props changed) head/sys/kgssapi/gss_canonicalize_name.c (contents, props changed) head/sys/kgssapi/gss_create_empty_oid_set.c (contents, props changed) head/sys/kgssapi/gss_delete_sec_context.c (contents, props changed) head/sys/kgssapi/gss_display_status.c (contents, props changed) head/sys/kgssapi/gss_export_name.c (contents, props changed) head/sys/kgssapi/gss_get_mic.c (contents, props changed) head/sys/kgssapi/gss_impl.c (contents, props changed) head/sys/kgssapi/gss_import_name.c (contents, props changed) head/sys/kgssapi/gss_init_sec_context.c (contents, props changed) head/sys/kgssapi/gss_names.c (contents, props changed) head/sys/kgssapi/gss_pname_to_uid.c (contents, props changed) head/sys/kgssapi/gss_release_buffer.c (contents, props changed) head/sys/kgssapi/gss_release_cred.c (contents, props changed) head/sys/kgssapi/gss_release_name.c (contents, props changed) head/sys/kgssapi/gss_release_oid_set.c (contents, props changed) head/sys/kgssapi/gss_set_cred_option.c (contents, props changed) head/sys/kgssapi/gss_test_oid_set_member.c (contents, props changed) head/sys/kgssapi/gss_unwrap.c (contents, props changed) head/sys/kgssapi/gss_verify_mic.c (contents, props changed) head/sys/kgssapi/gss_wrap.c (contents, props changed) head/sys/kgssapi/gss_wrap_size_limit.c (contents, props changed) head/sys/kgssapi/gssapi.h (contents, props changed) head/sys/kgssapi/gssapi_impl.h (contents, props changed) head/sys/kgssapi/gssd.x (contents, props changed) head/sys/kgssapi/gssd_prot.c (contents, props changed) head/sys/kgssapi/gsstest.c (contents, props changed) head/sys/kgssapi/kgss_if.m (contents, props changed) head/sys/kgssapi/krb5/ head/sys/kgssapi/krb5/kcrypto.c (contents, props changed) head/sys/kgssapi/krb5/kcrypto.h (contents, props changed) head/sys/kgssapi/krb5/kcrypto_aes.c (contents, props changed) head/sys/kgssapi/krb5/kcrypto_arcfour.c (contents, props changed) head/sys/kgssapi/krb5/kcrypto_des.c (contents, props changed) head/sys/kgssapi/krb5/kcrypto_des3.c (contents, props changed) head/sys/kgssapi/krb5/krb5_mech.c (contents, props changed) head/sys/modules/kgssapi/ head/sys/modules/kgssapi/Makefile (contents, props changed) head/sys/modules/kgssapi_krb5/ head/sys/modules/kgssapi_krb5/Makefile (contents, props changed) head/sys/nfsclient/nfs_krpc.c (contents, props changed) head/sys/nfsserver/nfs_fha.c (contents, props changed) head/sys/nfsserver/nfs_fha.h (contents, props changed) head/sys/nfsserver/nfs_srvkrpc.c (contents, props changed) head/sys/rpc/replay.c (contents, props changed) head/sys/rpc/replay.h (contents, props changed) head/sys/rpc/rpcsec_gss/ head/sys/rpc/rpcsec_gss.h (contents, props changed) head/sys/rpc/rpcsec_gss/rpcsec_gss.c (contents, props changed) head/sys/rpc/rpcsec_gss/rpcsec_gss_conf.c (contents, props changed) head/sys/rpc/rpcsec_gss/rpcsec_gss_int.h (contents, props changed) head/sys/rpc/rpcsec_gss/rpcsec_gss_misc.c (contents, props changed) head/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c (contents, props changed) head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c (contents, props changed) head/tools/regression/kgssapi/ head/tools/regression/kgssapi/Makefile (contents, props changed) head/tools/regression/kgssapi/gsstest.c (contents, props changed) head/tools/regression/rpcsec_gss/ head/tools/regression/rpcsec_gss/Makefile (contents, props changed) head/tools/regression/rpcsec_gss/rpctest.c (contents, props changed) head/usr.sbin/gssd/ head/usr.sbin/gssd/Makefile (contents, props changed) head/usr.sbin/gssd/gssd.8 (contents, props changed) head/usr.sbin/gssd/gssd.c (contents, props changed) Modified: head/etc/gss/mech head/etc/rc.d/Makefile head/etc/rc.d/nfsd head/include/rpc/xdr.h head/lib/libc/sys/Symbol.map head/lib/libc/xdr/Symbol.map head/lib/libc/xdr/xdr.c head/lib/librpcsec_gss/svc_rpcsec_gss.c head/sbin/mount_nfs/mount_nfs.c head/sys/compat/freebsd32/syscalls.master head/sys/conf/files head/sys/conf/options head/sys/fs/unionfs/union_vfsops.c head/sys/kern/syscalls.master head/sys/kern/vfs_export.c head/sys/kern/vfs_mount.c head/sys/modules/nfsclient/Makefile head/sys/modules/nfsserver/Makefile head/sys/nfsclient/nfs.h head/sys/nfsclient/nfs_socket.c head/sys/nfsclient/nfs_subs.c head/sys/nfsclient/nfs_vfsops.c head/sys/nfsclient/nfsmount.h head/sys/nfsserver/nfs.h head/sys/nfsserver/nfs_serv.c head/sys/nfsserver/nfs_srvcache.c head/sys/nfsserver/nfs_srvsock.c head/sys/nfsserver/nfs_srvsubs.c head/sys/nfsserver/nfs_syscalls.c head/sys/nfsserver/nfsm_subs.h head/sys/nfsserver/nfsrvcache.h head/sys/nlm/nlm.h head/sys/nlm/nlm_advlock.c head/sys/nlm/nlm_prot_impl.c head/sys/nlm/nlm_prot_svc.c head/sys/rpc/auth.h head/sys/rpc/auth_none.c head/sys/rpc/auth_unix.c head/sys/rpc/clnt.h head/sys/rpc/clnt_dg.c head/sys/rpc/clnt_rc.c head/sys/rpc/clnt_vc.c head/sys/rpc/rpc_com.h head/sys/rpc/rpc_generic.c head/sys/rpc/rpc_msg.h head/sys/rpc/rpc_prot.c head/sys/rpc/svc.c head/sys/rpc/svc.h head/sys/rpc/svc_auth.c head/sys/rpc/svc_auth.h head/sys/rpc/svc_auth_unix.c head/sys/rpc/svc_dg.c head/sys/rpc/svc_generic.c head/sys/rpc/svc_vc.c head/sys/rpc/xdr.h head/sys/sys/mount.h head/sys/xdr/xdr_mbuf.c head/usr.sbin/Makefile head/usr.sbin/mountd/exports.5 head/usr.sbin/mountd/mountd.c head/usr.sbin/nfsd/nfsd.c Modified: head/etc/gss/mech ============================================================================== --- head/etc/gss/mech Mon Nov 3 10:22:19 2008 (r184587) +++ head/etc/gss/mech Mon Nov 3 10:38:00 2008 (r184588) @@ -1,6 +1,6 @@ # $FreeBSD$ # # Name OID Library name Kernel module -kerberosv5 1.2.840.113554.1.2.2 /usr/lib/libgssapi_krb5.so.10 - +kerberosv5 1.2.840.113554.1.2.2 /usr/lib/libgssapi_krb5.so.10 kgssapi_krb5 spnego 1.3.6.1.5.5.2 /usr/lib/libgssapi_spnego.so.10 - #ntlm 1.3.6.1.4.1.311.2.2.10 /usr/lib/libgssapi_ntlm.so.10 - Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Mon Nov 3 10:22:19 2008 (r184587) +++ head/etc/rc.d/Makefile Mon Nov 3 10:38:00 2008 (r184588) @@ -11,7 +11,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI dmesg dumpon \ early.sh encswap \ fsck ftp-proxy ftpd \ - gbde geli geli2 \ + gbde geli geli2 gssd \ hcsecd \ hostapd hostid hostname \ idmapd inetd initrandom \ Added: head/etc/rc.d/gssd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/gssd Mon Nov 3 10:38:00 2008 (r184588) @@ -0,0 +1,18 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: gssd +# REQUIRE: root +# KEYWORD: nojail shutdown + +. /etc/rc.subr + +name="gssd" + +load_rc_config $name +rcvar="gssd_enable" +command="${gssd:-/usr/sbin/${name}}" +eval ${name}_flags=\"${gssd_flags}\" +run_rc_command "$1" Modified: head/etc/rc.d/nfsd ============================================================================== --- head/etc/rc.d/nfsd Mon Nov 3 10:22:19 2008 (r184587) +++ head/etc/rc.d/nfsd Mon Nov 3 10:38:00 2008 (r184588) @@ -4,7 +4,7 @@ # # PROVIDE: nfsd -# REQUIRE: mountd +# REQUIRE: mountd hostname gssd # KEYWORD: nojail shutdown . /etc/rc.subr Modified: head/include/rpc/xdr.h ============================================================================== --- head/include/rpc/xdr.h Mon Nov 3 10:22:19 2008 (r184587) +++ head/include/rpc/xdr.h Mon Nov 3 10:38:00 2008 (r184588) @@ -294,10 +294,13 @@ extern bool_t xdr_short(XDR *, short *); extern bool_t xdr_u_short(XDR *, u_short *); extern bool_t xdr_int16_t(XDR *, int16_t *); extern bool_t xdr_u_int16_t(XDR *, u_int16_t *); +extern bool_t xdr_uint16_t(XDR *, u_int16_t *); extern bool_t xdr_int32_t(XDR *, int32_t *); extern bool_t xdr_u_int32_t(XDR *, u_int32_t *); +extern bool_t xdr_uint32_t(XDR *, u_int32_t *); extern bool_t xdr_int64_t(XDR *, int64_t *); extern bool_t xdr_u_int64_t(XDR *, u_int64_t *); +extern bool_t xdr_uint64_t(XDR *, u_int64_t *); extern bool_t xdr_bool(XDR *, bool_t *); extern bool_t xdr_enum(XDR *, enum_t *); extern bool_t xdr_array(XDR *, char **, u_int *, u_int, u_int, xdrproc_t); Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Mon Nov 3 10:22:19 2008 (r184587) +++ head/lib/libc/sys/Symbol.map Mon Nov 3 10:38:00 2008 (r184588) @@ -982,4 +982,5 @@ FBSDprivate_1.0 { __sys_writev; __error_unthreaded; nlm_syscall; + gssd_syscall; }; Modified: head/lib/libc/xdr/Symbol.map ============================================================================== --- head/lib/libc/xdr/Symbol.map Mon Nov 3 10:22:19 2008 (r184587) +++ head/lib/libc/xdr/Symbol.map Mon Nov 3 10:38:00 2008 (r184588) @@ -45,3 +45,9 @@ FBSD_1.0 { /* xdr_sizeof; */ /* Why is xdr_sizeof.c not included in Makefileinc? */ xdrstdio_create; }; + +FBSD_1.1 { + xdr_uint16_t; + xdr_uint32_t; + xdr_uint64_t; +}; Modified: head/lib/libc/xdr/xdr.c ============================================================================== --- head/lib/libc/xdr/xdr.c Mon Nov 3 10:22:19 2008 (r184587) +++ head/lib/libc/xdr/xdr.c Mon Nov 3 10:38:00 2008 (r184588) @@ -263,6 +263,36 @@ xdr_u_int32_t(xdrs, u_int32_p) return (FALSE); } +/* + * XDR unsigned 32-bit integers + * same as xdr_int32_t - open coded to save a proc call! + */ +bool_t +xdr_uint32_t(xdrs, u_int32_p) + XDR *xdrs; + uint32_t *u_int32_p; +{ + u_long l; + + switch (xdrs->x_op) { + + case XDR_ENCODE: + l = (u_long) *u_int32_p; + return (XDR_PUTLONG(xdrs, (long *)&l)); + + case XDR_DECODE: + if (!XDR_GETLONG(xdrs, (long *)&l)) { + return (FALSE); + } + *u_int32_p = (u_int32_t) l; + return (TRUE); + + case XDR_FREE: + return (TRUE); + } + /* NOTREACHED */ + return (FALSE); +} /* * XDR short integers @@ -385,6 +415,36 @@ xdr_u_int16_t(xdrs, u_int16_p) return (FALSE); } +/* + * XDR unsigned 16-bit integers + */ +bool_t +xdr_uint16_t(xdrs, u_int16_p) + XDR *xdrs; + uint16_t *u_int16_p; +{ + u_long l; + + switch (xdrs->x_op) { + + case XDR_ENCODE: + l = (u_long) *u_int16_p; + return (XDR_PUTLONG(xdrs, (long *)&l)); + + case XDR_DECODE: + if (!XDR_GETLONG(xdrs, (long *)&l)) { + return (FALSE); + } + *u_int16_p = (u_int16_t) l; + return (TRUE); + + case XDR_FREE: + return (TRUE); + } + /* NOTREACHED */ + return (FALSE); +} + /* * XDR a char @@ -806,6 +866,38 @@ xdr_u_int64_t(xdrs, ullp) return (FALSE); } +/* + * XDR unsigned 64-bit integers + */ +bool_t +xdr_uint64_t(xdrs, ullp) + XDR *xdrs; + uint64_t *ullp; +{ + u_long ul[2]; + + switch (xdrs->x_op) { + case XDR_ENCODE: + ul[0] = (u_long)(*ullp >> 32) & 0xffffffff; + ul[1] = (u_long)(*ullp) & 0xffffffff; + if (XDR_PUTLONG(xdrs, (long *)&ul[0]) == FALSE) + return (FALSE); + return (XDR_PUTLONG(xdrs, (long *)&ul[1])); + case XDR_DECODE: + if (XDR_GETLONG(xdrs, (long *)&ul[0]) == FALSE) + return (FALSE); + if (XDR_GETLONG(xdrs, (long *)&ul[1]) == FALSE) + return (FALSE); + *ullp = (u_int64_t) + (((u_int64_t)ul[0] << 32) | ((u_int64_t)ul[1])); + return (TRUE); + case XDR_FREE: + return (TRUE); + } + /* NOTREACHED */ + return (FALSE); +} + /* * XDR hypers Modified: head/lib/librpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/lib/librpcsec_gss/svc_rpcsec_gss.c Mon Nov 3 10:22:19 2008 (r184587) +++ head/lib/librpcsec_gss/svc_rpcsec_gss.c Mon Nov 3 10:38:00 2008 (r184588) @@ -168,7 +168,7 @@ rpc_gss_set_callback(rpc_gss_callback_t { struct svc_rpc_gss_callback *scb; - scb = malloc(sizeof(struct svc_rpc_gss_callback)); + scb = mem_alloc(sizeof(struct svc_rpc_gss_callback)); if (!scb) { _rpc_gss_set_error(RPC_GSS_ER_SYSTEMERROR, ENOMEM); return (FALSE); @@ -255,7 +255,7 @@ rpc_gss_get_principal_name(rpc_gss_princ namelen += strlen(domain) + 1; } - buf.value = malloc(namelen); + buf.value = mem_alloc(namelen); buf.length = namelen; strcpy((char *) buf.value, name); if (node) { @@ -273,7 +273,7 @@ rpc_gss_get_principal_name(rpc_gss_princ */ maj_stat = gss_import_name(&min_stat, &buf, GSS_C_NT_USER_NAME, &gss_name); - free(buf.value); + mem_free(buf.value, buf.length); if (maj_stat != GSS_S_COMPLETE) { log_status("gss_import_name", mech_oid, maj_stat, min_stat); return (FALSE); @@ -300,7 +300,7 @@ rpc_gss_get_principal_name(rpc_gss_princ } gss_release_name(&min_stat, &gss_mech_name); - result = malloc(sizeof(int) + buf.length); + result = mem_alloc(sizeof(int) + buf.length); if (!result) { gss_release_buffer(&min_stat, &buf); return (FALSE); @@ -443,7 +443,9 @@ svc_rpc_gss_destroy_client(struct svc_rp gss_release_name(&min_stat, &client->cl_cname); if (client->cl_rawcred.client_principal) - free(client->cl_rawcred.client_principal); + mem_free(client->cl_rawcred.client_principal, + sizeof(*client->cl_rawcred.client_principal) + + client->cl_rawcred.client_principal->len); if (client->cl_verf.value) gss_release_buffer(&min_stat, &client->cl_verf); @@ -527,7 +529,7 @@ gss_oid_to_str(OM_uint32 *minor_status, * here for "{ " and "}\0". */ string_length += 4; - if ((bp = (char *) malloc(string_length))) { + if ((bp = (char *) mem_alloc(string_length))) { strcpy(bp, "{ "); number = (unsigned long) cp[0]; sprintf(numstr, "%ld ", number/40); @@ -634,8 +636,15 @@ svc_rpc_gss_accept_sec_context(struct sv client->cl_sname = sname; break; } + client->cl_sname = sname; + break; } } + if (!sname) { + xdr_free((xdrproc_t) xdr_gss_buffer_desc, + (char *) &recv_tok); + return (FALSE); + } } else { gr->gr_major = gss_accept_sec_context( &gr->gr_minor, @@ -663,11 +672,11 @@ svc_rpc_gss_accept_sec_context(struct sv log_status("accept_sec_context", client->cl_mech, gr->gr_major, gr->gr_minor); client->cl_state = CLIENT_STALE; - return (FALSE); + return (TRUE); } gr->gr_handle.value = &client->cl_id; - gr->gr_handle.length = sizeof(uint32_t); + gr->gr_handle.length = sizeof(client->cl_id); gr->gr_win = SVC_RPC_GSS_SEQWINDOW; /* Save client info. */ @@ -703,7 +712,7 @@ svc_rpc_gss_accept_sec_context(struct sv return (FALSE); } client->cl_rawcred.client_principal = - malloc(sizeof(*client->cl_rawcred.client_principal) + mem_alloc(sizeof(*client->cl_rawcred.client_principal) + export_name.length); client->cl_rawcred.client_principal->len = export_name.length; memcpy(client->cl_rawcred.client_principal->name, @@ -718,6 +727,7 @@ svc_rpc_gss_accept_sec_context(struct sv * kerberos5, this uses krb5_aname_to_localname. */ svc_rpc_gss_build_ucred(client, client->cl_cname); + gss_release_name(&min_stat, &client->cl_cname); #ifdef DEBUG { @@ -892,13 +902,12 @@ svc_rpc_gss_check_replay(struct svc_rpc_ * discard it. */ offset = client->cl_seqlast - seq; - if (offset >= client->cl_win) + if (offset >= SVC_RPC_GSS_SEQWINDOW) return (FALSE); word = offset / 32; bit = offset % 32; if (client->cl_seqmask[word] & (1 << bit)) return (FALSE); - client->cl_seqmask[word] |= (1 << bit); } return (TRUE); @@ -907,7 +916,7 @@ svc_rpc_gss_check_replay(struct svc_rpc_ static void svc_rpc_gss_update_seq(struct svc_rpc_gss_client *client, uint32_t seq) { - int offset, i; + int offset, i, word, bit; uint32_t carry, newcarry; if (seq > client->cl_seqlast) { @@ -936,7 +945,13 @@ svc_rpc_gss_update_seq(struct svc_rpc_gs } client->cl_seqmask[0] |= 1; client->cl_seqlast = seq; + } else { + offset = client->cl_seqlast - seq; + word = offset / 32; + bit = offset % 32; + client->cl_seqmask[word] |= (1 << bit); } + } enum auth_stat @@ -983,6 +998,10 @@ svc_rpc_gss(struct svc_req *rqst, struct /* Check the proc and find the client (or create it) */ if (gc.gc_proc == RPCSEC_GSS_INIT) { + if (gc.gc_handle.length != 0) { + result = AUTH_BADCRED; + goto out; + } client = svc_rpc_gss_create_client(); } else { if (gc.gc_handle.length != sizeof(uint32_t)) { Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Mon Nov 3 10:22:19 2008 (r184587) +++ head/sbin/mount_nfs/mount_nfs.c Mon Nov 3 10:38:00 2008 (r184588) @@ -134,6 +134,7 @@ struct sockaddr *addr; int addrlen = 0; u_char *fh = NULL; int fhsize = 0; +int secflavor = -1; enum mountmode { ANY, @@ -151,6 +152,8 @@ enum tryret { }; int fallback_mount(struct iovec *iov, int iovlen, int mntflags); +int sec_name_to_num(char *sec); +char *sec_num_to_name(int num); int getnfsargs(char *, struct iovec **iov, int *iovlen); int getnfs4args(char *, struct iovec **iov, int *iovlen); /* void set_rpc_maxgrouplist(int); */ @@ -308,6 +311,21 @@ main(int argc, char *argv[]) atoi(val)); if (portspec == NULL) err(1, "asprintf"); + } else if (strcmp(opt, "sec") == 0) { + /* + * Don't add this option to + * the iovec yet - we will + * negotiate which sec flavor + * to use with the remote + * mountd. + */ + pass_flag_to_nmount=0; + secflavor = sec_name_to_num(val); + if (secflavor < 0) { + errx(1, + "illegal sec value -- %s", + val); + } } else if (strcmp(opt, "retrycnt") == 0) { pass_flag_to_nmount=0; num = strtol(val, &p, 10); @@ -635,6 +653,36 @@ fallback_mount(struct iovec *iov, int io } int +sec_name_to_num(char *sec) +{ + if (!strcmp(sec, "krb5")) + return (RPCSEC_GSS_KRB5); + if (!strcmp(sec, "krb5i")) + return (RPCSEC_GSS_KRB5I); + if (!strcmp(sec, "krb5p")) + return (RPCSEC_GSS_KRB5P); + if (!strcmp(sec, "sys")) + return (AUTH_SYS); + return (-1); +} + +char * +sec_num_to_name(int flavor) +{ + switch (flavor) { + case RPCSEC_GSS_KRB5: + return ("krb5"); + case RPCSEC_GSS_KRB5I: + return ("krb5i"); + case RPCSEC_GSS_KRB5P: + return ("krb5p"); + case AUTH_SYS: + return ("sys"); + } + return (NULL); +} + +int getnfsargs(char *spec, struct iovec **iov, int *iovlen) { struct addrinfo hints, *ai_nfs, *ai; @@ -904,6 +952,7 @@ nfs_tryproto(struct addrinfo *ai, char * CLIENT *clp; struct netconfig *nconf, *nconf_mnt; const char *netid, *netid_mnt; + char *secname; int doconnect, nfsvers, mntvers, sotype; enum clnt_stat stat; enum mountmode trymntmode; @@ -1033,7 +1082,7 @@ tryagain: &rpc_createerr.cf_error)); } clp->cl_auth = authsys_create_default(); - nfhret.auth = -1; + nfhret.auth = secflavor; nfhret.vers = mntvers; stat = clnt_call(clp, RPCMNT_MOUNT, (xdrproc_t)xdr_dir, spec, (xdrproc_t)xdr_fh, &nfhret, @@ -1074,6 +1123,9 @@ tryagain: build_iovec(iov, iovlen, "addr", addr, addrlen); build_iovec(iov, iovlen, "fh", fh, fhsize); + secname = sec_num_to_name(nfhret.auth); + if (secname) + build_iovec(iov, iovlen, "sec", secname, (size_t)-1); if (nfsvers == 3) build_iovec(iov, iovlen, "nfsv3", NULL, 0); Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Mon Nov 3 10:22:19 2008 (r184587) +++ head/sys/compat/freebsd32/syscalls.master Mon Nov 3 10:38:00 2008 (r184588) @@ -854,3 +854,5 @@ 503 AUE_UNLINKAT NOPROTO { int unlinkat(int fd, char *path, \ int flag); } 504 AUE_POSIX_OPENPT NOPROTO { int posix_openpt(int flags); } +; 505 is initialised by the kgssapi code, if present. +505 AUE_NULL UNIMPL gssd_syscall Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Nov 3 10:22:19 2008 (r184587) +++ head/sys/conf/files Mon Nov 3 10:38:00 2008 (r184588) @@ -339,7 +339,7 @@ crypto/camellia/camellia.c optional cryp crypto/camellia/camellia-api.c optional crypto | ipsec crypto/des/des_ecb.c optional crypto | ipsec | netsmb crypto/des/des_setkey.c optional crypto | ipsec | netsmb -crypto/rc4/rc4.c optional netgraph_mppc_encryption +crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi crypto/rijndael/rijndael-alg-fst.c optional crypto | geom_bde | \ ipsec | random | wlan_ccmp crypto/rijndael/rijndael-api-fst.c optional geom_bde | random @@ -1746,6 +1746,56 @@ kern/vfs_subr.c standard kern/vfs_syscalls.c standard kern/vfs_vnops.c standard # +# Kernel GSS-API +# +gssd.h optional kgssapi \ + dependency "$S/kgssapi/gssd.x" \ + compile-with "rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h" \ + no-obj no-implicit-rule before-depend local \ + clean "gssd.h" +gssd_xdr.c optional kgssapi \ + dependency "$S/kgssapi/gssd.x gssd.h" \ + compile-with "rpcgen -c $S/kgssapi/gssd.x -o gssd_xdr.c" \ + no-implicit-rule before-depend local \ + clean "gssd_xdr.c" +gssd_clnt.c optional kgssapi \ + dependency "$S/kgssapi/gssd.x gssd.h" \ + compile-with "rpcgen -lM $S/kgssapi/gssd.x | grep -v string.h > gssd_clnt.c" \ + no-implicit-rule before-depend local \ + clean "gssd_clnt.c" +kgssapi/gss_accept_sec_context.c optional kgssapi +kgssapi/gss_add_oid_set_member.c optional kgssapi +kgssapi/gss_acquire_cred.c optional kgssapi +kgssapi/gss_canonicalize_name.c optional kgssapi +kgssapi/gss_create_empty_oid_set.c optional kgssapi +kgssapi/gss_delete_sec_context.c optional kgssapi +kgssapi/gss_display_status.c optional kgssapi +kgssapi/gss_export_name.c optional kgssapi +kgssapi/gss_get_mic.c optional kgssapi +kgssapi/gss_init_sec_context.c optional kgssapi +kgssapi/gss_impl.c optional kgssapi +kgssapi/gss_import_name.c optional kgssapi +kgssapi/gss_names.c optional kgssapi +kgssapi/gss_pname_to_uid.c optional kgssapi +kgssapi/gss_release_buffer.c optional kgssapi +kgssapi/gss_release_cred.c optional kgssapi +kgssapi/gss_release_name.c optional kgssapi +kgssapi/gss_release_oid_set.c optional kgssapi +kgssapi/gss_set_cred_option.c optional kgssapi +kgssapi/gss_test_oid_set_member.c optional kgssapi +kgssapi/gss_unwrap.c optional kgssapi +kgssapi/gss_verify_mic.c optional kgssapi +kgssapi/gss_wrap.c optional kgssapi +kgssapi/gss_wrap_size_limit.c optional kgssapi +kgssapi/gssd_prot.c optional kgssapi +kgssapi/krb5/krb5_mech.c optional kgssapi +kgssapi/krb5/kcrypto.c optional kgssapi +kgssapi/krb5/kcrypto_aes.c optional kgssapi +kgssapi/krb5/kcrypto_arcfour.c optional kgssapi +kgssapi/krb5/kcrypto_des.c optional kgssapi +kgssapi/krb5/kcrypto_des3.c optional kgssapi +kgssapi/kgss_if.m optional kgssapi +kgssapi/gsstest.c optional kgssapi_debug # These files in libkern/ are those needed by all architectures. Some # of the files in libkern/ are only needed on some architectures, e.g., # libkern/divdi3.c is needed by i386 but not alpha. Also, some of these @@ -2106,18 +2156,21 @@ nfsclient/krpc_subr.c optional bootp nf nfsclient/nfs_bio.c optional nfsclient nfsclient/nfs_diskless.c optional nfsclient nfs_root nfsclient/nfs_node.c optional nfsclient -nfsclient/nfs_socket.c optional nfsclient +nfsclient/nfs_socket.c optional nfsclient nfs_legacyrpc +nfsclient/nfs_krpc.c optional nfsclient nfsclient/nfs_subs.c optional nfsclient nfsclient/nfs_nfsiod.c optional nfsclient nfsclient/nfs_vfsops.c optional nfsclient nfsclient/nfs_vnops.c optional nfsclient nfsclient/nfs_lock.c optional nfsclient +nfsserver/nfs_fha.c optional nfsserver nfsserver/nfs_serv.c optional nfsserver -nfsserver/nfs_srvsock.c optional nfsserver -nfsserver/nfs_srvcache.c optional nfsserver +nfsserver/nfs_srvkrpc.c optional nfsserver +nfsserver/nfs_srvsock.c optional nfsserver nfs_legacyrpc +nfsserver/nfs_srvcache.c optional nfsserver nfs_legacyrpc nfsserver/nfs_srvsubs.c optional nfsserver -nfsserver/nfs_syscalls.c optional nfsserver -nlm/nlm_advlock.c optional nfslockd +nfsserver/nfs_syscalls.c optional nfsserver nfs_legacyrpc +nlm/nlm_advlock.c optional nfslockd nfsclient nlm/nlm_prot_clnt.c optional nfslockd nlm/nlm_prot_impl.c optional nfslockd nlm/nlm_prot_server.c optional nfslockd @@ -2143,27 +2196,33 @@ pci/intpm.c optional intpm pci pci/ncr.c optional ncr pci pci/nfsmb.c optional nfsmb pci pci/viapm.c optional viapm pci -rpc/auth_none.c optional krpc | nfslockd -rpc/auth_unix.c optional krpc | nfslockd -rpc/authunix_prot.c optional krpc | nfslockd -rpc/clnt_dg.c optional krpc | nfslockd -rpc/clnt_rc.c optional krpc | nfslockd -rpc/clnt_vc.c optional krpc | nfslockd -rpc/getnetconfig.c optional krpc | nfslockd -rpc/inet_ntop.c optional krpc | nfslockd -rpc/inet_pton.c optional krpc | nfslockd -rpc/rpc_callmsg.c optional krpc | nfslockd -rpc/rpc_generic.c optional krpc | nfslockd -rpc/rpc_prot.c optional krpc | nfslockd -rpc/rpcb_clnt.c optional krpc | nfslockd -rpc/rpcb_prot.c optional krpc | nfslockd +rpc/auth_none.c optional krpc | nfslockd | nfsclient | nfsserver +rpc/auth_unix.c optional krpc | nfslockd | nfsclient +rpc/authunix_prot.c optional krpc | nfslockd | nfsclient | nfsserver +rpc/clnt_dg.c optional krpc | nfslockd | nfsclient +rpc/clnt_rc.c optional krpc | nfslockd | nfsclient +rpc/clnt_vc.c optional krpc | nfslockd | nfsclient | nfsserver +rpc/getnetconfig.c optional krpc | nfslockd | nfsclient | nfsserver +rpc/inet_ntop.c optional krpc | nfslockd | nfsclient | nfsserver +rpc/inet_pton.c optional krpc | nfslockd | nfsclient | nfsserver +rpc/replay.c optional krpc | nfslockd | nfsserver +rpc/rpc_callmsg.c optional krpc | nfslockd | nfsclient | nfsserver +rpc/rpc_generic.c optional krpc | nfslockd | nfsclient | nfsserver +rpc/rpc_prot.c optional krpc | nfslockd | nfsclient | nfsserver +rpc/rpcb_clnt.c optional krpc | nfslockd | nfsclient | nfsserver +rpc/rpcb_prot.c optional krpc | nfslockd | nfsclient | nfsserver rpc/rpcclnt.c optional nfsclient -rpc/svc.c optional krpc | nfslockd -rpc/svc_auth.c optional krpc | nfslockd -rpc/svc_auth_unix.c optional krpc | nfslockd -rpc/svc_dg.c optional krpc | nfslockd -rpc/svc_generic.c optional krpc | nfslockd -rpc/svc_vc.c optional krpc | nfslockd +rpc/svc.c optional krpc | nfslockd | nfsserver +rpc/svc_auth.c optional krpc | nfslockd | nfsserver +rpc/svc_auth_unix.c optional krpc | nfslockd | nfsserver +rpc/svc_dg.c optional krpc | nfslockd | nfsserver +rpc/svc_generic.c optional krpc | nfslockd | nfsserver +rpc/svc_vc.c optional krpc | nfslockd | nfsserver +rpc/rpcsec_gss/rpcsec_gss.c optional krpc kgssapi | nfslockd kgssapi +rpc/rpcsec_gss/rpcsec_gss_conf.c optional krpc kgssapi | nfslockd kgssapi +rpc/rpcsec_gss/rpcsec_gss_misc.c optional krpc kgssapi | nfslockd kgssapi +rpc/rpcsec_gss/rpcsec_gss_prot.c optional krpc kgssapi | nfslockd kgssapi +rpc/rpcsec_gss/svc_rpcsec_gss.c optional krpc kgssapi | nfslockd kgssapi security/audit/audit.c optional audit security/audit/audit_arg.c optional audit security/audit/audit_bsm.c optional audit @@ -2251,12 +2310,12 @@ vm/vm_reserv.c standard vm/vm_unix.c standard vm/vm_zeroidle.c standard vm/vnode_pager.c standard -xdr/xdr.c optional krpc | nfslockd -xdr/xdr_array.c optional krpc | nfslockd -xdr/xdr_mbuf.c optional krpc | nfslockd -xdr/xdr_mem.c optional krpc | nfslockd -xdr/xdr_reference.c optional krpc | nfslockd -xdr/xdr_sizeof.c optional krpc | nfslockd +xdr/xdr.c optional krpc | nfslockd | nfsclient | nfsserver +xdr/xdr_array.c optional krpc | nfslockd | nfsclient | nfsserver +xdr/xdr_mbuf.c optional krpc | nfslockd | nfsclient | nfsserver +xdr/xdr_mem.c optional krpc | nfslockd | nfsclient | nfsserver +xdr/xdr_reference.c optional krpc | nfslockd | nfsclient | nfsserver +xdr/xdr_sizeof.c optional krpc | nfslockd | nfsclient | nfsserver # gnu/fs/xfs/xfs_alloc.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" \ Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Nov 3 10:22:19 2008 (r184587) +++ head/sys/conf/options Mon Nov 3 10:38:00 2008 (r184588) @@ -214,6 +214,10 @@ PSEUDOFS_TRACE opt_pseudofs.h # Broken - ffs_snapshot() dependency from ufs_lookup() :-( FFS opt_ffs_broken_fixme.h +# In-kernel GSS-API +KGSSAPI opt_kgssapi.h +KGSSAPI_DEBUG opt_kgssapi.h + # These static filesystems have one slightly bogus static dependency in # sys/i386/i386/autoconf.c. If any of these filesystems are # statically compiled into the kernel, code for mounting them as root @@ -222,6 +226,11 @@ NFSCLIENT opt_nfs.h NFSSERVER opt_nfs.h NFS4CLIENT opt_nfs.h +# Use this option to compile both NFS client and server using the +# legacy RPC implementation instead of the newer KRPC system (which +# supports modern features such as RPCSEC_GSS +NFS_LEGACYRPC opt_nfs.h + # filesystems and libiconv bridge CD9660_ICONV opt_dontuse.h MSDOSFS_ICONV opt_dontuse.h Modified: head/sys/fs/unionfs/union_vfsops.c ============================================================================== --- head/sys/fs/unionfs/union_vfsops.c Mon Nov 3 10:22:19 2008 (r184587) +++ head/sys/fs/unionfs/union_vfsops.c Mon Nov 3 10:38:00 2008 (r184588) @@ -521,7 +521,7 @@ unionfs_fhtovp(struct mount *mp, struct static int unionfs_checkexp(struct mount *mp, struct sockaddr *nam, int *extflagsp, - struct ucred **credanonp) + struct ucred **credanonp, int *numsecflavors, int **secflavors) { return (EOPNOTSUPP); } Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Mon Nov 3 10:22:19 2008 (r184587) +++ head/sys/kern/syscalls.master Mon Nov 3 10:38:00 2008 (r184588) @@ -895,5 +895,7 @@ char *path2); } 503 AUE_UNLINKAT STD { int unlinkat(int fd, char *path, int flag); } 504 AUE_POSIX_OPENPT STD { int posix_openpt(int flags); } +; 505 is initialised by the kgssapi code, if present. +505 AUE_NULL NOSTD { int gssd_syscall(char *path); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Mon Nov 3 10:22:19 2008 (r184587) +++ head/sys/kern/vfs_export.c Mon Nov 3 10:38:00 2008 (r184588) @@ -68,6 +68,8 @@ struct netcred { struct radix_node netc_rnodes[2]; int netc_exflags; struct ucred netc_anon; + int netc_numsecflavors; + int netc_secflavors[MAXSECFLAVORS]; }; /* @@ -120,6 +122,9 @@ vfs_hang_addrlist(struct mount *mp, stru np->netc_anon.cr_ngroups = argp->ex_anon.cr_ngroups; bcopy(argp->ex_anon.cr_groups, np->netc_anon.cr_groups, sizeof(np->netc_anon.cr_groups)); + np->netc_numsecflavors = argp->ex_numsecflavors; + bcopy(argp->ex_secflavors, np->netc_secflavors, + sizeof(np->netc_secflavors)); refcount_init(&np->netc_anon.cr_ref, 1); MNT_ILOCK(mp); mp->mnt_flag |= MNT_DEFEXPORTED; @@ -203,6 +208,9 @@ vfs_hang_addrlist(struct mount *mp, stru np->netc_anon.cr_ngroups = argp->ex_anon.cr_ngroups; bcopy(argp->ex_anon.cr_groups, np->netc_anon.cr_groups, sizeof(np->netc_anon.cr_groups)); + np->netc_numsecflavors = argp->ex_numsecflavors; + bcopy(argp->ex_secflavors, np->netc_secflavors, + sizeof(np->netc_secflavors)); refcount_init(&np->netc_anon.cr_ref, 1); return (0); out: @@ -253,6 +261,10 @@ vfs_export(struct mount *mp, struct expo struct netexport *nep; int error; + if (argp->ex_numsecflavors < 0 + || argp->ex_numsecflavors >= MAXSECFLAVORS) + return (EINVAL); + nep = mp->mnt_export; error = 0; lockmgr(&mp->mnt_explock, LK_EXCLUSIVE, NULL); @@ -441,7 +453,7 @@ vfs_export_lookup(struct mount *mp, stru int vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam, int *extflagsp, - struct ucred **credanonp) + struct ucred **credanonp, int *numsecflavors, int **secflavors) { struct netcred *np; @@ -452,6 +464,10 @@ vfs_stdcheckexp(struct mount *mp, struct return (EACCES); *extflagsp = np->netc_exflags; *credanonp = &np->netc_anon; + if (numsecflavors) + *numsecflavors = np->netc_numsecflavors; + if (secflavors) + *secflavors = np->netc_secflavors; return (0); } Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Mon Nov 3 10:22:19 2008 (r184587) +++ head/sys/kern/vfs_mount.c Mon Nov 3 10:38:00 2008 (r184588) @@ -827,6 +827,7 @@ vfs_domount( struct vnode *vp; struct mount *mp; struct vfsconf *vfsp; + struct oexport_args oexport; struct export_args export; int error, flag = 0; struct vattr va; @@ -1010,6 +1011,19 @@ vfs_domount( if (vfs_copyopt(mp->mnt_optnew, "export", &export, sizeof(export)) == 0) error = vfs_export(mp, &export); + else if (vfs_copyopt(mp->mnt_optnew, "export", &oexport, + sizeof(oexport)) == 0) { + export.ex_flags = oexport.ex_flags; + export.ex_root = oexport.ex_root; + export.ex_anon = oexport.ex_anon; + export.ex_addr = oexport.ex_addr; + export.ex_addrlen = oexport.ex_addrlen; + export.ex_mask = oexport.ex_mask; + export.ex_masklen = oexport.ex_masklen; + export.ex_indexfile = oexport.ex_indexfile; + export.ex_numsecflavors = 0; + error = vfs_export(mp, &export); + } } if (!error) { Added: head/sys/kgssapi/gss_accept_sec_context.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kgssapi/gss_accept_sec_context.c Mon Nov 3 10:38:00 2008 (r184588) @@ -0,0 +1,138 @@ +/*- + * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ + * Authors: Doug Rabson + * Developed with Red Inc: Alfred Perlstein + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include + +#include "gssd.h" +#include "kgss_if.h" + +OM_uint32 gss_accept_sec_context(OM_uint32 *minor_status, + gss_ctx_id_t *context_handle, + const gss_cred_id_t acceptor_cred_handle, + const gss_buffer_t input_token, + const gss_channel_bindings_t input_chan_bindings, + gss_name_t *src_name, + gss_OID *mech_type, + gss_buffer_t output_token, + OM_uint32 *ret_flags, + OM_uint32 *time_rec, + gss_cred_id_t *delegated_cred_handle) +{ + struct accept_sec_context_res res; + struct accept_sec_context_args args; + enum clnt_stat stat; + gss_ctx_id_t ctx = *context_handle; + gss_name_t name; + gss_cred_id_t cred; + + if (!kgss_gssd_handle) + return (GSS_S_FAILURE); + + if (ctx) + args.ctx = ctx->handle; + else + args.ctx = 0; + if (acceptor_cred_handle) + args.cred = acceptor_cred_handle->handle; + else + args.cred = 0; + args.input_token = *input_token; + args.input_chan_bindings = input_chan_bindings; + + bzero(&res, sizeof(res)); + stat = gssd_accept_sec_context_1(&args, &res, kgss_gssd_handle); + if (stat != RPC_SUCCESS) { + *minor_status = stat; + return (GSS_S_FAILURE); + } + + if (res.major_status != GSS_S_COMPLETE + && res.major_status != GSS_S_CONTINUE_NEEDED) { + *minor_status = res.minor_status; + xdr_free((xdrproc_t) xdr_accept_sec_context_res, &res); + return (res.major_status); + } + + *minor_status = res.minor_status; + + if (!ctx) { + ctx = kgss_create_context(res.mech_type); + if (!ctx) { + xdr_free((xdrproc_t) xdr_accept_sec_context_res, &res); + *minor_status = 0; + return (GSS_S_BAD_MECH); + } + } + *context_handle = ctx; + + ctx->handle = res.ctx; + name = malloc(sizeof(struct _gss_name_t), M_GSSAPI, M_WAITOK); + name->handle = res.src_name; + if (src_name) { + *src_name = name; + } else { + OM_uint32 junk; + gss_release_name(&junk, &name); + } + if (mech_type) + *mech_type = KGSS_MECH_TYPE(ctx); + kgss_copy_buffer(&res.output_token, output_token); + if (ret_flags) + *ret_flags = res.ret_flags; + if (time_rec) + *time_rec = res.time_rec; + cred = malloc(sizeof(struct _gss_cred_id_t), M_GSSAPI, M_WAITOK); + cred->handle = res.delegated_cred_handle; + if (delegated_cred_handle) { + *delegated_cred_handle = cred; + } else { + OM_uint32 junk; + gss_release_cred(&junk, &cred); + } + + xdr_free((xdrproc_t) xdr_accept_sec_context_res, &res); + + /* + * If the context establishment is complete, export it from + * userland and hand the result (which includes key material + * etc.) to the kernel implementation. + */ + if (res.major_status == GSS_S_COMPLETE) + res.major_status = kgss_transfer_context(ctx); + + return (res.major_status); +} Added: head/sys/kgssapi/gss_acquire_cred.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kgssapi/gss_acquire_cred.c Mon Nov 3 10:38:00 2008 (r184588) @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ + * Authors: Doug Rabson + * Developed with Red Inc: Alfred Perlstein + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include + +#include "gssd.h" + +OM_uint32 +gss_acquire_cred(OM_uint32 *minor_status, + const gss_name_t desired_name, + OM_uint32 time_req, + const gss_OID_set desired_mechs, + gss_cred_usage_t cred_usage, + gss_cred_id_t *output_cred_handle, + gss_OID_set *actual_mechs, + OM_uint32 *time_rec) +{ + OM_uint32 major_status; + struct acquire_cred_res res; + struct acquire_cred_args args; + enum clnt_stat stat; + gss_cred_id_t cred; + int i; + + if (!kgss_gssd_handle) + return (GSS_S_FAILURE); + + args.uid = curthread->td_ucred->cr_uid; + if (desired_name) + args.desired_name = desired_name->handle; + else + args.desired_name = 0; + args.time_req = time_req; + args.desired_mechs = desired_mechs; + args.cred_usage = cred_usage; + + bzero(&res, sizeof(res)); + stat = gssd_acquire_cred_1(&args, &res, kgss_gssd_handle); + if (stat != RPC_SUCCESS) { + *minor_status = stat; + return (GSS_S_FAILURE); + } + + if (res.major_status != GSS_S_COMPLETE) { + *minor_status = res.minor_status; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:39:36 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 255851065670; Mon, 3 Nov 2008 10:39:36 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 130528FC0A; Mon, 3 Nov 2008 10:39:36 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3AdZEY064477; Mon, 3 Nov 2008 10:39:35 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3AdZ0A064467; Mon, 3 Nov 2008 10:39:35 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811031039.mA3AdZ0A064467@svn.freebsd.org> From: Doug Rabson Date: Mon, 3 Nov 2008 10:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184589 - in head/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 10:39:36 -0000 Author: dfr Date: Mon Nov 3 10:39:35 2008 New Revision: 184589 URL: http://svn.freebsd.org/changeset/base/184589 Log: Regen. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Mon Nov 3 10:38:00 2008 (r184588) +++ head/sys/compat/freebsd32/freebsd32_proto.h Mon Nov 3 10:39:35 2008 (r184589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184183 2008-10-22 21:55:48Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184588 2008-11-03 10:38:00Z dfr */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Mon Nov 3 10:38:00 2008 (r184588) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Mon Nov 3 10:39:35 2008 (r184589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184183 2008-10-22 21:55:48Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184588 2008-11-03 10:38:00Z dfr */ #define FREEBSD32_SYS_syscall 0 @@ -356,4 +356,4 @@ #define FREEBSD32_SYS_symlinkat 502 #define FREEBSD32_SYS_unlinkat 503 #define FREEBSD32_SYS_posix_openpt 504 -#define FREEBSD32_SYS_MAXSYSCALL 505 +#define FREEBSD32_SYS_MAXSYSCALL 506 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Mon Nov 3 10:38:00 2008 (r184588) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Mon Nov 3 10:39:35 2008 (r184589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184183 2008-10-22 21:55:48Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184588 2008-11-03 10:38:00Z dfr */ const char *freebsd32_syscallnames[] = { @@ -512,4 +512,5 @@ const char *freebsd32_syscallnames[] = { "symlinkat", /* 502 = symlinkat */ "unlinkat", /* 503 = unlinkat */ "posix_openpt", /* 504 = posix_openpt */ + "#505", /* 505 = gssd_syscall */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Mon Nov 3 10:38:00 2008 (r184588) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Mon Nov 3 10:39:35 2008 (r184589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184183 2008-10-22 21:55:48Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184588 2008-11-03 10:38:00Z dfr */ #include "opt_compat.h" @@ -543,4 +543,5 @@ struct sysent freebsd32_sysent[] = { { AS(symlinkat_args), (sy_call_t *)symlinkat, AUE_SYMLINKAT, NULL, 0, 0 }, /* 502 = symlinkat */ { AS(unlinkat_args), (sy_call_t *)unlinkat, AUE_UNLINKAT, NULL, 0, 0 }, /* 503 = unlinkat */ { AS(posix_openpt_args), (sy_call_t *)posix_openpt, AUE_POSIX_OPENPT, NULL, 0, 0 }, /* 504 = posix_openpt */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 505 = gssd_syscall */ }; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Mon Nov 3 10:38:00 2008 (r184588) +++ head/sys/kern/init_sysent.c Mon Nov 3 10:39:35 2008 (r184589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 183361 2008-09-25 20:07:42Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 184588 2008-11-03 10:38:00Z dfr */ #include "opt_compat.h" @@ -533,4 +533,5 @@ struct sysent sysent[] = { { AS(symlinkat_args), (sy_call_t *)symlinkat, AUE_SYMLINKAT, NULL, 0, 0 }, /* 502 = symlinkat */ { AS(unlinkat_args), (sy_call_t *)unlinkat, AUE_UNLINKAT, NULL, 0, 0 }, /* 503 = unlinkat */ { AS(posix_openpt_args), (sy_call_t *)posix_openpt, AUE_POSIX_OPENPT, NULL, 0, 0 }, /* 504 = posix_openpt */ + { AS(gssd_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0 }, /* 505 = gssd_syscall */ }; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Mon Nov 3 10:38:00 2008 (r184588) +++ head/sys/kern/syscalls.c Mon Nov 3 10:39:35 2008 (r184589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 183361 2008-09-25 20:07:42Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 184588 2008-11-03 10:38:00Z dfr */ const char *syscallnames[] = { @@ -512,4 +512,5 @@ const char *syscallnames[] = { "symlinkat", /* 502 = symlinkat */ "unlinkat", /* 503 = unlinkat */ "posix_openpt", /* 504 = posix_openpt */ + "gssd_syscall", /* 505 = gssd_syscall */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Mon Nov 3 10:38:00 2008 (r184588) +++ head/sys/kern/systrace_args.c Mon Nov 3 10:39:35 2008 (r184589) @@ -3056,6 +3056,13 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } + /* gssd_syscall */ + case 505: { + struct gssd_syscall_args *p = params; + uarg[0] = (intptr_t) p->path; /* char * */ + *n_args = 1; + break; + } default: *n_args = 0; break; @@ -8112,6 +8119,16 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* gssd_syscall */ + case 505: + switch(ndx) { + case 0: + p = "char *"; + break; + default: + break; + }; + break; default: break; }; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Mon Nov 3 10:38:00 2008 (r184588) +++ head/sys/sys/syscall.h Mon Nov 3 10:39:35 2008 (r184589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 183361 2008-09-25 20:07:42Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 184588 2008-11-03 10:38:00Z dfr */ #define SYS_syscall 0 @@ -420,4 +420,5 @@ #define SYS_symlinkat 502 #define SYS_unlinkat 503 #define SYS_posix_openpt 504 -#define SYS_MAXSYSCALL 505 +#define SYS_gssd_syscall 505 +#define SYS_MAXSYSCALL 506 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Mon Nov 3 10:38:00 2008 (r184588) +++ head/sys/sys/syscall.mk Mon Nov 3 10:39:35 2008 (r184589) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 183361 2008-09-25 20:07:42Z jhb +# created from FreeBSD: head/sys/kern/syscalls.master 184588 2008-11-03 10:38:00Z dfr MIASM = \ syscall.o \ exit.o \ @@ -368,4 +368,5 @@ MIASM = \ renameat.o \ symlinkat.o \ unlinkat.o \ - posix_openpt.o + posix_openpt.o \ + gssd_syscall.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Mon Nov 3 10:38:00 2008 (r184588) +++ head/sys/sys/sysproto.h Mon Nov 3 10:39:35 2008 (r184589) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 183361 2008-09-25 20:07:42Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 184588 2008-11-03 10:38:00Z dfr */ #ifndef _SYS_SYSPROTO_H_ @@ -1633,6 +1633,9 @@ struct unlinkat_args { struct posix_openpt_args { char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; +struct gssd_syscall_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_exit(struct thread *, struct sys_exit_args *); int fork(struct thread *, struct fork_args *); @@ -1989,6 +1992,7 @@ int renameat(struct thread *, struct ren int symlinkat(struct thread *, struct symlinkat_args *); int unlinkat(struct thread *, struct unlinkat_args *); int posix_openpt(struct thread *, struct posix_openpt_args *); +int gssd_syscall(struct thread *, struct gssd_syscall_args *); #ifdef COMPAT_43 @@ -2570,6 +2574,7 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_symlinkat AUE_SYMLINKAT #define SYS_AUE_unlinkat AUE_UNLINKAT #define SYS_AUE_posix_openpt AUE_POSIX_OPENPT +#define SYS_AUE_gssd_syscall AUE_NULL #undef PAD_ #undef PADL_ From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 13:15:42 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E0EE1065690; Mon, 3 Nov 2008 13:15:42 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 4AF868FC22; Mon, 3 Nov 2008 13:15:42 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id B68B56D449; Mon, 3 Nov 2008 13:15:40 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 9338A84497; Mon, 3 Nov 2008 14:15:40 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bruce Evans References: <200810311447.m9VElFtp083250@svn.freebsd.org> <20081101212937.D12448@delplex.bde.org> Date: Mon, 03 Nov 2008 14:15:40 +0100 In-Reply-To: <20081101212937.D12448@delplex.bde.org> (Bruce Evans's message of "Sat, 1 Nov 2008 22:05:41 +1100 (EST)") Message-ID: <867i7lq7b7.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson Subject: Re: svn commit: r184509 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 13:15:42 -0000 Bruce Evans writes: > Robert Watson 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 =C2=A77.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 defines EXIT_FAILURE to 1. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 13:48:39 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4BA01065672; Mon, 3 Nov 2008 13:48:39 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from mx.nitro.dk (zarniwoop.nitro.dk [83.92.207.38]) by mx1.freebsd.org (Postfix) with ESMTP id 6E3E08FC1C; Mon, 3 Nov 2008 13:48:39 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from arthur.nitro.dk (arthur.bofh [192.168.2.3]) by mx.nitro.dk (Postfix) with ESMTP id 0D6BC1E8C02; Mon, 3 Nov 2008 13:48:31 +0000 (UTC) Received: by arthur.nitro.dk (Postfix, from userid 1000) id 7EFDE5C8A; Mon, 3 Nov 2008 14:48:38 +0100 (CET) Date: Mon, 3 Nov 2008 14:48:38 +0100 From: "Simon L. Nielsen" To: Doug Rabson Message-ID: <20081103134838.GB1207@arthur.nitro.dk> References: <200811031038.mA3Ac0UR064387@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200811031038.mA3Ac0UR064387@svn.freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: 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/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 13:48:39 -0000 On 2008.11.03 10:38:00 +0000, 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? -- Simon L. Nielsen From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 14:08:09 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A74C1065670; Mon, 3 Nov 2008 14:08:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47C7D8FC08; Mon, 3 Nov 2008 14:08:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3E899I068089; Mon, 3 Nov 2008 14:08:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3E89Bx068087; Mon, 3 Nov 2008 14:08:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200811031408.mA3E89Bx068087@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 3 Nov 2008 14:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184590 - in stable/7/sys: . kern ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 14:08:09 -0000 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.c Mon Nov 3 10:39:35 2008 (r184589) +++ stable/7/sys/ufs/ffs/ffs_vnops.c Mon 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) From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 14:11:06 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E9A5106567D; Mon, 3 Nov 2008 14:11:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CB818FC16; Mon, 3 Nov 2008 14:11:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3EB6O5068218; Mon, 3 Nov 2008 14:11:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3EB6t4068217; Mon, 3 Nov 2008 14:11:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200811031411.mA3EB6t4068217@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 3 Nov 2008 14:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184591 - in stable/7/sys: . kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 14:11:06 -0000 Author: kib Date: Mon Nov 3 14:11:06 2008 New Revision: 184591 URL: http://svn.freebsd.org/changeset/base/184591 Log: In vfs_busy(), lockmgr() cannot legitimately sleep, because code checked MNTK_UNMOUNT before, and mnt_mtx is used as interlock. vfs_busy() always tries to obtain a shared lock on mnt_lock, the other user is unmount who tries to drain it, setting MNTK_UNMOUNT before. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/kern/vfs_subr.c Modified: stable/7/sys/kern/vfs_subr.c ============================================================================== --- stable/7/sys/kern/vfs_subr.c Mon Nov 3 14:08:08 2008 (r184590) +++ stable/7/sys/kern/vfs_subr.c Mon Nov 3 14:11:06 2008 (r184591) @@ -361,7 +361,7 @@ vfs_busy(struct mount *mp, int flags, st } if (interlkp) mtx_unlock(interlkp); - lkflags = LK_SHARED | LK_INTERLOCK; + lkflags = LK_SHARED | LK_INTERLOCK | LK_NOWAIT; if (lockmgr(&mp->mnt_lock, lkflags, MNT_MTX(mp), td)) panic("vfs_busy: unexpected lock failure"); return (0); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 14:23:16 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7145A1065670; Mon, 3 Nov 2008 14:23:16 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41F6B8FC17; Mon, 3 Nov 2008 14:23:16 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3ENG7o068457; Mon, 3 Nov 2008 14:23:16 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3ENGoY068456; Mon, 3 Nov 2008 14:23:16 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200811031423.mA3ENGoY068456@svn.freebsd.org> From: Robert Watson Date: Mon, 3 Nov 2008 14:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184592 - head/sys/netsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 14:23:16 -0000 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; From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 14:35:43 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7108A106567A; Mon, 3 Nov 2008 14:35:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ED3B8FC1A; Mon, 3 Nov 2008 14:35:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3EZh0r068703; Mon, 3 Nov 2008 14:35:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3EZhUC068702; Mon, 3 Nov 2008 14:35:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200811031435.mA3EZhUC068702@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 3 Nov 2008 14:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184593 - in stable/7/sys: . ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 14:35:43 -0000 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.c Mon Nov 3 14:23:15 2008 (r184592) +++ stable/7/sys/ufs/ufs/ufs_vnops.c Mon 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); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 14:43:18 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C52EC106564A; Mon, 3 Nov 2008 14:43:18 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from itchy.rabson.org (unknown [IPv6:2002:50b1:e8f2:1::143]) by mx1.freebsd.org (Postfix) with ESMTP id 7C1418FC0C; Mon, 3 Nov 2008 14:43:18 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from [IPv6:2001:470:909f:1:21b:63ff:feb8:5abc] (unknown [IPv6:2001:470:909f:1:21b:63ff:feb8:5abc]) by itchy.rabson.org (Postfix) with ESMTP id 225A73F8F; Mon, 3 Nov 2008 14:42:34 +0000 (GMT) Message-Id: <3272BA7B-7D58-4448-A402-DC25D3C3655C@rabson.org> From: Doug Rabson To: Simon L. Nielsen In-Reply-To: <20081103134838.GB1207@arthur.nitro.dk> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Mon, 3 Nov 2008 14:43:16 +0000 References: <200811031038.mA3Ac0UR064387@svn.freebsd.org> <20081103134838.GB1207@arthur.nitro.dk> X-Mailer: Apple Mail (2.929.2) Cc: svn-src-head@freebsd.org, Doug Rabson , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: 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/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 14:43:18 -0000 On 3 Nov 2008, at 13:48, Simon L. Nielsen wrote: > On 2008.11.03 10:38:00 +0000, 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 :) From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 15:38:45 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3B981065677; Mon, 3 Nov 2008 15:38:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B29788FC14; Mon, 3 Nov 2008 15:38:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3FcjTm069857; Mon, 3 Nov 2008 15:38:45 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3Fcj6L069856; Mon, 3 Nov 2008 15:38:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811031538.mA3Fcj6L069856@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Nov 2008 15:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184594 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 15:38:45 -0000 Author: imp Date: Mon Nov 3 15:38:45 2008 New Revision: 184594 URL: http://svn.freebsd.org/changeset/base/184594 Log: Nit: Add a few leading zeros to make this match other mask constants in this file. Also to make sure that I got other ASI constants right. Modified: head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Mon Nov 3 14:35:43 2008 (r184593) +++ head/sys/dev/pci/pcireg.h Mon Nov 3 15:38:45 2008 (r184594) @@ -133,7 +133,7 @@ #define PCIM_BAR_IO_RESERVED 0x00000002 #define PCIM_BAR_IO_BASE 0xfffffffc #define PCIR_CIS 0x28 -#define PCIM_CIS_ASI_MASK 0x7 +#define PCIM_CIS_ASI_MASK 0x00000007 #define PCIM_CIS_ASI_CONFIG 0 #define PCIM_CIS_ASI_BAR0 1 #define PCIM_CIS_ASI_BAR1 2 From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 15:51:09 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 4F3C6106567C; Mon, 3 Nov 2008 15:51:05 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Mon, 3 Nov 2008 10:50:42 -0500 User-Agent: KMail/1.6.2 References: <200811021250.mA2CoGs1038957@svn.freebsd.org> In-Reply-To: <200811021250.mA2CoGs1038957@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200811031050.48765.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, Alexander Motin , svn-src-all@FreeBSD.org Subject: Re: svn commit: r184558 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 15:51:09 -0000 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-.diff.gz Please revert this commit until we resolve these issues with the vendor first. Thanks! Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 16:27:26 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 92C7B1065674; Mon, 3 Nov 2008 16:27:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Alexander Motin Date: Mon, 3 Nov 2008 11:27:13 -0500 User-Agent: KMail/1.6.2 References: <200811021250.mA2CoGs1038957@svn.freebsd.org> <200811031050.48765.jkim@FreeBSD.org> <490F21FC.1020508@FreeBSD.org> In-Reply-To: <490F21FC.1020508@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200811031127.14928.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184558 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 16:27:27 -0000 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 *. Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 16:36:23 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDB34106567E; Mon, 3 Nov 2008 16:36:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBDF38FC13; Mon, 3 Nov 2008 16:36:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3GaN8S070996; Mon, 3 Nov 2008 16:36:23 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3GaNVG070993; Mon, 3 Nov 2008 16:36:23 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200811031636.mA3GaNVG070993@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 3 Nov 2008 16:36:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184595 - head/sys/fs/coda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 16:36:23 -0000 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.h Mon Nov 3 15:38:45 2008 (r184594) +++ head/sys/fs/coda/cnode.h Mon 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_t c_cached_uid; /* cached uid */ - mode_t c_cached_mode; /* cached access mode */ + accmode_t c_cached_mode; /* cached access mode */ struct cnode *c_next; /* links if on FreeBSD machine */ }; #define VTOC(vp) ((struct cnode *)(vp)->v_data) Modified: head/sys/fs/coda/coda_subr.c ============================================================================== --- head/sys/fs/coda/coda_subr.c Mon Nov 3 15:38:45 2008 (r184594) +++ head/sys/fs/coda/coda_subr.c Mon 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 = mode>>6; + inp->flags = (int)accmode>>6; error = coda_call(mdp, Isize, &Osize, (char *)inp); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 17:08:32 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CD6D1065672; Mon, 3 Nov 2008 17:08:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id E476D8FC26; Mon, 3 Nov 2008 17:08:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 226874445; Mon, 03 Nov 2008 18:08:29 +0200 Message-ID: <490F21FC.1020508@FreeBSD.org> Date: Mon, 03 Nov 2008 18:08:28 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: Jung-uk Kim References: <200811021250.mA2CoGs1038957@svn.freebsd.org> <200811031050.48765.jkim@FreeBSD.org> In-Reply-To: <200811031050.48765.jkim@FreeBSD.org> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184558 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 17:08:32 -0000 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 From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 17:27:02 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 69C161065674; Mon, 3 Nov 2008 17:27:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Alexander Motin Date: Mon, 3 Nov 2008 12:26:42 -0500 User-Agent: KMail/1.6.2 References: <200811021250.mA2CoGs1038957@svn.freebsd.org> <200811031050.48765.jkim@FreeBSD.org> <490F21FC.1020508@FreeBSD.org> In-Reply-To: <490F21FC.1020508@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200811031226.46956.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184558 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 17:27:02 -0000 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? On top of that: /* Returning 0 is not allowed. */ return (curthread->td_tid + 1); may actually return 0 because it can be INT_MAX. :-) Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 17:36:31 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 41A92106564A; Mon, 3 Nov 2008 17:36:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Alexander Motin Date: Mon, 3 Nov 2008 12:36:15 -0500 User-Agent: KMail/1.6.2 References: <200811021250.mA2CoGs1038957@svn.freebsd.org> <490F21FC.1020508@FreeBSD.org> <200811031226.46956.jkim@FreeBSD.org> In-Reply-To: <200811031226.46956.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200811031236.18143.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184558 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 17:36:31 -0000 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 From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 17:36:45 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F214106567B; Mon, 3 Nov 2008 17:36:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id E3B878FC1D; Mon, 3 Nov 2008 17:36:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 226881598; Mon, 03 Nov 2008 19:36:43 +0200 Message-ID: <490F36A8.70601@FreeBSD.org> Date: Mon, 03 Nov 2008 19:36:40 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.17 (X11/20081029) MIME-Version: 1.0 To: Jung-uk Kim References: <200811021250.mA2CoGs1038957@svn.freebsd.org> <200811031050.48765.jkim@FreeBSD.org> <490F21FC.1020508@FreeBSD.org> <200811031226.46956.jkim@FreeBSD.org> In-Reply-To: <200811031226.46956.jkim@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184558 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 17:36:45 -0000 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 From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 17:56:02 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CC301065670; Mon, 3 Nov 2008 17:56:02 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id EFDEB8FC1A; Mon, 3 Nov 2008 17:56:01 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au [211.29.133.76]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id mA37wMZW005071; Mon, 3 Nov 2008 18:58:23 +1100 Received: from server.vk2pj.dyndns.org (c122-106-215-175.belrs3.nsw.optusnet.com.au [122.106.215.175]) by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id mA37wJAK027844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Nov 2008 18:58:20 +1100 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.3/8.14.3) with ESMTP id mA37wJ6k045884; Mon, 3 Nov 2008 18:58:19 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.3/8.14.3/Submit) id mA37wIxN045883; Mon, 3 Nov 2008 18:58:18 +1100 (EST) (envelope-from peter) Date: Mon, 3 Nov 2008 18:58:18 +1100 From: Peter Jeremy To: Ivan Voras Message-ID: <20081103075818.GK99398@server.vk2pj.dyndns.org> References: <200810301405.m9UE5wwZ053250@svn.freebsd.org> <877i7pdzva.fsf@kobe.laptop> <9bbcef730811021534gb114db9x16a2d6c9a3ecee8b@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IbVRjBtIbJdbeK1C" Content-Disposition: inline In-Reply-To: <9bbcef730811021534gb114db9x16a2d6c9a3ecee8b@mail.gmail.com> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Giorgos Keramidas Subject: Re: svn commit: r184471 - in head/bin: cat cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 17:56:02 -0000 --IbVRjBtIbJdbeK1C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2008-Nov-03 00:34:47 +0100, Ivan Voras wrote: >2008/10/31 Giorgos Keramidas : >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. --=20 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. --IbVRjBtIbJdbeK1C Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkkOrxoACgkQ/opHv/APuIcfOACgqkzSGEqtxRmhjWiJnshyt7ba iyAAoL1tl7Qt9BheFlqWPQLCfNXl8s3X =kfWE -----END PGP SIGNATURE----- --IbVRjBtIbJdbeK1C-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 18:05:46 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43CB5106567D; Mon, 3 Nov 2008 18:05:46 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id AEF7C8FC0C; Mon, 3 Nov 2008 18:05:45 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from kobe.laptop (adsl198-174.kln.forthnet.gr [79.103.11.174]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id mA3I5XiU029678 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 3 Nov 2008 20:05:39 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id mA3I5XQH052613; Mon, 3 Nov 2008 20:05:33 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id mA3I5VS3052612; Mon, 3 Nov 2008 20:05:31 +0200 (EET) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Peter Jeremy References: <200810301405.m9UE5wwZ053250@svn.freebsd.org> <877i7pdzva.fsf@kobe.laptop> <9bbcef730811021534gb114db9x16a2d6c9a3ecee8b@mail.gmail.com> <20081103075818.GK99398@server.vk2pj.dyndns.org> Date: Mon, 03 Nov 2008 20:05:31 +0200 In-Reply-To: <20081103075818.GK99398@server.vk2pj.dyndns.org> (Peter Jeremy's message of "Mon, 3 Nov 2008 18:58:18 +1100") Message-ID: <87y700it1w.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: mA3I5XiU029678 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.099, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.30, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ivan Voras Subject: Re: svn commit: r184471 - in head/bin: cat cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 18:05:46 -0000 On Mon, 3 Nov 2008 18:58:18 +1100, Peter Jeremy wrote: > On 2008-Nov-03 00:34:47 +0100, Ivan Voras wrote: >>2008/10/31 Giorgos Keramidas : >>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 :) From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 18:26:54 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B3391065678 for ; Mon, 3 Nov 2008 18:26:54 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from www.sonnenberger.org (www.ostsee-abc.de [62.206.222.50]) by mx1.freebsd.org (Postfix) with ESMTP id BC8978FC19 for ; Mon, 3 Nov 2008 18:26:53 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from britannica.bec.de (localhost [IPv6:::1]) by www.sonnenberger.org (Postfix) with ESMTP id 9CF2A6E788 for ; Mon, 3 Nov 2008 19:09:13 +0100 (CET) Received: by britannica.bec.de (Postfix, from userid 1000) id 4B69D939C2; Mon, 3 Nov 2008 19:07:06 +0100 (CET) Date: Mon, 3 Nov 2008 19:07:06 +0100 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Message-ID: <20081103180705.GA437@britannica.bec.de> References: <200810301405.m9UE5wwZ053250@svn.freebsd.org> <877i7pdzva.fsf@kobe.laptop> <9bbcef730811021534gb114db9x16a2d6c9a3ecee8b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9bbcef730811021534gb114db9x16a2d6c9a3ecee8b@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Subject: Re: svn commit: r184471 - in head/bin: cat cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 18:26:54 -0000 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 From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 18:28:13 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 020B5106568D; Mon, 3 Nov 2008 18:28:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E48048FC1D; Mon, 3 Nov 2008 18:28:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3ISCAG073058; Mon, 3 Nov 2008 18:28:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3ISC84073057; Mon, 3 Nov 2008 18:28:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200811031828.mA3ISC84073057@svn.freebsd.org> From: Alexander Motin Date: Mon, 3 Nov 2008 18:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184596 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 18:28:13 -0000 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); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 18:40:26 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 77948106564A; Mon, 3 Nov 2008 18:40:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Mon, 3 Nov 2008 13:40:08 -0500 User-Agent: KMail/1.6.2 References: <200811031828.mA3ISC84073057@svn.freebsd.org> In-Reply-To: <200811031828.mA3ISC84073057@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200811031340.12072.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, Alexander Motin , svn-src-all@FreeBSD.org Subject: Re: svn commit: r184596 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 18:40:26 -0000 On Monday 03 November 2008 01:28 pm, Alexander Motin wrote: > 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); > } Thanks! Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 18:45:57 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFC171065672; Mon, 3 Nov 2008 18:45:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 620AA8FC13; Mon, 3 Nov 2008 18:45:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mA3IjdRQ091877; Mon, 3 Nov 2008 13:45:51 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Alexander Motin Date: Mon, 3 Nov 2008 12:48:24 -0500 User-Agent: KMail/1.9.7 References: <200811021250.mA2CoGs1038957@svn.freebsd.org> In-Reply-To: <200811021250.mA2CoGs1038957@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811031248.24713.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Mon, 03 Nov 2008 13:45:51 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8559/Mon Nov 3 11:41:26 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184558 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 18:45:58 -0000 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 From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 18:46:04 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D12610656B8; Mon, 3 Nov 2008 18:46:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id C5BA78FC26; Mon, 3 Nov 2008 18:46:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mA3IjdRR091877; Mon, 3 Nov 2008 13:45:56 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Robert Watson Date: Mon, 3 Nov 2008 12:51:32 -0500 User-Agent: KMail/1.9.7 References: <200811022022.mA2KMOCC047394@svn.freebsd.org> In-Reply-To: <200811022022.mA2KMOCC047394@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811031251.32904.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Mon, 03 Nov 2008 13:45:57 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8559/Mon Nov 3 11:41:26 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184568 - head/sys/netsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 18:46:04 -0000 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.c Sun Nov 2 19:48:15 2008 (r184567) > +++ head/sys/netsmb/smb_conn.c Sun 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 From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 18:46:12 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A35E11065804; Mon, 3 Nov 2008 18:46:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 3F9688FC18; Mon, 3 Nov 2008 18:46:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mA3IjdRS091877; Mon, 3 Nov 2008 13:46:02 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= Date: Mon, 3 Nov 2008 13:01:07 -0500 User-Agent: KMail/1.9.7 References: <200810250618.m9P6ICWl023370@svn.freebsd.org> <863aidgk4y.fsf@ds4.des.no> In-Reply-To: <863aidgk4y.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200811031301.07841.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Mon, 03 Nov 2008 13:46:03 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8559/Mon Nov 3 11:41:26 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r184251 - in head/sys: conf dev/cfi sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 18:46:12 -0000 On Friday 31 October 2008 05:59:41 am Dag-Erling Sm=C3=B8rgrav wrote: > Marcel Moolenaar 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. > > =20 > > Obtained from: Juniper Networks, Inc. >=20 > You may want to *carefully* review the license on this code. It appears to be a standard 3-clause BSD license? =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 18:46:16 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9089A1065674; Mon, 3 Nov 2008 18:46:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 2B63C8FC1D; Mon, 3 Nov 2008 18:46:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mA3IjdRT091877; Mon, 3 Nov 2008 13:46:08 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= Date: Mon, 3 Nov 2008 14:44:00 -0500 User-Agent: KMail/1.9.7 References: <200810311447.m9VElFtp083250@svn.freebsd.org> <20081101212937.D12448@delplex.bde.org> <867i7lq7b7.fsf@ds4.des.no> In-Reply-To: <867i7lq7b7.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200811031444.00816.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Mon, 03 Nov 2008 13:46:08 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8559/Mon Nov 3 11:41:26 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson , Bruce Evans Subject: Re: svn commit: r184509 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 18:46:16 -0000 On Monday 03 November 2008 08:15:40 am Dag-Erling Sm=C3=B8rgrav wrote: > Bruce Evans writes: > > Robert Watson 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 > > [...] >=20 > I agree. If we must use symbolic names, I suggest we just follow the > standard, cf. ISO/IEC 9899:1999 =C2=A77.20.4.3: >=20 > 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. >=20 > Note that our defines EXIT_FAILURE to 1. I agree as well. I always use 'err(1,...)' or 'errx(1,...)'. =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 18:46:20 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD6171065742; Mon, 3 Nov 2008 18:46:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5B98B8FC22; Mon, 3 Nov 2008 18:46:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mA3IjdRU091877; Mon, 3 Nov 2008 13:46:14 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Jung-uk Kim Date: Mon, 3 Nov 2008 14:45:33 -0500 User-Agent: KMail/1.9.7 References: <200811021250.mA2CoGs1038957@svn.freebsd.org> <490F21FC.1020508@FreeBSD.org> <200811031127.14928.jkim@FreeBSD.org> In-Reply-To: <200811031127.14928.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811031445.33762.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Mon, 03 Nov 2008 13:46:14 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8559/Mon Nov 3 11:41:26 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r184558 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 18:46:21 -0000 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 From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 18:47:22 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67B8E1065676; Mon, 3 Nov 2008 18:47:22 +0000 (UTC) (envelope-from wb@freebie.xs4all.nl) Received: from smtp-vbr5.xs4all.nl (smtp-vbr5.xs4all.nl [194.109.24.25]) by mx1.freebsd.org (Postfix) with ESMTP id EAD888FC1D; Mon, 3 Nov 2008 18:47:21 +0000 (UTC) (envelope-from wb@freebie.xs4all.nl) Received: from freebie.xs4all.nl (freebie.xs4all.nl [82.95.250.254]) by smtp-vbr5.xs4all.nl (8.13.8/8.13.8) with ESMTP id mA3IlJja055426; Mon, 3 Nov 2008 19:47:19 +0100 (CET) (envelope-from wb@freebie.xs4all.nl) Received: from freebie.xs4all.nl (localhost [127.0.0.1]) by freebie.xs4all.nl (8.14.2/8.14.2) with ESMTP id mA3IlJkf001349; Mon, 3 Nov 2008 19:47:19 +0100 (CET) (envelope-from wb@freebie.xs4all.nl) Received: (from wb@localhost) by freebie.xs4all.nl (8.14.2/8.14.2/Submit) id mA3IlIri001348; Mon, 3 Nov 2008 19:47:18 +0100 (CET) (envelope-from wb) Date: Mon, 3 Nov 2008 19:47:18 +0100 From: Wilko Bulte To: Doug Rabson Message-ID: <20081103184717.GE1279@freebie.xs4all.nl> References: <200811031038.mA3Ac0UR064387@svn.freebsd.org> <20081103134838.GB1207@arthur.nitro.dk> <3272BA7B-7D58-4448-A402-DC25D3C3655C@rabson.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3272BA7B-7D58-4448-A402-DC25D3C3655C@rabson.org> User-Agent: Mutt/1.5.16 (2007-06-09) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: svn-src-head@FreeBSD.org, Doug Rabson , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, "Simon L. Nielsen" Subject: 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/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 18:47:22 -0000 Quoting Doug Rabson, who wrote on Mon, Nov 03, 2008 at 02:43:16PM +0000 .. > > On 3 Nov 2008, at 13:48, Simon L. Nielsen wrote: > >> On 2008.11.03 10:38:00 +0000, 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 :) From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 19:33:21 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26B181065674; Mon, 3 Nov 2008 19:33:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 156A78FC0C; Mon, 3 Nov 2008 19:33:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3JXKst074265; Mon, 3 Nov 2008 19:33:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3JXKWY074264; Mon, 3 Nov 2008 19:33:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200811031933.mA3JXKWY074264@svn.freebsd.org> From: John Baldwin Date: Mon, 3 Nov 2008 19:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184597 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 19:33:21 -0000 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); } /* From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 19:57:41 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C0F01065673; Mon, 3 Nov 2008 19:57:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A9E78FC18; Mon, 3 Nov 2008 19:57:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3Jve3K074691; Mon, 3 Nov 2008 19:57:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3Jvew9074690; Mon, 3 Nov 2008 19:57:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200811031957.mA3Jvew9074690@svn.freebsd.org> From: John Baldwin Date: Mon, 3 Nov 2008 19:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184598 - head/sys/tools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 19:57:41 -0000 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(ind"if ("substr(arg, 2)" != NULL) {"); - } printc(ind"ASSERT_VI_UNLOCKED("star"a->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}"); - } } } From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 20:00:35 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D06CE10656D7; Mon, 3 Nov 2008 20:00:35 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE4558FC1E; Mon, 3 Nov 2008 20:00:35 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3K0Zt6074804; Mon, 3 Nov 2008 20:00:35 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3K0Zok074801; Mon, 3 Nov 2008 20:00:35 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200811032000.mA3K0Zok074801@svn.freebsd.org> From: Attilio Rao Date: Mon, 3 Nov 2008 20:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184599 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 20:00:35 -0000 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.c Mon Nov 3 19:57:40 2008 (r184598) +++ head/sys/kern/vfs_subr.c Mon 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.h Mon Nov 3 19:57:40 2008 (r184598) +++ head/sys/sys/mount.h Mon 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 */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 20:26:07 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDD591065674; Mon, 3 Nov 2008 20:26:07 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8C8618FC1D; Mon, 3 Nov 2008 20:26:07 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mA3KNx7S061054; Mon, 3 Nov 2008 13:23:59 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 03 Nov 2008 13:25:12 -0700 (MST) Message-Id: <20081103.132512.-1476795190.imp@bsdimp.com> To: jhb@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200811031301.07841.jhb@freebsd.org> References: <200810250618.m9P6ICWl023370@svn.freebsd.org> <863aidgk4y.fsf@ds4.des.no> <200811031301.07841.jhb@freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, des@des.no, svn-src-all@FreeBSD.org, marcel@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184251 - in head/sys: conf dev/cfi sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 20:26:07 -0000 In message: <200811031301.07841.jhb@freebsd.org> John Baldwin writes: : On Friday 31 October 2008 05:59:41 am Dag-Erling Sm=F8rgrav wrote: : > Marcel Moolenaar writes: : > > Log: : > > Add a driver for flash memory that implements to the Common Fla= sh : > > Memory Interface (CFI). The flash memory can be read and writte= n : > > to through /dev/cfi# and an ioctl() exists so processes can rea= d : > > 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 From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 20:31:00 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF26D1065670; Mon, 3 Nov 2008 20:31:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD3818FC14; Mon, 3 Nov 2008 20:31:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3KV09B075360; Mon, 3 Nov 2008 20:31:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3KV0vv075357; Mon, 3 Nov 2008 20:31:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200811032031.mA3KV0vv075357@svn.freebsd.org> From: John Baldwin Date: Mon, 3 Nov 2008 20:31:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184600 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 20:31:01 -0000 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.c Mon Nov 3 20:00:35 2008 (r184599) +++ head/sys/kern/kern_descrip.c Mon 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.c Mon Nov 3 20:00:35 2008 (r184599) +++ head/sys/kern/vfs_syscalls.c Mon 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 ============================================================================== --- head/sys/kern/vfs_vnops.c Mon Nov 3 20:00:35 2008 (r184599) +++ head/sys/kern/vfs_vnops.c Mon Nov 3 20:31:00 2008 (r184600) @@ -673,7 +673,7 @@ vn_statfile(fp, sb, active_cred, td) int error; vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_SHARED | LK_RETRY); error = vn_stat(vp, sb, active_cred, fp->f_cred, td); VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 21:04:17 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99B281065943; Mon, 3 Nov 2008 21:04:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 18CBB8FC08; Mon, 3 Nov 2008 21:04:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mA3L3mHp092949; Mon, 3 Nov 2008 16:04:07 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: "M. Warner Losh" Date: Mon, 3 Nov 2008 17:03:42 -0500 User-Agent: KMail/1.9.7 References: <200810250618.m9P6ICWl023370@svn.freebsd.org> <200811031301.07841.jhb@freebsd.org> <20081103.132512.-1476795190.imp@bsdimp.com> In-Reply-To: <20081103.132512.-1476795190.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200811031703.42653.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Mon, 03 Nov 2008 16:04:07 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8560/Mon Nov 3 14:20:13 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, des@des.no, svn-src-all@freebsd.org, marcel@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184251 - in head/sys: conf dev/cfi sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 21:04:17 -0000 On Monday 03 November 2008 03:25:12 pm M. Warner Losh wrote: > In message: <200811031301.07841.jhb@freebsd.org> > John Baldwin writes: > : On Friday 31 October 2008 05:59:41 am Dag-Erling Sm=F8rgrav wrote: > : > Marcel Moolenaar 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. > : > > =20 > : > > Obtained from: Juniper Networks, Inc. > : >=20 > : > You may want to *carefully* review the license on this code. > :=20 > : It appears to be a standard 3-clause BSD license? >=20 > Whose name is in the disclaimer? If the problem is "AUTHOR" vs "AUTHOR AND CONTRIBUTORS" then it would perha= ps=20 be more useful to all involved to actually state one's concerns instead of= =20 vague hand-waving and suggestions of evil. =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 21:17:03 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4B331065674; Mon, 3 Nov 2008 21:17:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D31928FC1E; Mon, 3 Nov 2008 21:17:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3LH23P076251; Mon, 3 Nov 2008 21:17:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3LH25r076250; Mon, 3 Nov 2008 21:17:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200811032117.mA3LH25r076250@svn.freebsd.org> From: John Baldwin Date: Mon, 3 Nov 2008 21:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184601 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 21:17:04 -0000 Author: jhb Date: Mon Nov 3 21:17:02 2008 New Revision: 184601 URL: http://svn.freebsd.org/changeset/base/184601 Log: Adjust the license statement to more closely match a standard 3-clause BSD license. MFC after: 3 days Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Mon Nov 3 20:31:00 2008 (r184600) +++ head/sys/kern/subr_smp.c Mon Nov 3 21:17:02 2008 (r184601) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2001 - * John Baldwin . All rights reserved. + * Copyright (c) 2001, John Baldwin . + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,21 +10,21 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the author nor the names of any co-contributors + * 3. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY JOHN BALDWIN AND CONTRIBUTORS ``AS IS'' AND + * 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 JOHN BALDWIN 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 THE 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. */ /* From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 21:17:18 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B50281065673; Mon, 3 Nov 2008 21:17:18 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A38318FC1C; Mon, 3 Nov 2008 21:17:18 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3LHIFZ076292; Mon, 3 Nov 2008 21:17:18 GMT (envelope-from jasone@svn.freebsd.org) Received: (from jasone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3LHIab076290; Mon, 3 Nov 2008 21:17:18 GMT (envelope-from jasone@svn.freebsd.org) Message-Id: <200811032117.mA3LHIab076290@svn.freebsd.org> From: Jason Evans Date: Mon, 3 Nov 2008 21:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184602 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 21:17:18 -0000 Author: jasone Date: Mon Nov 3 21:17:18 2008 New Revision: 184602 URL: http://svn.freebsd.org/changeset/base/184602 Log: Revert to preferring mmap(2) over sbrk(2) when mapping memory, due to potential extreme contention in the kernel for multi-threaded applications on SMP systems. Reported by: kris Modified: head/lib/libc/stdlib/malloc.3 head/lib/libc/stdlib/malloc.c Modified: head/lib/libc/stdlib/malloc.3 ============================================================================== --- head/lib/libc/stdlib/malloc.3 Mon Nov 3 21:17:02 2008 (r184601) +++ head/lib/libc/stdlib/malloc.3 Mon Nov 3 21:17:18 2008 (r184602) @@ -255,7 +255,7 @@ If both the .Dq D and .Dq M -options are enabled, the allocator prefers the DSS over anonymous mappings, +options are enabled, the allocator prefers anonymous mappings over the DSS, but allocation only fails if memory cannot be acquired via either method. If neither option is enabled, then the .Dq M Modified: head/lib/libc/stdlib/malloc.c ============================================================================== --- head/lib/libc/stdlib/malloc.c Mon Nov 3 21:17:02 2008 (r184601) +++ head/lib/libc/stdlib/malloc.c Mon Nov 3 21:17:18 2008 (r184602) @@ -1536,11 +1536,6 @@ base_pages_alloc(size_t minsize) { #ifdef MALLOC_DSS - if (opt_dss) { - if (base_pages_alloc_dss(minsize) == false) - return (false); - } - if (opt_mmap && minsize != 0) #endif { @@ -1548,6 +1543,14 @@ base_pages_alloc(size_t minsize) return (false); } +#ifdef MALLOC_DSS + if (opt_dss) { + if (base_pages_alloc_dss(minsize) == false) + return (false); + } + +#endif + return (true); } @@ -1984,6 +1987,15 @@ chunk_alloc(size_t size, bool zero) assert((size & chunksize_mask) == 0); #ifdef MALLOC_DSS + if (opt_mmap) +#endif + { + ret = chunk_alloc_mmap(size); + if (ret != NULL) + goto RETURN; + } + +#ifdef MALLOC_DSS if (opt_dss) { ret = chunk_recycle_dss(size, zero); if (ret != NULL) { @@ -1994,14 +2006,7 @@ chunk_alloc(size_t size, bool zero) if (ret != NULL) goto RETURN; } - - if (opt_mmap) #endif - { - ret = chunk_alloc_mmap(size); - if (ret != NULL) - goto RETURN; - } /* All strategies for allocation failed. */ ret = NULL; From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 21:41:35 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89BBA106567A; Mon, 3 Nov 2008 21:41:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75C698FC12; Mon, 3 Nov 2008 21:41:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3LfZ08076801; Mon, 3 Nov 2008 21:41:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3LfZsk076797; Mon, 3 Nov 2008 21:41:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200811032141.mA3LfZsk076797@svn.freebsd.org> From: Marius Strobl Date: Mon, 3 Nov 2008 21:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184603 - in stable/7/sys: . sparc64/sparc64 sun4v/sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 21:41:35 -0000 Author: marius Date: Mon Nov 3 21:41:35 2008 New Revision: 184603 URL: http://svn.freebsd.org/changeset/base/184603 Log: MFC: r184376 - In GCC 4.2 __builtin_frame_address() was fixed to include the V9 stack bias so we no longer need to add it in db_backtrace() and stack_capture() respectively. This also reverts r182168, which kludged around the resulting unaligned access. - Sync the sun4v versions of db_trace.c and stack_machdep.c with the sparc64 ones and fix some style bugs. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/sparc64/sparc64/db_trace.c stable/7/sys/sparc64/sparc64/stack_machdep.c stable/7/sys/sun4v/sun4v/db_trace.c stable/7/sys/sun4v/sun4v/stack_machdep.c Modified: stable/7/sys/sparc64/sparc64/db_trace.c ============================================================================== --- stable/7/sys/sparc64/sparc64/db_trace.c Mon Nov 3 21:17:18 2008 (r184602) +++ stable/7/sys/sparc64/sparc64/db_trace.c Mon Nov 3 21:41:35 2008 (r184603) @@ -276,10 +276,9 @@ db_backtrace(struct thread *td, struct f void db_trace_self(void) { - db_expr_t addr; - addr = (db_expr_t)__builtin_frame_address(1); - db_backtrace(curthread, (struct frame *)(addr + SPOFF), -1); + db_backtrace(curthread, + (struct frame *)__builtin_frame_address(1), -1); } int @@ -288,5 +287,6 @@ db_trace_thread(struct thread *td, int c struct pcb *ctx; ctx = kdb_thr_ctx(td); - return (db_backtrace(td, (struct frame*)(ctx->pcb_sp + SPOFF), count)); + return (db_backtrace(td, + (struct frame *)(ctx->pcb_sp + SPOFF), count)); } Modified: stable/7/sys/sparc64/sparc64/stack_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/stack_machdep.c Mon Nov 3 21:17:18 2008 (r184602) +++ stable/7/sys/sparc64/sparc64/stack_machdep.c Mon Nov 3 21:41:35 2008 (r184603) @@ -28,31 +28,24 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include -#include -#include -#include - -#include #include #include -#include #include +static void stack_capture(struct stack *st, struct frame *fp); + static void -stack_capture(struct stack *st, uint64_t addr) +stack_capture(struct stack *st, struct frame *fp) { vm_offset_t callpc; stack_zero(st); while (1) { - addr += SPOFF; - callpc = - be64dec((void *)(addr + offsetof(struct frame, fr_pc))); + callpc = fp->fr_pc; if (!INKERNEL(callpc)) break; /* Don't bother traversing trap frames. */ @@ -63,30 +56,25 @@ stack_capture(struct stack *st, uint64_t break; if (stack_put(st, callpc) == -1) break; - addr = - be64dec((void *)(addr + offsetof(struct frame, fr_fp))); + fp = v9next_frame(fp); } } void stack_save_td(struct stack *st, struct thread *td) { - uint64_t addr; if (TD_IS_SWAPPED(td)) panic("stack_save_td: swapped"); if (TD_IS_RUNNING(td)) panic("stack_save_td: running"); - addr = td->td_pcb->pcb_sp; - stack_capture(st, addr); + stack_capture(st, (struct frame *)(td->td_pcb->pcb_sp + SPOFF)); } void stack_save(struct stack *st) { - uint64_t addr; - addr = (uint64_t)__builtin_frame_address(1); - stack_capture(st, addr); + stack_capture(st, (struct frame *)__builtin_frame_address(1)); } Modified: stable/7/sys/sun4v/sun4v/db_trace.c ============================================================================== --- stable/7/sys/sun4v/sun4v/db_trace.c Mon Nov 3 21:17:18 2008 (r184602) +++ stable/7/sys/sun4v/sun4v/db_trace.c Mon Nov 3 21:41:35 2008 (r184603) @@ -22,10 +22,11 @@ * 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$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -241,7 +242,6 @@ db_backtrace(struct thread *td, struct f db_addr_t pc; int trap; int user; - int quit; if (count == -1) count = 1024; @@ -249,7 +249,6 @@ db_backtrace(struct thread *td, struct f trap = 0; user = 0; npc = 0; - quit = 0; while (count-- && !user && !db_pager_quit) { pc = (db_addr_t)db_get_value((db_addr_t)&fp->fr_pc, sizeof(fp->fr_pc), FALSE); @@ -288,10 +287,9 @@ db_backtrace(struct thread *td, struct f void db_trace_self(void) { - db_expr_t addr; - addr = (db_expr_t)__builtin_frame_address(1); - db_backtrace(curthread, (struct frame *)(addr + SPOFF), -1); + db_backtrace(curthread, + (struct frame *)__builtin_frame_address(1), -1); } int @@ -300,5 +298,6 @@ db_trace_thread(struct thread *td, int c struct pcb *ctx; ctx = kdb_thr_ctx(td); - return (db_backtrace(td, (struct frame*)(ctx->pcb_sp + SPOFF), count)); + return (db_backtrace(td, + (struct frame *)(ctx->pcb_sp + SPOFF), count)); } Modified: stable/7/sys/sun4v/sun4v/stack_machdep.c ============================================================================== --- stable/7/sys/sun4v/sun4v/stack_machdep.c Mon Nov 3 21:17:18 2008 (r184602) +++ stable/7/sys/sun4v/sun4v/stack_machdep.c Mon Nov 3 21:41:35 2008 (r184603) @@ -32,54 +32,43 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - -#include #include #include -#include #include +static void stack_capture(struct stack *st, struct frame *fp); + static void -stack_capture(struct stack *st, uint64_t addr) +stack_capture(struct stack *st, struct frame *fp) { - struct frame *fp; vm_offset_t callpc; stack_zero(st); - fp = (struct frame *)(addr + SPOFF); while (1) { callpc = fp->fr_pc; if (!INKERNEL(callpc)) break; if (stack_put(st, callpc) == -1) break; - fp = (struct frame *)(fp->fr_fp + SPOFF); + fp = v9next_frame(fp); } - } void stack_save_td(struct stack *st, struct thread *td) { - uint64_t addr; if (TD_IS_SWAPPED(td)) panic("stack_save_td: swapped"); if (TD_IS_RUNNING(td)) panic("stack_save_td: running"); - addr = td->td_pcb->pcb_sp; - stack_capture(st, addr); + stack_capture(st, (struct frame *)(td->td_pcb->pcb_sp + SPOFF)); } void stack_save(struct stack *st) { - uint64_t addr; - addr = (uint64_t)__builtin_frame_address(1); - stack_capture(st, addr); + stack_capture(st, (struct frame *)__builtin_frame_address(1)); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 22:05:44 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C7C4106568C; Mon, 3 Nov 2008 22:05:44 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AE1C8FC08; Mon, 3 Nov 2008 22:05:44 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3M5i1t077287; Mon, 3 Nov 2008 22:05:44 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3M5irG077286; Mon, 3 Nov 2008 22:05:44 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200811032205.mA3M5irG077286@svn.freebsd.org> From: Nick Hibma Date: Mon, 3 Nov 2008 22:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184604 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 22:05:44 -0000 Author: n_hibma Date: Mon Nov 3 22:05:44 2008 New Revision: 184604 URL: http://svn.freebsd.org/changeset/base/184604 Log: uaa->ifaces contains pointers so set its entry to NULL not 0. Modified: head/sys/dev/usb/usb_subr.c Modified: head/sys/dev/usb/usb_subr.c ============================================================================== --- head/sys/dev/usb/usb_subr.c Mon Nov 3 21:41:35 2008 (r184603) +++ head/sys/dev/usb/usb_subr.c Mon Nov 3 22:05:44 2008 (r184604) @@ -930,7 +930,7 @@ usbd_probe_and_attach(device_t parent, u usbd_devinfo(dev, 1, devinfo); device_set_desc_copy(bdev, devinfo); if (device_probe_and_attach(bdev) == 0) { - ifaces[i] = 0; /* consumed */ + ifaces[i] = NULL; /* consumed */ found++; /* create another child for the next iface */ bdev = device_add_child(parent, NULL, -1); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 22:09:27 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D51E1065673; Mon, 3 Nov 2008 22:09:27 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B69E8FC1A; Mon, 3 Nov 2008 22:09:27 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3M9RaI077381; Mon, 3 Nov 2008 22:09:27 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3M9RhK077380; Mon, 3 Nov 2008 22:09:27 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200811032209.mA3M9RhK077380@svn.freebsd.org> From: Nick Hibma Date: Mon, 3 Nov 2008 22:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184605 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 22:09:27 -0000 Author: n_hibma Date: Mon Nov 3 22:09:27 2008 New Revision: 184605 URL: http://svn.freebsd.org/changeset/base/184605 Log: Bugfix: Cut&paste error from the NetBSD code. Also: Change the initialisation of the command string to a static initialiser. Verify it against the output of umass.c when being sent a command using 'camcontrol eject da0' to a Bulk-Only device. This should make those devices work that need a SCSI eject command to switch to modem mode (Novatel 950D and others). Modified: head/sys/dev/usb/u3g.c Modified: head/sys/dev/usb/u3g.c ============================================================================== --- head/sys/dev/usb/u3g.c Mon Nov 3 22:05:44 2008 (r184604) +++ head/sys/dev/usb/u3g.c Mon Nov 3 22:09:27 2008 (r184605) @@ -458,34 +458,38 @@ u3gstub_huawei_init(struct u3gstub_softc static int u3gstub_scsi_eject(struct u3gstub_softc *sc, struct usb_attach_arg *uaa) { - unsigned char cmd[31]; + /* See definition of umass_bbb_cbw_t in sys/dev/usb/umass.c and struct + * scsi_start_stop_unit in sys/cam/scsi/scsi_all.h . + */ + unsigned char cmd[31] = { + 0x55, 0x53, 0x42, 0x43, /* 0..3: Command Block Wrapper (CBW) signature */ + 0x01, 0x00, 0x00, 0x00, /* 4..7: CBW Tag, unique 32-bit number */ + 0x00, 0x00, 0x00, 0x00, /* 8..11: CBW Transfer Length, no data here */ + 0x00, /* 12: CBW Flag: output, so 0 */ + 0x00, /* 13: CBW Lun */ + 0x06, /* 14: CBW Length */ + + 0x1b, /* 15+0: opcode: SCSI START/STOP */ + 0x00, /* 15+1: byte2: Not immediate */ + 0x00, 0x00, /* 15+2..3: reserved */ + 0x02, /* 15+4: Load/Eject command */ + 0x00, /* 15+5: control */ + 0x00, 0x00, 0x00, 0x00, /* 15+6..15: unused */ + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 + }; + usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed = NULL; int i; - memset(cmd, 0, sizeof(cmd)); - cmd[0] = 0x55; /* Byte 0..3: Command Block Wrapper (CBW) signature */ - cmd[1] = 0x53; - cmd[2] = 0x42; - cmd[3] = 0x43; - cmd[4] = 0x01; /* 4..7: CBW Tag, has to unique, but only a single transfer used. */ - /* 8..11: CBW Transfer Length, no data here */ - /* 12: CBW Flag: output, so 0 */ - /* 13: CBW Lun: 0 */ - /* 14: CBW Length */ - cmd[14] = 0x06; - cmd[15] = 0x1b; /* 0: SCSI START/STOP opcode */ - /* 1..3 unused */ - cmd[15+4] = 0x02; /* 4 Load/Eject command */ - /* 5: unused */ - /* Find the bulk-out endpoints */ id = usbd_get_interface_descriptor(uaa->iface); for (i = 0 ; i < id->bNumEndpoints ; i++) { ed = usbd_interface2endpoint_descriptor(uaa->iface, i); if (ed != NULL - && UE_GET_DIR(ed->bEndpointAddress) != UE_DIR_OUT + && UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) break; } From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 22:43:37 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B733C1065672; Mon, 3 Nov 2008 22:43:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A60358FC18; Mon, 3 Nov 2008 22:43:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3MhbkN078070; Mon, 3 Nov 2008 22:43:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA3MhbGP078069; Mon, 3 Nov 2008 22:43:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811032243.mA3MhbGP078069@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Nov 2008 22:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184606 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 22:43:37 -0000 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 From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 22:49:54 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A5031065675 for ; Mon, 3 Nov 2008 22:49:54 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 831928FC08 for ; Mon, 3 Nov 2008 22:49:53 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 03 Nov 2008 22:49:51 -0000 Received: from p54A3FAF6.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.250.246] by mail.gmx.net (mp053) with SMTP; 03 Nov 2008 23:49:51 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX19X+IZzerZXuFf2+cz4DQTp/4KfSB9XroFRSdPHP7 +ZuUMcC4EJ5r1j Message-ID: <490F800E.9080201@gmx.de> Date: Mon, 03 Nov 2008 23:49:50 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.17 (X11/20080927) MIME-Version: 1.0 To: Nick Hibma References: <200811032209.mA3M9RhK077380@svn.freebsd.org> In-Reply-To: <200811032209.mA3M9RhK077380@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.48 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184605 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 22:49:54 -0000 Hi Nick. Nick Hibma wrote: > Author: n_hibma > Date: Mon Nov 3 22:09:27 2008 > New Revision: 184605 > URL: http://svn.freebsd.org/changeset/base/184605 > > Log: > Bugfix: Cut&paste error from the NetBSD code. > > Also: Change the initialisation of the command string to a static > initialiser. Verify it against the output of umass.c when being sent a > command using 'camcontrol eject da0' to a Bulk-Only device. > > This should make those devices work that need a SCSI eject command to > switch to modem mode (Novatel 950D and others). > > Modified: > head/sys/dev/usb/u3g.c > > Modified: head/sys/dev/usb/u3g.c > ============================================================================== > --- head/sys/dev/usb/u3g.c Mon Nov 3 22:05:44 2008 (r184604) > +++ head/sys/dev/usb/u3g.c Mon Nov 3 22:09:27 2008 (r184605) > @@ -458,34 +458,38 @@ u3gstub_huawei_init(struct u3gstub_softc > static int > u3gstub_scsi_eject(struct u3gstub_softc *sc, struct usb_attach_arg *uaa) > { > - unsigned char cmd[31]; > + /* See definition of umass_bbb_cbw_t in sys/dev/usb/umass.c and struct > + * scsi_start_stop_unit in sys/cam/scsi/scsi_all.h . > + */ > + unsigned char cmd[31] = { > + 0x55, 0x53, 0x42, 0x43, /* 0..3: Command Block Wrapper (CBW) signature */ > + 0x01, 0x00, 0x00, 0x00, /* 4..7: CBW Tag, unique 32-bit number */ > + 0x00, 0x00, 0x00, 0x00, /* 8..11: CBW Transfer Length, no data here */ > + 0x00, /* 12: CBW Flag: output, so 0 */ > + 0x00, /* 13: CBW Lun */ > + 0x06, /* 14: CBW Length */ > + > + 0x1b, /* 15+0: opcode: SCSI START/STOP */ > + 0x00, /* 15+1: byte2: Not immediate */ > + 0x00, 0x00, /* 15+2..3: reserved */ > + 0x02, /* 15+4: Load/Eject command */ > + 0x00, /* 15+5: control */ > + 0x00, 0x00, 0x00, 0x00, /* 15+6..15: unused */ > + 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00 > + }; > + > usb_interface_descriptor_t *id; > usb_endpoint_descriptor_t *ed = NULL; > int i; > > - memset(cmd, 0, sizeof(cmd)); > - cmd[0] = 0x55; /* Byte 0..3: Command Block Wrapper (CBW) signature */ > - cmd[1] = 0x53; > - cmd[2] = 0x42; > - cmd[3] = 0x43; > - cmd[4] = 0x01; /* 4..7: CBW Tag, has to unique, but only a single transfer used. */ > - /* 8..11: CBW Transfer Length, no data here */ > - /* 12: CBW Flag: output, so 0 */ > - /* 13: CBW Lun: 0 */ > - /* 14: CBW Length */ > - cmd[14] = 0x06; > - cmd[15] = 0x1b; /* 0: SCSI START/STOP opcode */ > - /* 1..3 unused */ > - cmd[15+4] = 0x02; /* 4 Load/Eject command */ > - /* 5: unused */ > - > > /* Find the bulk-out endpoints */ > id = usbd_get_interface_descriptor(uaa->iface); You may want to make cmd[] static and/or const, so the compiler really just puts the bytes in the data section instead of generating code, which pretty much is the same as the assignments you just removed. GCC creates 31 consecutive movb instructions for the static initialiser, which is most probably worse than the code before Regards Christoph From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 22:57:07 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C40CE1065678 for ; Mon, 3 Nov 2008 22:57:07 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from www.sonnenberger.org (www.ostsee-abc.de [62.206.222.50]) by mx1.freebsd.org (Postfix) with ESMTP id 836088FC17 for ; Mon, 3 Nov 2008 22:57:07 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from britannica.bec.de (localhost [IPv6:::1]) by www.sonnenberger.org (Postfix) with ESMTP id 83BFD6E788 for ; Mon, 3 Nov 2008 23:57:01 +0100 (CET) Received: by britannica.bec.de (Postfix, from userid 1000) id CC2A893BF8; Mon, 3 Nov 2008 23:54:53 +0100 (CET) Date: Mon, 3 Nov 2008 23:54:53 +0100 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Message-ID: <20081103225453.GA1509@britannica.bec.de> References: <200811032209.mA3M9RhK077380@svn.freebsd.org> <490F800E.9080201@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <490F800E.9080201@gmx.de> User-Agent: Mutt/1.5.18 (2008-05-17) Subject: Re: svn commit: r184605 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 22:57:07 -0000 On Mon, Nov 03, 2008 at 11:49:50PM +0100, Christoph Mallon wrote: > You may want to make cmd[] static and/or const, so the compiler really > just puts the bytes in the data section instead of generating code, > which pretty much is the same as the assignments you just removed. I didn't make it const originally as I am not sure if the USB stack will never modify the buffer. Joerg From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 00:20:44 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D20091065673; Tue, 4 Nov 2008 00:20:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE2168FC1B; Tue, 4 Nov 2008 00:20:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA40KiQx080180; Tue, 4 Nov 2008 00:20:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA40KiJg080161; Tue, 4 Nov 2008 00:20:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811040020.mA40KiJg080161@svn.freebsd.org> From: Warner Losh Date: Tue, 4 Nov 2008 00:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184607 - head/lib/libc/posix1e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 00:20:44 -0000 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.3 Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_add_perm.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.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 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. */ #include Modified: head/lib/libc/posix1e/acl_clear_perms.3 ============================================================================== --- head/lib/libc/posix1e/acl_clear_perms.3 Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_clear_perms.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_copy.c ============================================================================== --- head/lib/libc/posix1e/acl_copy.c Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_copy.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 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. */ #include Modified: head/lib/libc/posix1e/acl_copy_entry.3 ============================================================================== --- head/lib/libc/posix1e/acl_copy_entry.3 Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_copy_entry.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_create_entry.3 ============================================================================== --- head/lib/libc/posix1e/acl_create_entry.3 Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_create_entry.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_delete_entry.3 ============================================================================== --- head/lib/libc/posix1e/acl_delete_entry.3 Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_delete_entry.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_delete_perm.3 ============================================================================== --- head/lib/libc/posix1e/acl_delete_perm.3 Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_delete_perm.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_get_entry.3 ============================================================================== --- head/lib/libc/posix1e/acl_get_entry.3 Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_get_entry.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_get_perm_np.3 ============================================================================== --- head/lib/libc/posix1e/acl_get_perm_np.3 Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_get_perm_np.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_get_permset.3 ============================================================================== --- head/lib/libc/posix1e/acl_get_permset.3 Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_get_permset.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_get_qualifier.3 ============================================================================== --- head/lib/libc/posix1e/acl_get_qualifier.3 Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_get_qualifier.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_get_tag_type.3 ============================================================================== --- head/lib/libc/posix1e/acl_get_tag_type.3 Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_get_tag_type.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_perm.c ============================================================================== --- head/lib/libc/posix1e/acl_perm.c Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_perm.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 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. */ #include Modified: head/lib/libc/posix1e/acl_set_permset.3 ============================================================================== --- head/lib/libc/posix1e/acl_set_permset.3 Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_set_permset.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_set_qualifier.3 ============================================================================== --- head/lib/libc/posix1e/acl_set_qualifier.3 Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_set_qualifier.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_set_tag_type.3 ============================================================================== --- head/lib/libc/posix1e/acl_set_tag_type.3 Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_set_tag_type.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_size.c ============================================================================== --- head/lib/libc/posix1e/acl_size.c Mon Nov 3 22:43:37 2008 (r184606) +++ head/lib/libc/posix1e/acl_size.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 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. */ #include From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 01:45:51 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 842601065673; Tue, 4 Nov 2008 01:45:51 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A2618FC26; Tue, 4 Nov 2008 01:45:51 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA41jpvP082605; Tue, 4 Nov 2008 01:45:51 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA41jpNF082604; Tue, 4 Nov 2008 01:45:51 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200811040145.mA41jpNF082604@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 4 Nov 2008 01:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184608 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 01:45:51 -0000 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.conf Tue Nov 4 00:20:43 2008 (r184607) +++ svnadmin/conf/sizelimit.conf Tue Nov 4 01:45:49 2008 (r184608) @@ -17,3 +17,4 @@ #peter 3141592 #grog #kan +alfred 30240000 From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 02:31:04 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A3A31065674; Tue, 4 Nov 2008 02:31:04 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63FE48FC24; Tue, 4 Nov 2008 02:31:04 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA42V4po083520; Tue, 4 Nov 2008 02:31:04 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA42V4EQ083516; Tue, 4 Nov 2008 02:31:04 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200811040231.mA42V4EQ083516@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 4 Nov 2008 02:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: 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... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 02:31:04 -0000 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 device usb2_controller device usb2_controller_ehci device usb2_controller_ohci device usb2_controller_uhci # USB mass storage support device usb2_storage device usb2_storage_mass # USB ethernet support, requires miibus device usb2_ethernet device usb2_ethernet_aue device usb2_ethernet_axe device usb2_ethernet_cdce device usb2_ethernet_cue device usb2_ethernet_kue device usb2_ethernet_rue device usb2_ethernet_dav # USB wireless LAN support device usb2_wlan device usb2_wlan_rum device usb2_wlan_ral device usb2_wlan_zyd # USB serial device support device usb2_serial device usb2_serial_ark device usb2_serial_bsa device usb2_serial_bser device usb2_serial_chcom device usb2_serial_cycom device usb2_serial_foma device usb2_serial_ftdi device usb2_serial_gensa device usb2_serial_ipaq device usb2_serial_lpt device usb2_serial_mct device usb2_serial_modem device usb2_serial_moscom device usb2_serial_plcom device usb2_serial_visor device usb2_serial_vscom # USB bluetooth support device usb2_bluetooth device usb2_bluetooth_ng # USB input device support device usb2_input device usb2_input_hid device usb2_input_kbd device usb2_input_ms # USB sound and MIDI device support device usb2_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, props changed) head/lib/libusb20/libusb20_int.h (contents, props changed) head/lib/libusb20/libusb20_ugen20.c (contents, props changed) head/share/man/man4/usb2_bluetooth.4 (contents, props changed) head/share/man/man4/usb2_controller.4 (contents, props changed) head/share/man/man4/usb2_core.4 (contents, props changed) head/share/man/man4/usb2_ethernet.4 (contents, props changed) head/share/man/man4/usb2_image.4 (contents, props changed) head/share/man/man4/usb2_input.4 (contents, props changed) head/share/man/man4/usb2_misc.4 (contents, props changed) head/share/man/man4/usb2_ndis.4 (contents, props changed) head/share/man/man4/usb2_quirk.4 (contents, props changed) head/share/man/man4/usb2_serial.4 (contents, props changed) head/share/man/man4/usb2_sound.4 (contents, props changed) head/share/man/man4/usb2_storage.4 (contents, props changed) head/share/man/man4/usb2_template.4 (contents, props changed) head/share/man/man4/usb2_wlan.4 (contents, props changed) head/sys/dev/usb2/ head/sys/dev/usb2/bluetooth/ head/sys/dev/usb2/bluetooth/TODO.TXT (contents, props changed) head/sys/dev/usb2/bluetooth/ng_ubt2.c (contents, props changed) head/sys/dev/usb2/bluetooth/ng_ubt2_var.h (contents, props changed) head/sys/dev/usb2/bluetooth/ubtbcmfw2.c (contents, props changed) head/sys/dev/usb2/bluetooth/usb2_bluetooth.c (contents, props changed) head/sys/dev/usb2/bluetooth/usb2_bluetooth.h (contents, props changed) head/sys/dev/usb2/controller/ head/sys/dev/usb2/controller/at91dci.c (contents, props changed) head/sys/dev/usb2/controller/at91dci.h (contents, props changed) head/sys/dev/usb2/controller/at91dci_atmelarm.c (contents, props changed) head/sys/dev/usb2/controller/ehci2.c (contents, props changed) head/sys/dev/usb2/controller/ehci2.h (contents, props changed) head/sys/dev/usb2/controller/ehci2_pci.c (contents, props changed) head/sys/dev/usb2/controller/musb2_otg.c (contents, props changed) head/sys/dev/usb2/controller/musb2_otg.h (contents, props changed) head/sys/dev/usb2/controller/musb2_otg_atmelarm.c (contents, props changed) head/sys/dev/usb2/controller/ohci2.c (contents, props changed) head/sys/dev/usb2/controller/ohci2.h (contents, props changed) head/sys/dev/usb2/controller/ohci2_atmelarm.c (contents, props changed) head/sys/dev/usb2/controller/ohci2_pci.c (contents, props changed) head/sys/dev/usb2/controller/uhci2.c (contents, props changed) head/sys/dev/usb2/controller/uhci2.h (contents, props changed) head/sys/dev/usb2/controller/uhci2_pci.c (contents, props changed) head/sys/dev/usb2/controller/usb2_bus.h (contents, props changed) head/sys/dev/usb2/controller/usb2_controller.c (contents, props changed) head/sys/dev/usb2/controller/usb2_controller.h (contents, props changed) head/sys/dev/usb2/controller/usb2_pci.h (contents, props changed) head/sys/dev/usb2/controller/uss820dci.c (contents, props changed) head/sys/dev/usb2/controller/uss820dci.h (contents, props changed) head/sys/dev/usb2/controller/uss820dci_atmelarm.c (contents, props changed) head/sys/dev/usb2/controller/uss820dci_pccard.c (contents, props changed) head/sys/dev/usb2/core/ head/sys/dev/usb2/core/README.TXT (contents, props changed) head/sys/dev/usb2/core/usb2_busdma.c (contents, props changed) head/sys/dev/usb2/core/usb2_busdma.h (contents, props changed) head/sys/dev/usb2/core/usb2_compat_linux.c (contents, props changed) head/sys/dev/usb2/core/usb2_compat_linux.h (contents, props changed) head/sys/dev/usb2/core/usb2_config_td.c (contents, props changed) head/sys/dev/usb2/core/usb2_config_td.h (contents, props changed) head/sys/dev/usb2/core/usb2_core.c (contents, props changed) head/sys/dev/usb2/core/usb2_core.h (contents, props changed) head/sys/dev/usb2/core/usb2_debug.c (contents, props changed) head/sys/dev/usb2/core/usb2_debug.h (contents, props changed) head/sys/dev/usb2/core/usb2_dev.c (contents, props changed) head/sys/dev/usb2/core/usb2_dev.h (contents, props changed) head/sys/dev/usb2/core/usb2_device.c (contents, props changed) head/sys/dev/usb2/core/usb2_device.h (contents, props changed) head/sys/dev/usb2/core/usb2_dynamic.c (contents, props changed) head/sys/dev/usb2/core/usb2_dynamic.h (contents, props changed) head/sys/dev/usb2/core/usb2_error.c (contents, props changed) head/sys/dev/usb2/core/usb2_generic.c (contents, props changed) head/sys/dev/usb2/core/usb2_generic.h (contents, props changed) head/sys/dev/usb2/core/usb2_handle_request.c (contents, props changed) head/sys/dev/usb2/core/usb2_handle_request.h (contents, props changed) head/sys/dev/usb2/core/usb2_hid.c (contents, props changed) head/sys/dev/usb2/core/usb2_hid.h (contents, props changed) head/sys/dev/usb2/core/usb2_hub.c (contents, props changed) head/sys/dev/usb2/core/usb2_hub.h (contents, props changed) head/sys/dev/usb2/core/usb2_if.m (contents, props changed) head/sys/dev/usb2/core/usb2_lookup.c (contents, props changed) head/sys/dev/usb2/core/usb2_lookup.h (contents, props changed) head/sys/dev/usb2/core/usb2_mbuf.c (contents, props changed) head/sys/dev/usb2/core/usb2_mbuf.h (contents, props changed) head/sys/dev/usb2/core/usb2_msctest.c (contents, props changed) head/sys/dev/usb2/core/usb2_msctest.h (contents, props changed) head/sys/dev/usb2/core/usb2_parse.c (contents, props changed) head/sys/dev/usb2/core/usb2_parse.h (contents, props changed) head/sys/dev/usb2/core/usb2_process.c (contents, props changed) head/sys/dev/usb2/core/usb2_process.h (contents, props changed) head/sys/dev/usb2/core/usb2_request.c (contents, props changed) head/sys/dev/usb2/core/usb2_request.h (contents, props changed) head/sys/dev/usb2/core/usb2_sw_transfer.c (contents, props changed) head/sys/dev/usb2/core/usb2_sw_transfer.h (contents, props changed) head/sys/dev/usb2/core/usb2_transfer.c (contents, props changed) head/sys/dev/usb2/core/usb2_transfer.h (contents, props changed) head/sys/dev/usb2/core/usb2_util.c (contents, props changed) head/sys/dev/usb2/core/usb2_util.h (contents, props changed) head/sys/dev/usb2/core/usbdevs (contents, props changed) head/sys/dev/usb2/ethernet/ head/sys/dev/usb2/ethernet/if_aue2.c (contents, props changed) head/sys/dev/usb2/ethernet/if_aue2_reg.h (contents, props changed) head/sys/dev/usb2/ethernet/if_axe2.c (contents, props changed) head/sys/dev/usb2/ethernet/if_axe2_reg.h (contents, props changed) head/sys/dev/usb2/ethernet/if_cdce2.c (contents, props changed) head/sys/dev/usb2/ethernet/if_cdce2_reg.h (contents, props changed) head/sys/dev/usb2/ethernet/if_cue2.c (contents, props changed) head/sys/dev/usb2/ethernet/if_cue2_reg.h (contents, props changed) head/sys/dev/usb2/ethernet/if_kue2.c (contents, props changed) head/sys/dev/usb2/ethernet/if_kue2_fw.h (contents, props changed) head/sys/dev/usb2/ethernet/if_kue2_reg.h (contents, props changed) head/sys/dev/usb2/ethernet/if_rue2.c (contents, props changed) head/sys/dev/usb2/ethernet/if_rue2_reg.h (contents, props changed) head/sys/dev/usb2/ethernet/if_udav2.c (contents, props changed) head/sys/dev/usb2/ethernet/if_udav2_reg.h (contents, props changed) head/sys/dev/usb2/ethernet/usb2_ethernet.c (contents, props changed) head/sys/dev/usb2/ethernet/usb2_ethernet.h (contents, props changed) head/sys/dev/usb2/image/ head/sys/dev/usb2/image/usb2_image.c (contents, props changed) head/sys/dev/usb2/image/usb2_image.h (contents, props changed) head/sys/dev/usb2/image/uscanner2.c (contents, props changed) head/sys/dev/usb2/include/ head/sys/dev/usb2/include/Makefile (contents, props changed) head/sys/dev/usb2/include/ufm2_ioctl.h (contents, props changed) head/sys/dev/usb2/include/urio2_ioctl.h (contents, props changed) head/sys/dev/usb2/include/usb2_cdc.h (contents, props changed) head/sys/dev/usb2/include/usb2_defs.h (contents, props changed) head/sys/dev/usb2/include/usb2_devid.h (contents, props changed) head/sys/dev/usb2/include/usb2_devtable.h (contents, props changed) head/sys/dev/usb2/include/usb2_endian.h (contents, props changed) head/sys/dev/usb2/include/usb2_error.h (contents, props changed) head/sys/dev/usb2/include/usb2_hid.h (contents, props changed) head/sys/dev/usb2/include/usb2_ioctl.h (contents, props changed) head/sys/dev/usb2/include/usb2_mfunc.h (contents, props changed) head/sys/dev/usb2/include/usb2_revision.h (contents, props changed) head/sys/dev/usb2/include/usb2_standard.h (contents, props changed) head/sys/dev/usb2/input/ head/sys/dev/usb2/input/uhid2.c (contents, props changed) head/sys/dev/usb2/input/ukbd2.c (contents, props changed) head/sys/dev/usb2/input/ums2.c (contents, props changed) head/sys/dev/usb2/input/usb2_input.c (contents, props changed) head/sys/dev/usb2/input/usb2_input.h (contents, props changed) head/sys/dev/usb2/input/usb2_rdesc.h (contents, props changed) head/sys/dev/usb2/misc/ head/sys/dev/usb2/misc/udbp2.c (contents, props changed) head/sys/dev/usb2/misc/udbp2.h (contents, props changed) head/sys/dev/usb2/misc/ufm2.c (contents, props changed) head/sys/dev/usb2/misc/usb2_misc.c (contents, props changed) head/sys/dev/usb2/misc/usb2_misc.h (contents, props changed) head/sys/dev/usb2/ndis/ head/sys/dev/usb2/ndis/if_ndis_usb2.c (contents, props changed) head/sys/dev/usb2/ndis/usb2_ndis.c (contents, props changed) head/sys/dev/usb2/ndis/usb2_ndis.h (contents, props changed) head/sys/dev/usb2/quirk/ head/sys/dev/usb2/quirk/usb2_quirk.c (contents, props changed) head/sys/dev/usb2/quirk/usb2_quirk.h (contents, props changed) head/sys/dev/usb2/serial/ head/sys/dev/usb2/serial/uark2.c (contents, props changed) head/sys/dev/usb2/serial/ubsa2.c (contents, props changed) head/sys/dev/usb2/serial/ubser2.c (contents, props changed) head/sys/dev/usb2/serial/uchcom2.c (contents, props changed) head/sys/dev/usb2/serial/ucycom2.c (contents, props changed) head/sys/dev/usb2/serial/ufoma2.c (contents, props changed) head/sys/dev/usb2/serial/uftdi2.c (contents, props changed) head/sys/dev/usb2/serial/uftdi2_reg.h (contents, props changed) head/sys/dev/usb2/serial/ugensa2.c (contents, props changed) head/sys/dev/usb2/serial/uipaq2.c (contents, props changed) head/sys/dev/usb2/serial/ulpt2.c (contents, props changed) head/sys/dev/usb2/serial/umct2.c (contents, props changed) head/sys/dev/usb2/serial/umodem2.c (contents, props changed) head/sys/dev/usb2/serial/umoscom2.c (contents, props changed) head/sys/dev/usb2/serial/uplcom2.c (contents, props changed) head/sys/dev/usb2/serial/usb2_serial.c (contents, props changed) head/sys/dev/usb2/serial/usb2_serial.h (contents, props changed) head/sys/dev/usb2/serial/uvisor2.c (contents, props changed) head/sys/dev/usb2/serial/uvscom2.c (contents, props changed) head/sys/dev/usb2/sound/ head/sys/dev/usb2/sound/uaudio2.c (contents, props changed) head/sys/dev/usb2/sound/uaudio2.h (contents, props changed) head/sys/dev/usb2/sound/uaudio2_pcm.c (contents, props changed) head/sys/dev/usb2/sound/uaudio2_reg.h (contents, props changed) head/sys/dev/usb2/sound/usb2_sound.c (contents, props changed) head/sys/dev/usb2/sound/usb2_sound.h (contents, props changed) head/sys/dev/usb2/storage/ head/sys/dev/usb2/storage/ata-usb2.c (contents, props changed) head/sys/dev/usb2/storage/umass2.c (contents, props changed) head/sys/dev/usb2/storage/urio2.c (contents, props changed) head/sys/dev/usb2/storage/usb2_storage.c (contents, props changed) head/sys/dev/usb2/storage/usb2_storage.h (contents, props changed) head/sys/dev/usb2/storage/ustorage2_fs.c (contents, props changed) head/sys/dev/usb2/template/ head/sys/dev/usb2/template/usb2_template.c (contents, props changed) head/sys/dev/usb2/template/usb2_template.h (contents, props changed) head/sys/dev/usb2/template/usb2_template_cdce.c (contents, props changed) head/sys/dev/usb2/template/usb2_template_msc.c (contents, props changed) head/sys/dev/usb2/template/usb2_template_mtp.c (contents, props changed) head/sys/dev/usb2/wlan/ head/sys/dev/usb2/wlan/if_rum2.c (contents, props changed) head/sys/dev/usb2/wlan/if_rum2_fw.h (contents, props changed) head/sys/dev/usb2/wlan/if_rum2_reg.h (contents, props changed) head/sys/dev/usb2/wlan/if_rum2_var.h (contents, props changed) head/sys/dev/usb2/wlan/if_ural2.c (contents, props changed) head/sys/dev/usb2/wlan/if_ural2_reg.h (contents, props changed) head/sys/dev/usb2/wlan/if_ural2_var.h (contents, props changed) head/sys/dev/usb2/wlan/if_zyd2.c (contents, props changed) head/sys/dev/usb2/wlan/if_zyd2_fw.h (contents, props changed) head/sys/dev/usb2/wlan/if_zyd2_reg.h (contents, props changed) head/sys/dev/usb2/wlan/usb2_wlan.c (contents, props changed) head/sys/dev/usb2/wlan/usb2_wlan.h (contents, props changed) head/sys/modules/usb2/ head/sys/modules/usb2/Makefile (contents, props changed) head/sys/modules/usb2/bluetooth/ head/sys/modules/usb2/bluetooth/Makefile (contents, props changed) head/sys/modules/usb2/bluetooth_fw/ head/sys/modules/usb2/bluetooth_fw/Makefile (contents, props changed) head/sys/modules/usb2/bluetooth_ng/ head/sys/modules/usb2/bluetooth_ng/Makefile (contents, props changed) head/sys/modules/usb2/controller/ head/sys/modules/usb2/controller/Makefile (contents, props changed) head/sys/modules/usb2/controller_at91dci/ head/sys/modules/usb2/controller_at91dci/Makefile (contents, props changed) head/sys/modules/usb2/controller_ehci/ head/sys/modules/usb2/controller_ehci/Makefile (contents, props changed) head/sys/modules/usb2/controller_musb/ head/sys/modules/usb2/controller_musb/Makefile (contents, props changed) head/sys/modules/usb2/controller_ohci/ head/sys/modules/usb2/controller_ohci/Makefile (contents, props changed) head/sys/modules/usb2/controller_uhci/ head/sys/modules/usb2/controller_uhci/Makefile (contents, props changed) head/sys/modules/usb2/controller_uss820dci/ head/sys/modules/usb2/controller_uss820dci/Makefile (contents, props changed) head/sys/modules/usb2/core/ head/sys/modules/usb2/core/Makefile (contents, props changed) head/sys/modules/usb2/ethernet/ head/sys/modules/usb2/ethernet/Makefile (contents, props changed) head/sys/modules/usb2/ethernet_aue/ head/sys/modules/usb2/ethernet_aue/Makefile (contents, props changed) head/sys/modules/usb2/ethernet_axe/ head/sys/modules/usb2/ethernet_axe/Makefile (contents, props changed) head/sys/modules/usb2/ethernet_cdce/ head/sys/modules/usb2/ethernet_cdce/Makefile (contents, props changed) head/sys/modules/usb2/ethernet_cue/ head/sys/modules/usb2/ethernet_cue/Makefile (contents, props changed) head/sys/modules/usb2/ethernet_dav/ head/sys/modules/usb2/ethernet_dav/Makefile (contents, props changed) head/sys/modules/usb2/ethernet_kue/ head/sys/modules/usb2/ethernet_kue/Makefile (contents, props changed) head/sys/modules/usb2/ethernet_rue/ head/sys/modules/usb2/ethernet_rue/Makefile (contents, props changed) head/sys/modules/usb2/image/ head/sys/modules/usb2/image/Makefile (contents, props changed) head/sys/modules/usb2/input/ head/sys/modules/usb2/input/Makefile (contents, props changed) head/sys/modules/usb2/input_hid/ head/sys/modules/usb2/input_hid/Makefile (contents, props changed) head/sys/modules/usb2/input_kbd/ head/sys/modules/usb2/input_kbd/Makefile (contents, props changed) head/sys/modules/usb2/input_ms/ head/sys/modules/usb2/input_ms/Makefile (contents, props changed) head/sys/modules/usb2/misc/ head/sys/modules/usb2/misc/Makefile (contents, props changed) head/sys/modules/usb2/misc_dbp/ head/sys/modules/usb2/misc_dbp/Makefile (contents, props changed) head/sys/modules/usb2/misc_fm/ head/sys/modules/usb2/misc_fm/Makefile (contents, props changed) head/sys/modules/usb2/ndis/ head/sys/modules/usb2/ndis/Makefile (contents, props changed) head/sys/modules/usb2/quirk/ head/sys/modules/usb2/quirk/Makefile (contents, props changed) head/sys/modules/usb2/scanner/ head/sys/modules/usb2/scanner/Makefile (contents, props changed) head/sys/modules/usb2/serial/ head/sys/modules/usb2/serial/Makefile (contents, props changed) head/sys/modules/usb2/serial_ark/ head/sys/modules/usb2/serial_ark/Makefile (contents, props changed) head/sys/modules/usb2/serial_bsa/ head/sys/modules/usb2/serial_bsa/Makefile (contents, props changed) head/sys/modules/usb2/serial_bser/ head/sys/modules/usb2/serial_bser/Makefile (contents, props changed) head/sys/modules/usb2/serial_chcom/ head/sys/modules/usb2/serial_chcom/Makefile (contents, props changed) head/sys/modules/usb2/serial_cycom/ head/sys/modules/usb2/serial_cycom/Makefile (contents, props changed) head/sys/modules/usb2/serial_foma/ head/sys/modules/usb2/serial_foma/Makefile (contents, props changed) head/sys/modules/usb2/serial_ftdi/ head/sys/modules/usb2/serial_ftdi/Makefile (contents, props changed) head/sys/modules/usb2/serial_gensa/ head/sys/modules/usb2/serial_gensa/Makefile (contents, props changed) head/sys/modules/usb2/serial_ipaq/ head/sys/modules/usb2/serial_ipaq/Makefile (contents, props changed) head/sys/modules/usb2/serial_lpt/ head/sys/modules/usb2/serial_lpt/Makefile (contents, props changed) head/sys/modules/usb2/serial_mct/ head/sys/modules/usb2/serial_mct/Makefile (contents, props changed) head/sys/modules/usb2/serial_modem/ head/sys/modules/usb2/serial_modem/Makefile (contents, props changed) head/sys/modules/usb2/serial_moscom/ head/sys/modules/usb2/serial_moscom/Makefile (contents, props changed) head/sys/modules/usb2/serial_plcom/ head/sys/modules/usb2/serial_plcom/Makefile (contents, props changed) head/sys/modules/usb2/serial_visor/ head/sys/modules/usb2/serial_visor/Makefile (contents, props changed) head/sys/modules/usb2/serial_vscom/ head/sys/modules/usb2/serial_vscom/Makefile (contents, props changed) head/sys/modules/usb2/sound/ head/sys/modules/usb2/sound/Makefile (contents, props changed) head/sys/modules/usb2/storage/ head/sys/modules/usb2/storage/Makefile (contents, props changed) head/sys/modules/usb2/storage_ata/ head/sys/modules/usb2/storage_ata/Makefile (contents, props changed) head/sys/modules/usb2/storage_fs/ head/sys/modules/usb2/storage_fs/Makefile (contents, props changed) head/sys/modules/usb2/storage_mass/ head/sys/modules/usb2/storage_mass/Makefile (contents, props changed) head/sys/modules/usb2/storage_rio/ head/sys/modules/usb2/storage_rio/Makefile (contents, props changed) head/sys/modules/usb2/template/ head/sys/modules/usb2/template/Makefile (contents, props changed) head/sys/modules/usb2/wlan/ head/sys/modules/usb2/wlan/Makefile (contents, props changed) head/sys/modules/usb2/wlan_ral/ head/sys/modules/usb2/wlan_ral/Makefile (contents, props changed) head/sys/modules/usb2/wlan_rum/ head/sys/modules/usb2/wlan_rum/Makefile (contents, props changed) head/sys/modules/usb2/wlan_zyd/ head/sys/modules/usb2/wlan_zyd/Makefile (contents, props changed) head/usr.sbin/usbconfig/ head/usr.sbin/usbconfig/Makefile (contents, props changed) head/usr.sbin/usbconfig/dump.c (contents, props changed) head/usr.sbin/usbconfig/dump.h (contents, props changed) head/usr.sbin/usbconfig/usbconfig.8 (contents, props changed) head/usr.sbin/usbconfig/usbconfig.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/sound/pcm/channel.c head/sys/dev/sound/pcm/channel.h head/sys/dev/sound/pcm/mixer.c head/sys/dev/sound/pcm/mixer.h head/sys/modules/Makefile Added: head/lib/libusb20/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libusb20/Makefile Tue Nov 4 02:31:03 2008 (r184610) @@ -0,0 +1,24 @@ +# +# $FreeBSD$ +# +# Makefile for the FreeBSD specific LibUSB 2.0 +# + +LIB= usb20 +SHLIB_MAJOR= 1 +SHLIB_MINOR= 0 +SRCS= libusb20.c +SRCS+= libusb20_desc.c +SRCS+= libusb20_ugen20.c +SRCS+= libusb20_compat01.c +SRCS+= libusb20_compat10.c +INCS+= libusb20.h +INCS+= libusb20_desc.h +INCS+= libusb20_compat01.h +INCS+= libusb20_compat10.h +MAN= libusb20.3 +MKLINT= no +NOGCCERROR= + +.include + Added: head/lib/libusb20/libusb20.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libusb20/libusb20.3 Tue Nov 4 02:31:03 2008 (r184610) @@ -0,0 +1,893 @@ +.\" +.\" Copyright (c) 2008 Hans Petter Selasky +.\" +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 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$ +.\" +.Dd Oct 23, 2008 +.Dt LIBUSB20 3 +.Os +.Sh NAME +.Nm libusb20 +. +.Nd "USB access library" +. +. +.Sh LIBRARY +. +. +USB access library (libusb20 -lusb20) +. +. +. +.Sh SYNOPSIS +. +. +.In libusb20.h +. +. +.Sh DESCRIPTION +. +The +.Nm +library implements functions to be able to easily access and control +USB through the USB file system interface. +. +. +.Sh USB TRANSFER OPERATIONS +. +.Pp +. +.Fn libusb20_tr_close +This function will release all kernel resources associated with an USB +.Fa xfer . +. +This function returns zero upon success. +. +Non-zero return values indicate a LIBUSB20_ERROR value. +. +.Pp +. +.Fn libusb20_tr_open +This function will allocate kernel resources like +.Fa MaxBufSize +and +.Fa MaxFrameCount +associated with an USB +.Fa xfer +and bind the transfer to the specified +.Fa ep_no . +. +This function returns zero upon success. +. +Non-zero return values indicate a LIBUSB20_ERROR value. +. +.Pp +. +.Fn libusb20_tr_get_pointer +This function will return a pointer to the allocated USB transfer according to the +.Fa pdev +and +.Fa tr_index +arguments. +. +This function returns NULL in case of failure. +. +.Pp +. +.Fn libusb20_tr_get_time_complete +This function will return the completion time of an USB transfer in +millisecond units. This function is most useful for isochronous USB +transfers when doing echo cancelling. +. +.Pp +. +.Fn libusb20_tr_get_actual_frames +This function will return the actual number of USB frames after an USB +transfer completed. A value of zero means that no data was transferred. +. +.Pp +. +.Fn libusb20_tr_get_actual_length +This function will return the sum of the actual length for all +transferred USB frames for the given USB transfer. +. +.Pp +. +.Fn libusb20_tr_get_max_frames +This function will return the maximum number of USB frames that were +allocated when an USB transfer was setup for the given USB transfer. +. +.Pp +. +.Fn libusb20_tr_get_max_packet_length +This function will return the maximum packet length in bytes +associated with the given USB transfer. +. +The packet length can be used round up buffer sizes so that short USB +packets are avoided for proxy buffers. +. +. +.Pp +. +.Fn libusb20_tr_get_max_total_length +This function will return the maximum value for the length sum of all +USB frames associated with an USB transfer. +. +.Pp +. +.Fn libusb20_tr_get_status +This function will return the status of an USB transfer. +. +Status values are defined by a set of LIBUSB20_TRANSFER_XXX enums. +. +.Pp +. +.Fn libusb20_tr_pending +This function will return non-zero if the given USB transfer is +pending for completion. +. +Else this function returns zero. +. +.Pp +. +.Fn libusb20_tr_callback_wrapper +This is an internal function used to wrap asynchronous USB callbacks. +. +.Pp +. +.Fn libusb20_tr_clear_stall_sync +This is an internal function used to synchronously clear the stall on +the given USB transfer. +. +Please see the USB specification for more information on stall +clearing. +. +If the given USB transfer is pending when this function is called, the +USB transfer will complete with an error after that this function has +been called. +. +.Pp +. +.Fn libusb20_tr_drain +This function will stop the given USB transfer and will not return +until the USB transfer has been stopped in hardware. +. +.Pp +. +.Fn libusb20_tr_set_buffer +This function is used to set the +.Fa buffer +pointer for the given USB transfer and +.Fa fr_index . +. +Typically the frame index is zero. +. +. +.Pp +. +.Fn libusb20_tr_set_callback +This function is used to set the USB callback for asynchronous USB +transfers. +. +The callback type is defined by libusb20_tr_callback_t. +. +.Pp +. +.Fn libusb20_tr_set_flags +This function is used to set various USB flags for the given USB transfer. +.Bl -tag +.It LIBUSB20_TRANSFER_SINGLE_SHORT_NOT_OK +Report a short frame as error. +.It LIBUSB20_TRANSFER_MULTI_SHORT_NOT_OK +Multiple short frames are not allowed. +.It LIBUSB20_TRANSFER_FORCE_SHORT +All transmitted frames are short terminated. +.It LIBUSB20_TRANSFER_DO_CLEAR_STALL +Will do a clear-stall before starting the transfer. +.El +. +.Pp +. +.Fn libusb20_tr_set_length +This function sets the length of a given USB transfer and frame index. +. +.Pp +. +.Fn libusb20_tr_set_priv_sc0 +This function sets private driver pointer number zero. +. +.Pp +. +.Fn libusb20_tr_set_priv_sc1 +This function sets private driver pointer number one. +. +.Pp +. +.Fn libusb20_tr_set_timeout +This function sets the timeout for the given USB transfer. +. +A timeout value of zero means no timeout. +. +The timeout is given in milliseconds. +. +.Pp +. +.Fn libusb20_tr_set_total_frames +This function sets the total number of frames that should be executed when the USB transfer is submitted. +. +The total number of USB frames must be less than the maximum number of USB frames associated with the given USB transfer. +. +.Pp +. +.Fn libusb20_tr_setup_bulk +This function is a helper function for setting up a single frame USB BULK transfer. +. +.Pp +. +.Fn libusb20_tr_setup_control +This function is a helper function for setting up a single or dual +frame USB CONTROL transfer depending on the control transfer length. +. +.Pp +. +.Fn libusb20_tr_setup_intr +This function is a helper function for setting up a single frame USB INTERRUPT transfer. +. +.Pp +. +.Fn libusb20_tr_setup_isoc +This function is a helper function for setting up a multi frame USB ISOCHRONOUS transfer. +. +.Pp +. +.Fn libusb20_tr_start +This function will get the USB transfer started, if not already +started. +. +This function will not get the transfer queued in hardware. +. +This function is non-blocking. +. +.Pp +. +.Fn libusb20_tr_stop +This function will get the USB transfer stopped, if not already stopped. +. +This function is non-blocking, which means that the actual stop can +happen after the return of this function. +. +.Pp +. +.Fn libusb20_tr_submit +This function will get the USB transfer queued in hardware. +. +. +.Pp +. +.Fn libusb20_tr_get_priv_sc0 +This function returns private driver pointer number zero associated +with an USB transfer. +. +. +.Pp +. +.Fn libusb20_tr_get_priv_sc1 +This function returns private driver pointer number one associated +with an USB transfer. +. +. +.Sh USB DEVICE OPERATIONS +. +.Pp +. +.Fn libusb20_dev_get_backend_name +This function returns a zero terminated string describing the backend used. +. +.Pp +. +.Fn libusb20_dev_get_desc +This function returns a zero terminated string describing the given USB device. +. +.Pp +. +.Fn libusb20_dev_claim_interface +This function will try to claim the given USB interface given by +.Fa iface_index . +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_close +This function will close the given USB device. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_detach_kernel_driver +This function will try to detach the kernel driver for the USB interface given by +.Fa iface_index . +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_set_config_index +This function will try to set the configuration index on an USB +device. +. +The first configuration index is zero. +. +The un-configure index is 255. +. +This function returns zero on success else a LIBUSB20_ERROR value is returned. +. +.Pp +. +.Fn libusb20_dev_get_debug +This function returns the debug level of an USB device. +. +.Pp +. +.Fn libusb20_dev_get_fd +This function returns the file descriptor of the given USB device. +. +A negative value is returned when no file descriptor is present. +. +The file descriptor can be used for polling purposes. +. +.Pp +. +.Fn libusb20_dev_kernel_driver_active +This function returns a non-zero value if a kernel driver is active on +the given USB interface. +. +Else zero is returned. +. +.Pp +. +.Fn libusb20_dev_open +This function opens an USB device so that setting up USB transfers +becomes possible. +. +The number of USB transfers can be zero which means only control +transfers are allowed. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +A return value of LIBUSB20_ERROR_BUSY means that the device is already +opened. +. +.Pp +. +.Fn libusb20_dev_process +This function is called to sync kernel USB transfers with userland USB +transfers. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned typically indicating that the given USB device has been +detached. +. +.Pp +. +.Fn libusb20_dev_release_interface +This function will try to release a claimed USB interface for the specified USB device. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_request_sync +This function will perform a synchronous control request on the given +USB device. +. +Before this call will succeed the USB device must be opened. +. +.Fa setup +is a pointer to a decoded and host endian SETUP packet. +.Fa data +is a pointer to a data transfer buffer associated with the control transaction. This argument can be NULL. +.Fa pactlen +is a pointer to a variable that will hold the actual transfer length after the control transaction is complete. +.Fa timeout +is the transaction timeout given in milliseconds. +A timeout of zero means no timeout. +.Fa flags +is used to specify transaction flags, for example LIBUSB20_TRANSFER_SINGLE_SHORT_NOT_OK. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_req_string_sync +This function will synchronously request an USB string by language ID +and string index into the given buffer limited by a maximum length. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_req_string_simple_sync +This function will synchronously request an USB string using the +default language ID and convert the string into ASCII before storing +the string into the given buffer limited by a maximum length which +includes the terminating zero. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +. +.Pp +. +.Fn libusb20_dev_reset +This function will try to BUS reset the given USB device and restore +the last set USB configuration. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_set_power_mode +This function sets the power mode of the USB device. +. +Valid power modes: +.Bl -tag +.It LIBUSB20_POWER_OFF +.It LIBUSB20_POWER_ON +.It LIBUSB20_POWER_SAVE +.It LIBUSB20_POWER_SUSPEND +.It LIBUSB20_POWER_RESUME +.El +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_get_power_mode +This function returns the currently selected power mode for the given +USB device. +. +.Pp +. +.Fn libusb20_dev_set_alt_index +This function will try to set the given alternate index for the given +USB interface index. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_set_owner +This function will set the ownership of the given USB device. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_set_perm +This function will set the permissions of the given USB device. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_set_iface_owner +This function will set the ownership of the given USB interface. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_set_iface_perm +This function will set the permissions of the given USB interface. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_get_owner +This function will retrieve the current USB device ownership. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_get_perm +This function will retrieve the current USB device permissions. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_get_iface_owner +This function will retrieve the current USB interface ownership for +the given USB interface. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_get_iface_perm +This function will retrieve the current USB interface permissions for +the given USB interface. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_dev_get_device_desc +This function returns a pointer to the decoded and host endian version +of the device descriptor. +. +The USB device need not be opened when calling this function. +. +.Pp +. +.Fn libusb20_dev_alloc_config +This function will read out and decode the USB config descriptor for +the given USB device and config index. This function returns a pointer +to the decoded configuration which must eventually be passed to +free(). NULL is returned in case of failure. +. +.Pp +. +.Fn libusb20_dev_alloc(void) +This is an internal function to allocate a new USB device. +. +.Pp +. +.Fn libusb20_dev_get_address +This function returns the internal and not necessarily the real +hardware address of the given USB device. +. +.Pp +. +.Fn libusb20_dev_get_bus_number +This function return the internal bus number which the given USB +device belongs to. +. +.Pp +. +.Fn libusb20_dev_get_mode +This function returns the current operation mode of the USB entity. +. +Valid return values are: +.Bl -tag +.It LIBUSB20_MODE_HOST +.It LIBUSB20_MODE_DEVICE +.El +. +.Pp +. +.Fn libusb20_dev_get_speed +This function returns the current speed of the given USB device. +. +.Bl -tag +.It LIBUSB20_SPEED_UNKNOWN +.It LIBUSB20_SPEED_LOW +.It LIBUSB20_SPEED_FULL +.It LIBUSB20_SPEED_HIGH +.It LIBUSB20_SPEED_VARIABLE +.It LIBUSB20_SPEED_SUPER +.El +. +.Pp +. +.Fn libusb20_dev_get_config_index +This function returns the currently select config index for the given +USB device. +. +.Pp +. +.Fn libusb20_dev_free +This function will free the given USB device and all associated USB +transfers. +. +.Pp +. +.Fn libusb20_dev_set_debug +This function will set the debug level for the given USB device. +. +.Pp +. +.Fn libusb20_dev_wait_process +This function will wait until a pending USB transfer has completed on +the given USB device. +. +A timeout value can be specified which is passed on to the +.Xr 2 poll +function. +. +.Sh USB BUS OPERATIONS +. +.Fn libusb20_bus_set_owner +This function will set the ownership for the given USB bus. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_bus_set_perm +This function will set the permissions for the given USB bus. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_bus_get_owner +This function will retrieve the ownership for the given USB bus. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_bus_get_perm +This function will retrieve the permissions for the given USB bus. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +. +.Sh USB BACKEND OPERATIONS +. +.Fn libusb20_be_get_dev_quirk +This function will return the device quirk according to +.Fa index +into the libusb20_quirk structure pointed to by +.Fa pq . +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +If the given quirk does not exist LIBUSB20_ERROR_NOT_FOUND is +returned. +. +.Pp +. +.Fn libusb20_be_get_quirk_name +This function will return the quirk name according to +.Fa index +into the libusb20_quirk structure pointed to by +.Fa pq . +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +If the given quirk does not exist LIBUSB20_ERROR_NOT_FOUND is +returned. +. +.Pp +. +.Fn libusb20_be_add_dev_quirk +This function will add the libusb20_quirk structure pointed to by the +.Fa pq +argument into the device quirk list. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +If the given quirk cannot be added LIBUSB20_ERROR_NO_MEM is +returned. +. +.Pp +. +.Fn libusb20_be_remove_dev_quirk +This function will remove the quirk matching the libusb20_quirk structure pointed to by the +.Fa pq +argument from the device quirk list. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +If the given quirk does not exist LIBUSB20_ERROR_NOT_FOUND is +returned. +. +.Pp +. +.Fn libusb20_be_set_owner +This function will set the ownership for the given backend. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_be_set_perm +This function will set the permissions for the given backend. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_be_get_owner +This function will retrieve the ownership of the given backend. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_be_get_perm +This function will retrieve the permissions of the given backend. +. +. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_be_alloc +This is an internal function to allocate a USB backend. +. +.Pp +.Fn libusb20_be_alloc_default +.Fn libusb20_be_alloc_freebsd +.Fn libusb20_be_alloc_linux +These functions are used to allocate a specific USB backend or the +operating system default USB backend. Allocating a backend is a way to +scan for currently present USB devices. +. +.Pp +. +.Fn libusb20_be_device_foreach +This function is used to iterate USB devices present in a USB backend. +. +The starting value of +.Fa pdev +is NULL. +. +This function returns the next USB device in the list. +. +If NULL is returned the end of the USB device list has been reached. +. +.Pp +. +.Fn libusb20_be_dequeue_device +This function will dequeue the given USB device pointer from the +backend USB device list. +. +Dequeued USB devices will not be freed when the backend is freed. +. +.Pp +. +.Fn libusb20_be_enqueue_device +This function will enqueue the given USB device pointer in the backend USB device list. +. +Enqueued USB devices will get freed when the backend is freed. +. +.Pp +. +.Fn libusb20_be_free +This function will free the given backend and all USB devices in its device list. +. +. +.Sh USB DESCRIPTOR PARSING +. +.Fn libusb20_me_get_1 +This function will return a byte at the given byte offset of a message +entity. +. +This function is safe against invalid offsets. +. +.Pp +. +.Fn libusb20_me_get_2 +This function will return a little endian 16-bit value at the given byte offset of a message +entity. +. +This function is safe against invalid offsets. +. +.Pp +. +.Fn libusb20_me_encode +This function will encode a so-called *DECODED structure into binary +format. +. +The total encoded length that will fit in the given buffer is +returned. +. +If the buffer pointer is NULL no data will be written to the buffer +location. +. +.Pp +. +.Fn libusb20_me_decode +This function will decode a binary structure into a so-called *DECODED +structure. +. +The total decoded length is returned. +. +The buffer pointer cannot be NULL. +. +. +.Sh LIBUSB VERSION 0.1 COMPATIBILITY +. +.Fn usb_open +.Fn usb_close +.Fn usb_get_string +.Fn usb_get_string_simple +.Fn usb_get_descriptor_by_endpoint +.Fn usb_get_descriptor +.Fn usb_parse_descriptor +.Fn usb_parse_configuration +.Fn usb_destroy_configuration +.Fn usb_fetch_and_parse_descriptors +.Fn usb_bulk_write +.Fn usb_bulk_read +.Fn usb_interrupt_write +.Fn usb_interrupt_read +.Fn usb_control_msg +.Fn usb_set_configuration +.Fn usb_claim_interface +.Fn usb_release_interface +.Fn usb_set_altinterface +.Fn usb_resetep +.Fn usb_clear_halt +.Fn usb_reset +.Fn usb_strerror +.Fn usb_init +.Fn usb_set_debug +.Fn usb_find_busses +.Fn usb_find_devices +.Fn usb_device +.Fn usb_get_busses +These functions are compliant with LibUSB version 0.1.12. +. +.Sh FILES +. +. +/dev/usb +.Sh SEE ALSO +.Xr usb2_core 4 , +.Xr usbconfig 8 +. +. +.Sh HISTORY +. +. +Some parts of the +.Nm +API derives from the libusb project at sourceforge. Added: head/lib/libusb20/libusb20.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libusb20/libusb20.c Tue Nov 4 02:31:03 2008 (r184610) @@ -0,0 +1,1245 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 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. + */ + +#include +#include +#include +#include +#include +#include + +#include "libusb20.h" +#include "libusb20_desc.h" +#include "libusb20_int.h" + +static int +dummy_int(void) +{ + return (LIBUSB20_ERROR_NOT_SUPPORTED); +} + +static void +dummy_void(void) +{ + return; +} + +static void +dummy_callback(struct libusb20_transfer *xfer) +{ + ; /* style fix */ + switch (libusb20_tr_get_status(xfer)) { + case LIBUSB20_TRANSFER_START: + libusb20_tr_submit(xfer); + break; + default: + /* complete or error */ + break; + } + return; +} + +#define dummy_get_config_desc_full (void *)dummy_int +#define dummy_get_config_index (void *)dummy_int +#define dummy_set_config_index (void *)dummy_int +#define dummy_claim_interface (void *)dummy_int +#define dummy_release_interface (void *)dummy_int +#define dummy_set_alt_index (void *)dummy_int +#define dummy_reset_device (void *)dummy_int +#define dummy_set_power_mode (void *)dummy_int +#define dummy_get_power_mode (void *)dummy_int +#define dummy_kernel_driver_active (void *)dummy_int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 02:36:19 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83D37106567C; Tue, 4 Nov 2008 02:36:19 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 598678FC12; Tue, 4 Nov 2008 02:36:19 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA42aJpa083707; Tue, 4 Nov 2008 02:36:19 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA42aJJP083706; Tue, 4 Nov 2008 02:36:19 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200811040236.mA42aJJP083706@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 4 Nov 2008 02:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184611 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 02:36:19 -0000 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.conf Tue Nov 4 02:31:03 2008 (r184610) +++ svnadmin/conf/sizelimit.conf Tue Nov 4 02:36:18 2008 (r184611) @@ -17,4 +17,3 @@ #peter 3141592 #grog #kan -alfred 30240000 From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 03:42:01 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC1231065672; Tue, 4 Nov 2008 03:42:01 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAFCA8FC08; Tue, 4 Nov 2008 03:42:01 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA43g19N085236; Tue, 4 Nov 2008 03:42:01 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA43g1lZ085235; Tue, 4 Nov 2008 03:42:01 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <200811040342.mA43g1lZ085235@svn.freebsd.org> From: Alfred Perlstein Date: Tue, 4 Nov 2008 03:42:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184612 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 03:42:01 -0000 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 \ From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 09:15:17 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5902A106567F; Tue, 4 Nov 2008 09:15:17 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 110F78FC12; Tue, 4 Nov 2008 09:15:16 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 0EB4B6D43F; Tue, 4 Nov 2008 09:15:16 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id DF61684492; Tue, 4 Nov 2008 10:15:15 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin References: <200810250618.m9P6ICWl023370@svn.freebsd.org> <200811031301.07841.jhb@freebsd.org> <20081103.132512.-1476795190.imp@bsdimp.com> <200811031703.42653.jhb@freebsd.org> Date: Tue, 04 Nov 2008 10:15:15 +0100 In-Reply-To: <200811031703.42653.jhb@freebsd.org> (John Baldwin's message of "Mon, 3 Nov 2008 17:03:42 -0500") Message-ID: <86tzanq2cc.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, marcel@freebsd.org, src-committers@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r184251 - in head/sys: conf dev/cfi sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 09:15:17 -0000 John Baldwin writes: > M. Warner Losh writes: > > Whose name is in the disclaimer? > If the problem is "AUTHOR" vs "AUTHOR AND CONTRIBUTORS" then it would per= haps=20 > be more useful to all involved to actually state one's concerns instead o= f=20 > vague hand-waving and suggestions of evil. Actually, it says "Bill Paul and the voices in his head".. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 09:28:15 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57F8D1065678 for ; Tue, 4 Nov 2008 09:28:15 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 980028FC2D for ; Tue, 4 Nov 2008 09:28:14 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 04 Nov 2008 09:28:12 -0000 Received: from p54A3EE10.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.238.16] by mail.gmx.net (mp026) with SMTP; 04 Nov 2008 10:28:12 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX19JWL0Xe8pJtCPvxHfDyZMw2heMrtjKVgrvsH9u3P 3IWqkvYPhMW0n/ Message-ID: <491015AB.7070508@gmx.de> Date: Tue, 04 Nov 2008 10:28:11 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.17 (X11/20080927) MIME-Version: 1.0 To: Joerg Sonnenberger References: <200811032209.mA3M9RhK077380@svn.freebsd.org> <490F800E.9080201@gmx.de> <20081103225453.GA1509@britannica.bec.de> In-Reply-To: <20081103225453.GA1509@britannica.bec.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.64 Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r184605 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 09:28:15 -0000 Joerg Sonnenberger wrote: > On Mon, Nov 03, 2008 at 11:49:50PM +0100, Christoph Mallon wrote: >> You may want to make cmd[] static and/or const, so the compiler really >> just puts the bytes in the data section instead of generating code, >> which pretty much is the same as the assignments you just removed. > > I didn't make it const originally as I am not sure if the USB stack will > never modify the buffer. GCC generates 31 movb instructions to initialise the array on entry of the function. Every movb is 5 Bytes long (opcode + mod r/m + sib + offset + immediate). 31 * 5 = 155 Bytes. It is only sensible to use static initialisation for a local array, which contains lots of zeroes, if it can be made static or const (GCC is clever enough to turn a const array into a static one). Yes, GCC could be more clever and use movl instead of movb, but it isn't. Christoph From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 09:46:59 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D814F1065674; Tue, 4 Nov 2008 09:46:59 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 342158FC22; Tue, 4 Nov 2008 09:46:58 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl20-3.kln.forthnet.gr [77.49.147.3]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id mA49XvWC029079 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 4 Nov 2008 11:34:02 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id mA49Xv9j091051; Tue, 4 Nov 2008 11:33:57 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id mA49XuLM091050; Tue, 4 Nov 2008 11:33:56 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Alfred Perlstein References: <200811040231.mA42V4EQ083516@svn.freebsd.org> Date: Tue, 04 Nov 2008 11:33:56 +0200 In-Reply-To: <200811040231.mA42V4EQ083516@svn.freebsd.org> (Alfred Perlstein's message of "Tue, 4 Nov 2008 02:31:04 +0000 (UTC)") Message-ID: <87bpwv6diz.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: mA49XvWC029079 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.852, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.55, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: 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... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 09:46:59 -0000 On Tue, 4 Nov 2008 02:31:04 +0000 (UTC), Alfred Perlstein wrote: > 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. The tinderbox complains about `if_zyd2.c' on i386/pc98 and powerpc; we may have to commit something like: %%% --- if_zyd2.c.orig 2008-11-04 11:25:45.000000000 +0200 +++ if_zyd2.c 2008-11-04 11:31:24.000000000 +0200 @@ -378,6 +378,7 @@ struct zyd_softc *sc = xfer->priv_sc; struct zyd_cmd *cmd = &sc->sc_intr_ibuf; uint32_t actlen; + uint16_t code; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -392,14 +393,14 @@ usb2_copy_out(xfer->frbuffers, 0, &sc->sc_intr_ibuf, actlen); - switch (cmd->code) { - case htole16(ZYD_NOTIF_RETRYSTATUS): + code = le16toh(cmd->code); + switch (code) { + case ZYD_NOTIF_RETRYSTATUS: goto handle_notif_retrystatus; - case htole16(ZYD_NOTIF_IORD): + case ZYD_NOTIF_IORD: goto handle_notif_iord; default: - DPRINTFN(2, "unknown indication: 0x%04x\n", - le16toh(cmd->code)); + DPRINTFN(2, "unknown indication: 0x%04x\n", code); } /* fallthrough */ %%% From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 10:58:02 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA303106567A; Tue, 4 Nov 2008 10:58:02 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B877A8FC25; Tue, 4 Nov 2008 10:58:02 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4Aw2cP093687; Tue, 4 Nov 2008 10:58:02 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4Aw22W093656; Tue, 4 Nov 2008 10:58:02 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200811041058.mA4Aw22W093656@svn.freebsd.org> From: Ed Schouten Date: Tue, 4 Nov 2008 10:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184621 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 10:58:02 -0000 Author: ed Date: Tue Nov 4 10:58:02 2008 New Revision: 184621 URL: http://svn.freebsd.org/changeset/base/184621 Log: Remove redundant return value tests. There is no need to test whether the return value is non-zero here. Just return the error number directly. Modified: head/sys/kern/tty_pts.c Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Tue Nov 4 06:34:01 2008 (r184620) +++ head/sys/kern/tty_pts.c Tue Nov 4 10:58:02 2008 (r184621) @@ -701,13 +701,8 @@ posix_openpt(struct thread *td, struct p static int ptmx_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *fp) { - int error; - error = pts_alloc(fflags & (FREAD|FWRITE), td, fp); - if (error != 0) - return (error); - - return (0); + return (pts_alloc(fflags & (FREAD|FWRITE), td, fp)); } static struct cdevsw ptmx_cdevsw = { From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 11:52:50 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61B8B1065694; Tue, 4 Nov 2008 11:52:50 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F2C98FC67; Tue, 4 Nov 2008 11:52:50 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4BqoD2095614; Tue, 4 Nov 2008 11:52:50 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4BqoPb095612; Tue, 4 Nov 2008 11:52:50 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200811041152.mA4BqoPb095612@svn.freebsd.org> From: Rui Paulo Date: Tue, 4 Nov 2008 11:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184625 - in head: etc sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 11:52:50 -0000 Author: rpaulo Date: Tue Nov 4 11:52:50 2008 New Revision: 184625 URL: http://svn.freebsd.org/changeset/base/184625 Log: Add support for Asus A8Sr notebooks. PR: 128553 Submitted by: Eygene Ryabinkin Reviewed by: philip MFC after: 2 months Modified: head/etc/devd.conf head/sys/dev/acpi_support/acpi_asus.c Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Tue Nov 4 11:31:09 2008 (r184624) +++ head/etc/devd.conf Tue Nov 4 11:52:50 2008 (r184625) @@ -255,6 +255,28 @@ notify 10 { action "/etc/rc.resume acpi $notify"; }; +# The next blocks enable volume hotkeys that can be found on the Asus laptops +notify 0 { + match "system" "ACPI"; + match "subsystem" "ASUS"; + match "notify" "0x32"; + action "mixer 0"; +}; + +notify 0 { + match "system" "ACPI"; + match "subsystem"i "ASUS"; + match "notify" "0x31"; + action "mixer vol -10"; +}; + +notify 0 { + match "system" "ACPI"; + match "subsystem" "ASUS"; + match "notify" "0x30"; + action "mixer vol +10"; +}; + # The next blocks enable volume hotkeys that can be found on the Asus EeePC # The four keys above the keyboard notify 0x1a through to 0x1d respectively notify 0 { Modified: head/sys/dev/acpi_support/acpi_asus.c ============================================================================== --- head/sys/dev/acpi_support/acpi_asus.c Tue Nov 4 11:31:09 2008 (r184624) +++ head/sys/dev/acpi_support/acpi_asus.c Tue Nov 4 11:52:50 2008 (r184625) @@ -93,6 +93,9 @@ struct acpi_asus_model { char *wlan_set; void (*n_func)(ACPI_HANDLE, UINT32, void *); + + char *lcdd; + void (*lcdd_n_func)(ACPI_HANDLE, UINT32, void *); }; struct acpi_asus_led { @@ -113,6 +116,7 @@ struct acpi_asus_led { struct acpi_asus_softc { device_t dev; ACPI_HANDLE handle; + ACPI_HANDLE lcdd_handle; struct acpi_asus_model *model; struct sysctl_ctx_list sysctl_ctx; @@ -133,6 +137,9 @@ struct acpi_asus_softc { int s_wlan; }; +static void acpi_asus_lcdd_notify(ACPI_HANDLE h, UINT32 notify, + void *context); + /* * We can identify Asus laptops from the string they return * as a result of calling the ATK0100 'INIT' method. @@ -205,6 +212,20 @@ static struct acpi_asus_model acpi_asus_ .disp_set = "SDSP" }, { + .name = "A8SR", + .bled_set = "BLED", + .mled_set = "MLED", + .wled_set = "WLED", + .lcd_get = NULL, + .lcd_set = "\\_SB.PCI0.SBRG.EC0._Q10", + .brn_get = "GPLV", + .brn_set = "SPLV", + .disp_get = "\\_SB.PCI0.P0P1.VGA.GETD", + .disp_set = "SDSP", + .lcdd = "\\_SB.PCI0.P0P1.VGA.LCDD", + .lcdd_n_func = acpi_asus_lcdd_notify + }, + { .name = "D1x", .mled_set = "MLED", .lcd_get = "\\GP11", @@ -762,6 +783,22 @@ acpi_asus_attach(device_t dev) AcpiInstallNotifyHandler(sc->handle, ACPI_SYSTEM_NOTIFY, sc->model->n_func, dev); + /* Find and hook the 'LCDD' object */ + if (sc->model->lcdd != NULL && sc->model->lcdd_n_func != NULL) { + ACPI_STATUS res; + + sc->lcdd_handle = NULL; + res = AcpiGetHandle((sc->model->lcdd[0] == '\\' ? + NULL : sc->handle), sc->model->lcdd, &(sc->lcdd_handle)); + if (ACPI_SUCCESS(res)) { + AcpiInstallNotifyHandler((sc->lcdd_handle), + ACPI_DEVICE_NOTIFY, sc->model->lcdd_n_func, dev); + } else { + printf("%s: unable to find LCD device '%s'\n", + __func__, sc->model->lcdd); + } + } + return (0); } @@ -796,6 +833,13 @@ acpi_asus_detach(device_t dev) /* Remove notify handler */ AcpiRemoveNotifyHandler(sc->handle, ACPI_SYSTEM_NOTIFY, acpi_asus_notify); + + if (sc->lcdd_handle) { + KASSERT(sc->model->lcdd_n_func != NULL, + ("model->lcdd_n_func is NULL, but lcdd_handle is non-zero")); + AcpiRemoveNotifyHandler((sc->lcdd_handle), + ACPI_DEVICE_NOTIFY, sc->model->lcdd_n_func); + } /* Free sysctl tree */ sysctl_ctx_free(&sc->sysctl_ctx); @@ -1165,6 +1209,12 @@ acpi_asus_notify(ACPI_HANDLE h, UINT32 n } else if (notify == 0x34) { sc->s_lcd = 0; ACPI_VPRINT(sc->dev, acpi_sc, "LCD turned off\n"); + } else if (notify == 0x86) { + acpi_asus_sysctl_set(sc, ACPI_ASUS_METHOD_BRN, sc->s_brn-1); + ACPI_VPRINT(sc->dev, acpi_sc, "Brightness decreased\n"); + } else if (notify == 0x87) { + acpi_asus_sysctl_set(sc, ACPI_ASUS_METHOD_BRN, sc->s_brn+1); + ACPI_VPRINT(sc->dev, acpi_sc, "Brightness increased\n"); } else { /* Notify devd(8) */ acpi_UserNotify("ASUS", h, notify); @@ -1173,6 +1223,31 @@ acpi_asus_notify(ACPI_HANDLE h, UINT32 n } static void +acpi_asus_lcdd_notify(ACPI_HANDLE h, UINT32 notify, void *context) +{ + struct acpi_asus_softc *sc; + struct acpi_softc *acpi_sc; + + ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); + + sc = device_get_softc((device_t)context); + acpi_sc = acpi_device_get_parent_softc(sc->dev); + + ACPI_SERIAL_BEGIN(asus); + switch (notify) { + case 0x87: + acpi_asus_sysctl_set(sc, ACPI_ASUS_METHOD_BRN, sc->s_brn-1); + ACPI_VPRINT(sc->dev, acpi_sc, "Brightness decreased\n"); + break; + case 0x86: + acpi_asus_sysctl_set(sc, ACPI_ASUS_METHOD_BRN, sc->s_brn+1); + ACPI_VPRINT(sc->dev, acpi_sc, "Brightness increased\n"); + break; + } + ACPI_SERIAL_END(asus); +} + +static void acpi_asus_eeepc_notify(ACPI_HANDLE h, UINT32 notify, void *context) { struct acpi_asus_softc *sc; From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 12:30:31 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63CEA1065688; Tue, 4 Nov 2008 12:30:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 518CB8FC2E; Tue, 4 Nov 2008 12:30:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4CUVPN096569; Tue, 4 Nov 2008 12:30:31 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4CUVPV096568; Tue, 4 Nov 2008 12:30:31 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200811041230.mA4CUVPV096568@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 4 Nov 2008 12:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184629 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 12:30:31 -0000 Author: trasz Date: Tue Nov 4 12:30:31 2008 New Revision: 184629 URL: http://svn.freebsd.org/changeset/base/184629 Log: In UFS, when reading EA that contains ACL fails for some reason, include inode number and filesystem name, so the administrator can fix the problem. Approved by: rwatson (mentor) Modified: head/sys/ufs/ufs/ufs_acl.c Modified: head/sys/ufs/ufs/ufs_acl.c ============================================================================== --- head/sys/ufs/ufs/ufs_acl.c Tue Nov 4 12:03:55 2008 (r184628) +++ head/sys/ufs/ufs/ufs_acl.c Tue Nov 4 12:30:31 2008 (r184629) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef UFS_ACL @@ -217,7 +218,8 @@ ufs_getacl(ap) * are unsafe. */ printf("ufs_getacl(): Loaded invalid ACL (" - "%d bytes)\n", len); + "%d bytes), inumber %d on %s\n", len, + ip->i_number, ip->i_fs->fs_fsmnt); return (EPERM); } ufs_sync_acl_from_inode(ip, ap->a_aclp); @@ -262,7 +264,8 @@ ufs_getacl(ap) * protections are unsafe. */ printf("ufs_getacl(): Loaded invalid ACL (" - "%d bytes)\n", len); + "%d bytes), inumber %d on %s\n", len, + ip->i_number, ip->i_fs->fs_fsmnt); return (EPERM); } break; From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 13:49:54 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5890C106571A; Tue, 4 Nov 2008 13:49:54 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4688D8FC16; Tue, 4 Nov 2008 13:49:54 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4DnsFB098252; Tue, 4 Nov 2008 13:49:54 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4DnsrB098250; Tue, 4 Nov 2008 13:49:54 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811041349.mA4DnsrB098250@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 4 Nov 2008 13:49:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184633 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 13:49:54 -0000 Author: des Date: Tue Nov 4 13:49:53 2008 New Revision: 184633 URL: http://svn.freebsd.org/changeset/base/184633 Log: Avoid assigning a const char * to a char *. MFC after: 3 weeks Modified: head/lib/libutil/login_cap.c head/lib/libutil/login_class.c Modified: head/lib/libutil/login_cap.c ============================================================================== --- head/lib/libutil/login_cap.c Tue Nov 4 13:49:18 2008 (r184632) +++ head/lib/libutil/login_cap.c Tue Nov 4 13:49:53 2008 (r184633) @@ -61,6 +61,8 @@ static char * internal_string = NULL; static size_t internal_arraysz = 0; static const char ** internal_array = NULL; +static char path_login_conf[] = _PATH_LOGIN_CONF; + static char * allocstr(const char *str) { @@ -215,15 +217,14 @@ login_getclassbyname(char const *name, c if (dir && snprintf(userpath, MAXPATHLEN, "%s/%s", dir, _FILE_LOGIN_CONF) < MAXPATHLEN) { - login_dbarray[i] = userpath; if (_secure_path(userpath, pwd->pw_uid, pwd->pw_gid) != -1) - i++; /* only use 'secure' data */ + login_dbarray[i++] = userpath; } /* * XXX: Why to add the system database if the class is `me'? */ - if (_secure_path(_PATH_LOGIN_CONF, 0, 0) != -1) - login_dbarray[i++] = _PATH_LOGIN_CONF; + if (_secure_path(path_login_conf, 0, 0) != -1) + login_dbarray[i++] = path_login_conf; login_dbarray[i] = NULL; memset(lc, 0, sizeof(login_cap_t)); Modified: head/lib/libutil/login_class.c ============================================================================== --- head/lib/libutil/login_class.c Tue Nov 4 13:49:18 2008 (r184632) +++ head/lib/libutil/login_class.c Tue Nov 4 13:49:53 2008 (r184633) @@ -142,14 +142,13 @@ substvar(const char * var, const struct int tildes = 0; int dollas = 0; char *p; + const char *q; if (pwd != NULL) { - /* Count the number of ~'s in var to substitute */ - for (p = (char *)var; (p = strchr(p, '~')) != NULL; p++) - ++tildes; - /* Count the number of $'s in var to substitute */ - for (p = (char *)var; (p = strchr(p, '$')) != NULL; p++) - ++dollas; + for (q = var; *q != '\0'; ++q) { + tildes += (*q == '~'); + dollas += (*q == '$'); + } } np = malloc(strlen(var) + (dollas * nlen) From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 13:50:51 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36F7B106564A; Tue, 4 Nov 2008 13:50:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C68F8FC08; Tue, 4 Nov 2008 13:50:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4DooeS098319; Tue, 4 Nov 2008 13:50:50 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4DooH5098318; Tue, 4 Nov 2008 13:50:50 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811041350.mA4DooH5098318@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 4 Nov 2008 13:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184634 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 13:50:51 -0000 Author: des Date: Tue Nov 4 13:50:50 2008 New Revision: 184634 URL: http://svn.freebsd.org/changeset/base/184634 Log: Add missing header. Modified: head/lib/libutil/pty.c Modified: head/lib/libutil/pty.c ============================================================================== --- head/lib/libutil/pty.c Tue Nov 4 13:49:53 2008 (r184633) +++ head/lib/libutil/pty.c Tue Nov 4 13:50:50 2008 (r184634) @@ -47,6 +47,7 @@ static char sccsid[] = "@(#)pty.c 8.3 (B #include #include #include +#include int openpty(int *amaster, int *aslave, char *name, struct termios *termp, From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 13:51:15 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D54451065686; Tue, 4 Nov 2008 13:51:15 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3A3C8FC1E; Tue, 4 Nov 2008 13:51:15 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4DpFe9098365; Tue, 4 Nov 2008 13:51:15 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4DpFM1098364; Tue, 4 Nov 2008 13:51:15 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811041351.mA4DpFM1098364@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 4 Nov 2008 13:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184635 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 13:51:16 -0000 Author: des Date: Tue Nov 4 13:51:15 2008 New Revision: 184635 URL: http://svn.freebsd.org/changeset/base/184635 Log: libutil now builds at WARNS level 6. MFC after: 3 weeks Modified: head/lib/libutil/Makefile Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Tue Nov 4 13:50:50 2008 (r184634) +++ head/lib/libutil/Makefile Tue Nov 4 13:51:15 2008 (r184635) @@ -15,6 +15,8 @@ SRCS= _secure_path.c auth.c gr_util.c ex stub.c trimdomain.c uucplock.c INCS= libutil.h login_cap.h +WARNS?= 6 + CFLAGS+= -DLIBC_SCCS .if ${MK_INET6_SUPPORT} != "no" From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 14:17:50 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D8AC1065672; Tue, 4 Nov 2008 14:17:50 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B2ED8FC22; Tue, 4 Nov 2008 14:17:50 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4EHoVx099031; Tue, 4 Nov 2008 14:17:50 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4EHodx099029; Tue, 4 Nov 2008 14:17:50 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811041417.mA4EHodx099029@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 4 Nov 2008 14:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184638 - head/libexec/rpc.rquotad X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 14:17:50 -0000 Author: des Date: Tue Nov 4 14:17:49 2008 New Revision: 184638 URL: http://svn.freebsd.org/changeset/base/184638 Log: Whitespace and style fixes, build at WARNS level 6. MFC after: 3 weeks Modified: head/libexec/rpc.rquotad/Makefile head/libexec/rpc.rquotad/rquotad.c Modified: head/libexec/rpc.rquotad/Makefile ============================================================================== --- head/libexec/rpc.rquotad/Makefile Tue Nov 4 13:55:55 2008 (r184637) +++ head/libexec/rpc.rquotad/Makefile Tue Nov 4 14:17:49 2008 (r184638) @@ -4,6 +4,8 @@ PROG = rpc.rquotad SRCS = rquotad.c MAN = rpc.rquotad.8 +WARNS ?= 6 + DPADD= ${LIBRPCSVC} LDADD= -lrpcsvc Modified: head/libexec/rpc.rquotad/rquotad.c ============================================================================== --- head/libexec/rpc.rquotad/rquotad.c Tue Nov 4 13:55:55 2008 (r184637) +++ head/libexec/rpc.rquotad/rquotad.c Tue Nov 4 14:17:49 2008 (r184638) @@ -1,39 +1,35 @@ /* * by Manuel Bouyer (bouyer@ensta.fr) - * + * * There is no copyright, you can use it as you want. */ -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ +#include +__FBSDID("$FreeBSD$"); #include -#include #include #include #include #include -#include + +#include +#include +#include +#include +#include #include #include #include #include #include +#include #include #include #include -#include - #include - -#include -#include -#include -#include -#include +#include void rquota_service(struct svc_req *request, SVCXPRT *transp); void sendquota(struct svc_req *request, SVCXPRT *transp); @@ -56,15 +52,17 @@ struct fs_stat *fs_begin = NULL; int from_inetd = 1; -void +static void cleanup(int sig) { + + (void) sig; (void) rpcb_unset(RQUOTAPROG, RQUOTAVERS, NULL); exit(0); } int -main(int argc, char *argv[]) +main(void) { SVCXPRT *transp; int ok; @@ -101,19 +99,22 @@ main(int argc, char *argv[]) ok = svc_create(rquota_service, RQUOTAPROG, RQUOTAVERS, "udp"); if (!ok) { - syslog(LOG_ERR, "unable to register (RQUOTAPROG, RQUOTAVERS, %s)", (!from_inetd)?"udp":"(inetd)"); + syslog(LOG_ERR, + "unable to register (RQUOTAPROG, RQUOTAVERS, %s)", + from_inetd ? "(inetd)" : "udp"); exit(1); } - initfs(); /* init the fs_stat list */ + initfs(); svc_run(); syslog(LOG_ERR, "svc_run returned"); exit(1); } -void +void rquota_service(struct svc_req *request, SVCXPRT *transp) { + switch (request->rq_proc) { case NULLPROC: (void)svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL); @@ -133,7 +134,7 @@ rquota_service(struct svc_req *request, } /* read quota for the specified id, and send it */ -void +void sendquota(struct svc_req *request, SVCXPRT *transp) { struct getquota_args getq_args; @@ -183,7 +184,7 @@ sendquota(struct svc_req *request, SVCXP } } -void +void printerr_reply(SVCXPRT *transp) /* when a reply to a request failed */ { char name[INET6_ADDRSTRLEN]; @@ -203,7 +204,7 @@ printerr_reply(SVCXPRT *transp) /* when } /* initialise the fs_tab list from entries in /etc/fstab */ -void +void initfs(void) { struct fs_stat *fs_current = NULL; @@ -222,10 +223,12 @@ initfs(void) fs_current = (struct fs_stat *) malloc(sizeof(struct fs_stat)); fs_current->fs_next = fs_next; /* next element */ - fs_current->fs_file = malloc(sizeof(char) * (strlen(fs->fs_file) + 1)); + fs_current->fs_file = + malloc(sizeof(char) * (strlen(fs->fs_file) + 1)); strcpy(fs_current->fs_file, fs->fs_file); - fs_current->qfpathname = malloc(sizeof(char) * (strlen(qfpathname) + 1)); + fs_current->qfpathname = + malloc(sizeof(char) * (strlen(qfpathname) + 1)); strcpy(fs_current->qfpathname, qfpathname); stat(fs_current->fs_file, &st); @@ -242,7 +245,7 @@ initfs(void) * Return 0 if fail, 1 otherwise */ int -getfsquota(long id, char *path, struct dqblk *dqblk) +getfsquota(long id, char *path, struct dqblk *dqblk) { struct stat st_path; struct fs_stat *fs; @@ -301,8 +304,8 @@ hasquota(struct fstab *fs, char **qfnam { static char initname, usrname[100]; static char buf[BUFSIZ]; - char *opt, *cp; - char *qfextension[] = INITQFNAMES; + char *opt, *cp; + const char *qfextension[] = INITQFNAMES; if (!initname) { sprintf(usrname, "%s%s", qfextension[USRQUOTA], QUOTAFILENAME); @@ -321,7 +324,8 @@ hasquota(struct fstab *fs, char **qfnam *qfnamep = cp; return (1); } - sprintf(buf, "%s/%s.%s", fs->fs_file, QUOTAFILENAME, qfextension[USRQUOTA]); + sprintf(buf, "%s/%s.%s", fs->fs_file, QUOTAFILENAME, + qfextension[USRQUOTA]); *qfnamep = buf; return (1); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 15:56:44 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEE93106574E; Tue, 4 Nov 2008 15:56:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3F498FC14; Tue, 4 Nov 2008 15:56:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4Fuing001110; Tue, 4 Nov 2008 15:56:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4FuijN001109; Tue, 4 Nov 2008 15:56:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200811041556.mA4FuijN001109@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 4 Nov 2008 15:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184641 - in stable/7/sys: . kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 15:56:45 -0000 Author: kib Date: Tue Nov 4 15:56:44 2008 New Revision: 184641 URL: http://svn.freebsd.org/changeset/base/184641 Log: MFC r184409: Protect check for v_pollinfo == NULL and assignment of the newly allocated vpollinfo with vnode interlock. Fully initialize vpollinfo before putting pointer to it into vp->v_pollinfo. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/kern/vfs_subr.c Modified: stable/7/sys/kern/vfs_subr.c ============================================================================== --- stable/7/sys/kern/vfs_subr.c Tue Nov 4 15:47:06 2008 (r184640) +++ stable/7/sys/kern/vfs_subr.c Tue Nov 4 15:56:44 2008 (r184641) @@ -109,7 +109,7 @@ static void vgonel(struct vnode *); static void vfs_knllock(void *arg); static void vfs_knlunlock(void *arg); static int vfs_knllocked(void *arg); - +static void destroy_vpollinfo(struct vpollinfo *vi); /* * Enable Giant pushdown based on whether or not the vm is mpsafe in this @@ -815,11 +815,8 @@ vdestroy(struct vnode *vp) #ifdef MAC mac_destroy_vnode(vp); #endif - if (vp->v_pollinfo != NULL) { - knlist_destroy(&vp->v_pollinfo->vpi_selinfo.si_note); - mtx_destroy(&vp->v_pollinfo->vpi_lock); - uma_zfree(vnodepoll_zone, vp->v_pollinfo); - } + if (vp->v_pollinfo != NULL) + destroy_vpollinfo(vp->v_pollinfo); #ifdef INVARIANTS /* XXX Elsewhere we can detect an already freed vnode via NULL v_op. */ vp->v_op = NULL; @@ -3050,6 +3047,14 @@ vbusy(struct vnode *vp) mtx_unlock(&vnode_free_list_mtx); } +static void +destroy_vpollinfo(struct vpollinfo *vi) +{ + knlist_destroy(&vi->vpi_selinfo.si_note); + mtx_destroy(&vi->vpi_lock); + uma_zfree(vnodepoll_zone, vi); +} + /* * Initalize per-vnode helper structure to hold poll-related state. */ @@ -3058,15 +3063,20 @@ v_addpollinfo(struct vnode *vp) { struct vpollinfo *vi; + if (vp->v_pollinfo != NULL) + return; vi = uma_zalloc(vnodepoll_zone, M_WAITOK); + mtx_init(&vi->vpi_lock, "vnode pollinfo", NULL, MTX_DEF); + knlist_init(&vi->vpi_selinfo.si_note, vp, vfs_knllock, + vfs_knlunlock, vfs_knllocked); + VI_LOCK(vp); if (vp->v_pollinfo != NULL) { - uma_zfree(vnodepoll_zone, vi); + VI_UNLOCK(vp); + destroy_vpollinfo(vi); return; } vp->v_pollinfo = vi; - mtx_init(&vp->v_pollinfo->vpi_lock, "vnode pollinfo", NULL, MTX_DEF); - knlist_init(&vp->v_pollinfo->vpi_selinfo.si_note, vp, vfs_knllock, - vfs_knlunlock, vfs_knllocked); + VI_UNLOCK(vp); } /* @@ -3081,8 +3091,7 @@ int vn_pollrecord(struct vnode *vp, struct thread *td, int events) { - if (vp->v_pollinfo == NULL) - v_addpollinfo(vp); + v_addpollinfo(vp); mtx_lock(&vp->v_pollinfo->vpi_lock); if (vp->v_pollinfo->vpi_revents & events) { /* @@ -3917,8 +3926,7 @@ vfs_kqfilter(struct vop_kqfilter_args *a kn->kn_hook = (caddr_t)vp; - if (vp->v_pollinfo == NULL) - v_addpollinfo(vp); + v_addpollinfo(vp); if (vp->v_pollinfo == NULL) return (ENOMEM); knl = &vp->v_pollinfo->vpi_selinfo.si_note; From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 16:03:40 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11B531065670; Tue, 4 Nov 2008 16:03:40 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id AF3B28FC16; Tue, 4 Nov 2008 16:03:39 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local ([192.168.254.200]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id mA4G3Wau032927; Tue, 4 Nov 2008 09:03:32 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <49107254.9070307@samsco.org> Date: Tue, 04 Nov 2008 09:03:32 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Konstantin Belousov References: <200811041556.mA4FuijN001109@svn.freebsd.org> In-Reply-To: <200811041556.mA4FuijN001109@svn.freebsd.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn commit: r184641 - in stable/7/sys: . kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 16:03:40 -0000 In stable branches, and especially during release cycles, would it be possible to annotate whether changes like this fix known panics or user-visible bugs? Scott Konstantin Belousov wrote: > Author: kib > Date: Tue Nov 4 15:56:44 2008 > New Revision: 184641 > URL: http://svn.freebsd.org/changeset/base/184641 > > Log: > MFC r184409: > Protect check for v_pollinfo == NULL and assignment of the newly allocated > vpollinfo with vnode interlock. Fully initialize vpollinfo before putting > pointer to it into vp->v_pollinfo. > > Approved by: re (kensmith) > > Modified: > stable/7/sys/ (props changed) > stable/7/sys/kern/vfs_subr.c > > Modified: stable/7/sys/kern/vfs_subr.c > ============================================================================== > --- stable/7/sys/kern/vfs_subr.c Tue Nov 4 15:47:06 2008 (r184640) > +++ stable/7/sys/kern/vfs_subr.c Tue Nov 4 15:56:44 2008 (r184641) > @@ -109,7 +109,7 @@ static void vgonel(struct vnode *); > static void vfs_knllock(void *arg); > static void vfs_knlunlock(void *arg); > static int vfs_knllocked(void *arg); > - > +static void destroy_vpollinfo(struct vpollinfo *vi); > > /* > * Enable Giant pushdown based on whether or not the vm is mpsafe in this > @@ -815,11 +815,8 @@ vdestroy(struct vnode *vp) > #ifdef MAC > mac_destroy_vnode(vp); > #endif > - if (vp->v_pollinfo != NULL) { > - knlist_destroy(&vp->v_pollinfo->vpi_selinfo.si_note); > - mtx_destroy(&vp->v_pollinfo->vpi_lock); > - uma_zfree(vnodepoll_zone, vp->v_pollinfo); > - } > + if (vp->v_pollinfo != NULL) > + destroy_vpollinfo(vp->v_pollinfo); > #ifdef INVARIANTS > /* XXX Elsewhere we can detect an already freed vnode via NULL v_op. */ > vp->v_op = NULL; > @@ -3050,6 +3047,14 @@ vbusy(struct vnode *vp) > mtx_unlock(&vnode_free_list_mtx); > } > > +static void > +destroy_vpollinfo(struct vpollinfo *vi) > +{ > + knlist_destroy(&vi->vpi_selinfo.si_note); > + mtx_destroy(&vi->vpi_lock); > + uma_zfree(vnodepoll_zone, vi); > +} > + > /* > * Initalize per-vnode helper structure to hold poll-related state. > */ > @@ -3058,15 +3063,20 @@ v_addpollinfo(struct vnode *vp) > { > struct vpollinfo *vi; > > + if (vp->v_pollinfo != NULL) > + return; > vi = uma_zalloc(vnodepoll_zone, M_WAITOK); > + mtx_init(&vi->vpi_lock, "vnode pollinfo", NULL, MTX_DEF); > + knlist_init(&vi->vpi_selinfo.si_note, vp, vfs_knllock, > + vfs_knlunlock, vfs_knllocked); > + VI_LOCK(vp); > if (vp->v_pollinfo != NULL) { > - uma_zfree(vnodepoll_zone, vi); > + VI_UNLOCK(vp); > + destroy_vpollinfo(vi); > return; > } > vp->v_pollinfo = vi; > - mtx_init(&vp->v_pollinfo->vpi_lock, "vnode pollinfo", NULL, MTX_DEF); > - knlist_init(&vp->v_pollinfo->vpi_selinfo.si_note, vp, vfs_knllock, > - vfs_knlunlock, vfs_knllocked); > + VI_UNLOCK(vp); > } > > /* > @@ -3081,8 +3091,7 @@ int > vn_pollrecord(struct vnode *vp, struct thread *td, int events) > { > > - if (vp->v_pollinfo == NULL) > - v_addpollinfo(vp); > + v_addpollinfo(vp); > mtx_lock(&vp->v_pollinfo->vpi_lock); > if (vp->v_pollinfo->vpi_revents & events) { > /* > @@ -3917,8 +3926,7 @@ vfs_kqfilter(struct vop_kqfilter_args *a > > kn->kn_hook = (caddr_t)vp; > > - if (vp->v_pollinfo == NULL) > - v_addpollinfo(vp); > + v_addpollinfo(vp); > if (vp->v_pollinfo == NULL) > return (ENOMEM); > knl = &vp->v_pollinfo->vpi_selinfo.si_note; From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 16:08:50 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C4F51065678; Tue, 4 Nov 2008 16:08:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id D19DB8FC21; Tue, 4 Nov 2008 16:08:49 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 615972BC47; Wed, 5 Nov 2008 05:08:48 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hl8PnT4kru71; Wed, 5 Nov 2008 05:08:42 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Wed, 5 Nov 2008 05:08:42 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 9D9AD1142E; Wed, 5 Nov 2008 05:08:41 +1300 (NZDT) Date: Tue, 4 Nov 2008 08:08:41 -0800 From: Andrew Thompson To: Rui Paulo Message-ID: <20081104160841.GF93540@citylink.fud.org.nz> References: <200811041152.mA4BqoPb095612@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200811041152.mA4BqoPb095612@svn.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184625 - in head: etc sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 16:08:50 -0000 On Tue, Nov 04, 2008 at 11:52:50AM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Tue Nov 4 11:52:50 2008 > New Revision: 184625 > URL: http://svn.freebsd.org/changeset/base/184625 > > Log: > Add support for Asus A8Sr notebooks. > > PR: 128553 > Submitted by: Eygene Ryabinkin > Reviewed by: philip > MFC after: 2 months > > Modified: > head/etc/devd.conf > head/sys/dev/acpi_support/acpi_asus.c We could almost do with a /etc/devd.conf.d/ directory to drop in hardware specific event files. Andrew From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 16:43:03 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 148F21065677; Tue, 4 Nov 2008 16:43:03 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02DD88FC22; Tue, 4 Nov 2008 16:43:03 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4Gh2wd002168; Tue, 4 Nov 2008 16:43:02 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4Gh2Sm002167; Tue, 4 Nov 2008 16:43:02 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811041643.mA4Gh2Sm002167@svn.freebsd.org> From: Doug Rabson Date: Tue, 4 Nov 2008 16:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184643 - head/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 16:43:03 -0000 Author: dfr Date: Tue Nov 4 16:43:02 2008 New Revision: 184643 URL: http://svn.freebsd.org/changeset/base/184643 Log: Include . Modified: head/sys/nfsserver/nfs_srvkrpc.c Modified: head/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- head/sys/nfsserver/nfs_srvkrpc.c Tue Nov 4 16:22:14 2008 (r184642) +++ head/sys/nfsserver/nfs_srvkrpc.c Tue Nov 4 16:43:02 2008 (r184643) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 16:59:59 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C6271065677; Tue, 4 Nov 2008 16:59:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id DEA9D8FC26; Tue, 4 Nov 2008 16:59:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KxPG0-000I3l-70; Tue, 04 Nov 2008 18:59:56 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id mA4Gxqox023489 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 4 Nov 2008 18:59:52 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id mA4Gxq0r051649; Tue, 4 Nov 2008 18:59:52 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id mA4GxqNT051648; Tue, 4 Nov 2008 18:59:52 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Nov 2008 18:59:51 +0200 From: Kostik Belousov To: Scott Long Message-ID: <20081104165951.GQ18100@deviant.kiev.zoral.com.ua> References: <200811041556.mA4FuijN001109@svn.freebsd.org> <49107254.9070307@samsco.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sUOf/0EjaVk9Y/9c" Content-Disposition: inline In-Reply-To: <49107254.9070307@samsco.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1KxPG0-000I3l-70 0893544d19c01f9faf455f414a27df2b X-Terabit: YES Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r184641 - in stable/7/sys: . kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 16:59:59 -0000 --sUOf/0EjaVk9Y/9c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 04, 2008 at 09:03:32AM -0700, Scott Long wrote: > In stable branches, and especially during release cycles, would it be=20 > possible to annotate whether changes like this fix known panics or=20 > user-visible bugs? I thought that description of the change made it obvious. Access to the partially initialized structure is sure reason for a bad behaviour, panic in this particular case. It is slightly more involved in this case, because other thread was able to overwrite pointer to fully initialized structure put by current thread. This is what prevented by vnode interlock region. >=20 > Scott >=20 >=20 > Konstantin Belousov wrote: > >Author: kib > >Date: Tue Nov 4 15:56:44 2008 > >New Revision: 184641 > >URL: http://svn.freebsd.org/changeset/base/184641 > > > >Log: > > MFC r184409: > > Protect check for v_pollinfo =3D=3D NULL and assignment of the newly= =20 > > allocated > > vpollinfo with vnode interlock. Fully initialize vpollinfo before putt= ing > > pointer to it into vp->v_pollinfo. > > =20 > > Approved by: re (kensmith) > > > >Modified: > > stable/7/sys/ (props changed) > > stable/7/sys/kern/vfs_subr.c > > > >Modified: stable/7/sys/kern/vfs_subr.c > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- stable/7/sys/kern/vfs_subr.c Tue Nov 4 15:47:06 2008 (r184640) > >+++ stable/7/sys/kern/vfs_subr.c Tue Nov 4 15:56:44 2008 (r184641) > >@@ -109,7 +109,7 @@ static void vgonel(struct vnode *); > > static void vfs_knllock(void *arg); > > static void vfs_knlunlock(void *arg); > > static int vfs_knllocked(void *arg); > >- > >+static void destroy_vpollinfo(struct vpollinfo *vi); > >=20 > > /* > > * Enable Giant pushdown based on whether or not the vm is mpsafe in th= is > >@@ -815,11 +815,8 @@ vdestroy(struct vnode *vp) > > #ifdef MAC > > mac_destroy_vnode(vp); > > #endif > >- if (vp->v_pollinfo !=3D NULL) { > >- knlist_destroy(&vp->v_pollinfo->vpi_selinfo.si_note); > >- mtx_destroy(&vp->v_pollinfo->vpi_lock); > >- uma_zfree(vnodepoll_zone, vp->v_pollinfo); > >- } > >+ if (vp->v_pollinfo !=3D NULL) > >+ destroy_vpollinfo(vp->v_pollinfo); > > #ifdef INVARIANTS > > /* XXX Elsewhere we can detect an already freed vnode via NULL v_op.= =20 > > */ > > vp->v_op =3D NULL; > >@@ -3050,6 +3047,14 @@ vbusy(struct vnode *vp) > > mtx_unlock(&vnode_free_list_mtx); > > } > >=20 > >+static void > >+destroy_vpollinfo(struct vpollinfo *vi) > >+{ > >+ knlist_destroy(&vi->vpi_selinfo.si_note); > >+ mtx_destroy(&vi->vpi_lock); > >+ uma_zfree(vnodepoll_zone, vi); > >+} > >+ > > /* > > * Initalize per-vnode helper structure to hold poll-related state. > > */ > >@@ -3058,15 +3063,20 @@ v_addpollinfo(struct vnode *vp) > > { > > struct vpollinfo *vi; > >=20 > >+ if (vp->v_pollinfo !=3D NULL) > >+ return; > > vi =3D uma_zalloc(vnodepoll_zone, M_WAITOK); > >+ mtx_init(&vi->vpi_lock, "vnode pollinfo", NULL, MTX_DEF); > >+ knlist_init(&vi->vpi_selinfo.si_note, vp, vfs_knllock, > >+ vfs_knlunlock, vfs_knllocked); > >+ VI_LOCK(vp); > > if (vp->v_pollinfo !=3D NULL) { > >- uma_zfree(vnodepoll_zone, vi); > >+ VI_UNLOCK(vp); > >+ destroy_vpollinfo(vi); > > return; > > } > > vp->v_pollinfo =3D vi; > >- mtx_init(&vp->v_pollinfo->vpi_lock, "vnode pollinfo", NULL, MTX_DEF); > >- knlist_init(&vp->v_pollinfo->vpi_selinfo.si_note, vp, vfs_knllock, > >- vfs_knlunlock, vfs_knllocked); > >+ VI_UNLOCK(vp); > > } > >=20 > > /* > >@@ -3081,8 +3091,7 @@ int > > vn_pollrecord(struct vnode *vp, struct thread *td, int events) > > { > >=20 > >- if (vp->v_pollinfo =3D=3D NULL) > >- v_addpollinfo(vp); > >+ v_addpollinfo(vp); > > mtx_lock(&vp->v_pollinfo->vpi_lock); > > if (vp->v_pollinfo->vpi_revents & events) { > > /* > >@@ -3917,8 +3926,7 @@ vfs_kqfilter(struct vop_kqfilter_args *a > >=20 > > kn->kn_hook =3D (caddr_t)vp; > >=20 > >- if (vp->v_pollinfo =3D=3D NULL) > >- v_addpollinfo(vp); > >+ v_addpollinfo(vp); > > if (vp->v_pollinfo =3D=3D NULL) > > return (ENOMEM); > > knl =3D &vp->v_pollinfo->vpi_selinfo.si_note; --sUOf/0EjaVk9Y/9c Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkkQf4cACgkQC3+MBN1Mb4h9sQCgsy6wmhViv3AMrezd1PIXE5zw Vg4An1N13nuyG3CkPIEyrWnFZuSz/TWt =qPC0 -----END PGP SIGNATURE----- --sUOf/0EjaVk9Y/9c-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 17:08:35 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B7411065693 for ; Tue, 4 Nov 2008 17:08:35 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by mx1.freebsd.org (Postfix) with ESMTP id 42A248FC16 for ; Tue, 4 Nov 2008 17:08:34 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: by nf-out-0910.google.com with SMTP id h3so1314074nfh.33 for ; Tue, 04 Nov 2008 09:06:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-pgp-agent:x-mailer; bh=e+RDmr182A0LaC6qTCaU25Xnw+eRMTM5voYgXSPtDuI=; b=IBb+eQyZlQDANjvjV83T3jZQpx7kJj0V/NSs0I/efPZvMyRPRGqFIyusGtwN7xsunP BuA0Fdr2Z/V6KeN4oVlLl8TDA7WhGbl564Sj7R4ec0d+K2gOBel++WTap6BcPda3MuNb 9hsV+BaA+lZX44Ft22kkJQHacoWlhgM1wbrQs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-pgp-agent:x-mailer; b=xzcrT0cRHbz/62mpWjDlV59wZUR7SBi1RFdI2oIiW50F6DVeOxF1kXeciSjc6wp60P VrCw79TTRlNjLA4H0Qx0D+QnmoTfTVcq3/cbBuv5J2WoPGboMuvPfpTQlVUDeGKXZ/dg ULQoQEgq/ZJSiFDIr1L/Z+wxzQV0iMZmUNHEU= Received: by 10.103.193.12 with SMTP id v12mr788178mup.87.1225816876160; Tue, 04 Nov 2008 08:41:16 -0800 (PST) Received: from ndenev.cmotd.com (blah.sun-fish.com [217.18.249.150]) by mx.google.com with ESMTPS id y6sm33410818mug.7.2008.11.04.08.41.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 Nov 2008 08:41:14 -0800 (PST) Message-Id: <9EB5C9C2-EAE3-4508-80A0-A29E69B62D4F@gmail.com> From: Nikolay Denev To: Andrew Thompson In-Reply-To: <20081104160841.GF93540@citylink.fud.org.nz> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Tue, 4 Nov 2008 18:41:12 +0200 References: <200811041152.mA4BqoPb095612@svn.freebsd.org> <20081104160841.GF93540@citylink.fud.org.nz> X-Pgp-Agent: GPGMail d53 (v53, Leopard) X-Mailer: Apple Mail (2.929.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r184625 - in head: etc sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 17:08:35 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 4 Nov, 2008, at 18:08 , Andrew Thompson wrote: > On Tue, Nov 04, 2008 at 11:52:50AM +0000, Rui Paulo wrote: >> Author: rpaulo >> Date: Tue Nov 4 11:52:50 2008 >> New Revision: 184625 >> URL: http://svn.freebsd.org/changeset/base/184625 >> >> Log: >> Add support for Asus A8Sr notebooks. >> >> PR: 128553 >> Submitted by: Eygene Ryabinkin >> Reviewed by: philip >> MFC after: 2 months >> >> Modified: >> head/etc/devd.conf >> head/sys/dev/acpi_support/acpi_asus.c > > We could almost do with a /etc/devd.conf.d/ directory to drop in > hardware specific event files. > > > Andrew > This is exactly what I was thinking yesterday, because the devd.conf seems to continue to grow. Maybe use it only as a placeholder for includes, which can be located in /dev/devd/ or /etc/devd.conf.d/ ? And probably the events can be separated further in different files, based on the event types i.e. device, ACPI , IFNET, ZFS - -- Regards, Nikolay Denev -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (Darwin) iEYEARECAAYFAkkQeygACgkQHNAJ/fLbfrnvIQCffwgbmH7y3zcQ6ftbIvsUnXIr y2oAoKJ2BbffaLRcKOjZkD9C1KJl09JA =JHSw -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 17:11:03 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4F6F1065677; Tue, 4 Nov 2008 17:11:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5307B8FC08; Tue, 4 Nov 2008 17:11:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mA4HAliJ002408; Tue, 4 Nov 2008 12:10:53 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= Date: Tue, 4 Nov 2008 11:16:09 -0500 User-Agent: KMail/1.9.7 References: <200810250618.m9P6ICWl023370@svn.freebsd.org> <200811031703.42653.jhb@freebsd.org> <86tzanq2cc.fsf@ds4.des.no> In-Reply-To: <86tzanq2cc.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200811041116.09950.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Tue, 04 Nov 2008 12:10:53 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8567/Tue Nov 4 09:24:07 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, marcel@freebsd.org, src-committers@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r184251 - in head/sys: conf dev/cfi sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 17:11:03 -0000 On Tuesday 04 November 2008 04:15:15 am Dag-Erling Sm=C3=B8rgrav wrote: > John Baldwin writes: > > M. Warner Losh writes: > > > Whose name is in the disclaimer? > > If the problem is "AUTHOR" vs "AUTHOR AND CONTRIBUTORS" then it would=20 perhaps=20 > > be more useful to all involved to actually state one's concerns instead= of=20 > > vague hand-waving and suggestions of evil. >=20 > Actually, it says "Bill Paul and the voices in his head".. It turns out only sys/cfictl.h has that. All the files in sys/dev/cfi/ (wh= ich=20 is what I had checked since they were "first" in the commit message) are=20 fine. =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 18:02:36 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 464991065686; Tue, 4 Nov 2008 18:02:36 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32F108FC19; Tue, 4 Nov 2008 18:02:36 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4I2aFT003709; Tue, 4 Nov 2008 18:02:36 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4I2aVk003708; Tue, 4 Nov 2008 18:02:36 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200811041802.mA4I2aVk003708@svn.freebsd.org> From: Giorgos Keramidas Date: Tue, 4 Nov 2008 18:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184645 - head/usr.bin/vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 18:02:36 -0000 Author: keramida (doc committer) Date: Tue Nov 4 18:02:35 2008 New Revision: 184645 URL: http://svn.freebsd.org/changeset/base/184645 Log: Repeat vmstat header after window.rows instead of a hardcoded 20. Use ioctl() to get the window size in vmstat(8), and force a new header to be prepended to the output every time the current window size changes. Change the number of lines before each header to the current lines of the terminal when the terminal is resized, so that the full terminal length can be used for output lines. Inspired by: svn change 175562 (same feature for iostat) Reviewed by: ru (who fixed some of my bugs too) MFC after: 1 week Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Tue Nov 4 16:45:17 2008 (r184644) +++ head/usr.bin/vmstat/vmstat.c Tue Nov 4 18:02:35 2008 (r184645) @@ -133,7 +133,10 @@ static devstat_select_mode select_mode; static struct vmmeter sum, osum; -static int winlines = 20; +#define VMSTAT_DEFAULT_LINES 20 /* Default number of `winlines'. */ +volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ +static int winlines = VMSTAT_DEFAULT_LINES; /* Current number of tty rows. */ + static int aflag; static int nflag; static int Pflag; @@ -162,6 +165,8 @@ static void kread(int, void *, size_t); static void kreado(int, void *, size_t, size_t); static char *kgetstr(const char *); static void needhdr(int); +static void needresize(int); +static void doresize(void); static void printhdr(int, u_long); static void usage(void); @@ -277,8 +282,6 @@ main(int argc, char *argv[]) errx(1, "Cannot use -P with crash dumps"); if (todo & VMSTAT) { - struct winsize winsize; - /* * Make sure that the userland devstat version matches the * kernel devstat version. If not, exit and print a @@ -289,11 +292,6 @@ main(int argc, char *argv[]) argv = getdrivedata(argv); - winsize.ws_row = 0; - (void) ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&winsize); - if (winsize.ws_row > 0) - winlines = winsize.ws_row; - } #define BACKWARD_COMPATIBILITY @@ -578,8 +576,27 @@ dovmstat(unsigned int interval, int reps uptime = getuptime(); halfuptime = uptime / 2; + + /* + * If the user stops the program (control-Z) and then resumes it, + * print out the header again. + */ (void)signal(SIGCONT, needhdr); + /* + * If our standard output is a tty, then install a SIGWINCH handler + * and set wresized so that our first iteration through the main + * iostat loop will peek at the terminal's current rows to find out + * how many lines can fit in a screenful of output. + */ + if (isatty(fileno(stdout)) != 0) { + wresized = 1; + (void)signal(SIGWINCH, needresize); + } else { + wresized = 0; + winlines = VMSTAT_DEFAULT_LINES; + } + if (kd != NULL) { if (namelist[X_STATHZ].n_type != 0 && namelist[X_STATHZ].n_value != 0) @@ -758,7 +775,9 @@ printhdr(int ncpus, u_long cpumask) printf("\n"); } else printf(" us sy id\n"); - hdrcnt = winlines - 2; + if (wresized != 0) + doresize(); + hdrcnt = winlines; } /* @@ -771,6 +790,47 @@ needhdr(int dummy __unused) hdrcnt = 1; } +/* + * When the terminal is resized, force an update of the maximum number of rows + * printed between each header repetition. Then force a new header to be + * prepended to the next output. + */ +void +needresize(int signo) +{ + + wresized = 1; + hdrcnt = 1; +} + +/* + * Update the global `winlines' count of terminal rows. + */ +void +doresize(void) +{ + int status; + struct winsize w; + + for (;;) { + status = ioctl(fileno(stdout), TIOCGWINSZ, &w); + if (status == -1 && errno == EINTR) + continue; + else if (status == -1) + err(1, "ioctl"); + if (w.ws_row > 3) + winlines = w.ws_row - 3; + else + winlines = VMSTAT_DEFAULT_LINES; + break; + } + + /* + * Inhibit doresize() calls until we are rescheduled by SIGWINCH. + */ + wresized = 0; +} + #ifdef notyet static void dotimes(void) From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 18:20:54 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEC7C10656A4; Tue, 4 Nov 2008 18:20:54 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC3BD8FC16; Tue, 4 Nov 2008 18:20:54 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4IKsmk004109; Tue, 4 Nov 2008 18:20:54 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4IKsUg004108; Tue, 4 Nov 2008 18:20:54 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200811041820.mA4IKsUg004108@svn.freebsd.org> From: Giorgos Keramidas Date: Tue, 4 Nov 2008 18:20:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184646 - head/usr.bin/vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 18:20:54 -0000 Author: keramida (doc committer) Date: Tue Nov 4 18:20:54 2008 New Revision: 184646 URL: http://svn.freebsd.org/changeset/base/184646 Log: Fix comment typo that managed to sneak in when I copy pasted some comments & code from iostat. Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Tue Nov 4 18:02:35 2008 (r184645) +++ head/usr.bin/vmstat/vmstat.c Tue Nov 4 18:20:54 2008 (r184646) @@ -586,7 +586,7 @@ dovmstat(unsigned int interval, int reps /* * If our standard output is a tty, then install a SIGWINCH handler * and set wresized so that our first iteration through the main - * iostat loop will peek at the terminal's current rows to find out + * vmstat loop will peek at the terminal's current rows to find out * how many lines can fit in a screenful of output. */ if (isatty(fileno(stdout)) != 0) { From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 18:53:33 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C80E91065687; Tue, 4 Nov 2008 18:53:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B647E8FC2F; Tue, 4 Nov 2008 18:53:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4IrXmB004782; Tue, 4 Nov 2008 18:53:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4IrXIV004781; Tue, 4 Nov 2008 18:53:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200811041853.mA4IrXIV004781@svn.freebsd.org> From: John Baldwin Date: Tue, 4 Nov 2008 18:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184649 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 18:53:33 -0000 Author: jhb Date: Tue Nov 4 18:53:33 2008 New Revision: 184649 URL: http://svn.freebsd.org/changeset/base/184649 Log: Don't leak a reference on the /compat/linux vnode everytime the linprocfs 'mtab' file is read. MFC after: 1 month Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Tue Nov 4 18:38:48 2008 (r184648) +++ head/sys/compat/linprocfs/linprocfs.c Tue Nov 4 18:53:33 2008 (r184649) @@ -318,11 +318,13 @@ linprocfs_domtab(PFS_FILL_ARGS) NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, linux_emul_path, td); flep = NULL; error = namei(&nd); - VFS_UNLOCK_GIANT(NDHASGIANT(&nd)); - if (error != 0 || vn_fullpath(td, nd.ni_vp, &dlep, &flep) != 0) - lep = linux_emul_path; - else - lep = dlep; + lep = linux_emul_path; + if (error == 0) { + if (vn_fullpath(td, nd.ni_vp, &dlep, &flep) != 0) + lep = dlep; + vrele(nd.ni_vp); + VFS_UNLOCK_GIANT(NDHASGIANT(&nd)); + } lep_len = strlen(lep); mtx_lock(&mountlist_mtx); From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 18:54:45 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F2CE106568C; Tue, 4 Nov 2008 18:54:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DD938FC22; Tue, 4 Nov 2008 18:54:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4Isia1004839; Tue, 4 Nov 2008 18:54:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4IsiuL004838; Tue, 4 Nov 2008 18:54:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200811041854.mA4IsiuL004838@svn.freebsd.org> From: John Baldwin Date: Tue, 4 Nov 2008 18:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184650 - head/sys/fs/unionfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 18:54:45 -0000 Author: jhb Date: Tue Nov 4 18:54:44 2008 New Revision: 184650 URL: http://svn.freebsd.org/changeset/base/184650 Log: Don't pass WANTPARENT to the pathname lookup of the mount point for a unionfs mount just so we can immediately drop the reference on the parent directory vnode without using it. Modified: head/sys/fs/unionfs/union_vfsops.c Modified: head/sys/fs/unionfs/union_vfsops.c ============================================================================== --- head/sys/fs/unionfs/union_vfsops.c Tue Nov 4 18:53:33 2008 (r184649) +++ head/sys/fs/unionfs/union_vfsops.c Tue Nov 4 18:54:44 2008 (r184650) @@ -268,7 +268,7 @@ unionfs_domount(struct mount *mp, struct /* * Find upper node */ - NDINIT(ndp, LOOKUP, FOLLOW | WANTPARENT | LOCKLEAF, UIO_SYSSPACE, target, td); + NDINIT(ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, target, td); if ((error = namei(ndp))) return (error); @@ -278,9 +278,6 @@ unionfs_domount(struct mount *mp, struct lowerrootvp = mp->mnt_vnodecovered; upperrootvp = ndp->ni_vp; - vrele(ndp->ni_dvp); - ndp->ni_dvp = NULLVP; - /* create unionfs_mount */ ump = (struct unionfs_mount *)malloc(sizeof(struct unionfs_mount), M_UNIONFSMNT, M_WAITOK | M_ZERO); From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 18:56:12 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C00141065679; Tue, 4 Nov 2008 18:56:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADD848FC2A; Tue, 4 Nov 2008 18:56:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4IuCuE004915; Tue, 4 Nov 2008 18:56:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4IuCli004914; Tue, 4 Nov 2008 18:56:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200811041856.mA4IuCli004914@svn.freebsd.org> From: John Baldwin Date: Tue, 4 Nov 2008 18:56:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184651 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 18:56:12 -0000 Author: jhb Date: Tue Nov 4 18:56:12 2008 New Revision: 184651 URL: http://svn.freebsd.org/changeset/base/184651 Log: Quiet a WITNESS warning with the dirhash sx locks by setting the DUPOK flag. Specifically, if two threads race to create a dirhash for a directory, then one might already have created a private dirhash structure (and locked it) when it realizes the directory now has a structure and tries to lock that one. Modified: head/sys/ufs/ufs/ufs_dirhash.c Modified: head/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- head/sys/ufs/ufs/ufs_dirhash.c Tue Nov 4 18:54:44 2008 (r184650) +++ head/sys/ufs/ufs/ufs_dirhash.c Tue Nov 4 18:56:12 2008 (r184651) @@ -181,7 +181,16 @@ ufsdirhash_create(struct inode *ip) if (ndh == NULL) return (NULL); refcount_init(&ndh->dh_refcount, 1); - sx_init(&ndh->dh_lock, "dirhash"); + + /* + * The DUPOK is to prevent warnings from the + * sx_slock() a few lines down which is safe + * since the duplicate lock in that case is + * the one for this dirhash we are creating + * now which has no external references until + * after this function returns. + */ + sx_init_flags(&ndh->dh_lock, "dirhash", SX_DUPOK); sx_xlock(&ndh->dh_lock); } /* From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 19:04:01 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9E9A106568B; Tue, 4 Nov 2008 19:04:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0FF68FC27; Tue, 4 Nov 2008 19:04:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4J41mU005108; Tue, 4 Nov 2008 19:04:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4J41dL005103; Tue, 4 Nov 2008 19:04:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200811041904.mA4J41dL005103@svn.freebsd.org> From: John Baldwin Date: Tue, 4 Nov 2008 19:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184652 - in head/sys: dev/hwpmc fs/procfs kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 19:04:01 -0000 Author: jhb Date: Tue Nov 4 19:04:01 2008 New Revision: 184652 URL: http://svn.freebsd.org/changeset/base/184652 Log: Remove unnecessary locking around vn_fullpath(). The vnode lock for the vnode in question does not need to be held. All the data structures used during the name lookup are protected by the global name cache lock. Instead, the caller merely needs to ensure a reference is held on the vnode (such as vhold()) to keep it from being freed. In the case of procfs' /file entry, grab the process lock while we gain a new reference (via vhold()) on p_textvp to fully close races with execve(2). For the kern.proc.vmmap sysctl handler, use a shared vnode lock around the call to VOP_GETATTR() rather than an exclusive lock. MFC after: 1 month Modified: head/sys/dev/hwpmc/hwpmc_mod.c head/sys/fs/procfs/procfs.c head/sys/fs/procfs/procfs_map.c head/sys/kern/kern_descrip.c head/sys/kern/kern_proc.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Nov 4 18:56:12 2008 (r184651) +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Nov 4 19:04:01 2008 (r184652) @@ -680,9 +680,7 @@ pmc_getfilename(struct vnode *v, char ** *fullpath = "unknown"; *freepath = NULL; - vn_lock(v, LK_CANRECURSE | LK_EXCLUSIVE | LK_RETRY); vn_fullpath(curthread, v, fullpath, freepath); - VOP_UNLOCK(v, 0); } /* Modified: head/sys/fs/procfs/procfs.c ============================================================================== --- head/sys/fs/procfs/procfs.c Tue Nov 4 18:56:12 2008 (r184651) +++ head/sys/fs/procfs/procfs.c Tue Nov 4 19:04:01 2008 (r184652) @@ -70,17 +70,13 @@ procfs_doprocfile(PFS_FILL_ARGS) char *fullpath = "unknown"; char *freepath = NULL; struct vnode *textvp; - int err; + PROC_LOCK(p); textvp = p->p_textvp; - VI_LOCK(textvp); - vholdl(textvp); - err = vn_lock(textvp, LK_EXCLUSIVE | LK_INTERLOCK); - vdrop(textvp); - if (err) - return (err); + vhold(textvp); + PROC_UNLOCK(p); vn_fullpath(td, textvp, &fullpath, &freepath); - VOP_UNLOCK(textvp, 0); + vdrop(textvp); sbuf_printf(sb, "%s", fullpath); if (freepath) free(freepath, M_TEMP); Modified: head/sys/fs/procfs/procfs_map.c ============================================================================== --- head/sys/fs/procfs/procfs_map.c Tue Nov 4 18:56:12 2008 (r184651) +++ head/sys/fs/procfs/procfs_map.c Tue Nov 4 19:04:01 2008 (r184652) @@ -175,10 +175,9 @@ procfs_doprocmap(PFS_FILL_ARGS) shadow_count = obj->shadow_count; VM_OBJECT_UNLOCK(obj); if (vp != NULL) { - vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vn_fullpath(td, vp, &fullpath, &freepath); - vput(vp); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); VFS_UNLOCK_GIANT(vfslocked); } } else { Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Nov 4 18:56:12 2008 (r184651) +++ head/sys/kern/kern_descrip.c Tue Nov 4 19:04:01 2008 (r184652) @@ -2537,10 +2537,9 @@ export_vnode_for_sysctl(struct vnode *vp freepath = NULL; fullpath = "-"; FILEDESC_SUNLOCK(fdp); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vn_fullpath(curthread, vp, &fullpath, &freepath); - vput(vp); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); VFS_UNLOCK_GIANT(vfslocked); strlcpy(kif->kf_path, fullpath, sizeof(kif->kf_path)); if (freepath != NULL) @@ -2708,10 +2707,9 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER freepath = NULL; fullpath = "-"; FILEDESC_SUNLOCK(fdp); - vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vn_fullpath(curthread, vp, &fullpath, &freepath); - vput(vp); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); VFS_UNLOCK_GIANT(vfslocked); strlcpy(kif->kf_path, fullpath, sizeof(kif->kf_path)); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Tue Nov 4 18:56:12 2008 (r184651) +++ head/sys/kern/kern_proc.c Tue Nov 4 19:04:01 2008 (r184652) @@ -1440,11 +1440,11 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_shadow_count = obj->shadow_count; VM_OBJECT_UNLOCK(obj); if (vp != NULL) { - vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vn_fullpath(curthread, vp, &fullpath, &freepath); cred = curthread->td_ucred; + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vn_lock(vp, LK_SHARED | LK_RETRY); if (VOP_GETATTR(vp, &va, cred) == 0) { kve->kve_fileid = va.va_fileid; kve->kve_fsid = va.va_fsid; From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 19:13:54 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DAAF1065679; Tue, 4 Nov 2008 19:13:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F01258FC20; Tue, 4 Nov 2008 19:13:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4JDrs7005315; Tue, 4 Nov 2008 19:13:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4JDrle005314; Tue, 4 Nov 2008 19:13:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200811041913.mA4JDrle005314@svn.freebsd.org> From: John Baldwin Date: Tue, 4 Nov 2008 19:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184653 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 19:13:54 -0000 Author: jhb Date: Tue Nov 4 19:13:53 2008 New Revision: 184653 URL: http://svn.freebsd.org/changeset/base/184653 Log: Don't bother calling setrunnable() and clearing the sleeping flag in sleepq_resume_thread() if the thread isn't asleep. Modified: head/sys/kern/subr_sleepqueue.c Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Tue Nov 4 19:04:01 2008 (r184652) +++ head/sys/kern/subr_sleepqueue.c Tue Nov 4 19:13:53 2008 (r184653) @@ -680,22 +680,25 @@ sleepq_resume_thread(struct sleepqueue * td->td_wchan = NULL; td->td_flags &= ~TDF_SINTR; - /* - * Note that thread td might not be sleeping if it is running - * sleepq_catch_signals() on another CPU or is blocked on - * its proc lock to check signals. It doesn't hurt to clear - * the sleeping flag if it isn't set though, so we just always - * do it. However, we can't assert that it is set. - */ CTR3(KTR_PROC, "sleepq_wakeup: thread %p (pid %ld, %s)", (void *)td, (long)td->td_proc->p_pid, td->td_name); - TD_CLR_SLEEPING(td); /* Adjust priority if requested. */ MPASS(pri == 0 || (pri >= PRI_MIN && pri <= PRI_MAX)); if (pri != 0 && td->td_priority > pri) sched_prio(td, pri); - return (setrunnable(td)); + + /* + * Note that thread td might not be sleeping if it is running + * sleepq_catch_signals() on another CPU or is blocked on its + * proc lock to check signals. There's no need to mark the + * thread runnable in that case. + */ + if (TD_IS_SLEEPING(td)) { + TD_CLR_SLEEPING(td); + return (setrunnable(td)); + } + return (0); } #ifdef INVARIANTS From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 19:17:32 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83EAD1065691; Tue, 4 Nov 2008 19:17:32 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70FC28FC26; Tue, 4 Nov 2008 19:17:32 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4JHWT0005445; Tue, 4 Nov 2008 19:17:32 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4JHW5V005444; Tue, 4 Nov 2008 19:17:32 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <200811041917.mA4JHW5V005444@svn.freebsd.org> From: Max Laier Date: Tue, 4 Nov 2008 19:17:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184654 - head/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 19:17:32 -0000 Author: mlaier Date: Tue Nov 4 19:17:32 2008 New Revision: 184654 URL: http://svn.freebsd.org/changeset/base/184654 Log: style(9): mostly avoiding line wrap by not indenting cases. No obj change. Modified: head/usr.bin/du/du.c Modified: head/usr.bin/du/du.c ============================================================================== --- head/usr.bin/du/du.c Tue Nov 4 19:13:53 2008 (r184653) +++ head/usr.bin/du/du.c Tue Nov 4 19:17:32 2008 (r184654) @@ -85,7 +85,7 @@ main(int argc, char *argv[]) { FTS *fts; FTSENT *p; - off_t savednumber = 0; + off_t savednumber; long blocksize; int ftsoptions; int listall; @@ -102,75 +102,77 @@ main(int argc, char *argv[]) save = argv; ftsoptions = 0; + savednumber = 0; depth = INT_MAX; SLIST_INIT(&ignores); while ((ch = getopt(argc, argv, "HI:LPasd:chklmnrx")) != -1) switch (ch) { - case 'H': - Hflag = 1; - break; - case 'I': - ignoreadd(optarg); - break; - case 'L': - if (Pflag) - usage(); - Lflag = 1; - break; - case 'P': - if (Lflag) - usage(); - Pflag = 1; - break; - case 'a': - aflag = 1; - break; - case 's': - sflag = 1; - break; - case 'd': - dflag = 1; - errno = 0; - depth = atoi(optarg); - if (errno == ERANGE || depth < 0) { - warnx("invalid argument to option d: %s", optarg); - usage(); - } - break; - case 'c': - cflag = 1; - break; - case 'h': - if (setenv("BLOCKSIZE", "512", 1) == -1) - warn( - "setenv: cannot set BLOCKSIZE=512"); - hflag = 1; - break; - case 'k': - hflag = 0; - if (setenv("BLOCKSIZE", "1024", 1) == -1) - warn("setenv: cannot set BLOCKSIZE=1024"); - break; - case 'l': - lflag = 1; - break; - case 'm': - hflag = 0; - if (setenv("BLOCKSIZE", "1048576", 1) == -1) - warn("setenv: cannot set BLOCKSIZE=1048576"); - break; - case 'n': - nodumpflag = 1; - break; - case 'r': /* Compatibility. */ - break; - case 'x': - ftsoptions |= FTS_XDEV; - break; - case '?': - default: + case 'H': + Hflag = 1; + break; + case 'I': + ignoreadd(optarg); + break; + case 'L': + if (Pflag) + usage(); + Lflag = 1; + break; + case 'P': + if (Lflag) + usage(); + Pflag = 1; + break; + case 'a': + aflag = 1; + break; + case 's': + sflag = 1; + break; + case 'd': + dflag = 1; + errno = 0; + depth = atoi(optarg); + if (errno == ERANGE || depth < 0) { + warnx("invalid argument to option d: %s", + optarg); usage(); + } + break; + case 'c': + cflag = 1; + break; + case 'h': + if (setenv("BLOCKSIZE", "512", 1) == -1) + warn("setenv: cannot set BLOCKSIZE=512"); + hflag = 1; + break; + case 'k': + hflag = 0; + if (setenv("BLOCKSIZE", "1024", 1) == -1) + warn("setenv: cannot set BLOCKSIZE=1024"); + break; + case 'l': + lflag = 1; + break; + case 'm': + hflag = 0; + if (setenv("BLOCKSIZE", "1048576", 1) == -1) + warn("setenv: cannot set BLOCKSIZE=1048576"); + break; + case 'n': + nodumpflag = 1; + break; + case 'r': /* Compatibility. */ + break; + case 'x': + ftsoptions |= FTS_XDEV; + break; + case '?': + default: + usage(); + /* NOTREACHED */ } argc -= optind; @@ -222,7 +224,7 @@ main(int argc, char *argv[]) argv[1] = NULL; } - (void) getbsize(¬used, &blocksize); + (void)getbsize(¬used, &blocksize); blocksize /= 512; rval = 0; @@ -232,57 +234,60 @@ main(int argc, char *argv[]) while ((p = fts_read(fts)) != NULL) { switch (p->fts_info) { - case FTS_D: /* Ignore. */ - if (ignorep(p)) - fts_set(fts, p, FTS_SKIP); - break; - case FTS_DP: - if (ignorep(p)) - break; - - p->fts_parent->fts_bignum += - p->fts_bignum += p->fts_statp->st_blocks; - - if (p->fts_level <= depth) { - if (hflag) { - (void) prthumanval(howmany(p->fts_bignum, blocksize)); - (void) printf("\t%s\n", p->fts_path); - } else { - (void) printf("%jd\t%s\n", - (intmax_t)howmany(p->fts_bignum, blocksize), - p->fts_path); - } + case FTS_D: /* Ignore. */ + if (ignorep(p)) + fts_set(fts, p, FTS_SKIP); + break; + case FTS_DP: + if (ignorep(p)) + break; + + p->fts_parent->fts_bignum += p->fts_bignum += + p->fts_statp->st_blocks; + + if (p->fts_level <= depth) { + if (hflag) { + prthumanval(howmany(p->fts_bignum, + blocksize)); + (void)printf("\t%s\n", p->fts_path); + } else { + (void)printf("%jd\t%s\n", + (intmax_t)howmany(p->fts_bignum, + blocksize), p->fts_path); } - break; - case FTS_DC: /* Ignore. */ - break; - case FTS_DNR: /* Warn, continue. */ - case FTS_ERR: - case FTS_NS: - warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); - rval = 1; - break; - default: - if (ignorep(p)) - break; - - if (lflag == 0 && - p->fts_statp->st_nlink > 1 && linkchk(p)) - break; - - if (listall || p->fts_level == 0) { - if (hflag) { - (void) prthumanval(howmany(p->fts_statp->st_blocks, - blocksize)); - (void) printf("\t%s\n", p->fts_path); - } else { - (void) printf("%jd\t%s\n", - (intmax_t)howmany(p->fts_statp->st_blocks, blocksize), - p->fts_path); - } + } + break; + case FTS_DC: /* Ignore. */ + break; + case FTS_DNR: /* Warn, continue. */ + case FTS_ERR: + case FTS_NS: + warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); + rval = 1; + break; + default: + if (ignorep(p)) + break; + + if (lflag == 0 && p->fts_statp->st_nlink > 1 && + linkchk(p)) + break; + + if (listall || p->fts_level == 0) { + if (hflag) { + prthumanval(howmany( + p->fts_statp->st_blocks, + blocksize)); + (void)printf("\t%s\n", p->fts_path); + } else { + (void)printf("%jd\t%s\n", + (intmax_t)howmany( + p->fts_statp->st_blocks, + blocksize), p->fts_path); } + } - p->fts_parent->fts_bignum += p->fts_statp->st_blocks; + p->fts_parent->fts_bignum += p->fts_statp->st_blocks; } savednumber = p->fts_parent->fts_bignum; } @@ -292,10 +297,11 @@ main(int argc, char *argv[]) if (cflag) { if (hflag) { - (void) prthumanval(howmany(savednumber, blocksize)); - (void) printf("\ttotal\n"); + prthumanval(howmany(savednumber, blocksize)); + (void)printf("\ttotal\n"); } else { - (void) printf("%jd\ttotal\n", (intmax_t)howmany(savednumber, blocksize)); + (void)printf("%jd\ttotal\n", (intmax_t)howmany( + savednumber, blocksize)); } } @@ -348,7 +354,8 @@ linkchk(FTSENT *p) free_list = le->next; free(le); } - new_buckets = malloc(new_size * sizeof(new_buckets[0])); + new_buckets = malloc(new_size * + sizeof(new_buckets[0])); } if (new_buckets == NULL) { From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 19:20:19 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72BCC1065679; Tue, 4 Nov 2008 19:20:19 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 613F38FC14; Tue, 4 Nov 2008 19:20:19 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4JKJUn005552; Tue, 4 Nov 2008 19:20:19 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4JKJkc005551; Tue, 4 Nov 2008 19:20:19 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <200811041920.mA4JKJkc005551@svn.freebsd.org> From: Remko Lodder Date: Tue, 4 Nov 2008 19:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184655 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 19:20:19 -0000 Author: remko Date: Tue Nov 4 19:20:19 2008 New Revision: 184655 URL: http://svn.freebsd.org/changeset/base/184655 Log: Add Rene Ladan, as well as my relationship towards Rene. Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Tue Nov 4 19:17:32 2008 (r184654) +++ head/share/misc/committers-doc.dot Tue Nov 4 19:20:19 2008 (r184655) @@ -66,6 +66,7 @@ nik [label="Nik Clayton\nnik@FreeBSD.org pav [label="Pav Lucistnik\npav@FreeBSD.org\n2005/08/12"] pgj [label="Gabor Pali\npgj@FreeBSD.org\n2008/04/21"] remko [label="Remko Lodder\nremko@FreeBSD.org\n2004/10/16"] +rene [label="Rene Ladan\nrene@FreeBSD.org\n2008/11/03"] roam [label="Peter Pentchev\nroam@FreeBSD.org\n2003/02/14"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2003/07/20"] trhodes [label="Tom Rhodes\ntrhodes@FreeBSD.org\n2002/03/25"] @@ -116,6 +117,7 @@ nik -> bmah nik -> keramida remko -> jkois +remko -> rene simon -> josef simon -> remko From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 19:23:49 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 505EA1065675; Tue, 4 Nov 2008 19:23:49 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3ED218FC1C; Tue, 4 Nov 2008 19:23:49 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4JNnr1005698; Tue, 4 Nov 2008 19:23:49 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4JNnLO005697; Tue, 4 Nov 2008 19:23:49 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <200811041923.mA4JNnLO005697@svn.freebsd.org> From: Max Laier Date: Tue, 4 Nov 2008 19:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184656 - head/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 19:23:49 -0000 Author: mlaier Date: Tue Nov 4 19:23:48 2008 New Revision: 184656 URL: http://svn.freebsd.org/changeset/base/184656 Log: Declare functions and variables static and save a few byte. This is a style(9)-change, too. Separate commit as it changes the object. Modified: head/usr.bin/du/du.c Modified: head/usr.bin/du/du.c ============================================================================== --- head/usr.bin/du/du.c Tue Nov 4 19:20:19 2008 (r184655) +++ head/usr.bin/du/du.c Tue Nov 4 19:23:48 2008 (r184656) @@ -73,12 +73,12 @@ struct ignentry { static int linkchk(FTSENT *); static void usage(void); -void prthumanval(int64_t); -void ignoreadd(const char *); -void ignoreclean(void); -int ignorep(FTSENT *); +static void prthumanval(int64_t); +static void ignoreadd(const char *); +static void ignoreclean(void); +static int ignorep(FTSENT *); -int nodumpflag = 0; +static int nodumpflag = 0; int main(int argc, char *argv[]) @@ -443,7 +443,7 @@ linkchk(FTSENT *p) return (0); } -void +static void prthumanval(int64_t bytes) { char buf[5]; @@ -465,7 +465,7 @@ usage(void) exit(EX_USAGE); } -void +static void ignoreadd(const char *mask) { struct ignentry *ign; @@ -479,7 +479,7 @@ ignoreadd(const char *mask) SLIST_INSERT_HEAD(&ignores, ign, next); } -void +static void ignoreclean(void) { struct ignentry *ign; @@ -492,7 +492,7 @@ ignoreclean(void) } } -int +static int ignorep(FTSENT *ent) { struct ignentry *ign; From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 19:28:19 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B178C1065688; Tue, 4 Nov 2008 19:28:19 +0000 (UTC) (envelope-from rink@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FF948FC08; Tue, 4 Nov 2008 19:28:19 +0000 (UTC) (envelope-from rink@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4JSJ8E005884; Tue, 4 Nov 2008 19:28:19 GMT (envelope-from rink@svn.freebsd.org) Received: (from rink@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4JSJsM005883; Tue, 4 Nov 2008 19:28:19 GMT (envelope-from rink@svn.freebsd.org) Message-Id: <200811041928.mA4JSJsM005883@svn.freebsd.org> From: Rink Springer Date: Tue, 4 Nov 2008 19:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184658 - head/sys/dev/usb2/wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 19:28:19 -0000 Author: rink Date: Tue Nov 4 19:28:19 2008 New Revision: 184658 URL: http://svn.freebsd.org/changeset/base/184658 Log: Fix the build (on at least powerpc) by moving the htole16() from the case(x) expression directly to the switch(x) itself. Reviewed by: imp@ Modified: head/sys/dev/usb2/wlan/if_zyd2.c Modified: head/sys/dev/usb2/wlan/if_zyd2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_zyd2.c Tue Nov 4 19:26:39 2008 (r184657) +++ head/sys/dev/usb2/wlan/if_zyd2.c Tue Nov 4 19:28:19 2008 (r184658) @@ -392,10 +392,10 @@ zyd_intr_read_callback(struct usb2_xfer usb2_copy_out(xfer->frbuffers, 0, &sc->sc_intr_ibuf, actlen); - switch (cmd->code) { - case htole16(ZYD_NOTIF_RETRYSTATUS): + switch (htole16(cmd->code)) { + case ZYD_NOTIF_RETRYSTATUS: goto handle_notif_retrystatus; - case htole16(ZYD_NOTIF_IORD): + case ZYD_NOTIF_IORD: goto handle_notif_iord; default: DPRINTFN(2, "unknown indication: 0x%04x\n", From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 20:22:01 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAFE71065672 for ; Tue, 4 Nov 2008 20:22:01 +0000 (UTC) (envelope-from rbgarga@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.236]) by mx1.freebsd.org (Postfix) with ESMTP id 7DCF18FC14 for ; Tue, 4 Nov 2008 20:22:01 +0000 (UTC) (envelope-from rbgarga@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so3201967rvf.43 for ; Tue, 04 Nov 2008 12:22:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=6DrpTNqMftovznazipiptglk4Fn4MW2VI9CVqVtiOik=; b=bdw55O7j7J06obd/s+gcqjkGTtvrcsWSXpdaVbBTfUcQ2DxB8marUl+aF6z1jMfRau MRBgpOZFhkSM7LUbBvfg5/TaQLhVlZ6RicOs2sODeffGQ+Ug6ZP5h62Aruft38gwfNhj UwKoTwoMiUpMBfj7kPOPIIF3nHFGCzdFoV1Oc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=HvqjEmzKyRvN6PM3Rg+5I9QZseISyheGeKlV8nVEKGaGkhSFhaxyfJdSBk8xaguidj KFMMF9LlSCq//yiEu/RSsRvU2fkETF33iSA9lJCChGdBAT2xa2MkhTs6V5GCs+6E1XaI QC7BUf0hYwpTtYteM4KXrELJPbuecOy7/uH5A= Received: by 10.114.133.1 with SMTP id g1mr1180051wad.149.1225828561139; Tue, 04 Nov 2008 11:56:01 -0800 (PST) Received: by 10.114.161.8 with HTTP; Tue, 4 Nov 2008 11:56:01 -0800 (PST) Message-ID: <747dc8f30811041156qe2b710ape595c5671bc0ddf5@mail.gmail.com> Date: Tue, 4 Nov 2008 17:56:01 -0200 From: "Renato Botelho" To: "Rui Paulo" In-Reply-To: <200811041152.mA4BqoPb095612@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811041152.mA4BqoPb095612@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184625 - in head: etc sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 20:22:01 -0000 On Tue, Nov 4, 2008 at 9:52 AM, Rui Paulo wrote: > Author: rpaulo > Date: Tue Nov 4 11:52:50 2008 > New Revision: 184625 > URL: http://svn.freebsd.org/changeset/base/184625 > > Log: > Add support for Asus A8Sr notebooks. > > PR: 128553 > Submitted by: Eygene Ryabinkin > Reviewed by: philip > MFC after: 2 months > > Modified: > head/etc/devd.conf > head/sys/dev/acpi_support/acpi_asus.c > > Modified: head/etc/devd.conf > ============================================================================== > --- head/etc/devd.conf Tue Nov 4 11:31:09 2008 (r184624) > +++ head/etc/devd.conf Tue Nov 4 11:52:50 2008 (r184625) > @@ -255,6 +255,28 @@ notify 10 { > action "/etc/rc.resume acpi $notify"; > }; > > +# The next blocks enable volume hotkeys that can be found on the Asus laptops > +notify 0 { > + match "system" "ACPI"; > + match "subsystem" "ASUS"; > + match "notify" "0x32"; > + action "mixer 0"; > +}; > + > +notify 0 { > + match "system" "ACPI"; > + match "subsystem"i "ASUS"; devd.conf part is broken, you forgot a wrong "i" there -- Renato Botelho From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 20:57:40 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FF351065672; Tue, 4 Nov 2008 20:57:40 +0000 (UTC) (envelope-from rink@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2ECB18FC08; Tue, 4 Nov 2008 20:57:40 +0000 (UTC) (envelope-from rink@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4Kve17007509; Tue, 4 Nov 2008 20:57:40 GMT (envelope-from rink@svn.freebsd.org) Received: (from rink@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4KvenY007508; Tue, 4 Nov 2008 20:57:40 GMT (envelope-from rink@svn.freebsd.org) Message-Id: <200811042057.mA4KvenY007508@svn.freebsd.org> From: Rink Springer Date: Tue, 4 Nov 2008 20:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184659 - head/sys/dev/usb2/wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 20:57:40 -0000 Author: rink Date: Tue Nov 4 20:57:39 2008 New Revision: 184659 URL: http://svn.freebsd.org/changeset/base/184659 Log: Even though the previous commit was functionally equivalent with the code it replaced, it was wrong: le16toh should have been used. Note that these changes will not make the driver work on powerpc, but it should fix at least the i386/amd64 cases. Obtained from: //depot/projects/usb/src/sys/dev/usb2/wlan/if_zyd2.c#20 Noticed by: jeli, ed Modified: head/sys/dev/usb2/wlan/if_zyd2.c Modified: head/sys/dev/usb2/wlan/if_zyd2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_zyd2.c Tue Nov 4 19:28:19 2008 (r184658) +++ head/sys/dev/usb2/wlan/if_zyd2.c Tue Nov 4 20:57:39 2008 (r184659) @@ -392,7 +392,7 @@ zyd_intr_read_callback(struct usb2_xfer usb2_copy_out(xfer->frbuffers, 0, &sc->sc_intr_ibuf, actlen); - switch (htole16(cmd->code)) { + switch (le16toh(cmd->code)) { case ZYD_NOTIF_RETRYSTATUS: goto handle_notif_retrystatus; case ZYD_NOTIF_IORD: From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 21:15:52 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B90B1065672; Tue, 4 Nov 2008 21:15:52 +0000 (UTC) (envelope-from dds@aueb.gr) Received: from mx-out.forthnet.gr (mx-out.forthnet.gr [193.92.150.104]) by mx1.freebsd.org (Postfix) with ESMTP id DA93C8FC16; Tue, 4 Nov 2008 21:15:51 +0000 (UTC) (envelope-from dds@aueb.gr) Received: from mx-av-03.forthnet.gr (mx-av.forthnet.gr [193.92.150.27]) by mx-out-06.forthnet.gr (8.14.3/8.14.3) with ESMTP id mA4KUfSr008959; Tue, 4 Nov 2008 22:30:41 +0200 Received: from MX-IN-04.forthnet.gr (mx-in-04.forthnet.gr [193.92.150.163]) by mx-av-03.forthnet.gr (8.14.3/8.14.3) with ESMTP id mA4KUfNj002971; Tue, 4 Nov 2008 22:30:41 +0200 Received: from [192.168.136.18] (adsl81-74.kln.forthnet.gr [77.49.48.74]) by MX-IN-04.forthnet.gr (8.14.3/8.14.3) with ESMTP id mA4KUW3o015146; Tue, 4 Nov 2008 22:30:34 +0200 Authentication-Results: MX-IN-04.forthnet.gr smtp.mail=dds@aueb.gr; spf=neutral Authentication-Results: MX-IN-04.forthnet.gr header.from=dds@aueb.gr; sender-id=neutral In-Reply-To: <200811041802.mA4I2aVk003708@svn.freebsd.org> References: <200811041802.mA4I2aVk003708@svn.freebsd.org> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Diomidis Spinellis Date: Tue, 4 Nov 2008 22:30:07 +0200 To: Giorgos Keramidas X-Mailer: Apple Mail (2.753.1) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r184645 - head/usr.bin/vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 21:15:52 -0000 On Nov 4, 2008, at 8:02 PM, Giorgos Keramidas wrote: > Author: keramida (doc committer) > Date: Tue Nov 4 18:02:35 2008 > New Revision: 184645 > URL: http://svn.freebsd.org/changeset/base/184645 > > Log: > Repeat vmstat header after window.rows instead of a hardcoded 20. > > Use ioctl() to get the window size in vmstat(8), and force a new > header to be prepended to the output every time the current window > size changes. Change the number of lines before each header to the > current lines of the terminal when the terminal is resized, so that > the full terminal length can be used for output lines. > > Inspired by: svn change 175562 (same feature for iostat) > Reviewed by: ru (who fixed some of my bugs too) Thanks! This functionality is generally useful and tricky to code in a correct way. Should we perhaps package it in a library function, so that all header-printing commands can benefit from it, without repeating the code? Diomidis Spinellis - dds@ From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 22:09:36 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86E931065692; Tue, 4 Nov 2008 22:09:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 29BA48FC18; Tue, 4 Nov 2008 22:09:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mA4M9UQF004649; Tue, 4 Nov 2008 17:09:30 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: David Xu Date: Tue, 4 Nov 2008 17:05:47 -0500 User-Agent: KMail/1.9.7 References: <200810240109.m9O19P1u071214@svn.freebsd.org> In-Reply-To: <200810240109.m9O19P1u071214@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811041705.48043.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Tue, 04 Nov 2008 17:09:30 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8568/Tue Nov 4 13:53:00 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184217 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 22:09:36 -0000 On Thursday 23 October 2008 09:09:25 pm David Xu wrote: > Author: davidxu > Date: Fri Oct 24 01:09:24 2008 > New Revision: 184217 > URL: http://svn.freebsd.org/changeset/base/184217 > > Log: > Don't rearm callout if the process is exiting, it may leak a callout > because callout_drain() only waits for running callout, but not disable > it if it is rearmed. Can you please revert this as per previous discussion? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 22:09:42 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D7DB10656AA; Tue, 4 Nov 2008 22:09:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id F1F388FC13; Tue, 4 Nov 2008 22:09:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mA4M9UQG004649; Tue, 4 Nov 2008 17:09:35 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: David Xu Date: Tue, 4 Nov 2008 17:07:25 -0500 User-Agent: KMail/1.9.7 References: <200810240103.m9O13V7f071075@svn.freebsd.org> In-Reply-To: <200810240103.m9O13V7f071075@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811041707.26052.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Tue, 04 Nov 2008 17:09:36 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8568/Tue Nov 4 13:53:00 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184216 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 22:09:42 -0000 On Thursday 23 October 2008 09:03:31 pm David Xu wrote: > Author: davidxu > Date: Fri Oct 24 01:03:31 2008 > New Revision: 184216 > URL: http://svn.freebsd.org/changeset/base/184216 > > Log: > partly revert revision 184199, because TDF_NEEDSIGCHK is persitent > when thread is in kernel mode, it can cause dead loop, now unlock > process lock after acquired sleep queue lock and thread lock to > avoid the problem. This means TDF_NEEDSIGCHK and TDF_NEEDSUSPCHK must > be set with process lock and thread lock being hold at same time. You can't unlock the proc lock while holding the thread_lock(). This will lead to deadlock due to the way that thread_lock() works. This is different from the rules in 6.x where you could drop a mutex while holding sched_lock. You will need to revert this. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 22:09:48 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2BD91065830; Tue, 4 Nov 2008 22:09:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id C550F8FC08; Tue, 4 Nov 2008 22:09:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mA4M9UQH004649; Tue, 4 Nov 2008 17:09:41 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: David Xu Date: Tue, 4 Nov 2008 17:08:42 -0500 User-Agent: KMail/1.9.7 References: <200810230755.m9N7tceu051313@svn.freebsd.org> In-Reply-To: <200810230755.m9N7tceu051313@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811041708.42804.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Tue, 04 Nov 2008 17:09:42 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8568/Tue Nov 4 13:53:00 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184199 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 22:09:49 -0000 On Thursday 23 October 2008 03:55:38 am David Xu wrote: > Author: davidxu > Date: Thu Oct 23 07:55:38 2008 > New Revision: 184199 > URL: http://svn.freebsd.org/changeset/base/184199 > > Log: > Actually, for signal and thread suspension, extra process spin lock is > unnecessary, the normal process lock and thread lock are enough. The > spin lock is still needed for process and thread exiting to mimic > single sched_lock. With thread_lock() it is not safe to drop a mutex while holding thread_lock(). Instead, it can result in a deadlock. Peter has a test case that deadlocks due to these changes. Please revert this. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 22:18:24 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 680621065675; Tue, 4 Nov 2008 22:18:24 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.191]) by mx1.freebsd.org (Postfix) with ESMTP id 0823F8FC0A; Tue, 4 Nov 2008 22:16:53 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by fk-out-0910.google.com with SMTP id k31so3995052fkk.11 for ; Tue, 04 Nov 2008 14:16:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=DSxpQmx08/omI3t20tq6EDhcieUePjnM5L4fyzcFWKY=; b=OrySfd/L2YE2KoDKm/ppcOrqVsTzlW3RUoUOpzJvqeYKjocN8n5/mBpINdokKaFvUj B3eSTOZCXlFp2kp/XJ8h2cE3/b0bvi6Q2x4Fr3DzbNNTn2lvuo7A/MBQ7C0Bpw9yP42L Go8c1PvKRPlc61zGA+hSBQzuaSwgsxKMLktdk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=bu+fNcBZRjpTzzMq0eOcHzxMnRgEVuBch4ubnfA8s8Q4W0AgA/Mu4kihS+xXBRjSjr EWWKkBj0rTQcl2F11i1AsYs08ezvpR0KIuLofU0iibkjAfzrRRvm43fM291iSZn93zHa INHgfld15lDSSvqIQj3cKc0n8Paz7/64ZwEv4= Received: by 10.180.208.5 with SMTP id f5mr26678bkg.211.1225836999865; Tue, 04 Nov 2008 14:16:39 -0800 (PST) Received: by 10.181.56.15 with HTTP; Tue, 4 Nov 2008 14:16:39 -0800 (PST) Message-ID: <9bbcef730811041416o6eaf3033k459fb4d29c9e231a@mail.gmail.com> Date: Tue, 4 Nov 2008 23:16:39 +0100 From: "Ivan Voras" To: "Diomidis Spinellis" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811041802.mA4I2aVk003708@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Giorgos Keramidas Subject: Re: svn commit: r184645 - head/usr.bin/vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 22:18:24 -0000 2008/11/4 Diomidis Spinellis : > On Nov 4, 2008, at 8:02 PM, Giorgos Keramidas wrote: > >> Author: keramida (doc committer) >> Date: Tue Nov 4 18:02:35 2008 >> New Revision: 184645 >> URL: http://svn.freebsd.org/changeset/base/184645 >> >> Log: >> Repeat vmstat header after window.rows instead of a hardcoded 20. > Thanks! This functionality is generally useful and tricky to code in a > correct way. Any objections to http://people.freebsd.org/~ivoras/diffs/vmstat.c.patch.txt ? It uses humanize_number on interrupt, syscall and context switch counts. From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 22:22:49 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E015110656E2; Tue, 4 Nov 2008 22:22:49 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.189]) by mx1.freebsd.org (Postfix) with ESMTP id E1D0B8FC22; Tue, 4 Nov 2008 22:22:48 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by fk-out-0910.google.com with SMTP id k31so3998082fkk.11 for ; Tue, 04 Nov 2008 14:22:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=5alRRZUkadyZnzUP5lSDBEELoQ94G7VRUkUCgR5e+00=; b=PM9E+mvJOc52ZJ+8rtNQ9dDAGroqKFSb+aJLS/q3rpqA6hVdiWAI8WMFzpkKbEi9lR qkz0KmlEoAa3Y559l9Aeh30TrxNseajvrSkToqD0ldu7MQJqmZGMbiIx6BlDYIg6whKw S3y7FW/jOxW99qme24oAhkUmynVs32G0/0Emo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=aMfQZoWijNvcXCUWAL/4kEbhCLeOw8VldLTSTCpiicdDf3KrRJBrxPST9U7PUwdp2R c7zbTdrYhSkxAtPoFJ5Xok9V2cOKQsjJ74DEiqqw4BFjjvdeTgKv6wIyDzVgsb1yuBO0 Pf0RVpC4sr8As+6JddnG6uVJpFT+McoeGLVMs= Received: by 10.181.134.11 with SMTP id l11mr38443bkn.73.1225837367625; Tue, 04 Nov 2008 14:22:47 -0800 (PST) Received: by 10.181.56.15 with HTTP; Tue, 4 Nov 2008 14:22:47 -0800 (PST) Message-ID: <9bbcef730811041422x5f1e7bfco45380390c64b3b1c@mail.gmail.com> Date: Tue, 4 Nov 2008 23:22:47 +0100 From: "Ivan Voras" To: "John Baldwin" In-Reply-To: <200811041904.mA4J41dL005103@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811041904.mA4J41dL005103@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184652 - in head/sys: dev/hwpmc fs/procfs kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 22:22:50 -0000 2008/11/4 John Baldwin : > Author: jhb > Date: Tue Nov 4 19:04:01 2008 > New Revision: 184652 > URL: http://svn.freebsd.org/changeset/base/184652 > > Log: > Remove unnecessary locking around vn_fullpath(). The vnode lock for the Does this affect realpath(3)? (whose non-scalability is often reported for PHP web servers). From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 22:30:24 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B347D106564A; Tue, 4 Nov 2008 22:30:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2B858FC1D; Tue, 4 Nov 2008 22:30:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4MUOGL009345; Tue, 4 Nov 2008 22:30:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4MUOZC009344; Tue, 4 Nov 2008 22:30:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200811042230.mA4MUOZC009344@svn.freebsd.org> From: John Baldwin Date: Tue, 4 Nov 2008 22:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184660 - head/sys/security/audit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 22:30:24 -0000 Author: jhb Date: Tue Nov 4 22:30:24 2008 New Revision: 184660 URL: http://svn.freebsd.org/changeset/base/184660 Log: Don't lock the vnode around calls to vn_fullpath(). Reviewed by: csjp, rwatson Modified: head/sys/security/audit/audit_bsm_klib.c Modified: head/sys/security/audit/audit_bsm_klib.c ============================================================================== --- head/sys/security/audit/audit_bsm_klib.c Tue Nov 4 20:57:39 2008 (r184659) +++ head/sys/security/audit/audit_bsm_klib.c Tue Nov 4 22:30:24 2008 (r184660) @@ -492,7 +492,7 @@ audit_canon_path(struct thread *td, char char *rbuf, *fbuf, *copy; struct filedesc *fdp; struct sbuf sbf; - int error, cwir, locked; + int error, cwir; WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s: at %s:%d", __func__, __FILE__, __LINE__); @@ -539,17 +539,8 @@ audit_canon_path(struct thread *td, char * in the future. */ if (rvnp != NULL) { - /* - * Although unlikely, it is possible for filesystems to define - * their own VOP_LOCK, so strictly speaking, we need to - * conditionally pickup Giant around calls to vn_lock(9) - */ - locked = VFS_LOCK_GIANT(rvnp->v_mount); - vn_lock(rvnp, LK_EXCLUSIVE | LK_RETRY); - vdrop(rvnp); error = vn_fullpath_global(td, rvnp, &rbuf, &fbuf); - VOP_UNLOCK(rvnp, 0); - VFS_UNLOCK_GIANT(locked); + vdrop(rvnp); if (error) { cpath[0] = '\0'; if (cvnp != NULL) @@ -560,12 +551,8 @@ audit_canon_path(struct thread *td, char free(fbuf, M_TEMP); } if (cvnp != NULL) { - locked = VFS_LOCK_GIANT(cvnp->v_mount); - vn_lock(cvnp, LK_EXCLUSIVE | LK_RETRY); - vdrop(cvnp); error = vn_fullpath(td, cvnp, &rbuf, &fbuf); - VOP_UNLOCK(cvnp, 0); - VFS_UNLOCK_GIANT(locked); + vdrop(cvnp); if (error) { cpath[0] = '\0'; return; From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 22:31:04 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA2381065670; Tue, 4 Nov 2008 22:31:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D995A8FC1D; Tue, 4 Nov 2008 22:31:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4MV4l7009396; Tue, 4 Nov 2008 22:31:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4MV4F9009394; Tue, 4 Nov 2008 22:31:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200811042231.mA4MV4F9009394@svn.freebsd.org> From: John Baldwin Date: Tue, 4 Nov 2008 22:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184661 - in head/sys: kern security/audit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 22:31:05 -0000 Author: jhb Date: Tue Nov 4 22:31:04 2008 New Revision: 184661 URL: http://svn.freebsd.org/changeset/base/184661 Log: Use shared vnode locks for auditing vnode arguments as auditing only does a VOP_GETATTR() which does not require an exclusive lock. Reviewed by: csjp, rwatson Modified: head/sys/kern/vfs_syscalls.c head/sys/security/audit/audit_arg.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Nov 4 22:30:24 2008 (r184660) +++ head/sys/kern/vfs_syscalls.c Tue Nov 4 22:31:04 2008 (r184661) @@ -2734,7 +2734,7 @@ fchflags(td, uap) return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT - vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY); + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1); VOP_UNLOCK(fp->f_vnode, 0); #endif @@ -2896,7 +2896,7 @@ fchmod(td, uap) return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT - vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY); + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1); VOP_UNLOCK(fp->f_vnode, 0); #endif @@ -3074,7 +3074,7 @@ fchown(td, uap) return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT - vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY); + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1); VOP_UNLOCK(fp->f_vnode, 0); #endif @@ -3311,7 +3311,7 @@ kern_futimes(struct thread *td, int fd, return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT - vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY); + vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1); VOP_UNLOCK(fp->f_vnode, 0); #endif Modified: head/sys/security/audit/audit_arg.c ============================================================================== --- head/sys/security/audit/audit_arg.c Tue Nov 4 22:30:24 2008 (r184660) +++ head/sys/security/audit/audit_arg.c Tue Nov 4 22:31:04 2008 (r184661) @@ -631,7 +631,7 @@ audit_arg_file(struct proc *p, struct fi */ 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); audit_arg_vnode(vp, ARG_VNODE1); VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); @@ -849,7 +849,7 @@ audit_sysclose(struct thread *td, int fd 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); audit_arg_vnode(vp, ARG_VNODE1); VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 22:51:57 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33289106564A; Tue, 4 Nov 2008 22:51:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 217498FC0C; Tue, 4 Nov 2008 22:51:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4Mpu9K009858; Tue, 4 Nov 2008 22:51:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4MpuDS009857; Tue, 4 Nov 2008 22:51:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200811042251.mA4MpuDS009857@svn.freebsd.org> From: Marius Strobl Date: Tue, 4 Nov 2008 22:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184662 - stable/7/lib/libcam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 22:51:57 -0000 Author: marius Date: Tue Nov 4 22:51:56 2008 New Revision: 184662 URL: http://svn.freebsd.org/changeset/base/184662 Log: MFC: r184379 Supply a valid Connect ID when issuing XPT_DEV_MATCH, which according to my reading of the CAM draft is mandatory for all CCB function calls and enforced by xptioctl() since at least r168752. Previously we happened to use 0 as the Path ID, causing the XPT_DEV_MATCH call to fail if there's no SCSI bus 0. Basically the same bug was also fixed the same way for camcontrol(8) as part of r126514. PR: 127605 Approved by: re (kib) Modified: stable/7/lib/libcam/ (props changed) stable/7/lib/libcam/camlib.c Modified: stable/7/lib/libcam/camlib.c ============================================================================== --- stable/7/lib/libcam/camlib.c Tue Nov 4 22:31:04 2008 (r184661) +++ stable/7/lib/libcam/camlib.c Tue Nov 4 22:51:56 2008 (r184662) @@ -346,6 +346,9 @@ cam_open_btl(path_id_t path_id, target_i bzero(&ccb, sizeof(union ccb)); ccb.ccb_h.func_code = XPT_DEV_MATCH; + ccb.ccb_h.path_id = CAM_XPT_PATH_ID; + ccb.ccb_h.target_id = CAM_TARGET_WILDCARD; + ccb.ccb_h.target_lun = CAM_LUN_WILDCARD; /* Setup the result buffer */ bufsize = sizeof(struct dev_match_result); From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 22:51:58 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A57F106567F; Tue, 4 Nov 2008 22:51:58 +0000 (UTC) (envelope-from peter@wemm.org) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.229]) by mx1.freebsd.org (Postfix) with ESMTP id 4F2068FC13; Tue, 4 Nov 2008 22:51:58 +0000 (UTC) (envelope-from peter@wemm.org) Received: by rv-out-0506.google.com with SMTP id b25so3271929rvf.43 for ; Tue, 04 Nov 2008 14:51:57 -0800 (PST) Received: by 10.142.251.15 with SMTP id y15mr74336wfh.39.1225839117902; Tue, 04 Nov 2008 14:51:57 -0800 (PST) Received: by 10.142.255.21 with HTTP; Tue, 4 Nov 2008 14:51:57 -0800 (PST) Message-ID: Date: Tue, 4 Nov 2008 14:51:57 -0800 From: "Peter Wemm" To: "John Baldwin" In-Reply-To: <200811041707.26052.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200810240103.m9O13V7f071075@svn.freebsd.org> <200811041707.26052.jhb@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Xu Subject: Re: svn commit: r184216 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 22:51:58 -0000 On Tue, Nov 4, 2008 at 2:07 PM, John Baldwin wrote: > On Thursday 23 October 2008 09:03:31 pm David Xu wrote: >> Author: davidxu >> Date: Fri Oct 24 01:03:31 2008 >> New Revision: 184216 >> URL: http://svn.freebsd.org/changeset/base/184216 >> >> Log: >> partly revert revision 184199, because TDF_NEEDSIGCHK is persitent >> when thread is in kernel mode, it can cause dead loop, now unlock >> process lock after acquired sleep queue lock and thread lock to >> avoid the problem. This means TDF_NEEDSIGCHK and TDF_NEEDSUSPCHK must >> be set with process lock and thread lock being hold at same time. > > You can't unlock the proc lock while holding the thread_lock(). This will > lead to deadlock due to the way that thread_lock() works. This is different > from the rules in 6.x where you could drop a mutex while holding sched_lock. > You will need to revert this. > > -- > John Baldwin I had to back out rev 184216 and 184199 in total in order to stop my machine from dying. Compile this dumb program: http://people.freebsd.org/~peter/pth.c $ cc -pthread -o pth pth.c run in a shell while loop so that the entire thing is execed and exits repeatedly. $ while true; do date; ./pth; done On my 2-core athlon64 box at home, and the 8-core ref8-i386 in the freebsd.org cluster, this causes a lockup in mere seconds. Backing out these two changes solves it. my machine: spin lock 0xffffff00a4037000 (turnstile lock) held by 0xffffff01045746e0 (tid 100355) too long panic: spin lock held too long ref8-i386: spin lock 0xc06436c0 (sched lock 5) held by 0xd374f690 (tid 100249) too long panic: spin lock held too long -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:03:37 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A6741065672; Tue, 4 Nov 2008 23:03:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10B5F8FC20; Tue, 4 Nov 2008 23:03:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA4N3aTV010143; Tue, 4 Nov 2008 23:03:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA4N3apg010142; Tue, 4 Nov 2008 23:03:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200811042303.mA4N3apg010142@svn.freebsd.org> From: Xin LI Date: Tue, 4 Nov 2008 23:03:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184663 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 23:03:37 -0000 Author: delphij Date: Tue Nov 4 23:03:36 2008 New Revision: 184663 URL: http://svn.freebsd.org/changeset/base/184663 Log: Correct a typo that prevented my laptop from starting devd. Modified: head/etc/devd.conf Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Tue Nov 4 22:51:56 2008 (r184662) +++ head/etc/devd.conf Tue Nov 4 23:03:36 2008 (r184663) @@ -265,7 +265,7 @@ notify 0 { notify 0 { match "system" "ACPI"; - match "subsystem"i "ASUS"; + match "subsystem" "ASUS"; match "notify" "0x31"; action "mixer vol -10"; }; From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 00:48:47 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A85CC106568D; Wed, 5 Nov 2008 00:48:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 47FA98FC08; Wed, 5 Nov 2008 00:48:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mA50mdAk005785; Tue, 4 Nov 2008 19:48:41 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: "Ivan Voras" Date: Tue, 4 Nov 2008 17:50:08 -0500 User-Agent: KMail/1.9.7 References: <200811041904.mA4J41dL005103@svn.freebsd.org> <9bbcef730811041422x5f1e7bfco45380390c64b3b1c@mail.gmail.com> In-Reply-To: <9bbcef730811041422x5f1e7bfco45380390c64b3b1c@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811041750.08355.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Tue, 04 Nov 2008 19:48:41 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8568/Tue Nov 4 13:53:00 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184652 - in head/sys: dev/hwpmc fs/procfs kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 00:48:47 -0000 On Tuesday 04 November 2008 05:22:47 pm Ivan Voras wrote: > 2008/11/4 John Baldwin : > > Author: jhb > > Date: Tue Nov 4 19:04:01 2008 > > New Revision: 184652 > > URL: http://svn.freebsd.org/changeset/base/184652 > > > > Log: > > Remove unnecessary locking around vn_fullpath(). The vnode lock for the > > Does this affect realpath(3)? (whose non-scalability is often reported > for PHP web servers). realpath(3) calls getcwd(3) (which devolves to __getcwd(2) I think) once per invocation (and that already did not lock the vnode). It then calls lstat() for each component in the path. The lstat() calls should be using shared locks (at least with the recent changes to use shared lookups for UFS in HEAD). I imagine the bottleneck is more with lstat() than getcwd(3). Neither is helped by the specific changes above. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 01:35:55 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D54E01065670; Wed, 5 Nov 2008 01:35:55 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id AA2278FC1D; Wed, 5 Nov 2008 01:35:55 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from apple.my.domain (root@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id mA51Zqnq084024; Wed, 5 Nov 2008 01:35:53 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4910F8E7.4010805@freebsd.org> Date: Wed, 05 Nov 2008 09:37:43 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.9 (X11/20080612) MIME-Version: 1.0 To: John Baldwin References: <200810240109.m9O19P1u071214@svn.freebsd.org> <200811041705.48043.jhb@freebsd.org> In-Reply-To: <200811041705.48043.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184217 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 01:35:55 -0000 John Baldwin wrote: > On Thursday 23 October 2008 09:09:25 pm David Xu wrote: >> Author: davidxu >> Date: Fri Oct 24 01:09:24 2008 >> New Revision: 184217 >> URL: http://svn.freebsd.org/changeset/base/184217 >> >> Log: >> Don't rearm callout if the process is exiting, it may leak a callout >> because callout_drain() only waits for running callout, but not disable >> it if it is rearmed. > > Can you please revert this as per previous discussion? > I will do it, maybe I lost previous discussion ? From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 02:31:50 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4F1F1065670; Wed, 5 Nov 2008 02:31:50 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 238938FC14; Wed, 5 Nov 2008 02:31:49 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from kobe.laptop (adsl92-78.kln.forthnet.gr [77.49.59.78]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id mA52VcjN011611 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 5 Nov 2008 04:31:43 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id mA52Vb1H001412; Wed, 5 Nov 2008 04:31:37 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id mA52VbkF001411; Wed, 5 Nov 2008 04:31:37 +0200 (EET) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Diomidis Spinellis In-Reply-To: (Diomidis Spinellis's message of "Tue, 4 Nov 2008 22:30:07 +0200") Date: Wed, 05 Nov 2008 04:23:02 +0200 Message-ID: <87tzamgbcp.fsf@kobe.laptop> References: <200811041802.mA4I2aVk003708@svn.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: mA52VcjN011611 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.305, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.09, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184645 - head/usr.bin/vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 02:31:50 -0000 On Tue, 4 Nov 2008 22:30:07 +0200, Diomidis Spinellis wrote: >On Nov 4, 2008, at 8:02 PM, Giorgos Keramidas wrote: >> Author: keramida (doc committer) >> Date: Tue Nov 4 18:02:35 2008 >> New Revision: 184645 >> URL: http://svn.freebsd.org/changeset/base/184645 >> >> Log: >> Repeat vmstat header after window.rows instead of a hardcoded 20. >> >> Use ioctl() to get the window size in vmstat(8), and force a new >> header to be prepended to the output every time the current window >> size changes. Change the number of lines before each header to the >> current lines of the terminal when the terminal is resized, so that >> the full terminal length can be used for output lines. >> >> Inspired by: svn change 175562 (same feature for iostat) >> Reviewed by: ru (who fixed some of my bugs too) > > Thanks! This functionality is generally useful and tricky to code in a > correct way. Should we perhaps package it in a library function, so > that all header-printing commands can benefit from it, without > repeating the code? That's what I thought when I had to write almost the same code a second time. Once is ok, twice is almost ok, but if we find it repeated all over the place a library function would definitely be nice :) One of the utilities that includes a similar `repeated output' mode that I was planning to patch next is procstat(1). Right now procstat prints the header once, and then forgets about it. When the header scrolls off the terminal it's gone for good. The code of procstat is quite different that vmstat and iostat though, so I'll have to think a bit about the best way to make a library function out of the header display code and link all three of them to the same code. From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 02:31:55 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 621EF1065673; Wed, 5 Nov 2008 02:31:55 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id C6C4D8FC18; Wed, 5 Nov 2008 02:31:54 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from kobe.laptop (adsl92-78.kln.forthnet.gr [77.49.59.78]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id mA52Vcr8011610 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 5 Nov 2008 04:31:43 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id mA52Vbgp001408; Wed, 5 Nov 2008 04:31:37 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id mA52Var1001407; Wed, 5 Nov 2008 04:31:36 +0200 (EET) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: "Ivan Voras" In-Reply-To: <9bbcef730811041416o6eaf3033k459fb4d29c9e231a@mail.gmail.com> (Ivan Voras's message of "Tue, 4 Nov 2008 23:16:39 +0100") Date: Wed, 05 Nov 2008 04:18:54 +0200 Message-ID: <87y6zygbjl.fsf@kobe.laptop> References: <200811041802.mA4I2aVk003708@svn.freebsd.org> <9bbcef730811041416o6eaf3033k459fb4d29c9e231a@mail.gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: mA52Vcr8011610 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.305, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.09, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: Diomidis Spinellis , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184645 - head/usr.bin/vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 02:31:55 -0000 On Tue, 4 Nov 2008 23:16:39 +0100, "Ivan Voras" wrote: > 2008/11/4 Diomidis Spinellis : >> On Nov 4, 2008, at 8:02 PM, Giorgos Keramidas wrote: >> >>> Author: keramida (doc committer) >>> Date: Tue Nov 4 18:02:35 2008 >>> New Revision: 184645 >>> URL: http://svn.freebsd.org/changeset/base/184645 >>> >>> Log: >>> Repeat vmstat header after window.rows instead of a hardcoded 20. > >> Thanks! This functionality is generally useful and tricky to code in a >> correct way. > > Any objections to > > http://people.freebsd.org/~ivoras/diffs/vmstat.c.patch.txt ? > > It uses humanize_number on interrupt, syscall and context switch counts. It's great! I'm only a bit worried about breaking many people's scripts if we change the format to include humanized numbers by default, so I would like to see a similar patch committed but disabled by default for a while (and enabled by a command-line option like `-h'). The `-h' option seems to be the BSD equivalent of what GNU people would call `--humanized-output'. It would be nice to have vmstat and iostat display humanized numbers but let's keep the default to its traditional style and make the new output style accessible too :) From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 03:01:24 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 105BA1065670; Wed, 5 Nov 2008 03:01:24 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F18A78FC12; Wed, 5 Nov 2008 03:01:23 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA531N0k014736; Wed, 5 Nov 2008 03:01:23 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA531Nmk014730; Wed, 5 Nov 2008 03:01:23 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <200811050301.mA531Nmk014730@svn.freebsd.org> From: David Xu Date: Wed, 5 Nov 2008 03:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184667 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 03:01:24 -0000 Author: davidxu Date: Wed Nov 5 03:01:23 2008 New Revision: 184667 URL: http://svn.freebsd.org/changeset/base/184667 Log: Revert rev 184216 and 184199, due to the way the thread_lock works, it may cause a lockup. Noticed by: peter, jhb Modified: head/sys/kern/kern_sig.c head/sys/kern/kern_thr.c head/sys/kern/kern_thread.c head/sys/kern/subr_sleepqueue.c head/sys/kern/sys_process.c head/sys/sys/proc.h Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Nov 4 23:38:08 2008 (r184666) +++ head/sys/kern/kern_sig.c Wed Nov 5 03:01:23 2008 (r184667) @@ -2115,15 +2115,19 @@ tdsignal(struct proc *p, struct thread * * Otherwise, process goes back to sleep state. */ p->p_flag &= ~P_STOPPED_SIG; + PROC_SLOCK(p); if (p->p_numthreads == p->p_suspcount) { + PROC_SUNLOCK(p); p->p_flag |= P_CONTINUED; p->p_xstat = SIGCONT; PROC_LOCK(p->p_pptr); childproc_continued(p); PROC_UNLOCK(p->p_pptr); + PROC_SLOCK(p); } if (action == SIG_DFL) { thread_unsuspend(p); + PROC_SUNLOCK(p); sigqueue_delete(sigqueue, sig); goto out; } @@ -2132,12 +2136,14 @@ tdsignal(struct proc *p, struct thread * * The process wants to catch it so it needs * to run at least one thread, but which one? */ + PROC_SUNLOCK(p); goto runfast; } /* * The signal is not ignored or caught. */ thread_unsuspend(p); + PROC_SUNLOCK(p); goto out; } @@ -2161,10 +2167,12 @@ tdsignal(struct proc *p, struct thread * * It may run a bit until it hits a thread_suspend_check(). */ wakeup_swapper = 0; + PROC_SLOCK(p); thread_lock(td); if (TD_ON_SLEEPQ(td) && (td->td_flags & TDF_SINTR)) wakeup_swapper = sleepq_abort(td, intrval); thread_unlock(td); + PROC_SUNLOCK(p); if (wakeup_swapper) kick_proc0(); goto out; @@ -2185,6 +2193,7 @@ tdsignal(struct proc *p, struct thread * goto out; p->p_flag |= P_STOPPED_SIG; p->p_xstat = sig; + PROC_SLOCK(p); sig_suspend_threads(td, p, 1); if (p->p_numthreads == p->p_suspcount) { /* @@ -2195,8 +2204,10 @@ tdsignal(struct proc *p, struct thread * * should never be equal to p_suspcount. */ thread_stopped(p); + PROC_SUNLOCK(p); sigqueue_delete_proc(p, p->p_xstat); - } + } else + PROC_SUNLOCK(p); goto out; } } else { @@ -2211,8 +2222,12 @@ tdsignal(struct proc *p, struct thread * */ runfast: tdsigwakeup(td, sig, action, intrval); + PROC_SLOCK(p); thread_unsuspend(p); + PROC_SUNLOCK(p); out: + /* If we jump here, proc slock should not be owned. */ + PROC_SLOCK_ASSERT(p, MA_NOTOWNED); return (ret); } @@ -2232,6 +2247,7 @@ tdsigwakeup(struct thread *td, int sig, PROC_LOCK_ASSERT(p, MA_OWNED); prop = sigprop(sig); + PROC_SLOCK(p); thread_lock(td); /* * Bring the priority of a thread up if we want it to get @@ -2255,6 +2271,7 @@ tdsigwakeup(struct thread *td, int sig, */ if ((prop & SA_CONT) && action == SIG_DFL) { thread_unlock(td); + PROC_SUNLOCK(p); sigqueue_delete(&p->p_sigqueue, sig); /* * It may be on either list in this state. @@ -2283,6 +2300,7 @@ tdsigwakeup(struct thread *td, int sig, #endif } out: + PROC_SUNLOCK(p); thread_unlock(td); if (wakeup_swapper) kick_proc0(); @@ -2294,6 +2312,7 @@ sig_suspend_threads(struct thread *td, s struct thread *td2; PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_SLOCK_ASSERT(p, MA_OWNED); FOREACH_THREAD_IN_PROC(p, td2) { thread_lock(td2); @@ -2325,9 +2344,11 @@ ptracestop(struct thread *td, int sig) td->td_dbgflags |= TDB_XSIG; td->td_xsig = sig; + PROC_SLOCK(p); while ((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_XSIG)) { if (p->p_flag & P_SINGLE_EXIT) { td->td_dbgflags &= ~TDB_XSIG; + PROC_SUNLOCK(p); return (sig); } /* @@ -2349,6 +2370,7 @@ stopme: goto stopme; } } + PROC_SUNLOCK(p); return (td->td_xsig); } @@ -2489,8 +2511,10 @@ issignal(td) &p->p_mtx.lock_object, "Catching SIGSTOP"); p->p_flag |= P_STOPPED_SIG; p->p_xstat = sig; + PROC_SLOCK(p); sig_suspend_threads(td, p, 0); thread_suspend_switch(td); + PROC_SUNLOCK(p); mtx_lock(&ps->ps_mtx); break; } else if (prop & SA_IGNORE) { @@ -2532,15 +2556,18 @@ thread_stopped(struct proc *p) int n; PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_SLOCK_ASSERT(p, MA_OWNED); n = p->p_suspcount; if (p == curproc) n++; if ((p->p_flag & P_STOPPED_SIG) && (n == p->p_numthreads)) { + PROC_SUNLOCK(p); p->p_flag &= ~P_WAITED; PROC_LOCK(p->p_pptr); childproc_stopped(p, (p->p_flag & P_TRACED) ? CLD_TRAPPED : CLD_STOPPED); PROC_UNLOCK(p->p_pptr); + PROC_SLOCK(p); } } Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Tue Nov 4 23:38:08 2008 (r184666) +++ head/sys/kern/kern_thr.c Wed Nov 5 03:01:23 2008 (r184667) @@ -286,6 +286,7 @@ thr_exit(struct thread *td, struct thr_e PROC_LOCK(p); sigqueue_flush(&td->td_sigqueue); + PROC_SLOCK(p); /* * Shutting down last thread in the proc. This will actually @@ -293,10 +294,10 @@ thr_exit(struct thread *td, struct thr_e */ if (p->p_numthreads != 1) { thread_stopped(p); - PROC_SLOCK(p); thread_exit(); /* NOTREACHED */ } + PROC_SUNLOCK(p); PROC_UNLOCK(p); return (0); } Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Tue Nov 4 23:38:08 2008 (r184666) +++ head/sys/kern/kern_thread.c Wed Nov 5 03:01:23 2008 (r184667) @@ -543,6 +543,7 @@ thread_single(int mode) p->p_flag &= ~P_SINGLE_BOUNDARY; } p->p_flag |= P_STOPPED_SINGLE; + PROC_SLOCK(p); p->p_singlethread = td; if (mode == SINGLE_EXIT) remaining = p->p_numthreads; @@ -641,6 +642,7 @@ stopme: p->p_flag &= ~(P_STOPPED_SINGLE | P_SINGLE_EXIT); thread_unthread(td); } + PROC_SUNLOCK(p); return (0); } @@ -714,16 +716,15 @@ thread_suspend_check(int return_instead) if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) sigqueue_flush(&td->td_sigqueue); + PROC_SLOCK(p); thread_stopped(p); /* * If the process is waiting for us to exit, * this thread should just suicide. * Assumes that P_SINGLE_EXIT implies P_STOPPED_SINGLE. */ - if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) { - PROC_SLOCK(p); + if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) thread_exit(); - } if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE) { if (p->p_numthreads == p->p_suspcount + 1) { thread_lock(p->p_singlethread); @@ -734,8 +735,8 @@ thread_suspend_check(int return_instead) kick_proc0(); } } - thread_lock(td); PROC_UNLOCK(p); + thread_lock(td); /* * When a thread suspends, it just * gets taken off all queues. @@ -745,6 +746,7 @@ thread_suspend_check(int return_instead) p->p_boundary_count++; td->td_flags |= TDF_BOUNDARY; } + PROC_SUNLOCK(p); mi_switch(SW_INVOL | SWT_SUSPEND, NULL); if (return_instead == 0) td->td_flags &= ~TDF_BOUNDARY; @@ -764,22 +766,25 @@ thread_suspend_switch(struct thread *td) p = td->td_proc; KASSERT(!TD_IS_SUSPENDED(td), ("already suspended")); PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_SLOCK_ASSERT(p, MA_OWNED); /* * We implement thread_suspend_one in stages here to avoid * dropping the proc lock while the thread lock is owned. */ thread_stopped(p); p->p_suspcount++; - thread_lock(td); PROC_UNLOCK(p); + thread_lock(td); td->td_flags &= ~TDF_NEEDSUSPCHK; TD_SET_SUSPENDED(td); sched_sleep(td, 0); + PROC_SUNLOCK(p); DROP_GIANT(); mi_switch(SW_VOL | SWT_SUSPEND, NULL); thread_unlock(td); PICKUP_GIANT(); PROC_LOCK(p); + PROC_SLOCK(p); } void @@ -787,6 +792,7 @@ thread_suspend_one(struct thread *td) { struct proc *p = td->td_proc; + PROC_SLOCK_ASSERT(p, MA_OWNED); THREAD_LOCK_ASSERT(td, MA_OWNED); KASSERT(!TD_IS_SUSPENDED(td), ("already suspended")); p->p_suspcount++; @@ -800,6 +806,7 @@ thread_unsuspend_one(struct thread *td) { struct proc *p = td->td_proc; + PROC_SLOCK_ASSERT(p, MA_OWNED); THREAD_LOCK_ASSERT(td, MA_OWNED); KASSERT(TD_IS_SUSPENDED(td), ("Thread not suspended")); TD_CLR_SUSPENDED(td); @@ -817,6 +824,7 @@ thread_unsuspend(struct proc *p) int wakeup_swapper; PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_SLOCK_ASSERT(p, MA_OWNED); wakeup_swapper = 0; if (!P_SHOULDSTOP(p)) { FOREACH_THREAD_IN_PROC(p, td) { @@ -855,6 +863,7 @@ thread_single_end(void) p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); p->p_flag &= ~(P_STOPPED_SINGLE | P_SINGLE_EXIT | P_SINGLE_BOUNDARY); + PROC_SLOCK(p); p->p_singlethread = NULL; wakeup_swapper = 0; /* @@ -872,6 +881,7 @@ thread_single_end(void) thread_unlock(td); } } + PROC_SUNLOCK(p); if (wakeup_swapper) kick_proc0(); } Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Tue Nov 4 23:38:08 2008 (r184666) +++ head/sys/kern/subr_sleepqueue.c Wed Nov 5 03:01:23 2008 (r184667) @@ -395,7 +395,6 @@ sleepq_catch_signals(void *wchan, int pr sleepq_switch(wchan, pri); return (0); } - thread_unlock(td); mtx_unlock_spin(&sc->sc_lock); CTR3(KTR_PROC, "sleepq catching signals: thread %p (pid %ld, %s)", @@ -415,15 +414,16 @@ sleepq_catch_signals(void *wchan, int pr ret = ERESTART; mtx_unlock(&ps->ps_mtx); } - + /* + * Lock the per-process spinlock prior to dropping the PROC_LOCK + * to avoid a signal delivery race. PROC_LOCK, PROC_SLOCK, and + * thread_lock() are currently held in tdsignal(). + */ + PROC_SLOCK(p); mtx_lock_spin(&sc->sc_lock); - thread_lock(td); PROC_UNLOCK(p); - if (ret == 0) { - sleepq_switch(wchan, pri); - return (0); - } - + thread_lock(td); + PROC_SUNLOCK(p); /* * There were pending signals and this thread is still * on the sleep queue, remove it from the sleep queue. Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Tue Nov 4 23:38:08 2008 (r184666) +++ head/sys/kern/sys_process.c Wed Nov 5 03:01:23 2008 (r184667) @@ -795,8 +795,10 @@ kern_ptrace(struct thread *td, int req, * you should use PT_SUSPEND to suspend it before * continuing process. */ + PROC_SLOCK(p); p->p_flag &= ~(P_STOPPED_TRACE|P_STOPPED_SIG|P_WAITED); thread_unsuspend(p); + PROC_SUNLOCK(p); } else { if (data) psignal(p, data); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue Nov 4 23:38:08 2008 (r184666) +++ head/sys/sys/proc.h Wed Nov 5 03:01:23 2008 (r184667) @@ -500,8 +500,8 @@ struct proc { u_char p_pfsflags; /* (c) Procfs flags. */ struct nlminfo *p_nlminfo; /* (?) Only used by/for lockd. */ struct kaioinfo *p_aioinfo; /* (c) ASYNC I/O info. */ - struct thread *p_singlethread;/* (c) If single threading this is it */ - int p_suspcount; /* (c) Num threads in suspended mode. */ + struct thread *p_singlethread;/* (c + j) If single threading this is it */ + int p_suspcount; /* (j) Num threads in suspended mode. */ struct thread *p_xthread; /* (c) Trap thread */ int p_boundary_count;/* (c) Num threads at user boundary */ int p_pendingcnt; /* how many signals are pending */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 03:45:40 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B10641065672 for ; Wed, 5 Nov 2008 03:45:40 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by mx1.freebsd.org (Postfix) with ESMTP id 424A08FC08 for ; Wed, 5 Nov 2008 03:45:39 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: by ey-out-2122.google.com with SMTP id 6so1180433eyi.7 for ; Tue, 04 Nov 2008 19:45:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=3JGfeUVbfD3IjnOaLPdnAtjoo+tJ+5tg5oqP0XBfJuo=; b=yGc8W7RVz5ozQpuCP5uJlFKqp6MFkj3zl2u90RRIze7bJAOmLwwC6SFTE4MI2827X8 pxZwemwe8JH6s1K8+Fx/k8jmNF3ladKDXoab3TiIu/zCQL79BRt/JOK2dUwIYy8tVMp3 mZkEmd+K2NyZwdfZE5Do+rA0sSnyfD4tv6ss8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=hLSqNA+6ALa/Qts4PskWfVu+CrcixXZ/n18MBEYQukP0CHnVa2699/vBGtEzcagYDz gIoxvza+lyCQNUKVreKitDlGSMF24i/3RBEK4lftXTxWYuLyFef/HJdsJjrT6RbgQtvO FL3rkUeuO2hOYIRWUhfKCFXapvav2qUPWvjeU= Received: by 10.210.37.16 with SMTP id k16mr437002ebk.75.1225856738965; Tue, 04 Nov 2008 19:45:38 -0800 (PST) Received: by 10.210.54.9 with HTTP; Tue, 4 Nov 2008 19:45:38 -0800 (PST) Message-ID: Date: Wed, 5 Nov 2008 01:45:38 -0200 From: "Carlos A. M. dos Santos" To: "Joerg Sonnenberger" In-Reply-To: <20081103225453.GA1509@britannica.bec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811032209.mA3M9RhK077380@svn.freebsd.org> <490F800E.9080201@gmx.de> <20081103225453.GA1509@britannica.bec.de> Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r184605 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 03:45:40 -0000 On Mon, Nov 3, 2008 at 8:54 PM, Joerg Sonnenberger wrote: > On Mon, Nov 03, 2008 at 11:49:50PM +0100, Christoph Mallon wrote: >> You may want to make cmd[] static and/or const, so the compiler really >> just puts the bytes in the data section instead of generating code, >> which pretty much is the same as the assignments you just removed. > > I didn't make it const originally as I am not sure if the USB stack will > never modify the buffer. You may want to have a const array and memcpy it to cmd before calling usbd_transfer(). This will be smaller, though not much faster. -- cd /usr/ports/sysutils/life make clean From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 04:29:15 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80F861065689; Wed, 5 Nov 2008 04:29:15 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 409018FC1D; Wed, 5 Nov 2008 04:29:15 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mA54RafF016910; Tue, 4 Nov 2008 21:27:36 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 04 Nov 2008 21:28:50 -0700 (MST) Message-Id: <20081104.212850.1585998941.imp@bsdimp.com> To: thompsa@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20081104160841.GF93540@citylink.fud.org.nz> References: <200811041152.mA4BqoPb095612@svn.freebsd.org> <20081104160841.GF93540@citylink.fud.org.nz> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, rpaulo@FreeBSD.org Subject: Re: svn commit: r184625 - in head: etc sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 04:29:15 -0000 In message: <20081104160841.GF93540@citylink.fud.org.nz> Andrew Thompson writes: : On Tue, Nov 04, 2008 at 11:52:50AM +0000, Rui Paulo wrote: : > Author: rpaulo : > Date: Tue Nov 4 11:52:50 2008 : > New Revision: 184625 : > URL: http://svn.freebsd.org/changeset/base/184625 : > : > Log: : > Add support for Asus A8Sr notebooks. : > : > PR: 128553 : > Submitted by: Eygene Ryabinkin : > Reviewed by: philip : > MFC after: 2 months : > : > Modified: : > head/etc/devd.conf : > head/sys/dev/acpi_support/acpi_asus.c : : We could almost do with a /etc/devd.conf.d/ directory to drop in : hardware specific event files. devd already supports this concept... All files in a directory already are parsed and merged... Warner From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 05:26:12 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACDB71065675; Wed, 5 Nov 2008 05:26:11 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77A2B8FC08; Wed, 5 Nov 2008 05:26:11 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA55QBop017411; Wed, 5 Nov 2008 05:26:11 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA55QBk4017410; Wed, 5 Nov 2008 05:26:11 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200811050526.mA55QBk4017410@svn.freebsd.org> From: Tim Kientzle Date: Wed, 5 Nov 2008 05:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184668 - head/usr.bin/tar/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 05:26:12 -0000 Author: kientzle Date: Wed Nov 5 05:26:11 2008 New Revision: 184668 URL: http://svn.freebsd.org/changeset/base/184668 Log: Fix compile warnings building on amd64. This is modified slightly from Jaakko's original patch: I have misgivings about the portability of the 'z' printf modifier so opted to cast the arguments to (int) instead. PR: bin/128561 Submitted by: Jaakko Heinonen MFC after: 30 days Modified: head/usr.bin/tar/test/main.c Modified: head/usr.bin/tar/test/main.c ============================================================================== --- head/usr.bin/tar/test/main.c Wed Nov 5 03:01:23 2008 (r184667) +++ head/usr.bin/tar/test/main.c Wed Nov 5 05:26:11 2008 (r184668) @@ -324,10 +324,10 @@ test_assert_equal_string(const char *fil file, line); fprintf(stderr, " %s = ", e1); strdump(v1); - fprintf(stderr, " (length %d)\n", v1 == NULL ? 0 : strlen(v1)); + fprintf(stderr, " (length %d)\n", v1 == NULL ? 0 : (int)strlen(v1)); fprintf(stderr, " %s = ", e2); strdump(v2); - fprintf(stderr, " (length %d)\n", v2 == NULL ? 0 : strlen(v2)); + fprintf(stderr, " (length %d)\n", v2 == NULL ? 0 : (int)strlen(v2)); report_failure(extra); return (0); } @@ -402,7 +402,7 @@ hexdump(const char *p, const char *ref, char sep; for(i=0; i < l; i+=16) { - fprintf(stderr, "%04x", i + offset); + fprintf(stderr, "%04x", (int)(i + offset)); sep = ' '; for (j = 0; j < 16 && i + j < l; j++) { if (ref != NULL && p[i + j] != ref[i + j]) @@ -494,7 +494,8 @@ test_assert_empty_file(const char *f1fmt if (fd < 0) { fprintf(stderr, " Unable to open %s\n", f1); } else { - s = sizeof(buff) < st.st_size ? sizeof(buff) : st.st_size; + s = (sizeof(buff) < (size_t)st.st_size) ? + (ssize_t)sizeof(buff) : (ssize_t)st.st_size; s = read(fd, buff, s); hexdump(buff, NULL, s, 0); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 05:48:46 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD9D11065670; Wed, 5 Nov 2008 05:48:46 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 51CCA8FC13; Wed, 5 Nov 2008 05:48:46 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 3BF1A28454; Wed, 5 Nov 2008 13:48:45 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 3731FEC2121; Wed, 5 Nov 2008 13:48:44 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id s1Es2QHdoXkv; Wed, 5 Nov 2008 13:48:39 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 07647EC1EEF; Wed, 5 Nov 2008 13:48:36 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=kRy+hIcI+T9rZOv9FKCqhdfB+2f2E9XTcyH1MxF7CnC/A5vdgsDezpJP3J2EV5LVb GFWI4s3q0Qes60ruKcfoQ== Message-ID: <491133B1.9050208@delphij.net> Date: Tue, 04 Nov 2008 21:48:33 -0800 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.17 (X11/20080928) MIME-Version: 1.0 To: Tim Kientzle References: <200811050526.mA55QBk4017410@svn.freebsd.org> In-Reply-To: <200811050526.mA55QBk4017410@svn.freebsd.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r184668 - head/usr.bin/tar/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 05:48:46 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Tim Kientzle wrote: > Author: kientzle > Date: Wed Nov 5 05:26:11 2008 > New Revision: 184668 > URL: http://svn.freebsd.org/changeset/base/184668 > > Log: > Fix compile warnings building on amd64. This is modified slightly > from Jaakko's original patch: I have misgivings about the portability > of the 'z' printf modifier so opted to cast the arguments to (int) > instead. > > PR: bin/128561 > Submitted by: Jaakko Heinonen > MFC after: 30 days > [...] > @@ -494,7 +494,8 @@ test_assert_empty_file(const char *f1fmt > if (fd < 0) { > fprintf(stderr, " Unable to open %s\n", f1); > } else { > - s = sizeof(buff) < st.st_size ? sizeof(buff) : st.st_size; > + s = (sizeof(buff) < (size_t)st.st_size) ? > + (ssize_t)sizeof(buff) : (ssize_t)st.st_size; I'm more or less concerned about this - st_size is off_t, is it safe to cast it to size_t when comparing here? > s = read(fd, buff, s); > hexdump(buff, NULL, s, 0); > } > - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkkRM7AACgkQi+vbBBjt66D/YwCgqm9Do0SwckV4Da86gEyU4Yk8 AXMAni2tF+SzEObjliVy1z03irw7Qd6g =M8sh -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 06:40:53 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C90481065688; Wed, 5 Nov 2008 06:40:53 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7C288FC12; Wed, 5 Nov 2008 06:40:53 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA56er6a018746; Wed, 5 Nov 2008 06:40:53 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA56erap018745; Wed, 5 Nov 2008 06:40:53 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200811050640.mA56erap018745@svn.freebsd.org> From: Tim Kientzle Date: Wed, 5 Nov 2008 06:40:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184669 - head/usr.bin/tar/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 06:40:53 -0000 Author: kientzle Date: Wed Nov 5 06:40:53 2008 New Revision: 184669 URL: http://svn.freebsd.org/changeset/base/184669 Log: When comparing, cast to the larger size, off_t in this case. Once we know which one is smaller, then we cast to the smaller size. Thanks to Xin Li (delphij@) Pointy hat: /me Modified: head/usr.bin/tar/test/main.c Modified: head/usr.bin/tar/test/main.c ============================================================================== --- head/usr.bin/tar/test/main.c Wed Nov 5 05:26:11 2008 (r184668) +++ head/usr.bin/tar/test/main.c Wed Nov 5 06:40:53 2008 (r184669) @@ -494,7 +494,7 @@ test_assert_empty_file(const char *f1fmt if (fd < 0) { fprintf(stderr, " Unable to open %s\n", f1); } else { - s = (sizeof(buff) < (size_t)st.st_size) ? + s = ((off_t)sizeof(buff) < st.st_size) ? (ssize_t)sizeof(buff) : (ssize_t)st.st_size; s = read(fd, buff, s); hexdump(buff, NULL, s, 0); From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 07:06:31 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6701F1065670; Wed, 5 Nov 2008 07:06:31 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id 3D2098FC13; Wed, 5 Nov 2008 07:06:31 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from [10.123.2.205] (p53.kientzle.com [66.166.149.53]) by kientzle.com (8.12.9/8.12.9) with ESMTP id mA56futv029743; Tue, 4 Nov 2008 22:41:56 -0800 (PST) (envelope-from tim@kientzle.com) Message-ID: <4911402F.2000305@kientzle.com> Date: Tue, 04 Nov 2008 22:41:51 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422 X-Accept-Language: en-us, en MIME-Version: 1.0 To: d@delphij.net References: <200811050526.mA55QBk4017410@svn.freebsd.org> <491133B1.9050208@delphij.net> In-Reply-To: <491133B1.9050208@delphij.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Tim Kientzle , src-committers@FreeBSD.ORG Subject: Re: svn commit: r184668 - head/usr.bin/tar/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 07:06:31 -0000 Xin LI wrote: >>Author: kientzle >>Date: Wed Nov 5 05:26:11 2008 >>New Revision: 184668 >>URL: http://svn.freebsd.org/changeset/base/184668 >> >> >[...] > > >>@@ -494,7 +494,8 @@ test_assert_empty_file(const char *f1fmt >> if (fd < 0) { >> fprintf(stderr, " Unable to open %s\n", f1); >> } else { >>- s = sizeof(buff) < st.st_size ? sizeof(buff) : st.st_size; >>+ s = (sizeof(buff) < (size_t)st.st_size) ? >>+ (ssize_t)sizeof(buff) : (ssize_t)st.st_size; >> >> > >I'm more or less concerned about this - st_size is off_t, is it safe to >cast it to size_t when comparing here? > > Thanks. I've fixed this. Tim From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 07:41:57 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F41901065677; Wed, 5 Nov 2008 07:41:56 +0000 (UTC) (envelope-from dds@aueb.gr) Received: from mx-out.forthnet.gr (mx-out.forthnet.gr [193.92.150.104]) by mx1.freebsd.org (Postfix) with ESMTP id 6DE8B8FC13; Wed, 5 Nov 2008 07:41:55 +0000 (UTC) (envelope-from dds@aueb.gr) Received: from mx-av-05.forthnet.gr (mx-av.forthnet.gr [193.92.150.27]) by mx-out-03.forthnet.gr (8.14.3/8.14.3) with ESMTP id mA57gaYI013411; Wed, 5 Nov 2008 09:42:36 +0200 Received: from MX-IN-02.forthnet.gr (mx-in-02.forthnet.gr [193.92.150.185]) by mx-av-05.forthnet.gr (8.14.3/8.14.3) with ESMTP id mA57frjY011532; Wed, 5 Nov 2008 09:41:53 +0200 Received: from [192.168.136.16] (adsl81-74.kln.forthnet.gr [77.49.48.74]) by MX-IN-02.forthnet.gr (8.14.3/8.14.3) with ESMTP id mA57f7dF022567; Wed, 5 Nov 2008 09:41:08 +0200 Authentication-Results: MX-IN-02.forthnet.gr smtp.mail=dds@aueb.gr; spf=neutral Authentication-Results: MX-IN-02.forthnet.gr header.from=dds@aueb.gr; sender-id=neutral Message-ID: <49114E16.1090808@aueb.gr> Date: Wed, 05 Nov 2008 09:41:10 +0200 From: Diomidis Spinellis User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Giorgos Keramidas References: <200811041802.mA4I2aVk003708@svn.freebsd.org> <87tzamgbcp.fsf@kobe.laptop> In-Reply-To: <87tzamgbcp.fsf@kobe.laptop> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184645 - head/usr.bin/vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 07:41:57 -0000 Giorgos Keramidas wrote: > On Tue, 4 Nov 2008 22:30:07 +0200, Diomidis Spinellis wrote: >> On Nov 4, 2008, at 8:02 PM, Giorgos Keramidas wrote: >>> Author: keramida (doc committer) >>> Date: Tue Nov 4 18:02:35 2008 >>> New Revision: 184645 >>> URL: http://svn.freebsd.org/changeset/base/184645 >>> >>> Log: >>> Repeat vmstat header after window.rows instead of a hardcoded 20. >>> >>> Use ioctl() to get the window size in vmstat(8), and force a new >>> header to be prepended to the output every time the current window >>> size changes. Change the number of lines before each header to the >>> current lines of the terminal when the terminal is resized, so that >>> the full terminal length can be used for output lines. >>> >>> Inspired by: svn change 175562 (same feature for iostat) >>> Reviewed by: ru (who fixed some of my bugs too) >> Thanks! This functionality is generally useful and tricky to code in a >> correct way. Should we perhaps package it in a library function, so >> that all header-printing commands can benefit from it, without >> repeating the code? > > That's what I thought when I had to write almost the same code a second > time. Once is ok, twice is almost ok, but if we find it repeated all > over the place a library function would definitely be nice :) > > One of the utilities that includes a similar `repeated output' mode that > I was planning to patch next is procstat(1). Right now procstat prints > the header once, and then forgets about it. When the header scrolls off > the terminal it's gone for good. > > The code of procstat is quite different that vmstat and iostat though, > so I'll have to think a bit about the best way to make a library > function out of the header display code and link all three of them to > the same code. > And let us not forget netstat and nfsstat (both seem to use a hard-coded terminal size). Let me remark (without actually suggesting that we go down that road) that the old-school Unix approach to this problem might be to create a separate program that would add a specified header to its input. From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 09:27:14 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 325EA1065677; Wed, 5 Nov 2008 09:27:14 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 085858FC0C; Wed, 5 Nov 2008 09:27:14 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA59RDaB021754; Wed, 5 Nov 2008 09:27:13 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA59RDFQ021753; Wed, 5 Nov 2008 09:27:13 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200811050927.mA59RDFQ021753@svn.freebsd.org> From: Maxim Konovalov Date: Wed, 5 Nov 2008 09:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184671 - head/sbin/bsdlabel X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 09:27:14 -0000 Author: maxim Date: Wed Nov 5 09:27:13 2008 New Revision: 184671 URL: http://svn.freebsd.org/changeset/base/184671 Log: o Replace Xr to gpt(8) which is gone by gpart(8). Modified: head/sbin/bsdlabel/bsdlabel.8 Modified: head/sbin/bsdlabel/bsdlabel.8 ============================================================================== --- head/sbin/bsdlabel/bsdlabel.8 Wed Nov 5 09:03:46 2008 (r184670) +++ head/sbin/bsdlabel/bsdlabel.8 Wed Nov 5 09:27:13 2008 (r184671) @@ -497,5 +497,5 @@ are not generally compatible. .Xr disktab 5 , .Xr boot0cfg 8 , .Xr fdisk 8 , -.Xr gpt 8 , +.Xr gpart 8 , .Xr newfs 8 From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 09:28:31 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3160B1065687; Wed, 5 Nov 2008 09:28:31 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2118D8FC22; Wed, 5 Nov 2008 09:28:31 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA59SV5F021814; Wed, 5 Nov 2008 09:28:31 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA59SVPW021813; Wed, 5 Nov 2008 09:28:31 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200811050928.mA59SVPW021813@svn.freebsd.org> From: Maxim Konovalov Date: Wed, 5 Nov 2008 09:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184672 - head/sbin/bsdlabel X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 09:28:31 -0000 Author: maxim Date: Wed Nov 5 09:28:30 2008 New Revision: 184672 URL: http://svn.freebsd.org/changeset/base/184672 Log: o One more s/gpt/gpart/. Modified: head/sbin/bsdlabel/bsdlabel.8 Modified: head/sbin/bsdlabel/bsdlabel.8 ============================================================================== --- head/sbin/bsdlabel/bsdlabel.8 Wed Nov 5 09:27:13 2008 (r184671) +++ head/sbin/bsdlabel/bsdlabel.8 Wed Nov 5 09:28:30 2008 (r184672) @@ -481,7 +481,7 @@ to store the number of sectors, labels are restricted to a maximum of 2^32-1 sectors. This usually means 2TB of disk space. Larger disks should be partitioned using another method such as -.Xr gpt 8 . +.Xr gpart 8 . .Pp The various .Bx Ns s From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 09:42:06 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 179461065673; Wed, 5 Nov 2008 09:42:06 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0659F8FC1A; Wed, 5 Nov 2008 09:42:06 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA59g5CQ022075; Wed, 5 Nov 2008 09:42:05 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA59g55n022074; Wed, 5 Nov 2008 09:42:05 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200811050942.mA59g55n022074@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 5 Nov 2008 09:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184673 - head/usr.sbin/gssd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 09:42:06 -0000 Author: keramida (doc committer) Date: Wed Nov 5 09:42:05 2008 New Revision: 184673 URL: http://svn.freebsd.org/changeset/base/184673 Log: Tiny typo fix and remove 'example' from a "real" manpage. Modified: head/usr.sbin/gssd/gssd.8 Modified: head/usr.sbin/gssd/gssd.8 ============================================================================== --- head/usr.sbin/gssd/gssd.8 Wed Nov 5 09:28:30 2008 (r184672) +++ head/usr.sbin/gssd/gssd.8 Wed Nov 5 09:42:05 2008 (r184673) @@ -27,7 +27,7 @@ .\" .\" Note: The date here should be updated whenever a non-trivial .\" change is made to the manual page. -.Dd August 25, 2008 +.Dd November 5, 2008 .Dt GSSD 8 .Os .Sh NAME @@ -47,7 +47,7 @@ The options are as follows: Run in debug mode. In this mode, .Nm -will not for when it starts. +will not fork when it starts. .El .Sh FILES .Bl -tag -width ".Pa /etc/krb5.keytab" -compact @@ -62,7 +62,7 @@ by kernel GSS-API services. .Sh HISTORY The .Nm -manual page example first appeared in +manual page first appeared in .Fx 8.0 . .Sh AUTHORS This From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 09:44:06 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE46B1065674; Wed, 5 Nov 2008 09:44:06 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 56A108FC17; Wed, 5 Nov 2008 09:44:05 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from kobe.laptop (adsl92-78.kln.forthnet.gr [77.49.59.78]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id mA59hvi3004378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 5 Nov 2008 11:44:02 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id mA59hu2e002609; Wed, 5 Nov 2008 11:43:56 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id mA59hu0x002608; Wed, 5 Nov 2008 11:43:56 +0200 (EET) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Doug Rabson References: <200811031038.mA3Ac0UR064387@svn.freebsd.org> Date: Wed, 05 Nov 2008 11:43:56 +0200 In-Reply-To: <200811031038.mA3Ac0UR064387@svn.freebsd.org> (Doug Rabson's message of "Mon, 3 Nov 2008 10:38:00 +0000 (UTC)") Message-ID: <87ljvyecdf.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: mA59hvi3004378 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.309, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.09, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: 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/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 09:44:07 -0000 On Mon, 3 Nov 2008 10:38:00 +0000 (UTC), Doug Rabson wrote: > Added: > head/etc/rc.d/gssd (contents, props changed) Hi Doug, rc-stuff complains that gssd_enable isn't set "properly", because it isn't set at all. Does the following look ok? %%% diff -r e55b74172f0f etc/defaults/rc.conf --- a/etc/defaults/rc.conf Wed Nov 05 08:53:01 2008 +0200 +++ b/etc/defaults/rc.conf Wed Nov 05 11:43:13 2008 +0200 @@ -265,6 +265,9 @@ kpasswdd_server_enable="NO" # Run kpasswdd (or NO) kpasswdd_server="/usr/libexec/kpasswdd" # path to kerberos 5 passwd daemon +gssd_enable="NO" # Run the gssd daemon (or NO). +gssd_flags="" # Flags for gssd. + rwhod_enable="NO" # Run the rwho daemon (or NO). rwhod_flags="" # Flags for rwhod rarpd_enable="NO" # Run rarpd (or NO). %%% From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 10:05:40 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CB2D1065672; Wed, 5 Nov 2008 10:05:40 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from itchy.rabson.org (unknown [IPv6:2002:50b1:e8f2:1::143]) by mx1.freebsd.org (Postfix) with ESMTP id C95E98FC18; Wed, 5 Nov 2008 10:05:39 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from [IPv6:2001:470:909f:1:21b:63ff:feb8:5abc] (unknown [IPv6:2001:470:909f:1:21b:63ff:feb8:5abc]) by itchy.rabson.org (Postfix) with ESMTP id 337C73F9F; Wed, 5 Nov 2008 10:04:56 +0000 (GMT) Message-Id: From: Doug Rabson To: Giorgos Keramidas In-Reply-To: <87ljvyecdf.fsf@kobe.laptop> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Wed, 5 Nov 2008 10:05:38 +0000 References: <200811031038.mA3Ac0UR064387@svn.freebsd.org> <87ljvyecdf.fsf@kobe.laptop> X-Mailer: Apple Mail (2.929.2) Cc: svn-src-head@freebsd.org, Doug Rabson , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: 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/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 10:05:40 -0000 On 5 Nov 2008, at 09:43, Giorgos Keramidas wrote: > On Mon, 3 Nov 2008 10:38:00 +0000 (UTC), Doug Rabson > wrote: >> Added: >> head/etc/rc.d/gssd (contents, props changed) > > Hi Doug, > > rc-stuff complains that gssd_enable isn't set "properly", because it > isn't set at all. Does the following look ok? This looks perfect :) From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 10:20:34 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E8BE1065672; Wed, 5 Nov 2008 10:20:34 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DCA88FC2F; Wed, 5 Nov 2008 10:20:34 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5AKYdr022857; Wed, 5 Nov 2008 10:20:34 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5AKYdJ022856; Wed, 5 Nov 2008 10:20:34 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200811051020.mA5AKYdJ022856@svn.freebsd.org> From: Giorgos Keramidas Date: Wed, 5 Nov 2008 10:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184675 - head/etc/defaults X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 10:20:34 -0000 Author: keramida (doc committer) Date: Wed Nov 5 10:20:33 2008 New Revision: 184675 URL: http://svn.freebsd.org/changeset/base/184675 Log: Add defaults for /etc/rc.d/gssd Approved by: dfr Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Wed Nov 5 09:55:53 2008 (r184674) +++ head/etc/defaults/rc.conf Wed Nov 5 10:20:33 2008 (r184675) @@ -265,6 +265,9 @@ kadmind5_server="/usr/libexec/kadmind" # kpasswdd_server_enable="NO" # Run kpasswdd (or NO) kpasswdd_server="/usr/libexec/kpasswdd" # path to kerberos 5 passwd daemon +gssd_enable="NO" # Run the gssd daemon (or NO). +gssd_flags="" # Flags for gssd. + rwhod_enable="NO" # Run the rwho daemon (or NO). rwhod_flags="" # Flags for rwhod rarpd_enable="NO" # Run rarpd (or NO). From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 10:45:39 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0BFB1065673; Wed, 5 Nov 2008 10:45:39 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FF8B8FC1D; Wed, 5 Nov 2008 10:45:39 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5AjdNb024691; Wed, 5 Nov 2008 10:45:39 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5AjdBl024690; Wed, 5 Nov 2008 10:45:39 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811051045.mA5AjdBl024690@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 5 Nov 2008 10:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184676 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 10:45:39 -0000 Author: des Date: Wed Nov 5 10:45:39 2008 New Revision: 184676 URL: http://svn.freebsd.org/changeset/base/184676 Log: Disconnect gr_util.c from the build. It isn't documented or used anywhere in the tree, and due to unsafe pointer arithmetic, it will most likely crash on architectures with strict alignment requirements. Modified: head/lib/libutil/Makefile Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Wed Nov 5 10:20:33 2008 (r184675) +++ head/lib/libutil/Makefile Wed Nov 5 10:45:39 2008 (r184676) @@ -8,7 +8,7 @@ SHLIBDIR?= /lib LIB= util SHLIB_MAJOR= 7 -SRCS= _secure_path.c auth.c gr_util.c expand_number.c flopen.c fparseln.c \ +SRCS= _secure_path.c auth.c expand_number.c flopen.c fparseln.c \ hexdump.c humanize_number.c kld.c login.c login_auth.c login_cap.c \ login_class.c login_crypt.c login_ok.c login_times.c login_tty.c \ logout.c logwtmp.c pidfile.c property.c pty.c pw_util.c realhostname.c \ From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 11:06:10 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF7041065675; Wed, 5 Nov 2008 11:06:10 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEB618FC1C; Wed, 5 Nov 2008 11:06:10 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5B6AS5025129; Wed, 5 Nov 2008 11:06:10 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5B6AIU025128; Wed, 5 Nov 2008 11:06:10 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811051106.mA5B6AIU025128@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 5 Nov 2008 11:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184677 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 11:06:10 -0000 Author: des Date: Wed Nov 5 11:06:10 2008 New Revision: 184677 URL: http://svn.freebsd.org/changeset/base/184677 Log: Comment out WARNS. There are too many alignment issues in libutil. Modified: head/lib/libutil/Makefile Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Wed Nov 5 10:45:39 2008 (r184676) +++ head/lib/libutil/Makefile Wed Nov 5 11:06:10 2008 (r184677) @@ -15,7 +15,7 @@ SRCS= _secure_path.c auth.c expand_numbe stub.c trimdomain.c uucplock.c INCS= libutil.h login_cap.h -WARNS?= 6 +#WARNS?= 6 CFLAGS+= -DLIBC_SCCS From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 11:37:26 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD9BC106567B; Wed, 5 Nov 2008 11:37:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CDE38FC31; Wed, 5 Nov 2008 11:37:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5BbQa9025702; Wed, 5 Nov 2008 11:37:26 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5BbQ8S025701; Wed, 5 Nov 2008 11:37:26 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811051137.mA5BbQ8S025701@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 5 Nov 2008 11:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184678 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 11:37:26 -0000 Author: bz Date: Wed Nov 5 11:37:26 2008 New Revision: 184678 URL: http://svn.freebsd.org/changeset/base/184678 Log: Do only define the variable if either INET or INET6 is defined. To prevent it from compiling without INET and INET6 we should put an explicit #error in there like we have in other files, but not rely on an unused variable. MFC after: 2 months Modified: head/sys/net/if_gif.c Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Wed Nov 5 11:06:10 2008 (r184677) +++ head/sys/net/if_gif.c Wed Nov 5 11:37:26 2008 (r184678) @@ -207,7 +207,9 @@ static void gif_clone_destroy(ifp) struct ifnet *ifp; { +#if defined(INET) || defined(INET6) int err; +#endif struct gif_softc *sc = ifp->if_softc; mtx_lock(&gif_mtx); From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 11:39:46 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95F0F1065676; Wed, 5 Nov 2008 11:39:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 853558FC30; Wed, 5 Nov 2008 11:39:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5BdkJq025796; Wed, 5 Nov 2008 11:39:46 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5Bdkts025795; Wed, 5 Nov 2008 11:39:46 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811051139.mA5Bdkts025795@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 5 Nov 2008 11:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184679 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 11:39:46 -0000 Author: bz Date: Wed Nov 5 11:39:46 2008 New Revision: 184679 URL: http://svn.freebsd.org/changeset/base/184679 Log: Make tun(4) compile without INET. MFC after: 2 months Modified: head/sys/net/if_tun.c Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Wed Nov 5 11:37:26 2008 (r184678) +++ head/sys/net/if_tun.c Wed Nov 5 11:39:46 2008 (r184679) @@ -494,8 +494,10 @@ tunclose(struct cdev *dev, int foo, int static int tuninit(struct ifnet *ifp) { +#ifdef INET struct tun_softc *tp = ifp->if_softc; struct ifaddr *ifa; +#endif int error = 0; TUNDEBUG(ifp, "tuninit\n"); From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 11:43:01 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AC421065677; Wed, 5 Nov 2008 11:43:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79C698FC17; Wed, 5 Nov 2008 11:43:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5Bh12R025888; Wed, 5 Nov 2008 11:43:01 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5Bh1Fd025887; Wed, 5 Nov 2008 11:43:01 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811051143.mA5Bh1Fd025887@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 5 Nov 2008 11:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184680 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 11:43:01 -0000 Author: bz Date: Wed Nov 5 11:43:01 2008 New Revision: 184680 URL: http://svn.freebsd.org/changeset/base/184680 Log: Make compile without INET. MFC after: 2 months Modified: head/sys/net/if_arcsubr.c Modified: head/sys/net/if_arcsubr.c ============================================================================== --- head/sys/net/if_arcsubr.c Wed Nov 5 11:39:46 2008 (r184679) +++ head/sys/net/if_arcsubr.c Wed Nov 5 11:43:01 2008 (r184680) @@ -758,7 +758,9 @@ arc_resolvemulti(struct ifnet *ifp, stru struct sockaddr *sa) { struct sockaddr_dl *sdl; +#ifdef INET struct sockaddr_in *sin; +#endif #ifdef INET6 struct sockaddr_in6 *sin6; #endif From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 11:54:56 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B6B81065670; Wed, 5 Nov 2008 11:54:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AC318FC27; Wed, 5 Nov 2008 11:54:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5BsuUH026118; Wed, 5 Nov 2008 11:54:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5Bsurw026117; Wed, 5 Nov 2008 11:54:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811051154.mA5Bsurw026117@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 5 Nov 2008 11:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184681 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 11:54:56 -0000 Author: bz Date: Wed Nov 5 11:54:56 2008 New Revision: 184681 URL: http://svn.freebsd.org/changeset/base/184681 Log: Hide the IPv4 init function if the kernel is compiled without INET. It is not used in that case and would not compile. Modified: head/sys/net/radix_mpath.c Modified: head/sys/net/radix_mpath.c ============================================================================== --- head/sys/net/radix_mpath.c Wed Nov 5 11:43:01 2008 (r184680) +++ head/sys/net/radix_mpath.c Wed Nov 5 11:54:56 2008 (r184681) @@ -36,6 +36,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" #include "opt_inet6.h" #include @@ -308,6 +309,7 @@ rtalloc_mpath_fib(struct route *ro, u_in extern int in6_inithead(void **head, int off); extern int in_inithead(void **head, int off); +#ifdef INET int rn4_mpath_inithead(void **head, int off) { @@ -321,6 +323,7 @@ rn4_mpath_inithead(void **head, int off) } else return 0; } +#endif #ifdef INET6 int From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 12:02:25 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C96A1106568E; Wed, 5 Nov 2008 12:02:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B815C8FC3D; Wed, 5 Nov 2008 12:02:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5C2PYi026303; Wed, 5 Nov 2008 12:02:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5C2PdK026302; Wed, 5 Nov 2008 12:02:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811051202.mA5C2PdK026302@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 5 Nov 2008 12:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184682 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 12:02:26 -0000 Author: bz Date: Wed Nov 5 12:02:25 2008 New Revision: 184682 URL: http://svn.freebsd.org/changeset/base/184682 Log: Make compile without INET. The change is modelled after the way it was done for (without) INET6. MFC after: 2 months Modified: head/sys/net/if_spppsubr.c Modified: head/sys/net/if_spppsubr.c ============================================================================== --- head/sys/net/if_spppsubr.c Wed Nov 5 11:54:56 2008 (r184681) +++ head/sys/net/if_spppsubr.c Wed Nov 5 12:02:25 2008 (r184682) @@ -372,8 +372,10 @@ static void sppp_chap_scr(struct sppp *s static const char *sppp_auth_type_name(u_short proto, u_char type); static const char *sppp_cp_type_name(u_char type); +#ifdef INET static const char *sppp_dotted_quad(u_long addr); static const char *sppp_ipcp_opt_name(u_char opt); +#endif #ifdef INET6 static const char *sppp_ipv6cp_opt_name(u_char opt); #endif @@ -388,7 +390,9 @@ static void sppp_phase_network(struct sp static void sppp_print_bytes(const u_char *p, u_short len); static void sppp_print_string(const char *p, u_short len); static void sppp_qflush(struct ifqueue *ifq); +#ifdef INET static void sppp_set_ip_addr(struct sppp *sp, u_long src); +#endif #ifdef INET6 static void sppp_get_ip6_addrs(struct sppp *sp, struct in6_addr *src, struct in6_addr *dst, struct in6_addr *srcmask); @@ -523,9 +527,11 @@ sppp_input(struct ifnet *ifp, struct mbu struct ppp_header *h; int isr = -1; struct sppp *sp = IFP2SP(ifp); + int debug, do_account = 0; +#ifdef INET + int hlen, vjlen; u_char *iphdr; - int hlen, vjlen, do_account = 0; - int debug; +#endif SPPP_LOCK(sp); debug = ifp->if_flags & IFF_DEBUG; @@ -800,7 +806,9 @@ sppp_output(struct ifnet *ifp, struct mb struct ppp_header *h; struct ifqueue *ifq = NULL; int s, error, rv = 0; +#ifdef INET int ipproto = PPP_IP; +#endif int debug = ifp->if_flags & IFF_DEBUG; s = splimp(); @@ -2884,6 +2892,7 @@ sppp_lcp_check_and_close(struct sppp *sp *--------------------------------------------------------------------------* */ +#ifdef INET static void sppp_ipcp_init(struct sppp *sp) { @@ -3362,6 +3371,78 @@ sppp_ipcp_scr(struct sppp *sp) sp->confid[IDX_IPCP] = ++sp->pp_seq[IDX_IPCP]; sppp_cp_send(sp, PPP_IPCP, CONF_REQ, sp->confid[IDX_IPCP], i, &opt); } +#else /* !INET */ +static void +sppp_ipcp_init(struct sppp *sp) +{ +} + +static void +sppp_ipcp_up(struct sppp *sp) +{ +} + +static void +sppp_ipcp_down(struct sppp *sp) +{ +} + +static void +sppp_ipcp_open(struct sppp *sp) +{ +} + +static void +sppp_ipcp_close(struct sppp *sp) +{ +} + +static void +sppp_ipcp_TO(void *cookie) +{ +} + +static int +sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len) +{ + return (0); +} + +static void +sppp_ipcp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len) +{ +} + +static void +sppp_ipcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len) +{ +} + +static void +sppp_ipcp_tlu(struct sppp *sp) +{ +} + +static void +sppp_ipcp_tld(struct sppp *sp) +{ +} + +static void +sppp_ipcp_tls(struct sppp *sp) +{ +} + +static void +sppp_ipcp_tlf(struct sppp *sp) +{ +} + +static void +sppp_ipcp_scr(struct sppp *sp) +{ +} +#endif /* *--------------------------------------------------------------------------* @@ -4869,6 +4950,7 @@ sppp_get_ip_addrs(struct sppp *sp, u_lon if (src) *src = ntohl(ssrc); } +#ifdef INET /* * Set my IP address. Must be called at splimp. */ @@ -4922,6 +5004,7 @@ sppp_set_ip_addr(struct sppp *sp, u_long } } } +#endif #ifdef INET6 /* @@ -5292,6 +5375,7 @@ sppp_lcp_opt_name(u_char opt) return buf; } +#ifdef INET static const char * sppp_ipcp_opt_name(u_char opt) { @@ -5304,6 +5388,7 @@ sppp_ipcp_opt_name(u_char opt) snprintf (buf, sizeof(buf), "ipcp/0x%x", opt); return buf; } +#endif #ifdef INET6 static const char * @@ -5389,6 +5474,7 @@ sppp_print_string(const char *p, u_short } } +#ifdef INET static const char * sppp_dotted_quad(u_long addr) { @@ -5400,6 +5486,7 @@ sppp_dotted_quad(u_long addr) (int)(addr & 0xff)); return s; } +#endif static int sppp_strnlen(u_char *p, int max) From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 12:13:11 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 296661065675; Wed, 5 Nov 2008 12:13:11 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17EF98FC1B; Wed, 5 Nov 2008 12:13:11 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5CDAJ8026522; Wed, 5 Nov 2008 12:13:10 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5CDA36026521; Wed, 5 Nov 2008 12:13:10 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811051213.mA5CDA36026521@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 5 Nov 2008 12:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184683 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 12:13:11 -0000 Author: des Date: Wed Nov 5 12:13:10 2008 New Revision: 184683 URL: http://svn.freebsd.org/changeset/base/184683 Log: Like many other functions that handle sockaddrs, realhostname_sa() takes a struct sockaddr * that it casts internally to the appropriate type based on sa_family. However, struct sockaddr has very lax alignment requirements, which causes the compiler to complain when you cast a struct sockaddr * to, say, a struct sockaddr_in6 *. I find it reasonable to assume that the pointer we received is in fact correctly aligned. Therefore, we can work around the compiler warnings by casting to void * before casting to the desired type. For readability's sake, this is done with macros. The same technique should prove useful in other parts of the tree that deal with socket addresses. MFC after: 3 weeks Modified: head/lib/libutil/realhostname.c Modified: head/lib/libutil/realhostname.c ============================================================================== --- head/lib/libutil/realhostname.c Wed Nov 5 12:02:25 2008 (r184682) +++ head/lib/libutil/realhostname.c Wed Nov 5 12:13:10 2008 (r184683) @@ -83,6 +83,18 @@ realhostname(char *host, size_t hsize, c return result; } +/* + * struct sockaddr has very lax alignment requirements, since all its + * members are char or equivalent. This is a problem when trying to + * dereference a struct sockaddr_in6 * that was passed in as a struct + * sockaddr *. Although we know (or trust) that the passed-in struct was + * properly aligned, the compiler doesn't, and (rightly) complains. These + * macros perform the cast in a way that the compiler will accept. + */ +#define SOCKADDR_IN6(p) ((struct sockaddr_in6 *)(void *)(p)) +#define SOCKADDR_IN(p) ((struct sockaddr_in *)(void *)(p)) +#define SOCKINET(p) ((struct sockinet *)(void *)(p)) + int realhostname_sa(char *host, size_t hsize, struct sockaddr *addr, int addrlen) { @@ -96,10 +108,10 @@ realhostname_sa(char *host, size_t hsize /* IPv4 mapped IPv6 addr consideraton, specified in rfc2373. */ if (addr->sa_family == AF_INET6 && addrlen == sizeof(struct sockaddr_in6) && - IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)addr)->sin6_addr)) { + IN6_IS_ADDR_V4MAPPED(&SOCKADDR_IN6(addr)->sin6_addr)) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)addr; + sin6 = SOCKADDR_IN6(addr); memset(&lsin, 0, sizeof(lsin)); lsin.sin_len = sizeof(struct sockaddr_in); @@ -142,15 +154,16 @@ realhostname_sa(char *host, size_t hsize } if (sa->sa_len == addrlen && sa->sa_family == addr->sa_family) { - ((struct sockinet *)sa)->si_port = ((struct sockinet *)addr)->si_port; + SOCKINET(sa)->si_port = SOCKINET(addr)->si_port; #ifdef INET6 /* * XXX: sin6_socpe_id may not been * filled by DNS */ if (sa->sa_family == AF_INET6 && - ((struct sockaddr_in6 *)sa)->sin6_scope_id == 0) - ((struct sockaddr_in6 *)sa)->sin6_scope_id = ((struct sockaddr_in6 *)addr)->sin6_scope_id; + SOCKADDR_IN6(sa)->sin6_scope_id == 0) + SOCKADDR_IN6(sa)->sin6_scope_id = + SOCKADDR_IN6(addr)->sin6_scope_id; #endif if (!memcmp(sa, addr, sa->sa_len)) { result = HOSTNAME_FOUND; From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 12:28:45 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50CB51065674; Wed, 5 Nov 2008 12:28:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E8D08FC08; Wed, 5 Nov 2008 12:28:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5CSj9A026890; Wed, 5 Nov 2008 12:28:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5CSjSf026889; Wed, 5 Nov 2008 12:28:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200811051228.mA5CSjSf026889@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 5 Nov 2008 12:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184684 - stable/7/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 12:28:45 -0000 Author: kib Date: Wed Nov 5 12:28:44 2008 New Revision: 184684 URL: http://svn.freebsd.org/changeset/base/184684 Log: MFC r183737 (by kan): Allow strong symbols to override weak ones for lookups done through dlsym with RTLD_NEXT/RTLD_SELF handles. Allow symbols from ld-elf.so to be located this way too. Approved by: re (kensmith), kan Modified: stable/7/libexec/rtld-elf/ (props changed) stable/7/libexec/rtld-elf/rtld.c Modified: stable/7/libexec/rtld-elf/rtld.c ============================================================================== --- stable/7/libexec/rtld-elf/rtld.c Wed Nov 5 12:13:10 2008 (r184683) +++ stable/7/libexec/rtld-elf/rtld.c Wed Nov 5 12:28:44 2008 (r184684) @@ -1891,7 +1891,7 @@ do_dlsym(void *handle, const char *name, { DoneList donelist; const Obj_Entry *obj, *defobj; - const Elf_Sym *def; + const Elf_Sym *def, *symp; unsigned long hash; int lockstate; @@ -1917,9 +1917,26 @@ do_dlsym(void *handle, const char *name, if (handle == RTLD_NEXT) obj = obj->next; for (; obj != NULL; obj = obj->next) { - if ((def = symlook_obj(name, hash, obj, ve, flags)) != NULL) { - defobj = obj; - break; + if ((symp = symlook_obj(name, hash, obj, ve, flags)) != NULL) { + if (def == NULL || ELF_ST_BIND(symp->st_info) != STB_WEAK) { + def = symp; + defobj = obj; + if (ELF_ST_BIND(def->st_info) != STB_WEAK) + break; + } + } + } + /* + * Search the dynamic linker itself, and possibly resolve the + * symbol from there. This is how the application links to + * dynamic linker services such as dlopen. Only the values listed + * in the "exports" array can be resolved from the dynamic linker. + */ + if (def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) { + symp = symlook_obj(name, hash, &obj_rtld, ve, flags); + if (symp != NULL && is_exported(symp)) { + def = symp; + defobj = &obj_rtld; } } } else { From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 12:29:58 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA3731065674; Wed, 5 Nov 2008 12:29:58 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 36E978FC21; Wed, 5 Nov 2008 12:29:58 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 505F16D43F; Wed, 5 Nov 2008 12:29:57 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 418F784461; Wed, 5 Nov 2008 13:29:57 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Alfred Perlstein References: <200811040231.mA42V4EQ083516@svn.freebsd.org> Date: Wed, 05 Nov 2008 13:29:56 +0100 In-Reply-To: <200811040231.mA42V4EQ083516@svn.freebsd.org> (Alfred Perlstein's message of "Tue, 4 Nov 2008 02:31:04 +0000 (UTC)") Message-ID: <86skq6gxtn.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: 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... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 12:29:58 -0000 It looks like whoever wrote this went out of their way to find new and creative ways to break just about every style rule we have. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 12:32:43 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13E1A1065675; Wed, 5 Nov 2008 12:32:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 019488FC13; Wed, 5 Nov 2008 12:32:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5CWgPg027011; Wed, 5 Nov 2008 12:32:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5CWgbB027010; Wed, 5 Nov 2008 12:32:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200811051232.mA5CWgbB027010@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 5 Nov 2008 12:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184685 - stable/7/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 12:32:43 -0000 Author: kib Date: Wed Nov 5 12:32:42 2008 New Revision: 184685 URL: http://svn.freebsd.org/changeset/base/184685 Log: MFC r182698 (by kan): Make sure internal rtld malloc routines are not called from unlocked contexts as rtld's malloc is not thread safe and is only supposed to be called with exclusive bind lock already held. Approved by: re (kensmith), kan Modified: stable/7/libexec/rtld-elf/ (props changed) stable/7/libexec/rtld-elf/rtld.c Modified: stable/7/libexec/rtld-elf/rtld.c ============================================================================== --- stable/7/libexec/rtld-elf/rtld.c Wed Nov 5 12:28:44 2008 (r184684) +++ stable/7/libexec/rtld-elf/rtld.c Wed Nov 5 12:32:42 2008 (r184685) @@ -106,8 +106,8 @@ static int load_needed_objects(Obj_Entry static int load_preload_objects(void); static Obj_Entry *load_object(const char *, const Obj_Entry *); static Obj_Entry *obj_from_addr(const void *); -static void objlist_call_fini(Objlist *); -static void objlist_call_init(Objlist *); +static void objlist_call_fini(Objlist *, int *lockstate); +static void objlist_call_init(Objlist *, int *lockstate); static void objlist_clear(Objlist *); static Objlist_Entry *objlist_find(Objlist *, const Obj_Entry *); static void objlist_init(Objlist *); @@ -512,8 +512,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ r_debug_state(NULL, &obj_main->linkmap); /* say hello to gdb! */ - objlist_call_init(&initlist); lockstate = wlock_acquire(rtld_bind_lock); + objlist_call_init(&initlist, &lockstate); objlist_clear(&initlist); wlock_release(rtld_bind_lock, lockstate); @@ -1433,7 +1433,7 @@ obj_from_addr(const void *addr) * non-NULL fini functions. */ static void -objlist_call_fini(Objlist *list) +objlist_call_fini(Objlist *list, int *lockstate) { Objlist_Entry *elm; char *saved_msg; @@ -1443,6 +1443,7 @@ objlist_call_fini(Objlist *list) * call into the dynamic linker and overwrite it. */ saved_msg = errmsg_save(); + wlock_release(rtld_bind_lock, *lockstate); STAILQ_FOREACH(elm, list, link) { if (elm->obj->refcount == 0) { dbg("calling fini function for %s at %p", elm->obj->path, @@ -1452,6 +1453,7 @@ objlist_call_fini(Objlist *list) call_initfini_pointer(elm->obj, elm->obj->fini); } } + *lockstate = wlock_acquire(rtld_bind_lock); errmsg_restore(saved_msg); } @@ -1461,7 +1463,7 @@ objlist_call_fini(Objlist *list) * functions. */ static void -objlist_call_init(Objlist *list) +objlist_call_init(Objlist *list, int *lockstate) { Objlist_Entry *elm; char *saved_msg; @@ -1471,6 +1473,7 @@ objlist_call_init(Objlist *list) * call into the dynamic linker and overwrite it. */ saved_msg = errmsg_save(); + wlock_release(rtld_bind_lock, *lockstate); STAILQ_FOREACH(elm, list, link) { dbg("calling init function for %s at %p", elm->obj->path, (void *)elm->obj->init); @@ -1478,6 +1481,7 @@ objlist_call_init(Objlist *list) elm->obj->path); call_initfini_pointer(elm->obj, elm->obj->init); } + *lockstate = wlock_acquire(rtld_bind_lock); errmsg_restore(saved_msg); } @@ -1638,15 +1642,18 @@ static void rtld_exit(void) { Obj_Entry *obj; + int lockstate; + lockstate = wlock_acquire(rtld_bind_lock); dbg("rtld_exit()"); /* Clear all the reference counts so the fini functions will be called. */ for (obj = obj_list; obj != NULL; obj = obj->next) obj->refcount = 0; - objlist_call_fini(&list_fini); + objlist_call_fini(&list_fini, &lockstate); /* No need to remove the items from the list, since we are exiting. */ if (!libmap_disable) lm_fini(); + wlock_release(rtld_bind_lock, lockstate); } static void * @@ -1760,11 +1767,9 @@ dlclose(void *handle) if (root->refcount == 0) { /* * The object is no longer referenced, so we must unload it. - * First, call the fini functions with no locks held. + * First, call the fini functions. */ - wlock_release(rtld_bind_lock, lockstate); - objlist_call_fini(&list_fini); - lockstate = wlock_acquire(rtld_bind_lock); + objlist_call_fini(&list_fini, &lockstate); objlist_remove_unref(&list_fini); /* Finish cleaning up the newly-unreferenced objects. */ @@ -1872,10 +1877,8 @@ dlopen(const char *name, int mode) name); GDB_STATE(RT_CONSISTENT,obj ? &obj->linkmap : NULL); - /* Call the init functions with no locks held. */ - wlock_release(rtld_bind_lock, lockstate); - objlist_call_init(&initlist); - lockstate = wlock_acquire(rtld_bind_lock); + /* Call the init functions. */ + objlist_call_init(&initlist, &lockstate); objlist_clear(&initlist); wlock_release(rtld_bind_lock, lockstate); return obj; From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 14:14:32 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 224511065694; Wed, 5 Nov 2008 14:14:32 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1018FC25; Wed, 5 Nov 2008 14:14:32 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5EEVRM028840; Wed, 5 Nov 2008 14:14:31 GMT (envelope-from danger@svn.freebsd.org) Received: (from danger@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5EEVVv028839; Wed, 5 Nov 2008 14:14:31 GMT (envelope-from danger@svn.freebsd.org) Message-Id: <200811051414.mA5EEVVv028839@svn.freebsd.org> From: Daniel Gerzo Date: Wed, 5 Nov 2008 14:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184686 - in stable/7/usr.sbin/portsnap: . portsnap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 14:14:32 -0000 Author: danger (doc committer) Date: Wed Nov 5 14:14:31 2008 New Revision: 184686 URL: http://svn.freebsd.org/changeset/base/184686 Log: MFC rev. 183041: - remove superfluous word PR: docs/127401 Submitted by: Mick Charles Beaver Approved by: re@ (blackend) Modified: stable/7/usr.sbin/portsnap/ (props changed) stable/7/usr.sbin/portsnap/portsnap/portsnap.8 Modified: stable/7/usr.sbin/portsnap/portsnap/portsnap.8 ============================================================================== --- stable/7/usr.sbin/portsnap/portsnap/portsnap.8 Wed Nov 5 12:32:42 2008 (r184685) +++ stable/7/usr.sbin/portsnap/portsnap/portsnap.8 Wed Nov 5 14:14:31 2008 (r184686) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2005 +.Dd September 15, 2008 .Dt PORTSNAP 8 .Os FreeBSD .Sh NAME @@ -60,7 +60,7 @@ Store working files (e.g.\& downloaded u .Pa /var/db/portsnap , or as given in the configuration file.) .It Fl f Ar conffile -Read the configuration from from +Read the configuration from .Ar conffile . (default: .Pa /etc/portsnap.conf ) From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 14:15:22 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B3231065670; Wed, 5 Nov 2008 14:15:22 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 480D18FC31; Wed, 5 Nov 2008 14:15:22 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5EFMAH028896; Wed, 5 Nov 2008 14:15:22 GMT (envelope-from danger@svn.freebsd.org) Received: (from danger@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5EFMVm028895; Wed, 5 Nov 2008 14:15:22 GMT (envelope-from danger@svn.freebsd.org) Message-Id: <200811051415.mA5EFMVm028895@svn.freebsd.org> From: Daniel Gerzo Date: Wed, 5 Nov 2008 14:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184687 - in stable/6/usr.sbin/portsnap: . portsnap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 14:15:22 -0000 Author: danger (doc committer) Date: Wed Nov 5 14:15:22 2008 New Revision: 184687 URL: http://svn.freebsd.org/changeset/base/184687 Log: MFC rev. 183041: - remove superfluous word PR: docs/127401 Submitted by: Mick Charles Beaver Approved by: re@ (blackend) Modified: stable/6/usr.sbin/portsnap/ (props changed) stable/6/usr.sbin/portsnap/portsnap/portsnap.8 Modified: stable/6/usr.sbin/portsnap/portsnap/portsnap.8 ============================================================================== --- stable/6/usr.sbin/portsnap/portsnap/portsnap.8 Wed Nov 5 14:14:31 2008 (r184686) +++ stable/6/usr.sbin/portsnap/portsnap/portsnap.8 Wed Nov 5 14:15:22 2008 (r184687) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2005 +.Dd September 15, 2008 .Dt PORTSNAP 8 .Os FreeBSD .Sh NAME @@ -60,7 +60,7 @@ Store working files (e.g. downloaded upd .Pa /var/db/portsnap , or as given in the configuration file.) .It Fl f Ar conffile -Read the configuration from from +Read the configuration from .Ar conffile . (default: .Pa /etc/portsnap.conf ) From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 14:15:53 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F4811065679; Wed, 5 Nov 2008 14:15:53 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D2078FC31; Wed, 5 Nov 2008 14:15:53 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5EFrRt028939; Wed, 5 Nov 2008 14:15:53 GMT (envelope-from danger@svn.freebsd.org) Received: (from danger@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5EFrRq028938; Wed, 5 Nov 2008 14:15:53 GMT (envelope-from danger@svn.freebsd.org) Message-Id: <200811051415.mA5EFrRq028938@svn.freebsd.org> From: Daniel Gerzo Date: Wed, 5 Nov 2008 14:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184688 - in releng/6.4/usr.sbin/portsnap: . portsnap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 14:15:53 -0000 Author: danger (doc committer) Date: Wed Nov 5 14:15:53 2008 New Revision: 184688 URL: http://svn.freebsd.org/changeset/base/184688 Log: MFC rev. 183041: - remove superfluous word PR: docs/127401 Submitted by: Mick Charles Beaver Approved by: re@ (blackend) Modified: releng/6.4/usr.sbin/portsnap/ (props changed) releng/6.4/usr.sbin/portsnap/portsnap/portsnap.8 Modified: releng/6.4/usr.sbin/portsnap/portsnap/portsnap.8 ============================================================================== --- releng/6.4/usr.sbin/portsnap/portsnap/portsnap.8 Wed Nov 5 14:15:22 2008 (r184687) +++ releng/6.4/usr.sbin/portsnap/portsnap/portsnap.8 Wed Nov 5 14:15:53 2008 (r184688) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2005 +.Dd September 15, 2008 .Dt PORTSNAP 8 .Os FreeBSD .Sh NAME @@ -60,7 +60,7 @@ Store working files (e.g. downloaded upd .Pa /var/db/portsnap , or as given in the configuration file.) .It Fl f Ar conffile -Read the configuration from from +Read the configuration from .Ar conffile . (default: .Pa /etc/portsnap.conf ) From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 15:04:04 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 605FA1065673; Wed, 5 Nov 2008 15:04:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C1F08FC25; Wed, 5 Nov 2008 15:04:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5F440L029905; Wed, 5 Nov 2008 15:04:04 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5F44tx029900; Wed, 5 Nov 2008 15:04:04 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200811051504.mA5F44tx029900@svn.freebsd.org> From: Ed Schouten Date: Wed, 5 Nov 2008 15:04:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184689 - in head: share/man/man4 sys/conf sys/dev/snp sys/modules sys/modules/snp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 15:04:04 -0000 Author: ed Date: Wed Nov 5 15:04:03 2008 New Revision: 184689 URL: http://svn.freebsd.org/changeset/base/184689 Log: Reintroduce the snp(4) driver. Because the TTY hooks interface was not finished when I imported the MPSAFE TTY layer, I had to disconnect the snp(4) driver. This snp(4) implementation has been sitting in my P4 branch for some time now. Unfortunately it still doesn't use the same error handling as snp(4) (returning codes through FIONREAD), but it should already be usable. I'm committing this to SVN, hoping someone else could polish off its rough edges. It's always better than having a broken driver sitting in the tree. Modified: head/share/man/man4/snp.4 head/sys/conf/NOTES head/sys/dev/snp/snp.c head/sys/modules/Makefile head/sys/modules/snp/Makefile Modified: head/share/man/man4/snp.4 ============================================================================== --- head/share/man/man4/snp.4 Wed Nov 5 14:15:53 2008 (r184688) +++ head/share/man/man4/snp.4 Wed Nov 5 15:04:03 2008 (r184689) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2005 +.Dd November 5, 2008 .Dt SNP 4 .Os .Sh NAME @@ -77,11 +77,23 @@ The .Nm device first appeared in .Fx 2.1 . +In +.Fx 8.0 +the +.Nm +driver was rewritten to work with the replaced TTY subsystem. .Sh AUTHORS -.An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il +The author of the current implementation is +.An Ed Schouten Aq ed@FreeBSD.org . +Previous versions of +.Nm +were based on code written by +.An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il . .Sh BUGS -Caveat emptor! -This manual page is horribly stale and wildly inaccurate in some places. -.Pp -While in line mode, user input cannot be seen. -No signals may be sent to the observed tty. +This version of +.Nm +does not return proper error codes when calling +.Dv FIONREAD . +It also does not allow +.Dv SNPSTTY +to detach itself from the TTY. Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Nov 5 14:15:53 2008 (r184688) +++ head/sys/conf/NOTES Wed Nov 5 15:04:03 2008 (r184689) @@ -1278,6 +1278,7 @@ options SES_ENABLE_PASSTHROUGH device pty #BSD-style compatibility pseudo ttys device nmdm #back-to-back tty devices device md #Memory/malloc disk +device snp #Snoop device - to look at pty/vty/etc.. device ccd #Concatenated disk driver device firmware #firmware(9) support Modified: head/sys/dev/snp/snp.c ============================================================================== --- head/sys/dev/snp/snp.c Wed Nov 5 14:15:53 2008 (r184688) +++ head/sys/dev/snp/snp.c Wed Nov 5 15:04:03 2008 (r184689) @@ -1,638 +1,352 @@ /*- - * Copyright (c) 1995 Ugen J.S.Antsilevich + * Copyright (c) 2008 Ed Schouten + * All rights reserved. * - * Redistribution and use in source forms, with and without modification, - * are permitted provided that this entire comment appears intact. - * - * Redistribution in binary form may occur without any restrictions. - * Obviously, it would be nice if you gave credit where credit is due - * but requiring it would be too onerous. - * - * This software is provided ``AS IS'' without any warranties of any kind. - * - * Snoop stuff. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 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. */ #include __FBSDID("$FreeBSD$"); #include -#include +#include #include #include -#include -#include -#include -#include #include +#include #include -#include +#include #include +#include +#include +#include #include -#include -#include - -static l_close_t snplclose; -static l_write_t snplwrite; -static d_open_t snpopen; -static d_read_t snpread; -static d_write_t snpwrite; -static d_ioctl_t snpioctl; -static d_poll_t snppoll; - -static struct cdevsw snp_cdevsw = { - .d_version = D_VERSION, - .d_flags = D_PSEUDO | D_NEEDGIANT, - .d_open = snpopen, - .d_read = snpread, - .d_write = snpwrite, - .d_ioctl = snpioctl, - .d_poll = snppoll, - .d_name = "snp", -}; -static struct linesw snpdisc = { - .l_open = tty_open, - .l_close = snplclose, - .l_read = ttread, - .l_write = snplwrite, - .l_ioctl = l_nullioctl, - .l_rint = ttyinput, - .l_start = ttstart, - .l_modem = ttymodem -}; +static struct cdev *snp_dev; +/* XXX: should be mtx, but TTY can be locked by Giant. */ +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"); /* - * This is the main snoop per-device structure. + * There is no need to have a big input buffer. In most typical setups, + * we won't inject much data into the TTY, because users can't type + * really fast. */ -struct snoop { - LIST_ENTRY(snoop) snp_list; /* List glue. */ - struct cdev *snp_target; /* Target tty device. */ - struct tty *snp_tty; /* Target tty pointer. */ - u_long snp_len; /* Possible length. */ - u_long snp_base; /* Data base. */ - u_long snp_blen; /* Used length. */ - caddr_t snp_buf; /* Allocation pointer. */ - int snp_flags; /* Flags. */ - struct selinfo snp_sel; /* Select info. */ - int snp_olddisc; /* Old line discipline. */ -}; - +#define SNP_INPUT_BUFSIZE 16 /* - * Possible flags. + * The output buffer has to be really big. Right now we don't support + * any form of flow control, which means we lost any data we can't + * accept. We set the output buffer size to about twice the size of a + * pseudo-terminal/virtual console's output buffer. */ -#define SNOOP_ASYNC 0x0002 -#define SNOOP_OPEN 0x0004 -#define SNOOP_RWAIT 0x0008 -#define SNOOP_OFLOW 0x0010 -#define SNOOP_DOWN 0x0020 +#define SNP_OUTPUT_BUFSIZE 16384 -/* - * Other constants. - */ -#define SNOOP_MINLEN (4*1024) /* This should be power of 2. - * 4K tested to be the minimum - * for which on normal tty - * usage there is no need to - * allocate more. - */ -#define SNOOP_MAXLEN (64*1024) /* This one also,64K enough - * If we grow more,something - * really bad in this world.. - */ +static d_open_t snp_open; +static d_read_t snp_read; +static d_write_t snp_write; +static d_ioctl_t snp_ioctl; +static d_poll_t snp_poll; -static MALLOC_DEFINE(M_SNP, "snp", "Snoop device data"); -/* - * The number of the "snoop" line discipline. This gets determined at - * module load time. - */ -static int snooplinedisc; -static struct cdev *snoopdev; +static struct cdevsw snp_cdevsw = { + .d_version = D_VERSION, + .d_open = snp_open, + .d_read = snp_read, + .d_write = snp_write, + .d_ioctl = snp_ioctl, + .d_poll = snp_poll, + .d_name = "snp", +}; -static LIST_HEAD(, snoop) snp_sclist = LIST_HEAD_INITIALIZER(&snp_sclist); +static th_getc_capture_t snp_getc_capture; -static struct tty *snpdevtotty(struct cdev *dev); -static void snp_detach(void *arg); -static int snp_down(struct snoop *snp); -static int snp_in(struct snoop *snp, char *buf, int n); -static int snp_modevent(module_t mod, int what, void *arg); -static struct snoop *ttytosnp(struct tty *); +static struct ttyhook snp_hook = { + .th_getc_capture = snp_getc_capture, +}; -static struct snoop * -ttytosnp(struct tty *tp) -{ - struct snoop *snp; - - LIST_FOREACH(snp, &snp_sclist, snp_list) { - if (snp->snp_tty == tp) - return (snp); - } - return (NULL); -} +/* + * Per-instance structure. + * + * List of locks + * (r) locked by snp_register_lock on assignment + * (t) locked by tty_lock + */ +struct snp_softc { + struct tty *snp_tty; /* (r) TTY we're snooping. */ + struct ttyoutq snp_outq; /* (t) Output queue. */ + struct cv snp_outwait; /* (t) Output wait queue. */ + struct selinfo snp_outpoll; /* (t) Output polling. */ +}; -static int -snplclose(struct tty *tp, int flag) +static void +snp_dtor(void *data) { - struct snoop *snp; - int error; - - snp = ttytosnp(tp); - error = snp_down(snp); - if (error != 0) - return (error); - error = ttylclose(tp, flag); - return (error); -} + struct snp_softc *ss = data; + struct tty *tp; -static int -snplwrite(struct tty *tp, struct uio *uio, int flag) -{ - struct iovec iov; - struct uio uio2; - struct snoop *snp; - int error, ilen; - char *ibuf; - - error = 0; - ibuf = NULL; - snp = ttytosnp(tp); - while (uio->uio_resid > 0) { - ilen = imin(512, uio->uio_resid); - ibuf = malloc(ilen, M_SNP, M_WAITOK); - error = uiomove(ibuf, ilen, uio); - if (error != 0) - break; - snp_in(snp, ibuf, ilen); - /* Hackish, but probably the least of all evils. */ - iov.iov_base = ibuf; - iov.iov_len = ilen; - uio2.uio_iov = &iov; - uio2.uio_iovcnt = 1; - uio2.uio_offset = 0; - uio2.uio_resid = ilen; - uio2.uio_segflg = UIO_SYSSPACE; - uio2.uio_rw = UIO_WRITE; - uio2.uio_td = uio->uio_td; - error = ttwrite(tp, &uio2, flag); - if (error != 0) - break; - free(ibuf, M_SNP); - ibuf = NULL; + tp = ss->snp_tty; + if (tp != NULL) { + tty_lock(tp); + ttyoutq_free(&ss->snp_outq); + ttyhook_unregister(tp); } - if (ibuf != NULL) - free(ibuf, M_SNP); - return (error); -} - -static struct tty * -snpdevtotty(struct cdev *dev) -{ - struct cdevsw *cdp; - struct tty *tp; - cdp = dev_refthread(dev); - if (cdp == NULL) - return (NULL); - if (!(cdp->d_flags & D_TTY)) - tp = NULL; - else - tp = dev->si_tty; - dev_relthread(dev); - return (tp); + cv_destroy(&ss->snp_outwait); + free(ss, M_SNP); } -#define SNP_INPUT_BUF 5 /* This is even too much, the maximal - * interactive mode write is 3 bytes - * length for function keys... - */ +/* + * Snoop device node routines. + */ static int -snpwrite(struct cdev *dev, struct uio *uio, int flag) +snp_open(struct cdev *dev, int flag, int mode, struct thread *td) { - struct snoop *snp; - struct tty *tp; - int error, i, len; - unsigned char c[SNP_INPUT_BUF]; + struct snp_softc *ss; - error = devfs_get_cdevpriv((void **)&snp); - if (error != 0) - return (error); + /* Allocate per-snoop data. */ + ss = malloc(sizeof(struct snp_softc), M_SNP, M_WAITOK|M_ZERO); + ttyoutq_init(&ss->snp_outq); + cv_init(&ss->snp_outwait, "snp out"); - tp = snp->snp_tty; - if (tp == NULL) - return (EIO); - if ((tp->t_state & TS_SNOOP) && tp->t_line == snooplinedisc) - goto tty_input; + devfs_set_cdevpriv(ss, snp_dtor); - printf("snp: attempt to write to bad tty\n"); - return (EIO); - -tty_input: - if (!(tp->t_state & TS_ISOPEN)) - return (EIO); - - while (uio->uio_resid > 0) { - len = imin(uio->uio_resid, SNP_INPUT_BUF); - if ((error = uiomove(c, len, uio)) != 0) - return (error); - for (i=0; i < len; i++) { - if (ttyinput(c[i], tp)) - return (EIO); - } - } return (0); } - static int -snpread(struct cdev *dev, struct uio *uio, int flag) +snp_read(struct cdev *dev, struct uio *uio, int flag) { - struct snoop *snp; - int error, len, n, nblen, s; - caddr_t from; - char *nbuf; + int error, oresid = uio->uio_resid; + struct snp_softc *ss; + struct tty *tp; + + if (uio->uio_resid == 0) + return (0); - error = devfs_get_cdevpriv((void **)&snp); + error = devfs_get_cdevpriv((void **)&ss); if (error != 0) return (error); - - KASSERT(snp->snp_len + snp->snp_base <= snp->snp_blen, - ("snoop buffer error")); - - if (snp->snp_tty == NULL) + + tp = ss->snp_tty; + if (tp == NULL || tty_gone(tp)) return (EIO); - snp->snp_flags &= ~SNOOP_RWAIT; + tty_lock(tp); + for (;;) { + error = ttyoutq_read_uio(&ss->snp_outq, tp, uio); + if (error != 0 || uio->uio_resid != oresid) + break; - do { - if (snp->snp_len == 0) { - if (flag & O_NONBLOCK) - return (EWOULDBLOCK); - snp->snp_flags |= SNOOP_RWAIT; - error = tsleep(snp, (PZERO + 1) | PCATCH, - "snprd", 0); - if (error != 0) - return (error); + /* Wait for more data. */ + if (flag & O_NONBLOCK) { + error = EWOULDBLOCK; + break; } - } while (snp->snp_len == 0); - - n = snp->snp_len; - - error = 0; - while (snp->snp_len > 0 && uio->uio_resid > 0 && error == 0) { - len = min((unsigned)uio->uio_resid, snp->snp_len); - from = (caddr_t)(snp->snp_buf + snp->snp_base); - if (len == 0) + error = cv_wait_sig(&ss->snp_outwait, tp->t_mtx); + if (error != 0) + break; + if (tty_gone(tp)) { + error = EIO; break; - - error = uiomove(from, len, uio); - snp->snp_base += len; - snp->snp_len -= len; - } - if ((snp->snp_flags & SNOOP_OFLOW) && (n < snp->snp_len)) { - snp->snp_flags &= ~SNOOP_OFLOW; - } - s = spltty(); - nblen = snp->snp_blen; - if (((nblen / 2) >= SNOOP_MINLEN) && (nblen / 2) >= snp->snp_len) { - while (nblen / 2 >= snp->snp_len && nblen / 2 >= SNOOP_MINLEN) - nblen = nblen / 2; - if ((nbuf = malloc(nblen, M_SNP, M_NOWAIT)) != NULL) { - bcopy(snp->snp_buf + snp->snp_base, nbuf, snp->snp_len); - free(snp->snp_buf, M_SNP); - snp->snp_buf = nbuf; - snp->snp_blen = nblen; - snp->snp_base = 0; } } - splx(s); + tty_unlock(tp); return (error); } static int -snp_in(struct snoop *snp, char *buf, int n) +snp_write(struct cdev *dev, struct uio *uio, int flag) { - int s_free, s_tail; - int s, len, nblen; - caddr_t from, to; - char *nbuf; + struct snp_softc *ss; + struct tty *tp; + int error, len, i; + char in[SNP_INPUT_BUFSIZE]; + + error = devfs_get_cdevpriv((void **)&ss); + if (error != 0) + return (error); + + tp = ss->snp_tty; + if (tp == NULL || tty_gone(tp)) + return (EIO); - KASSERT(n >= 0, ("negative snoop char count")); + while (uio->uio_resid > 0) { + /* Read new data. */ + len = imin(uio->uio_resid, sizeof in); + error = uiomove(in, len, uio); + if (error != 0) + return (error); - if (n == 0) - return (0); + tty_lock(tp); - if (snp->snp_flags & SNOOP_DOWN) { - printf("snp: more data to down interface\n"); - return (0); - } + /* Driver could have abandoned the TTY in the mean time. */ + if (tty_gone(tp)) { + tty_unlock(tp); + return (ENXIO); + } - if (snp->snp_flags & SNOOP_OFLOW) { - printf("snp: buffer overflow\n"); /* - * On overflow we just repeat the standart close - * procedure...yes , this is waste of space but.. Then next - * read from device will fail if one would recall he is - * snooping and retry... + * Deliver data to the TTY. Ignore errors for now, + * because we shouldn't bail out when we're running + * close to the watermarks. */ - - return (snp_down(snp)); - } - s_tail = snp->snp_blen - (snp->snp_len + snp->snp_base); - s_free = snp->snp_blen - snp->snp_len; - - - if (n > s_free) { - s = spltty(); - nblen = snp->snp_blen; - while ((n > s_free) && ((nblen * 2) <= SNOOP_MAXLEN)) { - nblen = snp->snp_blen * 2; - s_free = nblen - (snp->snp_len + snp->snp_base); - } - if ((n <= s_free) && (nbuf = malloc(nblen, M_SNP, M_NOWAIT))) { - bcopy(snp->snp_buf + snp->snp_base, nbuf, snp->snp_len); - free(snp->snp_buf, M_SNP); - snp->snp_buf = nbuf; - snp->snp_blen = nblen; - snp->snp_base = 0; + if (ttydisc_can_bypass(tp)) { + ttydisc_rint_bypass(tp, in, len); } else { - snp->snp_flags |= SNOOP_OFLOW; - if (snp->snp_flags & SNOOP_RWAIT) { - snp->snp_flags &= ~SNOOP_RWAIT; - wakeup(snp); - } - splx(s); - return (0); + for (i = 0; i < len; i++) + ttydisc_rint(tp, in[i], 0); } - splx(s); - } - if (n > s_tail) { - from = (caddr_t)(snp->snp_buf + snp->snp_base); - to = (caddr_t)(snp->snp_buf); - len = snp->snp_len; - bcopy(from, to, len); - snp->snp_base = 0; - } - to = (caddr_t)(snp->snp_buf + snp->snp_base + snp->snp_len); - bcopy(buf, to, n); - snp->snp_len += n; - - if (snp->snp_flags & SNOOP_RWAIT) { - snp->snp_flags &= ~SNOOP_RWAIT; - wakeup(snp); - } - selwakeuppri(&snp->snp_sel, PZERO + 1); - - return (n); -} - -static void -snp_dtor(void *data) -{ - struct snoop *snp = data; - - snp->snp_blen = 0; - LIST_REMOVE(snp, snp_list); - free(snp->snp_buf, M_SNP); - snp->snp_flags &= ~SNOOP_OPEN; - snp_detach(snp); -} - -static int -snpopen(struct cdev *dev, int flag, int mode, struct thread *td) -{ - struct snoop *snp; - int error; - - snp = malloc(sizeof(*snp), M_SNP, M_WAITOK | M_ZERO); - error = devfs_set_cdevpriv(snp, snp_dtor); - if (error != 0) { - free(snp, M_SNP); - return (error); - } - - /* - * We intentionally do not OR flags with SNOOP_OPEN, but set them so - * all previous settings (especially SNOOP_OFLOW) will be cleared. - */ - snp->snp_flags = SNOOP_OPEN; - - snp->snp_buf = malloc(SNOOP_MINLEN, M_SNP, M_WAITOK); - snp->snp_blen = SNOOP_MINLEN; - snp->snp_base = 0; - snp->snp_len = 0; - - /* - * snp_tty == NULL is for inactive snoop devices. - */ - snp->snp_tty = NULL; - snp->snp_target = NULL; - - LIST_INSERT_HEAD(&snp_sclist, snp, snp_list); - return (0); -} - - -static void -snp_detach(void *arg) -{ - struct snoop *snp; - struct tty *tp; - - snp = (struct snoop *)arg; - snp->snp_base = 0; - snp->snp_len = 0; - - /* - * If line disc. changed we do not touch this pointer, SLIP/PPP will - * change it anyway. - */ - tp = snp->snp_tty; - if (tp == NULL) - goto detach_notty; - - if ((tp->t_state & TS_SNOOP) && tp->t_line == snooplinedisc) { - tp->t_state &= ~TS_SNOOP; - tp->t_line = snp->snp_olddisc; - } else - printf("snp: bad attached tty data\n"); - - snp->snp_tty = NULL; - snp->snp_target = NULL; - -detach_notty: - selwakeuppri(&snp->snp_sel, PZERO + 1); - if ((snp->snp_flags & SNOOP_OPEN) == 0) - free(snp, M_SNP); -} - -static int -snp_down(struct snoop *snp) -{ - if (snp->snp_blen != SNOOP_MINLEN) { - free(snp->snp_buf, M_SNP); - snp->snp_buf = malloc(SNOOP_MINLEN, M_SNP, M_WAITOK); - snp->snp_blen = SNOOP_MINLEN; + ttydisc_rint_done(tp); + tty_unlock(tp); } - snp->snp_flags |= SNOOP_DOWN; - snp_detach(snp); return (0); } static int -snpioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, +snp_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td) { - struct snoop *snp; + struct snp_softc *ss; struct tty *tp; - struct cdev *tdev; - struct file *fp; - int error, s; + int error; - error = devfs_get_cdevpriv((void **)&snp); + error = devfs_get_cdevpriv((void **)&ss); if (error != 0) return (error); switch (cmd) { case SNPSTTY: - s = *(int *)data; - if (s < 0) - return (snp_down(snp)); - - if (fget(td, s, &fp) != 0) - return (EINVAL); - if (fp->f_type != DTYPE_VNODE || - fp->f_vnode->v_type != VCHR || - fp->f_vnode->v_rdev == NULL) { - fdrop(fp, td); - return (EINVAL); - } - tdev = fp->f_vnode->v_rdev; - fdrop(fp, td); - - if (snp->snp_tty != NULL) - return (EBUSY); - - tp = snpdevtotty(tdev); - if (!tp) - return (EINVAL); - if (tp->t_state & TS_SNOOP) + /* Bind TTY to snoop instance. */ + sx_xlock(&snp_register_lock); + if (ss->snp_tty != NULL) { + sx_xunlock(&snp_register_lock); return (EBUSY); + } + error = ttyhook_register(&ss->snp_tty, td, *(int *)data, + &snp_hook, ss); + sx_xunlock(&snp_register_lock); + if (error != 0) + return (error); - s = spltty(); - tp->t_state |= TS_SNOOP; - snp->snp_olddisc = tp->t_line; - tp->t_line = snooplinedisc; - snp->snp_tty = tp; - snp->snp_target = tdev; - - /* - * Clean overflow and down flags - - * we'll have a chance to get them in the future :))) - */ - snp->snp_flags &= ~SNOOP_OFLOW; - snp->snp_flags &= ~SNOOP_DOWN; - splx(s); - break; + /* Now that went okay, allocate a buffer for the queue. */ + tp = ss->snp_tty; + tty_lock(tp); + ttyoutq_setsize(&ss->snp_outq, tp, SNP_OUTPUT_BUFSIZE); + tty_unlock(tp); + return (0); case SNPGTTY: - /* - * We keep snp_target field specially to make - * SNPGTTY happy, else we can't know what is device - * major/minor for tty. - */ - *((dev_t *)data) = dev2udev(snp->snp_target); - break; - - case FIONBIO: - break; - - case FIOASYNC: - if (*(int *)data) - snp->snp_flags |= SNOOP_ASYNC; + /* Obtain device number of associated TTY. */ + if (ss->snp_tty == NULL) + *(dev_t *)data = NODEV; else - snp->snp_flags &= ~SNOOP_ASYNC; - break; - + *(dev_t *)data = tty_udev(ss->snp_tty); + return (0); case FIONREAD: - s = spltty(); - if (snp->snp_tty != NULL) - *(int *)data = snp->snp_len; - else - if (snp->snp_flags & SNOOP_DOWN) { - if (snp->snp_flags & SNOOP_OFLOW) - *(int *)data = SNP_OFLOW; - else - *(int *)data = SNP_TTYCLOSE; - } else { - *(int *)data = SNP_DETACH; - } - splx(s); - break; - + tp = ss->snp_tty; + if (tp != NULL) { + tty_lock(tp); + *(int *)data = ttyoutq_bytesused(&ss->snp_outq); + tty_unlock(tp); + } else { + *(int *)data = 0; + } + return (0); default: return (ENOTTY); } - return (0); } static int -snppoll(struct cdev *dev, int events, struct thread *td) +snp_poll(struct cdev *dev, int events, struct thread *td) { - struct snoop *snp; + struct snp_softc *ss; + struct tty *tp; int revents; - if (devfs_get_cdevpriv((void **)&snp) != 0) + if (devfs_get_cdevpriv((void **)&ss) != 0) return (events & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); revents = 0; - /* - * If snoop is down, we don't want to poll() forever so we return 1. - * Caller should see if we down via FIONREAD ioctl(). The last should - * return -1 to indicate down state. - */ + if (events & (POLLIN | POLLRDNORM)) { - if (snp->snp_flags & SNOOP_DOWN || snp->snp_len > 0) - revents |= events & (POLLIN | POLLRDNORM); - else - selrecord(td, &snp->snp_sel); + tp = ss->snp_tty; + if (tp != NULL) { + tty_lock(tp); + if (ttyoutq_bytesused(&ss->snp_outq) > 0) + revents |= events & (POLLIN | POLLRDNORM); + tty_unlock(tp); + } } + + if (revents == 0) + selrecord(td, &ss->snp_outpoll); + return (revents); } +/* + * TTY hook events. + */ + static int snp_modevent(module_t mod, int type, void *data) { switch (type) { case MOD_LOAD: - snooplinedisc = ldisc_register(LDISC_LOAD, &snpdisc); - snoopdev = make_dev(&snp_cdevsw, 0, UID_ROOT, GID_WHEEL, - 0600, "snp"); - /* For compatibility */ - make_dev_alias(snoopdev, "snp0"); - break; + snp_dev = make_dev(&snp_cdevsw, 0, + UID_ROOT, GID_WHEEL, 0600, "snp"); + return (0); case MOD_UNLOAD: - if (!LIST_EMPTY(&snp_sclist)) - return (EBUSY); - destroy_dev(snoopdev); - ldisc_deregister(snooplinedisc); - break; + /* XXX: Make existing users leave. */ + destroy_dev(snp_dev); + return (0); default: return (EOPNOTSUPP); - break; } - return (0); +} + +static void +snp_getc_capture(struct tty *tp, const void *buf, size_t len) +{ + struct snp_softc *ss = ttyhook_softc(tp); + + ttyoutq_write(&ss->snp_outq, buf, len); + + cv_broadcast(&ss->snp_outwait); + selwakeup(&ss->snp_outpoll); } static moduledata_t snp_mod = { - "snp", - snp_modevent, - NULL + "snp", + snp_modevent, + NULL }; + DECLARE_MODULE(snp, snp_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Nov 5 14:15:53 2008 (r184688) +++ head/sys/modules/Makefile Wed Nov 5 15:04:03 2008 (r184689) @@ -252,6 +252,7 @@ SUBDIR= ${_3dfx} \ ${_smbfs} \ sn \ ${_snc} \ + snp \ ${_sound} \ ${_speaker} \ ${_splash} \ Modified: head/sys/modules/snp/Makefile ============================================================================== --- head/sys/modules/snp/Makefile Wed Nov 5 14:15:53 2008 (r184688) +++ head/sys/modules/snp/Makefile Wed Nov 5 15:04:03 2008 (r184689) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../dev/snp KMOD= snp -SRCS= snp.c vnode_if.h +SRCS= snp.c .include From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 15:07:42 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1F831065672; Wed, 5 Nov 2008 15:07:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A070D8FC12; Wed, 5 Nov 2008 15:07:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5F7g5U029994; Wed, 5 Nov 2008 15:07:42 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5F7gO4029993; Wed, 5 Nov 2008 15:07:42 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811051507.mA5F7gO4029993@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 5 Nov 2008 15:07:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184690 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 15:07:42 -0000 Author: des Date: Wed Nov 5 15:07:42 2008 New Revision: 184690 URL: http://svn.freebsd.org/changeset/base/184690 Log: Missing email address MFC after: 3 weeks Modified: head/share/man/man9/pseudofs.9 Modified: head/share/man/man9/pseudofs.9 ============================================================================== --- head/share/man/man9/pseudofs.9 Wed Nov 5 15:04:03 2008 (r184689) +++ head/share/man/man9/pseudofs.9 Wed Nov 5 15:07:42 2008 (r184690) @@ -67,4 +67,4 @@ module appeared in The .Nm module and this manual page were written by -.An Dag-Erling Sm\(/orgrav . +.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 15:08:10 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0499C106567E; Wed, 5 Nov 2008 15:08:10 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E74208FC1A; Wed, 5 Nov 2008 15:08:09 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5F89hI030041; Wed, 5 Nov 2008 15:08:09 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5F89XD030040; Wed, 5 Nov 2008 15:08:09 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811051508.mA5F89XD030040@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 5 Nov 2008 15:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184691 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 15:08:10 -0000 Author: des Date: Wed Nov 5 15:08:09 2008 New Revision: 184691 URL: http://svn.freebsd.org/changeset/base/184691 Log: utf-8 MFC after: 3 weeks Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Wed Nov 5 15:07:42 2008 (r184690) +++ head/sys/compat/linprocfs/linprocfs.c Wed Nov 5 15:08:09 2008 (r184691) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2000 Dag-Erling Coïdan Smørgrav * Copyright (c) 1999 Pierre Beyssac * Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 16:24:32 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 688BC1065673; Wed, 5 Nov 2008 16:24:32 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E1888FC24; Wed, 5 Nov 2008 16:24:32 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5GOWmV031555; Wed, 5 Nov 2008 16:24:32 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5GOWxF031554; Wed, 5 Nov 2008 16:24:32 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811051624.mA5GOWxF031554@svn.freebsd.org> From: Doug Rabson Date: Wed, 5 Nov 2008 16:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184692 - head/sys/xdr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 16:24:32 -0000 Author: dfr Date: Wed Nov 5 16:24:31 2008 New Revision: 184692 URL: http://svn.freebsd.org/changeset/base/184692 Log: Don't return a NULL mbuf from xdrmbuf_getall. Modified: head/sys/xdr/xdr_mbuf.c Modified: head/sys/xdr/xdr_mbuf.c ============================================================================== --- head/sys/xdr/xdr_mbuf.c Wed Nov 5 15:08:09 2008 (r184691) +++ head/sys/xdr/xdr_mbuf.c Wed Nov 5 16:24:31 2008 (r184692) @@ -119,7 +119,10 @@ xdrmbuf_getall(XDR *xdrs) xdrs->x_private = NULL; } - m_adj(m, xdrs->x_handy); + if (m) + m_adj(m, xdrs->x_handy); + else + MGET(m, M_WAITOK, MT_DATA); return (m); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 16:25:27 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 361ED1065670; Wed, 5 Nov 2008 16:25:27 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24C638FC08; Wed, 5 Nov 2008 16:25:27 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5GPRfB031612; Wed, 5 Nov 2008 16:25:27 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5GPR5c031611; Wed, 5 Nov 2008 16:25:27 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811051625.mA5GPR5c031611@svn.freebsd.org> From: Doug Rabson Date: Wed, 5 Nov 2008 16:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184693 - head/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 16:25:27 -0000 Author: dfr Date: Wed Nov 5 16:25:26 2008 New Revision: 184693 URL: http://svn.freebsd.org/changeset/base/184693 Log: If mountd doesn't specify a secflavor list for the mount, assume that -sec=sys is what was wanted. Modified: head/sys/nfsserver/nfs_srvsubs.c Modified: head/sys/nfsserver/nfs_srvsubs.c ============================================================================== --- head/sys/nfsserver/nfs_srvsubs.c Wed Nov 5 16:24:31 2008 (r184692) +++ head/sys/nfsserver/nfs_srvsubs.c Wed Nov 5 16:25:26 2008 (r184693) @@ -1103,6 +1103,7 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla int credflavor; int vfslocked; int numsecflavors, *secflavors; + int authsys; int v3 = nfsd->nd_flag & ND_NFSV3; int mountreq; @@ -1123,6 +1124,15 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla &numsecflavors, &secflavors); if (error) goto out; + if (numsecflavors == 0) { + /* + * This can happen if the system is running with an + * old mountd that doesn't pass in a secflavor list. + */ + numsecflavors = 1; + authsys = RPCAUTH_UNIX; + secflavors = &authsys; + } credflavor = nfsd->nd_credflavor; for (i = 0; i < numsecflavors; i++) { if (secflavors[i] == credflavor) From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 16:41:42 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E32A1065675; Wed, 5 Nov 2008 16:41:42 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 5612C8FC17; Wed, 5 Nov 2008 16:41:42 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 5FA952BC43; Thu, 6 Nov 2008 05:41:41 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mgc0aPABqgWn; Thu, 6 Nov 2008 05:41:37 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Thu, 6 Nov 2008 05:41:37 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 405A211430; Thu, 6 Nov 2008 05:41:37 +1300 (NZDT) Date: Wed, 5 Nov 2008 08:41:37 -0800 From: Andrew Thompson To: Dag-Erling Sm??rgrav Message-ID: <20081105164137.GE840@citylink.fud.org.nz> References: <200811040231.mA42V4EQ083516@svn.freebsd.org> <86skq6gxtn.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86skq6gxtn.fsf@ds4.des.no> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org Subject: Re: 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... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 16:41:42 -0000 On Wed, Nov 05, 2008 at 01:29:56PM +0100, Dag-Erling Sm??rgrav wrote: > It looks like whoever wrote this went out of their way to find new and > creative ways to break just about every style rule we have. I am currently working on a patch to fix a lot of this. From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 17:12:19 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2053F1065674; Wed, 5 Nov 2008 17:12:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E8D98FC18; Wed, 5 Nov 2008 17:12:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5HCInI032612; Wed, 5 Nov 2008 17:12:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5HCIP7032611; Wed, 5 Nov 2008 17:12:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200811051712.mA5HCIP7032611@svn.freebsd.org> From: Alexander Motin Date: Wed, 5 Nov 2008 17:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184695 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 17:12:19 -0000 Author: mav Date: Wed Nov 5 17:12:18 2008 New Revision: 184695 URL: http://svn.freebsd.org/changeset/base/184695 Log: Improve driver operation example description. Modified: head/share/man/man4/snd_hda.4 Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Wed Nov 5 16:35:13 2008 (r184694) +++ head/share/man/man4/snd_hda.4 Wed Nov 5 17:12:18 2008 (r184695) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 24, 2008 +.Dd November 5, 2008 .Dt SND_HDA 4 .Os .Sh NAME @@ -266,9 +266,12 @@ capabilities and jack sense status to co .Sh EXAMPLES Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example. It has two audio connectors on a front side, three audio connectors on a rear side and one -internal speaker. Codec has five stereo DACs and two ADCs, all are routable to -any pin. All codec pins are reversible. +internal speaker. According to verbose driver output and codec datasheet, +codec has five stereo DACs and two stereo ADCs, all of them are routable to +any codec pin (external connector). All codec pins are reversible. .Pp +So high codec uniformity and flexibility allow driver to configure it in many +deferent ways, depending on requested pins usage decribed by pins configuration. Driver reports such default pin configuration when verbose messages enabled: .Bd -literal hdac0: nid 20 0x01014020 as 2 seq 0 Line-out Jack jack 1 loc 1 color Green misc 0 @@ -284,9 +287,15 @@ hdac0: nid 30 0x411111f0 as 15 seq 0 hdac0: nid 31 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1 .Ed .Pp -Pins with nid 21,23,28,30 and 31 are disabled due to "None" connectivity, so -total pin count matches - six. All present pins by default are grouped into 3 -associations: +Here we can see, that the nodes with ID (nid) 25 and 27 are front pannel +connectors (Jack, loc 2), nids 20, 24 and 26 are rear pannel connectors +(Jack, loc 1) and nid 21 is a built-in speaker (Fixed, loc 25). +Pins with nids 22, 23, 28, 30 and 31 will be disabled by driver due to "None" +connectivity. So the pin count and description matches to connectors that +we have. +.Pp +Using association (as) and sequence (seq) fields values pins are grouped into +3 associations: .Bd -literal hdac0: Association 0 (1) out: hdac0: Pin nid=21 seq=0 @@ -299,10 +308,21 @@ hdac0: Pin nid=26 seq=1 hdac0: Pin nid=25 seq=15 .Ed .Pp -It means that by default pcm0 device will play to the internal speaker and -headphones jack with speaker automute on headphones connection. -Recording on pcm0 will go from two external microphones and line-in jack. -pcm1 playback will go to the Line-out jack. +Each pcm device uses two associations: one for playback and one for recording. +Associations processed and assigned to pcm devices in order of their numbers. +It means that association #0 (1) will become pcm0 device playback, using +internal speaker and headphones jack with speaker automute on headphones +connection. +Association #1 (2) will become pcm1 playback, using the Line-out jack. +Association #2 (3) will become pcm0 recording, using external microphones and +line-in jack. +.Pp +Driver provides extensive set of verbose messages to diagnose it's operation +logic and description of resulted codec configuration. +.Pp +Using device.hints it is possible to modify existing pins configuration to +create broad range of different audio setups. Here is examples of some setups +possible for the described hardware: .Ss Example 1 Setting .Bd -literal From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 19:35:10 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5663F106568A; Wed, 5 Nov 2008 19:35:10 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41B068FC16; Wed, 5 Nov 2008 19:35:10 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5JZAtM035424; Wed, 5 Nov 2008 19:35:10 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5JZ9GB035415; Wed, 5 Nov 2008 19:35:09 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200811051935.mA5JZ9GB035415@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 5 Nov 2008 19:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184696 - in head/cddl: . contrib/opensolaris/cmd/dtrace contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 19:35:10 -0000 Author: rodrigc Date: Wed Nov 5 19:35:09 2008 New Revision: 184696 URL: http://svn.freebsd.org/changeset/base/184696 Log: Merge latest DTrace changes from Perforce. Approved by: jb Modified: head/cddl/Makefile.inc head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_program.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h Modified: head/cddl/Makefile.inc ============================================================================== --- head/cddl/Makefile.inc Wed Nov 5 17:12:18 2008 (r184695) +++ head/cddl/Makefile.inc Wed Nov 5 19:35:09 2008 (r184696) @@ -4,3 +4,5 @@ OPENSOLARIS_USR_DISTDIR= ${.CURDIR}/../. OPENSOLARIS_SYS_DISTDIR= ${.CURDIR}/../../../sys/cddl/contrib/opensolaris IGNORE_PRAGMA= YES + +CFLAGS+= -DNEED_SOLARIS_BOOLEAN Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Wed Nov 5 17:12:18 2008 (r184695) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Wed Nov 5 19:35:09 2008 (r184696) @@ -1576,7 +1576,7 @@ main(int argc, char *argv[]) if ((v = make_argv(optarg)) == NULL) fatal("failed to allocate memory"); - P = dtrace_proc_create(g_dtp, v[0], v); + P = dtrace_proc_create(g_dtp, v[0], v, NULL, NULL); if (P == NULL) dfatal(NULL); /* dtrace_errmsg() only */ Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst Wed Nov 5 17:12:18 2008 (r184695) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst Wed Nov 5 19:35:09 2008 (r184696) @@ -23,7 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" +# ident "%Z%%M% %I% %E% SMI" # Exception list: names tests that are bypassed when running in Java # mode (relative to /opt/SUNWdtrt/tst) @@ -49,6 +49,7 @@ common/usdt/tst.dlclose2.ksh common/usdt/tst.dlclose3.ksh common/usdt/tst.eliminate.ksh common/usdt/tst.enabled.ksh +common/usdt/tst.enabled2.ksh common/usdt/tst.entryreturn.ksh common/usdt/tst.fork.ksh common/usdt/tst.header.ksh Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Wed Nov 5 17:12:18 2008 (r184695) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Wed Nov 5 19:35:09 2008 (r184696) @@ -868,15 +868,19 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, i /* * We may have already processed this object file in an earlier linker * invocation. Check to see if the present instruction sequence matches - * the one we would install. + * the one we would install below. */ if (isenabled) { - if (ip[0] == DT_OP_CLR_O0) + if (ip[0] == DT_OP_NOP) { + (*off) += sizeof (ip[0]); return (0); + } } else { if (DT_IS_RESTORE(ip[1])) { - if (ip[0] == DT_OP_RET) + if (ip[0] == DT_OP_RET) { + (*off) += sizeof (ip[0]); return (0); + } } else if (DT_IS_MOV_O7(ip[1])) { if (DT_IS_RETL(ip[0])) return (0); @@ -910,7 +914,17 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, i return (-1); } - ip[0] = DT_OP_CLR_O0; + + /* + * On SPARC, we take advantage of the fact that the first + * argument shares the same register as for the return value. + * The macro handles the work of zeroing that register so we + * don't need to do anything special here. We instrument the + * instruction in the delay slot as we'll need to modify the + * return register after that instruction has been emulated. + */ + ip[0] = DT_OP_NOP; + (*off) += sizeof (ip[0]); } else { /* * If the call is followed by a restore, it's a tail call so @@ -919,11 +933,16 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, i * so change the call to a retl-like instruction that returns * to that register value + 8 (rather than the typical %o7 + * 8); the delay slot instruction is left, but should have no - * effect. Otherwise we change the call to be a nop. In the - * first and the last case we adjust the offset to land on what - * was once the delay slot of the call so we correctly get all - * the arguments as they would have been passed in a normal - * function call. + * effect. Otherwise we change the call to be a nop. We + * identify the subsequent instruction as the probe point in + * all but the leaf tail-call case to ensure that arguments to + * the probe are complete and consistent. An astute, though + * largely hypothetical, observer would note that there is the + * possibility of a false-positive probe firing if the function + * contained a branch to the instruction in the delay slot of + * the call. Fixing this would require significant in-kernel + * modifications, and isn't worth doing until we see it in the + * wild. */ if (DT_IS_RESTORE(ip[1])) { ip[0] = DT_OP_RET; Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Wed Nov 5 17:12:18 2008 (r184695) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Wed Nov 5 19:35:09 2008 (r184696) @@ -115,8 +115,9 @@ #define DT_VERS_1_5 DT_VERSION_NUMBER(1, 5, 0) #define DT_VERS_1_6 DT_VERSION_NUMBER(1, 6, 0) #define DT_VERS_1_6_1 DT_VERSION_NUMBER(1, 6, 1) -#define DT_VERS_LATEST DT_VERS_1_6_1 -#define DT_VERS_STRING "Sun D 1.6.1" +#define DT_VERS_1_6_2 DT_VERSION_NUMBER(1, 6, 2) +#define DT_VERS_LATEST DT_VERS_1_6_2 +#define DT_VERS_STRING "Sun D 1.6.2" const dt_version_t _dtrace_versions[] = { DT_VERS_1_0, /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */ @@ -130,6 +131,7 @@ const dt_version_t _dtrace_versions[] = DT_VERS_1_5, /* D API 1.5 Solaris Express 7/07 */ DT_VERS_1_6, /* D API 1.6 */ DT_VERS_1_6_1, /* D API 1.6.1 */ + DT_VERS_1_6_2, /* D API 1.6.2 */ 0 }; Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Wed Nov 5 17:12:18 2008 (r184695) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Wed Nov 5 19:35:09 2008 (r184696) @@ -955,7 +955,8 @@ dt_proc_create_thread(dtrace_hdl_t *dtp, } struct ps_prochandle * -dt_proc_create(dtrace_hdl_t *dtp, const char *file, char *const *argv) +dt_proc_create(dtrace_hdl_t *dtp, const char *file, char *const *argv, + proc_child_func *pcf, void *child_arg) { dt_proc_hash_t *dph = dtp->dt_procs; dt_proc_t *dpr; @@ -981,7 +982,7 @@ dt_proc_create(dtrace_hdl_t *dtp, const #else (void) proc_clearflags(dpr->dpr_proc, PR_RLC); (void) proc_setflags(dpr->dpr_proc, PR_KLC); - if ((err = proc_create(file, argv, &dpr->dpr_proc)) != 0) + if ((err = proc_create(file, argv, pcf, child_arg, &dpr->dpr_proc)) != 0) return (dt_proc_error(dtp, dpr, "failed to execute %s: %s\n", file, strerror(err))); dpr->dpr_hdl = dtp; @@ -1183,10 +1184,11 @@ dt_proc_hash_destroy(dtrace_hdl_t *dtp) } struct ps_prochandle * -dtrace_proc_create(dtrace_hdl_t *dtp, const char *file, char *const *argv) +dtrace_proc_create(dtrace_hdl_t *dtp, const char *file, char *const *argv, + proc_child_func *pcf, void *child_arg) { dt_ident_t *idp = dt_idhash_lookup(dtp->dt_macros, "target"); - struct ps_prochandle *P = dt_proc_create(dtp, file, argv); + struct ps_prochandle *P = dt_proc_create(dtp, file, argv, pcf, child_arg); if (P != NULL && idp != NULL && idp->di_id == 0) #if defined(sun) Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h Wed Nov 5 17:12:18 2008 (r184695) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h Wed Nov 5 19:35:09 2008 (r184696) @@ -99,7 +99,7 @@ typedef struct dt_proc_hash { } dt_proc_hash_t; extern struct ps_prochandle *dt_proc_create(dtrace_hdl_t *, - const char *, char *const *); + const char *, char *const *, proc_child_func *, void *); extern struct ps_prochandle *dt_proc_grab(dtrace_hdl_t *, pid_t, int, int); extern void dt_proc_release(dtrace_hdl_t *, struct ps_prochandle *); Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_program.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_program.c Wed Nov 5 17:12:18 2008 (r184695) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_program.c Wed Nov 5 19:35:09 2008 (r184696) @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -436,8 +436,13 @@ dt_header_decl(dt_idhash_t *dhp, dt_iden if (fprintf(infop->dthi_out, ");\n") < 0) return (dt_set_errno(dtp, errno)); - if (fprintf(infop->dthi_out, "extern int " - "__dtraceenabled_%s___%s(void);\n", infop->dthi_pfname, fname) < 0) + if (fprintf(infop->dthi_out, + "#ifndef\t__sparc\n" + "extern int __dtraceenabled_%s___%s(void);\n" + "#else\n" + "extern int __dtraceenabled_%s___%s(long);\n" + "#endif\n", + infop->dthi_pfname, fname, infop->dthi_pfname, fname) < 0) return (dt_set_errno(dtp, errno)); return (0); @@ -499,13 +504,20 @@ dt_header_probe(dt_idhash_t *dhp, dt_ide return (dt_set_errno(dtp, errno)); if (!infop->dthi_empty) { - if (fprintf(infop->dthi_out, "#define\t%s_%s_ENABLED() \\\n", - infop->dthi_pmname, mname) < 0) - return (dt_set_errno(dtp, errno)); - - if (fprintf(infop->dthi_out, "\t__dtraceenabled_%s___%s()\n", + if (fprintf(infop->dthi_out, + "#ifndef\t__sparc\n" + "#define\t%s_%s_ENABLED() \\\n" + "\t__dtraceenabled_%s___%s()\n" + "#else\n" + "#define\t%s_%s_ENABLED() \\\n" + "\t__dtraceenabled_%s___%s(0)\n" + "#endif\n", + infop->dthi_pmname, mname, + infop->dthi_pfname, fname, + infop->dthi_pmname, mname, infop->dthi_pfname, fname) < 0) return (dt_set_errno(dtp, errno)); + } else { if (fprintf(infop->dthi_out, "#define\t%s_%s_ENABLED() (0)\n", infop->dthi_pmname, mname) < 0) Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h Wed Nov 5 17:12:18 2008 (r184695) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h Wed Nov 5 19:35:09 2008 (r184696) @@ -33,6 +33,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -413,7 +414,7 @@ extern int dtrace_aggregate_walk_valvarr */ extern struct ps_prochandle *dtrace_proc_create(dtrace_hdl_t *, - const char *, char *const *); + const char *, char *const *, proc_child_func *, void *); extern struct ps_prochandle *dtrace_proc_grab(dtrace_hdl_t *, pid_t, int); extern void dtrace_proc_release(dtrace_hdl_t *, struct ps_prochandle *); From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 19:35:44 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15DC61065691; Wed, 5 Nov 2008 19:35:44 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 048A98FC0A; Wed, 5 Nov 2008 19:35:44 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5JZhqD035468; Wed, 5 Nov 2008 19:35:43 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5JZh6l035466; Wed, 5 Nov 2008 19:35:43 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200811051935.mA5JZh6l035466@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 5 Nov 2008 19:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184697 - head/lib/libproc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 19:35:44 -0000 Author: rodrigc Date: Wed Nov 5 19:35:43 2008 New Revision: 184697 URL: http://svn.freebsd.org/changeset/base/184697 Log: Merge latest DTrace changes from Perforce. Update libproc API to reflect new changes. Approved by: jb Modified: head/lib/libproc/libproc.h head/lib/libproc/proc_create.c Modified: head/lib/libproc/libproc.h ============================================================================== --- head/lib/libproc/libproc.h Wed Nov 5 19:35:09 2008 (r184696) +++ head/lib/libproc/libproc.h Wed Nov 5 19:35:43 2008 (r184697) @@ -33,6 +33,8 @@ struct proc_handle; +typedef void (*proc_child_func)(void *); + /* Values returned by proc_state(). */ #define PS_IDLE 1 #define PS_STOP 2 @@ -55,7 +57,8 @@ int proc_addr2sym(struct proc_handle *, int proc_attach(pid_t pid, int flags, struct proc_handle **pphdl); int proc_continue(struct proc_handle *); int proc_clearflags(struct proc_handle *, int); -int proc_create(const char *, char * const *, struct proc_handle **); +int proc_create(const char *, char * const *, proc_child_func *, void *, + struct proc_handle **); int proc_detach(struct proc_handle *); int proc_getflags(struct proc_handle *); int proc_name2sym(struct proc_handle *, const char *, const char *, GElf_Sym *); Modified: head/lib/libproc/proc_create.c ============================================================================== --- head/lib/libproc/proc_create.c Wed Nov 5 19:35:09 2008 (r184696) +++ head/lib/libproc/proc_create.c Wed Nov 5 19:35:43 2008 (r184697) @@ -90,7 +90,8 @@ proc_attach(pid_t pid, int flags, struct } int -proc_create(const char *file, char * const *argv, struct proc_handle **pphdl) +proc_create(const char *file, char * const *argv, proc_child_func *pcf, + void *child_arg, struct proc_handle **pphdl) { struct proc_handle *phdl; struct kevent kev; @@ -106,13 +107,16 @@ proc_create(const char *file, char * con return (ENOMEM); /* Fork a new process. */ - if ((pid = fork()) == -1) + if ((pid = vfork()) == -1) error = errno; else if (pid == 0) { /* The child expects to be traced. */ if (ptrace(PT_TRACE_ME, 0, 0, 0) != 0) _exit(1); + if (pcf != NULL) + (*pcf)(child_arg); + /* Execute the specified file: */ execvp(file, argv); From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 19:39:12 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22BEE106567A; Wed, 5 Nov 2008 19:39:12 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DA808FC1A; Wed, 5 Nov 2008 19:39:12 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5JdCQ1035590; Wed, 5 Nov 2008 19:39:12 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5JdBCK035580; Wed, 5 Nov 2008 19:39:11 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200811051939.mA5JdBCK035580@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 5 Nov 2008 19:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184698 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/dtrace cddl/dev/dtrace cddl/dev/systrace sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 19:39:12 -0000 Author: rodrigc Date: Wed Nov 5 19:39:11 2008 New Revision: 184698 URL: http://svn.freebsd.org/changeset/base/184698 Log: Merge latest DTrace changes from Perforce. Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c head/sys/cddl/compat/opensolaris/sys/types.h head/sys/cddl/compat/opensolaris/sys/uio.h head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c head/sys/cddl/dev/dtrace/dtrace_ioctl.c head/sys/cddl/dev/dtrace/dtrace_load.c head/sys/cddl/dev/dtrace/dtrace_unload.c head/sys/cddl/dev/systrace/systrace.c head/sys/sys/sysent.h Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Wed Nov 5 19:35:43 2008 (r184697) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Wed Nov 5 19:39:11 2008 (r184698) @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define KMEM_DEBUG + #ifdef KMEM_DEBUG #include #include @@ -93,6 +95,10 @@ void zfs_kmem_free(void *buf, size_t size __unused) { #ifdef KMEM_DEBUG + if (buf == NULL) { + printf("%s: attempt to free NULL\n",__func__); + return; + } struct kmem_item *i; buf = (u_char *)buf - sizeof(struct kmem_item); @@ -236,7 +242,8 @@ calloc(size_t n, size_t s) } #ifdef KMEM_DEBUG -static void +void kmem_show(void *); +void kmem_show(void *dummy __unused) { struct kmem_item *i; @@ -248,12 +255,10 @@ kmem_show(void *dummy __unused) printf("KMEM_DEBUG: Leaked elements:\n\n"); LIST_FOREACH(i, &kmem_items, next) { printf("address=%p\n", i); - stack_print(&i->stack); - printf("\n"); } } mtx_unlock(&kmem_items_mtx); } -SYSUNINIT(sol_kmem, SI_SUB_DRIVERS, SI_ORDER_FIRST, kmem_show, NULL); +SYSUNINIT(sol_kmem, SI_SUB_CPU, SI_ORDER_FIRST, kmem_show, NULL); #endif /* KMEM_DEBUG */ Modified: head/sys/cddl/compat/opensolaris/sys/types.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/types.h Wed Nov 5 19:35:43 2008 (r184697) +++ head/sys/cddl/compat/opensolaris/sys/types.h Wed Nov 5 19:39:11 2008 (r184698) @@ -64,12 +64,13 @@ typedef void pathname_t; typedef int64_t rlim64_t; #else - +#ifdef NEED_SOLARIS_BOOLEAN #if defined(__XOPEN_OR_POSIX) typedef enum { _B_FALSE, _B_TRUE } boolean_t; #else typedef enum { B_FALSE, B_TRUE } boolean_t; #endif /* defined(__XOPEN_OR_POSIX) */ +#endif typedef longlong_t offset_t; typedef u_longlong_t u_offset_t; Modified: head/sys/cddl/compat/opensolaris/sys/uio.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/uio.h Wed Nov 5 19:35:43 2008 (r184697) +++ head/sys/cddl/compat/opensolaris/sys/uio.h Wed Nov 5 19:39:11 2008 (r184698) @@ -51,6 +51,7 @@ typedef struct iovec iovec_t; #define uio_loffset uio_offset +#ifdef BUILDING_ZFS static __inline int zfs_uiomove(void *cp, size_t n, enum uio_rw dir, uio_t *uio) { @@ -59,5 +60,6 @@ zfs_uiomove(void *cp, size_t n, enum uio return (uiomove(cp, (int)n, uio)); } #define uiomove(cp, n, dir, uio) zfs_uiomove((cp), (n), (dir), (uio)) +#endif #endif /* !_OPENSOLARIS_SYS_UIO_H_ */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Nov 5 19:35:43 2008 (r184697) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Nov 5 19:39:11 2008 (r184698) @@ -3007,6 +3007,9 @@ dtrace_dif_variable(dtrace_mstate_t *mst case DIF_VAR_EXECARGS: { struct pargs *p_args = curthread->td_proc->p_args; + if (p_args == NULL) + return(0); + return (dtrace_dif_varstrz( (uintptr_t) p_args->ar_args, p_args->ar_length, state, mstate)); } @@ -10598,7 +10601,6 @@ dtrace_buffer_alloc(dtrace_buffer_t *buf /* * If there is already a buffer allocated for this CPU, it * is only possible that this is a DR event. In this case, - * the buffer size must match our specified size. */ if (buf->dtb_tomax != NULL) { ASSERT(buf->dtb_size == size); @@ -12815,11 +12817,7 @@ dtrace_state_create(struct cdev *dev) state = ddi_get_soft_state(dtrace_softstate, minor); #else if (dev != NULL) { - /* - * Disable this until we have the ability to set user - * credentials for DTrace. - * cr = dev->si_cred; - */ + cr = dev->si_cred; m = dev2unit(dev); } @@ -15241,6 +15239,15 @@ dtrace_attach(dev_info_t *devi, ddi_atta } #endif +#if !defined(sun) +#if __FreeBSD_version >= 800039 +static void +dtrace_dtr(void *data __unused) +{ +} +#endif +#endif + /*ARGSUSED*/ static int #if defined(sun) @@ -15266,6 +15273,7 @@ dtrace_open(struct cdev *dev, int oflags #else cred_t *cred_p = NULL; +#if __FreeBSD_version < 800039 /* * The first minor device is the one that is cloned so there is * nothing more to do here. @@ -15281,6 +15289,7 @@ dtrace_open(struct cdev *dev, int oflags */ if (dev->si_drv1 != NULL) return (EBUSY); +#endif cred_p = dev->si_cred; #endif @@ -15292,9 +15301,11 @@ dtrace_open(struct cdev *dev, int oflags dtrace_cred2priv(cred_p, &priv, &uid, &zoneid); if (priv == DTRACE_PRIV_NONE) { #if !defined(sun) +#if __FreeBSD_version < 800039 /* Destroy the cloned device. */ destroy_dev(dev); #endif +#endif return (EACCES); } @@ -15326,7 +15337,11 @@ dtrace_open(struct cdev *dev, int oflags state = dtrace_state_create(devp, cred_p); #else state = dtrace_state_create(dev); +#if __FreeBSD_version < 800039 dev->si_drv1 = state; +#else + devfs_set_cdevpriv(state, dtrace_dtr); +#endif #endif mutex_exit(&cpu_lock); @@ -15340,9 +15355,11 @@ dtrace_open(struct cdev *dev, int oflags #endif mutex_exit(&dtrace_lock); #if !defined(sun) +#if __FreeBSD_version < 800039 /* Destroy the cloned device. */ destroy_dev(dev); #endif +#endif return (EAGAIN); } @@ -15368,11 +15385,16 @@ dtrace_close(struct cdev *dev, int flags state = ddi_get_soft_state(dtrace_softstate, minor); #else +#if __FreeBSD_version < 800039 dtrace_state_t *state = dev->si_drv1; /* Check if this is not a cloned device. */ if (dev2unit(dev) == 0) return (0); +#else + dtrace_state_t *state; + devfs_get_cdevpriv((void **) &state); +#endif #endif @@ -15392,7 +15414,11 @@ dtrace_close(struct cdev *dev, int flags #if !defined(sun) kmem_free(state, 0); +#if __FreeBSD_version < 800039 dev->si_drv1 = NULL; +#else + devfs_clear_cdevpriv(); +#endif #endif } @@ -15407,8 +15433,10 @@ dtrace_close(struct cdev *dev, int flags mutex_exit(&dtrace_lock); mutex_exit(&cpu_lock); +#if __FreeBSD_version < 800039 /* Schedule this cloned device to be destroyed. */ destroy_dev_sched(dev); +#endif return (0); } @@ -16442,16 +16470,20 @@ _fini(void) static d_ioctl_t dtrace_ioctl; static void dtrace_load(void *); static int dtrace_unload(void); +#if __FreeBSD_version < 800039 static void dtrace_clone(void *, struct ucred *, char *, int , struct cdev **); static struct clonedevs *dtrace_clones; /* Ptr to the array of cloned devices. */ static eventhandler_tag eh_tag; /* Event handler tag. */ +#else +static struct cdev *dtrace_dev; +#endif void dtrace_invop_init(void); void dtrace_invop_uninit(void); static struct cdevsw dtrace_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDMINOR, + .d_flags = D_TRACKCLOSE | D_NEEDMINOR, .d_close = dtrace_close, .d_ioctl = dtrace_ioctl, .d_open = dtrace_open, @@ -16459,7 +16491,9 @@ static struct cdevsw dtrace_cdevsw = { }; #include +#if __FreeBSD_version < 800039 #include +#endif #include #include #include Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Nov 5 19:35:43 2008 (r184697) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Nov 5 19:39:11 2008 (r184698) @@ -2044,13 +2044,6 @@ err: tp->ftt_proc->ftpc_acount != 0) break; - /* - * The count of active providers can only be - * decremented (i.e. to zero) during exec, exit, and - * removal of a meta provider so it should be - * impossible to drop the count during this operation(). - */ - ASSERT(tp->ftt_proc->ftpc_acount != 0); tp = tp->ftt_next; } Modified: head/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_ioctl.c Wed Nov 5 19:35:43 2008 (r184697) +++ head/sys/cddl/dev/dtrace/dtrace_ioctl.c Wed Nov 5 19:39:11 2008 (r184698) @@ -32,7 +32,12 @@ static int dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags __unused, struct thread *td) { +#if __FreeBSD_version < 800039 dtrace_state_t *state = dev->si_drv1; +#else + dtrace_state_t *state; + devfs_get_cdevpriv((void **) &state); +#endif int error = 0; if (state == NULL) return (EINVAL); Modified: head/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_load.c Wed Nov 5 19:35:43 2008 (r184697) +++ head/sys/cddl/dev/dtrace/dtrace_load.c Wed Nov 5 19:39:11 2008 (r184698) @@ -154,11 +154,15 @@ dtrace_load(void *dummy) mutex_exit(&cpu_lock); +#if __FreeBSD_version < 800039 /* Enable device cloning. */ clone_setup(&dtrace_clones); /* Setup device cloning events. */ eh_tag = EVENTHANDLER_REGISTER(dev_clone, dtrace_clone, 0, 1000); +#else + dtrace_dev = make_dev(&dtrace_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "dtrace/dtrace"); +#endif return; } Modified: head/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_unload.c Wed Nov 5 19:35:43 2008 (r184697) +++ head/sys/cddl/dev/dtrace/dtrace_unload.c Wed Nov 5 19:39:11 2008 (r184698) @@ -28,6 +28,7 @@ dtrace_unload() dtrace_state_t *state; int error = 0; +#if __FreeBSD_version < 800039 /* * Check if there is still an event handler callback * registered. @@ -40,6 +41,9 @@ dtrace_unload() /* Stop device cloning. */ clone_cleanup(&dtrace_clones); } +#else + destroy_dev(dtrace_dev); +#endif mutex_enter(&dtrace_provider_lock); mutex_enter(&dtrace_lock); Modified: head/sys/cddl/dev/systrace/systrace.c ============================================================================== --- head/sys/cddl/dev/systrace/systrace.c Wed Nov 5 19:35:43 2008 (r184697) +++ head/sys/cddl/dev/systrace/systrace.c Wed Nov 5 19:39:11 2008 (r184698) @@ -50,15 +50,41 @@ #include #include #include -#include -#include #include +#include #include #include #include #include +#ifdef LINUX_SYSTRACE +#include +#include +#include +#include +#include +extern struct sysent linux_sysent[]; +#define DEVNAME "dtrace/linsystrace" +#define PROVNAME "linsyscall" +#define MAXSYSCALL LINUX_SYS_MAXSYSCALL +#define SYSCALLNAMES linux_syscallnames +#define SYSENT linux_sysent +#else +/* + * The syscall arguments are processed into a DTrace argument array + * using a generated function. See sys/kern/makesyscalls.sh. + */ +#include +#include +extern const char *syscallnames[]; +#define DEVNAME "dtrace/systrace" +#define PROVNAME "syscall" +#define MAXSYSCALL SYS_MAXSYSCALL +#define SYSCALLNAMES syscallnames +#define SYSENT sysent +#endif + #define SYSTRACE_ARTIFICIAL_FRAMES 1 #define SYSTRACE_SHIFT 16 @@ -67,17 +93,13 @@ #define SYSTRACE_ENTRY(id) ((1 << SYSTRACE_SHIFT) | (id)) #define SYSTRACE_RETURN(id) (id) -#if ((1 << SYSTRACE_SHIFT) <= SYS_MAXSYSCALL) +#if ((1 << SYSTRACE_SHIFT) <= MAXSYSCALL) #error 1 << SYSTRACE_SHIFT must exceed number of system calls #endif -extern char *syscallnames[]; - static d_open_t systrace_open; static int systrace_unload(void); static void systrace_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *); -static void systrace_args(int, void *, u_int64_t *, int *); -static void systrace_probe(u_int32_t, int, struct sysent *, void *); static void systrace_provide(void *, dtrace_probedesc_t *); static void systrace_destroy(void *, dtrace_id_t, void *); static void systrace_enable(void *, dtrace_id_t, void *); @@ -87,9 +109,18 @@ static void systrace_load(void *); static struct cdevsw systrace_cdevsw = { .d_version = D_VERSION, .d_open = systrace_open, +#ifdef LINUX_SYSTRACE + .d_name = "linsystrace", +#else .d_name = "systrace", +#endif }; +static union { + const char **p_constnames; + char **pp_syscallnames; +} uglyhack = { SYSCALLNAMES }; + static dtrace_pattr_t systrace_attr = { { DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, { DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, @@ -114,12 +145,14 @@ static dtrace_pops_t systrace_pops = { static struct cdev *systrace_cdev; static dtrace_provider_id_t systrace_id; +#if !defined(LINUX_SYSTRACE) /* - * The syscall arguments are processed into a DTrace argument array - * using a generated function. See sys/kern/makesyscalls.sh. + * Probe callback function. + * + * Note: This function is called for _all_ syscalls, regardless of which sysent + * array the syscall comes from. It could be a standard syscall or a + * compat syscall from something like Linux. */ -#include - static void systrace_probe(u_int32_t id, int sysnum, struct sysent *sysent, void *params) { @@ -127,21 +160,20 @@ systrace_probe(u_int32_t id, int sysnum, u_int64_t uargs[8]; /* - * Check if this syscall has a custom argument conversion - * function registered. If so, it is a syscall registered - * by a loaded module. + * Check if this syscall has an argument conversion function + * registered. */ if (sysent->sy_systrace_args_func != NULL) /* * Convert the syscall parameters using the registered * function. */ - (*sysent->sy_systrace_args_func)(params, uargs, &n_args); + (*sysent->sy_systrace_args_func)(sysnum, params, uargs, &n_args); else /* * Use the built-in system call argument conversion * function to translate the syscall structure fields - * into thhe array of 64-bit values that DTrace + * into the array of 64-bit values that DTrace * expects. */ systrace_args(sysnum, params, uargs, &n_args); @@ -149,6 +181,7 @@ systrace_probe(u_int32_t id, int sysnum, /* Process the probe using the converted argments. */ dtrace_probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4]); } +#endif static void systrace_getargdesc(void *arg, dtrace_id_t id, void *parg, dtrace_argdesc_t *desc) @@ -172,15 +205,15 @@ systrace_provide(void *arg, dtrace_probe if (desc != NULL) return; - for (i = 0; i < SYS_MAXSYSCALL; i++) { + for (i = 0; i < MAXSYSCALL; i++) { if (dtrace_probe_lookup(systrace_id, NULL, - syscallnames[i], "entry") != 0) + uglyhack.pp_syscallnames[i], "entry") != 0) continue; - (void) dtrace_probe_create(systrace_id, NULL, syscallnames[i], + (void) dtrace_probe_create(systrace_id, NULL, uglyhack.pp_syscallnames[i], "entry", SYSTRACE_ARTIFICIAL_FRAMES, (void *)((uintptr_t)SYSTRACE_ENTRY(i))); - (void) dtrace_probe_create(systrace_id, NULL, syscallnames[i], + (void) dtrace_probe_create(systrace_id, NULL, uglyhack.pp_syscallnames[i], "return", SYSTRACE_ARTIFICIAL_FRAMES, (void *)((uintptr_t)SYSTRACE_RETURN(i))); } @@ -209,10 +242,13 @@ systrace_enable(void *arg, dtrace_id_t i { int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg); + if (SYSENT[sysnum].sy_systrace_args_func == NULL) + SYSENT[sysnum].sy_systrace_args_func = systrace_args; + if (SYSTRACE_ISENTRY((uintptr_t)parg)) - sysent[sysnum].sy_entry = id; + SYSENT[sysnum].sy_entry = id; else - sysent[sysnum].sy_return = id; + SYSENT[sysnum].sy_return = id; } static void @@ -220,8 +256,8 @@ systrace_disable(void *arg, dtrace_id_t { int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg); - sysent[sysnum].sy_entry = 0; - sysent[sysnum].sy_return = 0; + SYSENT[sysnum].sy_entry = 0; + SYSENT[sysnum].sy_return = 0; } static void @@ -229,13 +265,15 @@ systrace_load(void *dummy) { /* Create the /dev/dtrace/systrace entry. */ systrace_cdev = make_dev(&systrace_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, - "dtrace/systrace"); + DEVNAME); - if (dtrace_register("syscall", &systrace_attr, DTRACE_PRIV_USER, + if (dtrace_register(PROVNAME, &systrace_attr, DTRACE_PRIV_USER, NULL, &systrace_pops, NULL, &systrace_id) != 0) return; +#if !defined(LINUX_SYSTRACE) systrace_probe_func = systrace_probe; +#endif } @@ -247,7 +285,9 @@ systrace_unload() if ((error = dtrace_unregister(systrace_id)) != 0) return (error); +#if !defined(LINUX_SYSTRACE) systrace_probe_func = NULL; +#endif destroy_dev(systrace_cdev); @@ -286,7 +326,16 @@ systrace_open(struct cdev *dev __unused, SYSINIT(systrace_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, systrace_load, NULL); SYSUNINIT(systrace_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, systrace_unload, NULL); +#ifdef LINUX_SYSTRACE +DEV_MODULE(linsystrace, systrace_modevent, NULL); +MODULE_VERSION(linsystrace, 1); +MODULE_DEPEND(linsystrace, linux, 1, 1, 1); +MODULE_DEPEND(linsystrace, systrace, 1, 1, 1); +MODULE_DEPEND(linsystrace, dtrace, 1, 1, 1); +MODULE_DEPEND(linsystrace, opensolaris, 1, 1, 1); +#else DEV_MODULE(systrace, systrace_modevent, NULL); MODULE_VERSION(systrace, 1); MODULE_DEPEND(systrace, dtrace, 1, 1, 1); MODULE_DEPEND(systrace, opensolaris, 1, 1, 1); +#endif Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Wed Nov 5 19:35:43 2008 (r184697) +++ head/sys/sys/sysent.h Wed Nov 5 19:39:11 2008 (r184698) @@ -48,7 +48,7 @@ typedef void (*systrace_probe_func_t)(u_ * Used by loaded syscalls to convert arguments to a DTrace array * of 64-bit arguments. */ -typedef void (*systrace_args_func_t)(void *, u_int64_t *, int *); +typedef void (*systrace_args_func_t)(int, void *, u_int64_t *, int *); extern systrace_probe_func_t systrace_probe_func; From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 19:39:38 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B4BB106564A; Wed, 5 Nov 2008 19:39:38 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A3568FC1B; Wed, 5 Nov 2008 19:39:38 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5Jdc1w035628; Wed, 5 Nov 2008 19:39:38 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5JdcZ4035627; Wed, 5 Nov 2008 19:39:38 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200811051939.mA5JdcZ4035627@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 5 Nov 2008 19:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184699 - head/usr.bin/fstat/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 19:39:38 -0000 Author: rodrigc Date: Wed Nov 5 19:39:37 2008 New Revision: 184699 URL: http://svn.freebsd.org/changeset/base/184699 Log: Merge latest DTrace changes from Perforce. Approved by: jb Modified: head/usr.bin/fstat/zfs/Makefile Modified: head/usr.bin/fstat/zfs/Makefile ============================================================================== --- head/usr.bin/fstat/zfs/Makefile Wed Nov 5 19:39:11 2008 (r184698) +++ head/usr.bin/fstat/zfs/Makefile Wed Nov 5 19:39:37 2008 (r184699) @@ -15,6 +15,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/.. +CFLAGS+= -DNEED_SOLARIS_BOOLEAN all: ${OBJS} CLEANFILES= ${OBJS} From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 19:40:37 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AA1F1065690; Wed, 5 Nov 2008 19:40:37 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06EE48FC08; Wed, 5 Nov 2008 19:40:37 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5JeafA035691; Wed, 5 Nov 2008 19:40:36 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5JeapQ035688; Wed, 5 Nov 2008 19:40:36 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200811051940.mA5JeapQ035688@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 5 Nov 2008 19:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184700 - in head/sys: kern modules/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 19:40:37 -0000 Author: rodrigc Date: Wed Nov 5 19:40:36 2008 New Revision: 184700 URL: http://svn.freebsd.org/changeset/base/184700 Log: Merge latest DTrace changes from Perforce. Approved by: jb Modified: head/sys/kern/kern_exec.c head/sys/kern/vfs_syscalls.c head/sys/modules/zfs/Makefile Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Wed Nov 5 19:39:37 2008 (r184699) +++ head/sys/kern/kern_exec.c Wed Nov 5 19:40:36 2008 (r184700) @@ -388,8 +388,6 @@ do_execve(td, args, mac_p) imgp->image_header = NULL; - SDT_PROBE(proc, kernel, , exec, args->fname, 0, 0, 0, 0 ); - /* * Translate the file name. namei() returns a vnode pointer * in ni_vp amoung other things. @@ -403,6 +401,8 @@ do_execve(td, args, mac_p) | MPSAFE | AUDITVNODE1, UIO_SYSSPACE, args->fname, td); } + SDT_PROBE(proc, kernel, , exec, args->fname, 0, 0, 0, 0 ); + interpret: if (args->fname != NULL) { error = namei(ndp); @@ -800,8 +800,9 @@ interpret: vfs_mark_atime(imgp->vp, td->td_ucred); -done1: + SDT_PROBE(proc, kernel, , exec_success, args->fname, 0, 0, 0, 0); +done1: /* * Free any resources malloc'd earlier that we didn't use. */ @@ -812,8 +813,6 @@ done1: crfree(newcred); VOP_UNLOCK(imgp->vp, 0); - SDT_PROBE(proc, kernel, , exec_success, args->fname, 0, 0, 0, 0); - /* * Handle deferred decrement of ref counts. */ Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Wed Nov 5 19:39:37 2008 (r184699) +++ head/sys/kern/vfs_syscalls.c Wed Nov 5 19:40:36 2008 (r184700) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" +#include "opt_kdtrace.h" #include "opt_ktrace.h" #include "opt_mac.h" @@ -58,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -82,6 +84,14 @@ __FBSDID("$FreeBSD$"); #include #include +SDT_PROVIDER_DEFINE(vfs); +SDT_PROBE_DEFINE(vfs, , stat, mode); +SDT_PROBE_ARGTYPE(vfs, , stat, mode, 0, "char *"); +SDT_PROBE_ARGTYPE(vfs, , stat, mode, 1, "int"); +SDT_PROBE_DEFINE(vfs, , stat, reg); +SDT_PROBE_ARGTYPE(vfs, , stat, reg, 0, "char *"); +SDT_PROBE_ARGTYPE(vfs, , stat, reg, 1, "int"); + static int chroot_refuse_vdir_fds(struct filedesc *fdp); static int getutimes(const struct timeval *, enum uio_seg, struct timespec *); static int setfown(struct thread *td, struct vnode *, uid_t, gid_t); @@ -2334,6 +2344,11 @@ kern_statat(struct thread *td, int flag, return (error); vfslocked = NDHASGIANT(&nd); error = vn_stat(nd.ni_vp, &sb, td->td_ucred, NOCRED, td); + if (!error) { + SDT_PROBE(vfs, , stat, mode, path, sb.st_mode, 0, 0, 0); + if (S_ISREG(sb.st_mode)) + SDT_PROBE(vfs, , stat, reg, path, pathseg, 0, 0, 0); + } NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Wed Nov 5 19:39:37 2008 (r184699) +++ head/sys/modules/zfs/Makefile Wed Nov 5 19:40:36 2008 (r184700) @@ -78,6 +78,7 @@ CFLAGS+=-I${.CURDIR}/../.. CFLAGS+=-I${SUNW}/common/zfs CFLAGS+=-I${SUNW}/common CFLAGS+=-I${.CURDIR}/../../../include +CFLAGS+=-DBUILDING_ZFS #CFLAGS+=-DDEBUG=1 #DEBUG_FLAGS=-g From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 19:50:43 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41D5410656DD; Wed, 5 Nov 2008 19:50:43 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 012E88FC0C; Wed, 5 Nov 2008 19:50:42 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 306EC2BC47; Thu, 6 Nov 2008 08:50:42 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 73GvZZJT91hg; Thu, 6 Nov 2008 08:50:38 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Thu, 6 Nov 2008 08:50:38 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 12D2E11430; Thu, 6 Nov 2008 08:50:38 +1300 (NZDT) Date: Wed, 5 Nov 2008 11:50:37 -0800 From: Andrew Thompson To: Craig Rodrigues Message-ID: <20081105195037.GF840@citylink.fud.org.nz> References: <200811051939.mA5JdBCK035580@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200811051939.mA5JdBCK035580@svn.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184698 - in head/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/dtrace cddl/dev/dtrace cddl/dev/systrace sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 19:50:43 -0000 On Wed, Nov 05, 2008 at 07:39:11PM +0000, Craig Rodrigues wrote: > Author: rodrigc > Date: Wed Nov 5 19:39:11 2008 > New Revision: 184698 > URL: http://svn.freebsd.org/changeset/base/184698 > > Log: > Merge latest DTrace changes from Perforce. > > Modified: > head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c > head/sys/cddl/compat/opensolaris/sys/types.h > head/sys/cddl/compat/opensolaris/sys/uio.h > head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c > head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c > head/sys/cddl/dev/dtrace/dtrace_ioctl.c > head/sys/cddl/dev/dtrace/dtrace_load.c > head/sys/cddl/dev/dtrace/dtrace_unload.c > head/sys/cddl/dev/systrace/systrace.c > head/sys/sys/sysent.h > > Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c > ============================================================================== > --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Wed Nov 5 19:35:43 2008 (r184697) > +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Wed Nov 5 19:39:11 2008 (r184698) > @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#define KMEM_DEBUG Didnt this cause a huge performance hit when it was accidentally merged with the stable-7 dtrace import? Andrew From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 20:32:14 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B47B1065670; Wed, 5 Nov 2008 20:32:14 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED6208FC12; Wed, 5 Nov 2008 20:32:13 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA5KWD2C036640; Wed, 5 Nov 2008 20:32:13 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA5KWDDl036639; Wed, 5 Nov 2008 20:32:13 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200811052032.mA5KWDDl036639@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 5 Nov 2008 20:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184701 - head/sys/cddl/compat/opensolaris/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 20:32:14 -0000 Author: rodrigc Date: Wed Nov 5 20:32:13 2008 New Revision: 184701 URL: http://svn.freebsd.org/changeset/base/184701 Log: Remove definition of KMEM_DEBUG accidentally brought in by latest DTrace import. Noticed by: thompsa Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Wed Nov 5 19:40:36 2008 (r184700) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Wed Nov 5 20:32:13 2008 (r184701) @@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define KMEM_DEBUG - #ifdef KMEM_DEBUG #include #include From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 21:00:34 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86DCD106564A; Wed, 5 Nov 2008 21:00:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 1B4118FC0A; Wed, 5 Nov 2008 21:00:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mA5L0Ldx015327; Wed, 5 Nov 2008 16:00:27 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: David Xu Date: Wed, 5 Nov 2008 10:35:20 -0500 User-Agent: KMail/1.9.7 References: <200811050301.mA531Nmk014730@svn.freebsd.org> In-Reply-To: <200811050301.mA531Nmk014730@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811051035.21103.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Wed, 05 Nov 2008 16:00:27 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8576/Wed Nov 5 13:28:48 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.4 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_03_06,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184667 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 21:00:34 -0000 On Tuesday 04 November 2008 10:01:23 pm David Xu wrote: > Author: davidxu > Date: Wed Nov 5 03:01:23 2008 > New Revision: 184667 > URL: http://svn.freebsd.org/changeset/base/184667 > > Log: > Revert rev 184216 and 184199, due to the way the thread_lock works, > it may cause a lockup. > > Noticed by: peter, jhb Thanks. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 21:00:43 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCA5D1065759; Wed, 5 Nov 2008 21:00:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 261FB8FC14; Wed, 5 Nov 2008 21:00:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id mA5L0Le0015327; Wed, 5 Nov 2008 16:00:33 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: David Xu Date: Wed, 5 Nov 2008 10:44:08 -0500 User-Agent: KMail/1.9.7 References: <200810240109.m9O19P1u071214@svn.freebsd.org> <200811041705.48043.jhb@freebsd.org> <4910F8E7.4010805@freebsd.org> In-Reply-To: <4910F8E7.4010805@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811051044.08650.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Wed, 05 Nov 2008 16:00:34 -0500 (EST) X-Virus-Scanned: ClamAV 0.93.1/8576/Wed Nov 5 13:28:48 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.4 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_03_06,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184217 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 21:00:44 -0000 On Tuesday 04 November 2008 08:37:43 pm David Xu wrote: > John Baldwin wrote: > > On Thursday 23 October 2008 09:09:25 pm David Xu wrote: > >> Author: davidxu > >> Date: Fri Oct 24 01:09:24 2008 > >> New Revision: 184217 > >> URL: http://svn.freebsd.org/changeset/base/184217 > >> > >> Log: > >> Don't rearm callout if the process is exiting, it may leak a callout > >> because callout_drain() only waits for running callout, but not disable > >> it if it is rearmed. > > > > Can you please revert this as per previous discussion? > > > > I will do it, maybe I lost previous discussion ? I thought someone else had followed up to my original e-mail, but here are my comments from when this was first committed: > Log: > Don't rearm callout if the process is exiting, it may leak a callout > because callout_drain() only waits for running callout, but not disable > it if it is rearmed. Actually, it does prevent rearming from within the callout routine itself while waiting: int callout_reset_on(struct callout *c, int to_ticks, void (*ftn)(void *), void *arg, int cpu) { ... if (cc->cc_curr == c) { ... if (cc->cc_waiting) { /* * Someone has called callout_drain to kill this * callout. Don't reschedule. */ CTR4(KTR_CALLOUT, "%s %p func %p arg %p", cancelled ? "cancelled" : "failed to cancel", c, c->c_func, c->c_arg); CC_UNLOCK(cc); return (cancelled); } } ... } Lots of callouts using callout_init_mtx() (e.g. all the callouts in the NIC drivers) depend on this feature. Please revert this. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 21:50:30 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75D071065686; Wed, 5 Nov 2008 21:50:30 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 19D5F8FC08; Wed, 5 Nov 2008 21:50:30 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mA5LlS1n034838; Wed, 5 Nov 2008 14:47:29 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 05 Nov 2008 14:48:40 -0700 (MST) Message-Id: <20081105.144840.-432836001.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: <86skq6gxtn.fsf@ds4.des.no> References: <200811040231.mA42V4EQ083516@svn.freebsd.org> <86skq6gxtn.fsf@ds4.des.no> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, alfred@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: 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... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 21:50:30 -0000 In message: <86skq6gxtn.fsf@ds4.des.no> Dag-Erling_Sm=F8rgrav writes: : It looks like whoever wrote this went out of their way to find new an= d : creative ways to break just about every style rule we have. Not just coding style, but also style of /dev entries, the modules style, etc. Warner From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 22:02:53 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7873E106564A; Wed, 5 Nov 2008 22:02:53 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 220E88FC12; Wed, 5 Nov 2008 22:02:53 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mA5LxtJb034996; Wed, 5 Nov 2008 14:59:55 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 05 Nov 2008 15:01:08 -0700 (MST) Message-Id: <20081105.150108.1649771743.imp@bsdimp.com> To: des@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200811051508.mA5F89XD030040@svn.freebsd.org> References: <200811051508.mA5F89XD030040@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184691 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 22:02:53 -0000 In message: <200811051508.mA5F89XD030040@svn.freebsd.org> Dag-Erling Smorgrav writes: : utf-8 Is there some reason to prefer utf-8 over the 8-bit iso character set we were using? Warner From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 23:26:43 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C50AE1065674; Wed, 5 Nov 2008 23:26:43 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.189]) by mx1.freebsd.org (Postfix) with ESMTP id C401F8FC19; Wed, 5 Nov 2008 23:26:42 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by fk-out-0910.google.com with SMTP id k31so235888fkk.11 for ; Wed, 05 Nov 2008 15:26:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=03JqyRnaifXZrDXH39LELesWTZlFADbkaN3+j8nq4lw=; b=kwfFDE0460Uze0WdV34HwYCTpXY4T9KKqMzImjtDjTBETXNNIBeSdRLpOgbTI2JrLv uFbg8p+VnCPpovIbALcCzZdbIrAYAl20Q4UuPhsanxWYavobkpNN3HQk2y5LFYiHRSBS ehf1p+Jgc0sAGqjc8yvSO+3oraAaClQasbIpc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=qlMfStcTfCuihXhCLkM5pyiMEqSaf2b8SvN0kqGUdcPifJefs5NoD/P1D56fOk87CA 95h/ElXTLoY/7ApRT0qGxV2swv75t+aVciC9HzBCYP+YssOQ2RneOMAvOviO1KNpHhMi KG0malydllbgB8AruicOgJBFPvEqhgw6Fker8= Received: by 10.181.18.2 with SMTP id v2mr450014bki.194.1225927601423; Wed, 05 Nov 2008 15:26:41 -0800 (PST) Received: by 10.181.225.15 with HTTP; Wed, 5 Nov 2008 15:26:41 -0800 (PST) Message-ID: <9bbcef730811051526p3a978848uf904a149cb81fbce@mail.gmail.com> Date: Thu, 6 Nov 2008 00:26:41 +0100 From: "Ivan Voras" To: "M. Warner Losh" In-Reply-To: <20081105.150108.1649771743.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811051508.mA5F89XD030040@svn.freebsd.org> <20081105.150108.1649771743.imp@bsdimp.com> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, des@freebsd.org Subject: Re: svn commit: r184691 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 23:26:44 -0000 2008/11/5 M. Warner Losh : > In message: <200811051508.mA5F89XD030040@svn.freebsd.org> > Dag-Erling Smorgrav writes: > : utf-8 > > Is there some reason to prefer utf-8 over the 8-bit iso character set > we were using? Reason? You mean you actually *like* 8-bit code pages in the first place? :) As a person from a country that has during its history decided it really needs 3-4 dots and dashes in its alphabet that make it (the alphabet) not representable in ASCII, and who has had Many Fun Days converting between various 8-bit code pages, ISO standard or not, and especially with deducing which code page is actually being used as all bytes are created equal (and Microsoft just *had* to tweak two letters from iso8859-2 into Latin2), I welcome UTF-8 with a warm room, a beer, peanuts and a backrub. UTF-8 (as opposed to old 8-bit code pages which need to die as soon as possible and UTF-16 which got itself messed up with endianess) in unambiguous. A sequence of proper UTF-8 bytes (and UTF-8 has a structure so not every random collection of bytes with the 8th bit set is proper UTF-8) can always be linked to the same letter. This is why there's such a big push to get systems to properly support UTF-8. FreeBSD had a SoC project this year that was supposed to properly implement Unicode collations (and thus collation of UTF-8 strings) but it looks dead or in a dormant state right now (though I didn't follow it attentively). From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 23:38:50 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FC4B10656EA; Wed, 5 Nov 2008 23:38:50 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 51A718FC2E; Wed, 5 Nov 2008 23:38:50 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mA5NbwYN035984; Wed, 5 Nov 2008 16:37:58 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 05 Nov 2008 16:39:11 -0700 (MST) Message-Id: <20081105.163911.420518480.imp@bsdimp.com> To: ivoras@gmail.com From: "M. Warner Losh" In-Reply-To: <9bbcef730811051526p3a978848uf904a149cb81fbce@mail.gmail.com> References: <200811051508.mA5F89XD030040@svn.freebsd.org> <20081105.150108.1649771743.imp@bsdimp.com> <9bbcef730811051526p3a978848uf904a149cb81fbce@mail.gmail.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, des@FreeBSD.org Subject: Re: svn commit: r184691 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 23:38:50 -0000 In message: <9bbcef730811051526p3a978848uf904a149cb81fbce@mail.gmail.com> "Ivan Voras" writes: : 2008/11/5 M. Warner Losh : : > In message: <200811051508.mA5F89XD030040@svn.freebsd.org> : > Dag-Erling Smorgrav writes: : > : utf-8 : > : > Is there some reason to prefer utf-8 over the 8-bit iso character set : > we were using? : : Reason? You mean you actually *like* 8-bit code pages in the first place? :) Liked? Not necessarily. Understood: yes. Just didn't have a clue why the change. : As a person from a country that has during its history decided it : really needs 3-4 dots and dashes in its alphabet that make it (the : alphabet) not representable in ASCII, and who has had Many Fun Days : converting between various 8-bit code pages, ISO standard or not, and : especially with deducing which code page is actually being used as all : bytes are created equal (and Microsoft just *had* to tweak two letters : from iso8859-2 into Latin2), I welcome UTF-8 with a warm room, a beer, : peanuts and a backrub. Hmmmm. peanuts.... : UTF-8 (as opposed to old 8-bit code pages which need to die as soon as : possible and UTF-16 which got itself messed up with endianess) in : unambiguous. A sequence of proper UTF-8 bytes (and UTF-8 has a : structure so not every random collection of bytes with the 8th bit set : is proper UTF-8) can always be linked to the same letter. : : This is why there's such a big push to get systems to properly support : UTF-8. FreeBSD had a SoC project this year that was supposed to : properly implement Unicode collations (and thus collation of UTF-8 : strings) but it looks dead or in a dormant state right now (though I : didn't follow it attentively). That makes sense. Warner From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 04:06:33 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1F9E1065788; Thu, 6 Nov 2008 04:06:33 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id 72F198FC08; Thu, 6 Nov 2008 04:06:33 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from [10.123.2.205] (p53.kientzle.com [66.166.149.53]) by kientzle.com (8.12.9/8.12.9) with ESMTP id mA63U4tv036277; Wed, 5 Nov 2008 19:30:05 -0800 (PST) (envelope-from kientzle@freebsd.org) Message-ID: <491264B8.80602@freebsd.org> Date: Wed, 05 Nov 2008 19:30:00 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "M. Warner Losh" References: <200811051508.mA5F89XD030040@svn.freebsd.org> <20081105.150108.1649771743.imp@bsdimp.com> <9bbcef730811051526p3a978848uf904a149cb81fbce@mail.gmail.com> <20081105.163911.420518480.imp@bsdimp.com> In-Reply-To: <20081105.163911.420518480.imp@bsdimp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, ivoras@gmail.com, des@freebsd.org Subject: Re: svn commit: r184691 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 04:06:33 -0000 > : This is why there's such a big push to get systems to properly support > : UTF-8. FreeBSD had a SoC project this year that was supposed to > : properly implement Unicode collations... > > That makes sense. Yes, UTF-8 is good. More UTF-8, please. Tim From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 04:53:02 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C94DB106567B; Thu, 6 Nov 2008 04:53:02 +0000 (UTC) (envelope-from matteo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6EC18FC1F; Thu, 6 Nov 2008 04:53:02 +0000 (UTC) (envelope-from matteo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA64r2ku045758; Thu, 6 Nov 2008 04:53:02 GMT (envelope-from matteo@svn.freebsd.org) Received: (from matteo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA64r24k045757; Thu, 6 Nov 2008 04:53:02 GMT (envelope-from matteo@svn.freebsd.org) Message-Id: <200811060453.mA64r24k045757@svn.freebsd.org> From: Matteo Riondato Date: Thu, 6 Nov 2008 04:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184706 - head/usr.sbin/cron/crontab X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 04:53:02 -0000 Author: matteo Date: Thu Nov 6 04:53:02 2008 New Revision: 184706 URL: http://svn.freebsd.org/changeset/base/184706 Log: Be paranoid and zero out passwd PR: 122070 Submitted by: Steven Kreuzer Reminded by: gnn@ MFC after: 3 days Modified: head/usr.sbin/cron/crontab/crontab.c Modified: head/usr.sbin/cron/crontab/crontab.c ============================================================================== --- head/usr.sbin/cron/crontab/crontab.c Thu Nov 6 04:51:09 2008 (r184705) +++ head/usr.sbin/cron/crontab/crontab.c Thu Nov 6 04:53:02 2008 (r184706) @@ -138,6 +138,7 @@ parse_args(argc, argv) if (!(pw = getpwuid(getuid()))) errx(ERROR_EXIT, "your UID isn't in the passwd file, bailing out"); + bzero(pw->pw_passwd, strlen(pw->pw_passwd)); (void) strncpy(User, pw->pw_name, (sizeof User)-1); User[(sizeof User)-1] = '\0'; strcpy(RealUser, User); @@ -154,6 +155,7 @@ parse_args(argc, argv) errx(ERROR_EXIT, "must be privileged to use -u"); if (!(pw = getpwnam(optarg))) errx(ERROR_EXIT, "user `%s' unknown", optarg); + bzero(pw->pw_passwd, strlen(pw->pw_passwd)); (void) strncpy(User, pw->pw_name, (sizeof User)-1); User[(sizeof User)-1] = '\0'; break; From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 08:55:47 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 432741065673; Thu, 6 Nov 2008 08:55:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 325978FC1A; Thu, 6 Nov 2008 08:55:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA68tk96050031; Thu, 6 Nov 2008 08:55:46 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA68tklS050030; Thu, 6 Nov 2008 08:55:46 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811060855.mA68tklS050030@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2008 08:55:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184708 - head/sys/dev/an X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 08:55:47 -0000 Author: bz Date: Thu Nov 6 08:55:46 2008 New Revision: 184708 URL: http://svn.freebsd.org/changeset/base/184708 Log: In case INET is not defined, then ANCACHE is not defined and the sc does not have 'an_have_rssimap' variable. Add an ANCACHE check to poperly hide the case and make an(4) compile without INET. MFC after: 2 months Modified: head/sys/dev/an/if_an.c Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Thu Nov 6 06:14:25 2008 (r184707) +++ head/sys/dev/an/if_an.c Thu Nov 6 08:55:46 2008 (r184708) @@ -2686,8 +2686,10 @@ an_init(void *xsc) } } +#ifdef ANCACHE if (sc->an_have_rssimap) sc->an_config.an_rxmode |= AN_RXMODE_NORMALIZED_RSSI; +#endif /* Set the ssid list */ sc->an_ssidlist.an_type = AN_RID_SSIDLIST; From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 09:07:56 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F817106567F; Thu, 6 Nov 2008 09:07:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E7838FC2E; Thu, 6 Nov 2008 09:07:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA697uZF050299; Thu, 6 Nov 2008 09:07:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA697ue4050298; Thu, 6 Nov 2008 09:07:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811060907.mA697ue4050298@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2008 09:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184709 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 09:07:56 -0000 Author: bz Date: Thu Nov 6 09:07:56 2008 New Revision: 184709 URL: http://svn.freebsd.org/changeset/base/184709 Log: Hide an unused variable in case we compile without INET. Include ethernet.h directly so that the constants are always defined. Makes fddi compile without INET. MFC after: 2 months Modified: head/sys/net/if_fddisubr.c Modified: head/sys/net/if_fddisubr.c ============================================================================== --- head/sys/net/if_fddisubr.c Thu Nov 6 08:55:46 2008 (r184708) +++ head/sys/net/if_fddisubr.c Thu Nov 6 09:07:56 2008 (r184709) @@ -56,6 +56,7 @@ #include #include +#include #include #include #include @@ -695,7 +696,9 @@ fddi_resolvemulti(ifp, llsa, sa) struct sockaddr *sa; { struct sockaddr_dl *sdl; +#ifdef INET struct sockaddr_in *sin; +#endif #ifdef INET6 struct sockaddr_in6 *sin6; #endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 09:18:30 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 331F61065690; Thu, 6 Nov 2008 09:18:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 222908FC13; Thu, 6 Nov 2008 09:18:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA69IUHl050551; Thu, 6 Nov 2008 09:18:30 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA69ITMR050550; Thu, 6 Nov 2008 09:18:29 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811060918.mA69ITMR050550@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2008 09:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184710 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 09:18:30 -0000 Author: bz Date: Thu Nov 6 09:18:29 2008 New Revision: 184710 URL: http://svn.freebsd.org/changeset/base/184710 Log: Hide an unused variable in case we compile without INET. Include ethernet.h and if_arp.h directly so that the constants are always defined. Makes token compile without INET. MFC after: 2 months Modified: head/sys/net/if_iso88025subr.c Modified: head/sys/net/if_iso88025subr.c ============================================================================== --- head/sys/net/if_iso88025subr.c Thu Nov 6 09:07:56 2008 (r184709) +++ head/sys/net/if_iso88025subr.c Thu Nov 6 09:18:29 2008 (r184710) @@ -55,10 +55,12 @@ #include #include +#include #include #include #include +#include #include #include #include @@ -695,7 +697,9 @@ iso88025_resolvemulti (ifp, llsa, sa) struct sockaddr *sa; { struct sockaddr_dl *sdl; +#ifdef INET struct sockaddr_in *sin; +#endif #ifdef INET6 struct sockaddr_in6 *sin6; #endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 09:27:47 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A105E1065670; Thu, 6 Nov 2008 09:27:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 900F98FC1E; Thu, 6 Nov 2008 09:27:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA69Rlho050753; Thu, 6 Nov 2008 09:27:47 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA69RlEd050752; Thu, 6 Nov 2008 09:27:47 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811060927.mA69RlEd050752@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2008 09:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184711 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 09:27:47 -0000 Author: bz Date: Thu Nov 6 09:27:47 2008 New Revision: 184711 URL: http://svn.freebsd.org/changeset/base/184711 Log: Check for INET not AF_INET in #ifdef. Makes it compile without INET. MFC after: 2 months Modified: head/sys/net/if_fwsubr.c Modified: head/sys/net/if_fwsubr.c ============================================================================== --- head/sys/net/if_fwsubr.c Thu Nov 6 09:18:29 2008 (r184710) +++ head/sys/net/if_fwsubr.c Thu Nov 6 09:27:47 2008 (r184711) @@ -136,7 +136,7 @@ firewire_output(struct ifnet *ifp, struc } switch (dst->sa_family) { -#ifdef AF_INET +#ifdef INET case AF_INET: /* * Only bother with arp for unicast. Allocation of From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 09:31:17 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83AAC106567F; Thu, 6 Nov 2008 09:31:17 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 3CA9B8FC13; Thu, 6 Nov 2008 09:31:17 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id DE96A6D43F; Thu, 6 Nov 2008 09:31:15 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id C49B38442C; Thu, 6 Nov 2008 10:31:15 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Doug Rabson References: <200811031038.mA3Ac0UR064387@svn.freebsd.org> Date: Thu, 06 Nov 2008 10:31:15 +0100 In-Reply-To: <200811031038.mA3Ac0UR064387@svn.freebsd.org> (Doug Rabson's message of "Mon, 3 Nov 2008 10:38:00 +0000 (UTC)") Message-ID: <868wrx5hgc.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: 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/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 09:31:17 -0000 Doug Rabson writes: > Log: > Implement support for RPCSEC_GSS authentication to both the NFS client > and server. This replaces the RPC implementation of the NFS client and > server with the newer RPC implementation originally developed > (actually ported from the userland sunrpc code) to support the NFS > Lock Manager. I have tested this code extensively and I believe it is > stable and that performance is at least equal to the legacy RPC > implementation. I wonder how much you *did* test. The nfsserver module won't load: Nov 6 10:00:14 ds4 kernel: link_elf_obj: symbol svcpool_create undefined Nov 6 10:00:14 ds4 kernel: kldload: /boot/ds4/nfsserver.ko: Unsupported fi= le type svcpool_create is apparently part of the krpc module: des@ds4 ~% gfk \^svcpool_create=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 src/sys/rpc/svc.c: svcpool_create(const char *name, struct sysctl_oid_list = *sysctl_base) des@ds4 ~% grep -wF svc.c /sys/conf/files* /sys/conf/files:rpc/svc.c optional krpc | nfslockd | nfsserver des@ds4 ~% find /sys/modules -name Makefile | xargs grep -wF svc.c /sys/modules/krpc/Makefile: svc.c \ so the nfsserver module lacks a dependency on the krpc module, but that doesn't matter, because the krpc module won't load either: Nov 6 10:02:10 ds4 kernel: link_elf_obj: symbol replay_setreply undefined Nov 6 10:02:10 ds4 kernel: kldload: /boot/ds4/krpc.ko: Unsupported file ty= pe replay_setreply is not part of any module: des@ds4 ~% gfk \^replay_setreply=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 src/sys/rpc/replay.c: replay_setreply(struct replay_cache *rc, des@ds4 ~% grep -wF replay.c /sys/conf/files* /sys/conf/files:rpc/replay.c optional krpc | nfslockd | nfsserver des@ds4 ~% find /sys/modules -name Makefile | xargs grep -wF replay.c DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 09:32:03 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFD8B1065670; Thu, 6 Nov 2008 09:32:03 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id AA0908FC29; Thu, 6 Nov 2008 09:32:03 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 0824A6D44C; Thu, 6 Nov 2008 09:32:03 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id E6EDC8444A; Thu, 6 Nov 2008 10:32:02 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "M. Warner Losh" References: <200811040231.mA42V4EQ083516@svn.freebsd.org> <86skq6gxtn.fsf@ds4.des.no> <20081105.144840.-432836001.imp@bsdimp.com> Date: Thu, 06 Nov 2008 10:32:02 +0100 In-Reply-To: <20081105.144840.-432836001.imp@bsdimp.com> (M. Warner Losh's message of "Wed, 05 Nov 2008 14:48:40 -0700 (MST)") Message-ID: <864p2l5hf1.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, alfred@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: 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... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 09:32:04 -0000 "M. Warner Losh" writes: > Dag-Erling_Sm=C3=B8rgrav writes: > > It looks like whoever wrote this went out of their way to find new and > > creative ways to break just about every style rule we have. > Not just coding style, but also style of /dev entries, the modules > style, etc. So the question is, why was this code imported at all? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 09:41:32 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11A63106567E; Thu, 6 Nov 2008 09:41:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00B9E8FC08; Thu, 6 Nov 2008 09:41:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA69fVsN051031; Thu, 6 Nov 2008 09:41:31 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA69fV1U051030; Thu, 6 Nov 2008 09:41:31 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811060941.mA69fV1U051030@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2008 09:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184712 - head/sys/dev/en X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 09:41:32 -0000 Author: bz Date: Thu Nov 6 09:41:31 2008 New Revision: 184712 URL: http://svn.freebsd.org/changeset/base/184712 Log: Hide an unused variable in case we compile with neither INET nor INET6. NATM needs 'struct in_addr' to compile, which is a problem on its own but include in.h for now if we have NATM but neither INET or INET6. MFC after: 2 months Modified: head/sys/dev/en/midway.c Modified: head/sys/dev/en/midway.c ============================================================================== --- head/sys/dev/en/midway.c Thu Nov 6 09:27:47 2008 (r184711) +++ head/sys/dev/en/midway.c Thu Nov 6 09:41:31 2008 (r184712) @@ -141,10 +141,12 @@ enum { #include #include -#if defined(INET) || defined(INET6) +#if defined(NATM) || defined(INET) || defined(INET6) #include +#if defined(INET) || defined(INET6) #include #endif +#endif #ifdef NATM #include @@ -1524,7 +1526,9 @@ static int en_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct en_softc *sc = (struct en_softc *)ifp->if_softc; +#if defined(INET) || defined(INET6) struct ifaddr *ifa = (struct ifaddr *)data; +#endif struct ifreq *ifr = (struct ifreq *)data; struct atmio_vcctable *vtab; int error = 0; From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 09:53:00 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 152DD106567E; Thu, 6 Nov 2008 09:53:00 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 75BC98FC14; Thu, 6 Nov 2008 09:52:59 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 92FEB6D43F; Thu, 6 Nov 2008 09:52:58 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 75E1A8443F; Thu, 6 Nov 2008 10:52:58 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "M. Warner Losh" References: <200811051508.mA5F89XD030040@svn.freebsd.org> <20081105.150108.1649771743.imp@bsdimp.com> Date: Thu, 06 Nov 2008 10:52:58 +0100 In-Reply-To: <20081105.150108.1649771743.imp@bsdimp.com> (M. Warner Losh's message of "Wed, 05 Nov 2008 15:01:08 -0700 (MST)") Message-ID: <86iqr141vp.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184691 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 09:53:00 -0000 "M. Warner Losh" writes: > Is there some reason to prefer utf-8 over the 8-bit iso character set > we were using? Respect for people whose names can't be spelled using ISO-8859-1. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 10:11:56 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id C797C1065698; Thu, 6 Nov 2008 10:11:56 +0000 (UTC) Date: Thu, 6 Nov 2008 10:11:56 +0000 From: Alexey Dokuchaev To: Dag-Erling Sm??rgrav Message-ID: <20081106101156.GA40311@FreeBSD.org> References: <200811040231.mA42V4EQ083516@svn.freebsd.org> <86skq6gxtn.fsf@ds4.des.no> <20081105.144840.-432836001.imp@bsdimp.com> <864p2l5hf1.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <864p2l5hf1.fsf@ds4.des.no> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, alfred@FreeBSD.org, "M. Warner Losh" , src-committers@FreeBSD.org Subject: Re: 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... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 10:11:56 -0000 On Thu, Nov 06, 2008 at 10:32:02AM +0100, Dag-Erling Sm??rgrav wrote: > "M. Warner Losh" writes: > > Dag-Erling_Sm??rgrav writes: > > > It looks like whoever wrote this went out of their way to find new and > > > creative ways to break just about every style rule we have. > > Not just coding style, but also style of /dev entries, the modules > > style, etc. > > So the question is, why was this code imported at all? Seconded, especially since it says the code was reviewed by you Warner in the commit log. ./danfe From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 10:17:58 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 271EB106567C; Thu, 6 Nov 2008 10:17:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 161438FC19; Thu, 6 Nov 2008 10:17:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6AHvtO051811; Thu, 6 Nov 2008 10:17:57 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6AHv91051810; Thu, 6 Nov 2008 10:17:57 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811061017.mA6AHv91051810@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2008 10:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184714 - head/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 10:17:58 -0000 Author: bz Date: Thu Nov 6 10:17:57 2008 New Revision: 184714 URL: http://svn.freebsd.org/changeset/base/184714 Log: Hide AF_INET specific ioctl handling under #ifdef INET. Reviewed by: kmacy MFC after: 2 months Modified: head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Thu Nov 6 09:59:57 2008 (r184713) +++ head/sys/dev/cxgb/cxgb_main.c Thu Nov 6 10:17:57 2008 (r184714) @@ -1931,7 +1931,9 @@ static int cxgb_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data) { struct port_info *p = ifp->if_softc; +#ifdef INET struct ifaddr *ifa = (struct ifaddr *)data; +#endif struct ifreq *ifr = (struct ifreq *)data; int flags, error = 0, reinit = 0; uint32_t mask; @@ -1944,6 +1946,7 @@ cxgb_ioctl(struct ifnet *ifp, unsigned l error = cxgb_set_mtu(p, ifr->ifr_mtu); break; case SIOCSIFADDR: +#ifdef INET if (ifa->ifa_addr->sa_family == AF_INET) { ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { @@ -1953,6 +1956,7 @@ cxgb_ioctl(struct ifnet *ifp, unsigned l } arp_ifinit(ifp, ifa); } else +#endif error = ether_ioctl(ifp, command, data); break; case SIOCSIFFLAGS: From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 10:35:47 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CEA5106567E; Thu, 6 Nov 2008 10:35:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C5AD8FC18; Thu, 6 Nov 2008 10:35:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6AZkbF053373; Thu, 6 Nov 2008 10:35:46 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6AZkPH053372; Thu, 6 Nov 2008 10:35:46 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811061035.mA6AZkPH053372@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2008 10:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184715 - head/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 10:35:47 -0000 Author: bz Date: Thu Nov 6 10:35:46 2008 New Revision: 184715 URL: http://svn.freebsd.org/changeset/base/184715 Log: For now our LRO code (tcp_lro.c) only supports IPv4 properly thus only enable if INET is on. Reviewed by: kmacy MFC after: 2 months Modified: head/sys/dev/cxgb/cxgb_osdep.h Modified: head/sys/dev/cxgb/cxgb_osdep.h ============================================================================== --- head/sys/dev/cxgb/cxgb_osdep.h Thu Nov 6 10:17:57 2008 (r184714) +++ head/sys/dev/cxgb/cxgb_osdep.h Thu Nov 6 10:35:46 2008 (r184715) @@ -110,7 +110,10 @@ struct t3_mbuf_hdr { #endif #if __FreeBSD_version >= 701000 +#include "opt_inet.h" +#ifdef INET #define LRO_SUPPORTED +#endif #define TOE_SUPPORTED #endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 10:53:36 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 148E91065675; Thu, 6 Nov 2008 10:53:36 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 033E48FC25; Thu, 6 Nov 2008 10:53:36 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6ArZ9B053714; Thu, 6 Nov 2008 10:53:35 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6ArZri053711; Thu, 6 Nov 2008 10:53:35 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200811061053.mA6ArZri053711@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 6 Nov 2008 10:53:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184716 - in head/sys: modules/krpc modules/nfsserver nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 10:53:36 -0000 Author: des Date: Thu Nov 6 10:53:35 2008 New Revision: 184716 URL: http://svn.freebsd.org/changeset/base/184716 Log: Unbreak NFS. Pointy hat to: dfr Modified: head/sys/modules/krpc/Makefile head/sys/modules/nfsserver/Makefile head/sys/nfsserver/nfs_srvsubs.c Modified: head/sys/modules/krpc/Makefile ============================================================================== --- head/sys/modules/krpc/Makefile Thu Nov 6 10:35:46 2008 (r184715) +++ head/sys/modules/krpc/Makefile Thu Nov 6 10:53:35 2008 (r184716) @@ -16,6 +16,7 @@ SRCS= auth_none.c \ rpc_prot.c \ rpcb_clnt.c \ rpcb_prot.c \ + replay.c \ svc.c \ svc_auth.c \ svc_auth_unix.c \ Modified: head/sys/modules/nfsserver/Makefile ============================================================================== --- head/sys/modules/nfsserver/Makefile Thu Nov 6 10:35:46 2008 (r184715) +++ head/sys/modules/nfsserver/Makefile Thu Nov 6 10:53:35 2008 (r184716) @@ -3,8 +3,8 @@ .PATH: ${.CURDIR}/../../nfsserver ${.CURDIR}/../../nfs KMOD= nfsserver SRCS= vnode_if.h \ - nfs_serv.c nfs_srvkrpc.c nfs_srvsock.c nfs_srvcache.c nfs_srvsubs.c \ - nfs_syscalls.c nfs_common.c \ + nfs_fha.c nfs_serv.c nfs_srvkrpc.c nfs_srvsock.c nfs_srvcache.c \ + nfs_srvsubs.c nfs_syscalls.c nfs_common.c \ opt_mac.h \ opt_nfs.h SRCS+= opt_inet6.h Modified: head/sys/nfsserver/nfs_srvsubs.c ============================================================================== --- head/sys/nfsserver/nfs_srvsubs.c Thu Nov 6 10:35:46 2008 (r184715) +++ head/sys/nfsserver/nfs_srvsubs.c Thu Nov 6 10:53:35 2008 (r184716) @@ -596,6 +596,7 @@ DECLARE_MODULE(nfsserver, nfsserver_mod, /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(nfsserver, 1); +MODULE_DEPEND(nfsserver, krpc, 1, 1, 1); /* * Set up nameidata for a lookup() call and do it. From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 11:00:57 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71389106567C; Thu, 6 Nov 2008 11:00:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 608F08FC3A; Thu, 6 Nov 2008 11:00:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6B0v7x053897; Thu, 6 Nov 2008 11:00:57 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6B0vjg053896; Thu, 6 Nov 2008 11:00:57 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811061100.mA6B0vjg053896@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2008 11:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184717 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 11:00:57 -0000 Author: bz Date: Thu Nov 6 11:00:57 2008 New Revision: 184717 URL: http://svn.freebsd.org/changeset/base/184717 Log: Hide AF_INET specific ioctl handling under #ifdef INET. MFC after: 2 months Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Nov 6 10:53:35 2008 (r184716) +++ head/sys/dev/e1000/if_em.c Thu Nov 6 11:00:57 2008 (r184717) @@ -34,6 +34,7 @@ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" +#include "opt_inet.h" #endif #include @@ -1033,7 +1034,9 @@ em_ioctl(struct ifnet *ifp, u_long comma { struct adapter *adapter = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; +#ifdef INET struct ifaddr *ifa = (struct ifaddr *)data; +#endif int error = 0; if (adapter->in_detach) @@ -1041,6 +1044,7 @@ em_ioctl(struct ifnet *ifp, u_long comma switch (command) { case SIOCSIFADDR: +#ifdef INET if (ifa->ifa_addr->sa_family == AF_INET) { /* * XXX @@ -1057,6 +1061,7 @@ em_ioctl(struct ifnet *ifp, u_long comma } arp_ifinit(ifp, ifa); } else +#endif error = ether_ioctl(ifp, command, data); break; case SIOCSIFMTU: From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 11:11:25 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3095106567C; Thu, 6 Nov 2008 11:11:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A21198FC13; Thu, 6 Nov 2008 11:11:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6BBPSb054103; Thu, 6 Nov 2008 11:11:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6BBPgS054102; Thu, 6 Nov 2008 11:11:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811061111.mA6BBPgS054102@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2008 11:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184718 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 11:11:25 -0000 Author: bz Date: Thu Nov 6 11:11:25 2008 New Revision: 184718 URL: http://svn.freebsd.org/changeset/base/184718 Log: Hide AF_INET specific ioctl handling under #ifdef INET. MFC after: 2 months Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Thu Nov 6 11:00:57 2008 (r184717) +++ head/sys/dev/e1000/if_igb.c Thu Nov 6 11:11:25 2008 (r184718) @@ -34,6 +34,7 @@ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" +#include "opt_inet.h" #endif #include @@ -802,7 +803,9 @@ igb_ioctl(struct ifnet *ifp, u_long comm { struct adapter *adapter = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; +#ifdef INET struct ifaddr *ifa = (struct ifaddr *)data; +#endif int error = 0; if (adapter->in_detach) @@ -810,6 +813,7 @@ igb_ioctl(struct ifnet *ifp, u_long comm switch (command) { case SIOCSIFADDR: +#ifdef INET if (ifa->ifa_addr->sa_family == AF_INET) { /* * XXX @@ -826,6 +830,7 @@ igb_ioctl(struct ifnet *ifp, u_long comm } arp_ifinit(ifp, ifa); } else +#endif error = ether_ioctl(ifp, command, data); break; case SIOCSIFMTU: From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 11:43:49 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAA5F1065670; Thu, 6 Nov 2008 11:43:49 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F3E08FC1B; Thu, 6 Nov 2008 11:43:49 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6BhncL054679; Thu, 6 Nov 2008 11:43:49 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6BhnnZ054678; Thu, 6 Nov 2008 11:43:49 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811061143.mA6BhnnZ054678@svn.freebsd.org> From: Doug Rabson Date: Thu, 6 Nov 2008 11:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184719 - head/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 11:43:50 -0000 Author: dfr Date: Thu Nov 6 11:43:49 2008 New Revision: 184719 URL: http://svn.freebsd.org/changeset/base/184719 Log: Don't depend on krpc.ko in the NFS_LEGACYRPC case. Modified: head/sys/nfsserver/nfs_srvsubs.c Modified: head/sys/nfsserver/nfs_srvsubs.c ============================================================================== --- head/sys/nfsserver/nfs_srvsubs.c Thu Nov 6 11:11:25 2008 (r184718) +++ head/sys/nfsserver/nfs_srvsubs.c Thu Nov 6 11:43:49 2008 (r184719) @@ -596,7 +596,9 @@ DECLARE_MODULE(nfsserver, nfsserver_mod, /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(nfsserver, 1); +#ifndef NFS_LEGACYRPC MODULE_DEPEND(nfsserver, krpc, 1, 1, 1); +#endif /* * Set up nameidata for a lookup() call and do it. From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 12:33:33 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B537106568F; Thu, 6 Nov 2008 12:33:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AEEE8FC08; Thu, 6 Nov 2008 12:33:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6CXXuV055644; Thu, 6 Nov 2008 12:33:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6CXXCb055643; Thu, 6 Nov 2008 12:33:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811061233.mA6CXXCb055643@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2008 12:33:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184720 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 12:33:33 -0000 Author: bz Date: Thu Nov 6 12:33:33 2008 New Revision: 184720 URL: http://svn.freebsd.org/changeset/base/184720 Log: Fix a bug introduced with r182851 splitting tcp_mss() into tcp_mss() and tcp_mss_update() so that tcp_mtudisc() could re-use the same code. In case we return early and got a metricptr to pass the hostcache info back to the caller we need to initialize the data to a defined state (zero it) as tcp_hc_get() would do if there was no hit. Without that the caller would check on random stack garbage which could lead to undefined results. This only affected tcp_mss() if there was no routing entry for the peer, tcp_mtudisc() was not affected. MFC after: 2 months (along with r182851) Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Nov 6 11:43:49 2008 (r184719) +++ head/sys/netinet/tcp_input.c Thu Nov 6 12:33:33 2008 (r184720) @@ -2847,8 +2847,16 @@ tcp_mss_update(struct tcpcb *tp, int off /* * No route to sender, stay with default mss and return. */ - if (maxmtu == 0) + if (maxmtu == 0) { + /* + * In case we return early we need to intialize metrics + * to a defined state as tcp_hc_get() would do for us + * if there was no cache hit. + */ + if (metricptr != NULL) + bzero(metricptr, sizeof(struct hc_metrics_lite)); return; + } /* Check the interface for TSO capabilities. */ if (mtuflags & CSUM_TSO) From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 12:59:00 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C92341065672; Thu, 6 Nov 2008 12:59:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B89568FC16; Thu, 6 Nov 2008 12:59:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6Cx0te056107; Thu, 6 Nov 2008 12:59:00 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6Cx0YK056106; Thu, 6 Nov 2008 12:59:00 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811061259.mA6Cx0YK056106@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2008 12:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184721 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 12:59:00 -0000 Author: bz Date: Thu Nov 6 12:59:00 2008 New Revision: 184721 URL: http://svn.freebsd.org/changeset/base/184721 Log: Adopt the comment for tcp_maxmtu(); we are returning a number not a pointer. While here update the rest of the comment to better match what we have these days. MFC after: 2 months Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Nov 6 12:33:33 2008 (r184720) +++ head/sys/netinet/tcp_subr.c Thu Nov 6 12:59:00 2008 (r184721) @@ -1584,9 +1584,9 @@ tcp_mtudisc(struct inpcb *inp, int errno /* * Look-up the routing entry to the peer of this inpcb. If no route - * is found and it cannot be allocated, then return NULL. This routine - * is called by TCP routines that access the rmx structure and by tcp_mss - * to get the interface MTU. + * is found and it cannot be allocated, then return 0. This routine + * is called by TCP routines that access the rmx structure and by + * tcp_mss_update to get the peer/interface MTU. */ u_long tcp_maxmtu(struct in_conninfo *inc, int *flags) From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 13:26:00 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E45CF1065679; Thu, 6 Nov 2008 13:25:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D32BA8FC40; Thu, 6 Nov 2008 13:25:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6DPx33056621; Thu, 6 Nov 2008 13:25:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6DPxDW056618; Thu, 6 Nov 2008 13:25:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811061325.mA6DPxDW056618@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2008 13:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184722 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 13:26:00 -0000 Author: bz Date: Thu Nov 6 13:25:59 2008 New Revision: 184722 URL: http://svn.freebsd.org/changeset/base/184722 Log: Fix a bug introduced with r182851 splitting tcp_mss() into tcp_mss() and tcp_mss_update() so that tcp_mtudisc() could re-use the same code. Move the TSO logic back to tcp_mss() and out of tcp_mss_update(). We tried to avoid that initially but if were are called from tcp_output() with EMSGSIZE, we cleared the TSO flag on the tcpcb there, called into tcp_mtudisc() and tcp_mss_update() which then would reenable TSO on the tcpcb based on TSO capabilities of the interface as learnt in tcp_maxmtu/6(). So if TSO was enabled on the (possibly new) outgoing interface it was turned back on, which lead to an endless loop between tcp_output() and tcp_mtudisc() until we overflew the stack. Reported by: kmacy MFC after: 2 months (along with r182851) Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Nov 6 12:59:00 2008 (r184721) +++ head/sys/netinet/tcp_input.c Thu Nov 6 13:25:59 2008 (r184722) @@ -2812,7 +2812,8 @@ tcp_xmit_timer(struct tcpcb *tp, int rtt * segment. Outgoing SYN/ACK MSS settings are handled in tcp_mssopt(). */ void -tcp_mss_update(struct tcpcb *tp, int offer, struct hc_metrics_lite *metricptr) +tcp_mss_update(struct tcpcb *tp, int offer, + struct hc_metrics_lite *metricptr, int *mtuflags) { INIT_VNET_INET(tp->t_inpcb->inp_vnet); int mss; @@ -2820,7 +2821,6 @@ tcp_mss_update(struct tcpcb *tp, int off struct inpcb *inp = tp->t_inpcb; struct hc_metrics_lite metrics; int origoffer = offer; - int mtuflags = 0; #ifdef INET6 int isipv6 = ((inp->inp_vflag & INP_IPV6) != 0) ? 1 : 0; size_t min_protoh = isipv6 ? @@ -2835,12 +2835,12 @@ tcp_mss_update(struct tcpcb *tp, int off /* Initialize. */ #ifdef INET6 if (isipv6) { - maxmtu = tcp_maxmtu6(&inp->inp_inc, &mtuflags); + maxmtu = tcp_maxmtu6(&inp->inp_inc, mtuflags); tp->t_maxopd = tp->t_maxseg = V_tcp_v6mssdflt; } else #endif { - maxmtu = tcp_maxmtu(&inp->inp_inc, &mtuflags); + maxmtu = tcp_maxmtu(&inp->inp_inc, mtuflags); tp->t_maxopd = tp->t_maxseg = V_tcp_mssdflt; } @@ -2858,10 +2858,6 @@ tcp_mss_update(struct tcpcb *tp, int off return; } - /* Check the interface for TSO capabilities. */ - if (mtuflags & CSUM_TSO) - tp->t_flags |= TF_TSO; - /* What have we got? */ switch (offer) { case 0: @@ -2980,12 +2976,13 @@ tcp_mss(struct tcpcb *tp, int offer) struct inpcb *inp; struct socket *so; struct hc_metrics_lite metrics; + int mtuflags = 0; #ifdef INET6 int isipv6; #endif KASSERT(tp != NULL, ("%s: tp == NULL", __func__)); - tcp_mss_update(tp, offer, &metrics); + tcp_mss_update(tp, offer, &metrics, &mtuflags); mss = tp->t_maxseg; inp = tp->t_inpcb; @@ -3098,6 +3095,10 @@ tcp_mss(struct tcpcb *tp, int offer) tp->snd_cwnd = mss * V_ss_fltsz_local; else tp->snd_cwnd = mss * V_ss_fltsz; + + /* Check the interface for TSO capabilities. */ + if (mtuflags & CSUM_TSO) + tp->t_flags |= TF_TSO; } /* Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Nov 6 12:59:00 2008 (r184721) +++ head/sys/netinet/tcp_subr.c Thu Nov 6 13:25:59 2008 (r184722) @@ -1562,7 +1562,7 @@ tcp_mtudisc(struct inpcb *inp, int errno tp = intotcpcb(inp); KASSERT(tp != NULL, ("tcp_mtudisc: tp == NULL")); - tcp_mss_update(tp, -1, NULL); + tcp_mss_update(tp, -1, NULL, NULL); so = inp->inp_socket; SOCKBUF_LOCK(&so->so_snd); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Thu Nov 6 12:59:00 2008 (r184721) +++ head/sys/netinet/tcp_var.h Thu Nov 6 13:25:59 2008 (r184722) @@ -546,7 +546,7 @@ void tcp_reass_init(void); void tcp_input(struct mbuf *, int); u_long tcp_maxmtu(struct in_conninfo *, int *); u_long tcp_maxmtu6(struct in_conninfo *, int *); -void tcp_mss_update(struct tcpcb *, int, struct hc_metrics_lite *); +void tcp_mss_update(struct tcpcb *, int, struct hc_metrics_lite *, int *); void tcp_mss(struct tcpcb *, int); int tcp_mssopt(struct in_conninfo *); struct inpcb * From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 13:28:50 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADC3B1065675; Thu, 6 Nov 2008 13:28:50 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BCDE8FC14; Thu, 6 Nov 2008 13:28:50 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6DSoVf056706; Thu, 6 Nov 2008 13:28:50 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6DSonm056705; Thu, 6 Nov 2008 13:28:50 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200811061328.mA6DSonm056705@svn.freebsd.org> From: Ken Smith Date: Thu, 6 Nov 2008 13:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184723 - stable/7/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 13:28:50 -0000 Author: kensmith Date: Thu Nov 6 13:28:50 2008 New Revision: 184723 URL: http://svn.freebsd.org/changeset/base/184723 Log: Oops. Correct a mis-merge. This piece of r183860 didn't make it through while doing the merge. PR: misc/128610 Submitted by: veron x503 hotmail com Approved by: re (blackend, kib) Modified: stable/7/release/Makefile Modified: stable/7/release/Makefile ============================================================================== --- stable/7/release/Makefile Thu Nov 6 13:25:59 2008 (r184722) +++ stable/7/release/Makefile Thu Nov 6 13:28:50 2008 (r184723) @@ -1091,7 +1091,7 @@ CD_DISC2_PKGS= ${CD_PACKAGE_TREE}/disc2 CD_DISC3_PKGS= ${CD_PACKAGE_TREE}/disc3 .endif .if exists(${CD_PACKAGE_TREE}/dvd1) -CD_DVD_PKGS= ${CD_PACKAGE_TREE}/dvd1 +CD_DVD1_PKGS= ${CD_PACKAGE_TREE}/dvd1 .endif .endif .endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 13:32:49 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67FD610656AD; Thu, 6 Nov 2008 13:32:49 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 564978FC25; Thu, 6 Nov 2008 13:32:49 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6DWnas056805; Thu, 6 Nov 2008 13:32:49 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6DWnN1056804; Thu, 6 Nov 2008 13:32:49 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200811061332.mA6DWnN1056804@svn.freebsd.org> From: Ken Smith Date: Thu, 6 Nov 2008 13:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184724 - stable/6/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 13:32:49 -0000 Author: kensmith Date: Thu Nov 6 13:32:49 2008 New Revision: 184724 URL: http://svn.freebsd.org/changeset/base/184724 Log: Oops. Correct a mis-merge. This piece of r183860 didn't make it through while doing the merge. PR: misc/128610 Submitted by: veron x503 hotmail com Approved by: re (blackend, kib) Modified: stable/6/release/Makefile Modified: stable/6/release/Makefile ============================================================================== --- stable/6/release/Makefile Thu Nov 6 13:28:50 2008 (r184723) +++ stable/6/release/Makefile Thu Nov 6 13:32:49 2008 (r184724) @@ -1109,7 +1109,7 @@ CD_DISC2_PKGS= ${CD_PACKAGE_TREE}/disc2 CD_DISC3_PKGS= ${CD_PACKAGE_TREE}/disc3 .endif .if exists(${CD_PACKAGE_TREE}/dvd1) -CD_DVD_PKGS= ${CD_PACKAGE_TREE}/dvd1 +CD_DVD1_PKGS= ${CD_PACKAGE_TREE}/dvd1 .endif .endif .endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 13:34:49 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D14A0106564A; Thu, 6 Nov 2008 13:34:49 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFEA28FC0A; Thu, 6 Nov 2008 13:34:49 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6DYntG056892; Thu, 6 Nov 2008 13:34:49 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6DYna9056891; Thu, 6 Nov 2008 13:34:49 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200811061334.mA6DYna9056891@svn.freebsd.org> From: Ken Smith Date: Thu, 6 Nov 2008 13:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184725 - releng/6.4/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 13:34:49 -0000 Author: kensmith Date: Thu Nov 6 13:34:49 2008 New Revision: 184725 URL: http://svn.freebsd.org/changeset/base/184725 Log: Oops. Correct a mis-merge. This piece of r183860 didn't make it through while doing the merge. PR: misc/128610 Submitted by: veron x503 hotmail com Approved by: re (blackend, kib) Modified: releng/6.4/release/Makefile Modified: releng/6.4/release/Makefile ============================================================================== --- releng/6.4/release/Makefile Thu Nov 6 13:32:49 2008 (r184724) +++ releng/6.4/release/Makefile Thu Nov 6 13:34:49 2008 (r184725) @@ -1109,7 +1109,7 @@ CD_DISC2_PKGS= ${CD_PACKAGE_TREE}/disc2 CD_DISC3_PKGS= ${CD_PACKAGE_TREE}/disc3 .endif .if exists(${CD_PACKAGE_TREE}/dvd1) -CD_DVD_PKGS= ${CD_PACKAGE_TREE}/dvd1 +CD_DVD1_PKGS= ${CD_PACKAGE_TREE}/dvd1 .endif .endif .endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 13:40:02 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBE231065678; Thu, 6 Nov 2008 13:40:02 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id 8846C8FC17; Thu, 6 Nov 2008 13:40:02 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (pD9E2E681.dip.t-dialin.net [217.226.230.129]) by redbull.bpaserver.net (Postfix) with ESMTP id 7C1922E1FB; Thu, 6 Nov 2008 14:39:57 +0100 (CET) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 3ADE0147FEB; Thu, 6 Nov 2008 14:39:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1225978788; bh=wXgNEDK2hdUrrapNFZCQ9u+Zrl7ryLYRo oq8S8s2fwo=; h=Message-ID:Date:From:To:Cc:Subject:References: In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=rEc0yU37YHGWnHHVDzs0wE5EXjdwqx1zP5qzZBs76Y/B0Pk3WAvHPfjFkuGRpVh8N TUK2thk5XmZSIiueVBwA2srP9v1gFmlYdZDV1YUSYT+dNJOYPMLTYxRAqXOM/rRcrCL Kvmq4ahI8e6Ku2oEzYsxcWEi282e465uYaHpQX7fN8lnotUOHDM3r7QhervmH7nlidx kpNqHWXwHQHbIEgIOkAvifpfGXn3AUSiF9MrHZ8NySreEKl4XPyS0PHn9ZtCEcuoG/o QQf3on9kPLi0t+UbVBB9rRetooYgAkSZsV6ZaqbIrqJeZmz1WmF2fgZ6TuNZkwqk+1X 71dNV5tNQ== Received: (from www@localhost) by webmail.leidinger.net (8.14.2/8.13.8/Submit) id mA6DdlC8047516; Thu, 6 Nov 2008 14:39:47 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Thu, 06 Nov 2008 14:39:47 +0100 Message-ID: <20081106143947.14544np9rgzv5egw@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Thu, 06 Nov 2008 14:39:47 +0100 From: Alexander Leidinger To: Ivan Voras References: <200811051508.mA5F89XD030040@svn.freebsd.org> <20081105.150108.1649771743.imp@bsdimp.com> <9bbcef730811051526p3a978848uf904a149cb81fbce@mail.gmail.com> In-Reply-To: <9bbcef730811051526p3a978848uf904a149cb81fbce@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.3) / FreeBSD-8.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-MailScanner-ID: 7C1922E1FB.5EFEF X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, ORDB-RBL, SpamAssassin (not cached, score=-14.823, required 6, BAYES_00 -15.00, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, RDNS_DYNAMIC 0.10, TW_SV 0.08) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, des@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r184691 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 13:40:03 -0000 Quoting Ivan Voras (from Thu, 6 Nov 2008 00:26:41 +0100): > This is why there's such a big push to get systems to properly support > UTF-8. FreeBSD had a SoC project this year that was supposed to > properly implement Unicode collations (and thus collation of UTF-8 > strings) but it looks dead or in a dormant state right now (though I > didn't follow it attentively). As per the commit log of the ideas list, this is on the way into SVN (soon-ish, I assume). Bye, Alexander. -- http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 13:41:12 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A9D11065676; Thu, 6 Nov 2008 13:41:12 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id 3E84C8FC0A; Thu, 6 Nov 2008 13:41:12 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (pD9E2E681.dip.t-dialin.net [217.226.230.129]) by redbull.bpaserver.net (Postfix) with ESMTP id A8D2E2E1FB; Thu, 6 Nov 2008 14:41:08 +0100 (CET) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id A35CC14801B; Thu, 6 Nov 2008 14:41:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1225978860; bh=nfmwzYa/YeVOB27WdFJZuBxzolhtD4yB9 oycQPYgTo8=; h=Message-ID:Date:From:To:Cc:Subject:References: In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=qTiBS10TpnKa2F77c645JENPYs+12HgPQBfUgw0Aih12B/B+jeCIKghRPs+J6AFH1 f5JZkQK1JYNO0s60otLqo+ya25IsCkt9+2yjAf/Rl6YkfEXRST+dq2+APN9nVinaCTQ uUuxak8J6Ho8Lvsgvm5kzYtk6hh0XkEQVVpmQfnGmpbdeL04/OHTtwi59/3q4rB8/Be vLZLvvUogW8tDL1y22jZSTOKwEPD6XX+Z0N0gssflCftD7ZdQNfZiNUoamWg9mOqmbI 8bfbkltOky4wWuy9aplCpxUmxUoRU9E/uuxZ18I3dFe6ASmHn/8pmGxLtC532wmx5ZJ jq9gHsmNw== Received: (from www@localhost) by webmail.leidinger.net (8.14.2/8.13.8/Submit) id mA6Df0E5047800; Thu, 6 Nov 2008 14:41:00 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Thu, 06 Nov 2008 14:41:00 +0100 Message-ID: <20081106144100.13331xe51kxe0mjo@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Thu, 06 Nov 2008 14:41:00 +0100 From: Alexander Leidinger To: Craig Rodrigues References: <200811051935.mA5JZ9GB035415@svn.freebsd.org> In-Reply-To: <200811051935.mA5JZ9GB035415@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.3) / FreeBSD-8.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-MailScanner-ID: A8D2E2E1FB.93851 X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, ORDB-RBL, SpamAssassin (not cached, score=-14.823, required 6, BAYES_00 -15.00, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, RDNS_DYNAMIC 0.10, TW_SV 0.08) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184696 - in head/cddl: . contrib/opensolaris/cmd/dtrace contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 13:41:12 -0000 Quoting Craig Rodrigues (from Wed, 5 Nov 2008 19:35:09 +0000 (UTC)): > Author: rodrigc > Date: Wed Nov 5 19:35:09 2008 > New Revision: 184696 > URL: http://svn.freebsd.org/changeset/base/184696 > > Log: > Merge latest DTrace changes from Perforce. It would be good to mention what kind of changes are merged. Bye, Alexander. -- Join the Navy; sail to far-off exotic lands, meet exciting interesting people, and kill them. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 13:41:53 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06CE71065673; Thu, 6 Nov 2008 13:41:53 +0000 (UTC) (envelope-from rdivacky@lev.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id AEAC58FC18; Thu, 6 Nov 2008 13:41:51 +0000 (UTC) (envelope-from rdivacky@lev.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 927929CB5D0; Thu, 6 Nov 2008 14:39:22 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UlMvqHCnfVed; Thu, 6 Nov 2008 14:39:17 +0100 (CET) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id E88889CB5DE; Thu, 6 Nov 2008 14:39:16 +0100 (CET) Received: (from rdivacky@localhost) by lev.vlakno.cz (8.14.2/8.14.2/Submit) id mA6DdGtS091394; Thu, 6 Nov 2008 14:39:16 +0100 (CET) (envelope-from rdivacky) Date: Thu, 6 Nov 2008 14:39:16 +0100 From: Roman Divacky To: Alexander Leidinger Message-ID: <20081106133916.GA91328@freebsd.org> References: <200811051508.mA5F89XD030040@svn.freebsd.org> <20081105.150108.1649771743.imp@bsdimp.com> <9bbcef730811051526p3a978848uf904a149cb81fbce@mail.gmail.com> <20081106143947.14544np9rgzv5egw@webmail.leidinger.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081106143947.14544np9rgzv5egw@webmail.leidinger.net> User-Agent: Mutt/1.4.2.3i Cc: src-committers@freebsd.org, Ivan Voras , svn-src-all@freebsd.org, "M. Warner Losh" , svn-src-head@freebsd.org, des@freebsd.org Subject: Re: svn commit: r184691 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 13:41:53 -0000 On Thu, Nov 06, 2008 at 02:39:47PM +0100, Alexander Leidinger wrote: > Quoting Ivan Voras (from Thu, 6 Nov 2008 00:26:41 +0100): > > >This is why there's such a big push to get systems to properly support > >UTF-8. FreeBSD had a SoC project this year that was supposed to > >properly implement Unicode collations (and thus collation of UTF-8 > >strings) but it looks dead or in a dormant state right now (though I > >didn't follow it attentively). > > As per the commit log of the ideas list, this is on the way into SVN > (soon-ish, I assume). Konrad just got his commit bit, I believe he's going to do something with it :) From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 13:49:47 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78558106567C; Thu, 6 Nov 2008 13:49:47 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.189]) by mx1.freebsd.org (Postfix) with ESMTP id 806848FC16; Thu, 6 Nov 2008 13:49:46 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by fk-out-0910.google.com with SMTP id k31so699983fkk.11 for ; Thu, 06 Nov 2008 05:49:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=n9YLazC0hyn34gbuzIhY4T8yy0K5Ds7cHcNdHfhdXqk=; b=PPHA0gyjjZMkJsjFJ1jDNhAsuJ8eHwvjEBmSgd2EubpmgWqHTmDadZ/xmNBWDAIIwS mFn1d4bapw72WKvtzMai/Z27i3UDcSJ1l9nqjCAJf0++cwgyOTtMvb4+WfZKi4anp0JA hVGD+sMsY9Y3wmuPtr7haAbXkeBH55QgdQKMw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=EG3/6V1DaOt48zv43JyT7liWqz76w8bXrX3JzivtYxhufNKo91IvpTaEhOVFagz2Sk eHYBNotNFG9LlOoFwqbMR5x2dLmsoLFC808jfgY2xGp3AnOtu8v/UFbpdLQJTb+gS/Am kVt/GIzafmfdFt/y2GQzapYzbvIm1I0jT7sbI= Received: by 10.181.215.9 with SMTP id s9mr667582bkq.212.1225979385061; Thu, 06 Nov 2008 05:49:45 -0800 (PST) Received: by 10.181.225.15 with HTTP; Thu, 6 Nov 2008 05:49:45 -0800 (PST) Message-ID: <9bbcef730811060549y6f821062kac2572510cfd76d4@mail.gmail.com> Date: Thu, 6 Nov 2008 14:49:45 +0100 From: "Ivan Voras" To: "Roman Divacky" In-Reply-To: <20081106133916.GA91328@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811051508.mA5F89XD030040@svn.freebsd.org> <20081105.150108.1649771743.imp@bsdimp.com> <9bbcef730811051526p3a978848uf904a149cb81fbce@mail.gmail.com> <20081106143947.14544np9rgzv5egw@webmail.leidinger.net> <20081106133916.GA91328@freebsd.org> Cc: svn-src-head@freebsd.org, Alexander Leidinger , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184691 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 13:49:47 -0000 2008/11/6 Roman Divacky : > On Thu, Nov 06, 2008 at 02:39:47PM +0100, Alexander Leidinger wrote: >> Quoting Ivan Voras (from Thu, 6 Nov 2008 00:26:41 +0100): >> >> >This is why there's such a big push to get systems to properly support >> >UTF-8. FreeBSD had a SoC project this year that was supposed to >> >properly implement Unicode collations (and thus collation of UTF-8 >> >strings) but it looks dead or in a dormant state right now (though I >> >didn't follow it attentively). >> >> As per the commit log of the ideas list, this is on the way into SVN >> (soon-ish, I assume). > > Konrad just got his commit bit, I believe he's going to do something > with it :) Excellent news :) If it works it means no more patching PostgreSQL to support my collation! From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 15:21:38 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9767106567D; Thu, 6 Nov 2008 15:21:38 +0000 (UTC) (envelope-from peter@wemm.org) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.28]) by mx1.freebsd.org (Postfix) with ESMTP id 3228C8FC19; Thu, 6 Nov 2008 15:21:37 +0000 (UTC) (envelope-from peter@wemm.org) Received: by yw-out-2324.google.com with SMTP id 9so256088ywe.13 for ; Thu, 06 Nov 2008 07:21:37 -0800 (PST) Received: by 10.142.103.2 with SMTP id a2mr506904wfc.164.1225984897294; Thu, 06 Nov 2008 07:21:37 -0800 (PST) Received: by 10.142.255.21 with HTTP; Thu, 6 Nov 2008 07:21:37 -0800 (PST) Message-ID: Date: Thu, 6 Nov 2008 07:21:37 -0800 From: "Peter Wemm" To: "John Baldwin" In-Reply-To: <200811041750.08355.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811041904.mA4J41dL005103@svn.freebsd.org> <9bbcef730811041422x5f1e7bfco45380390c64b3b1c@mail.gmail.com> <200811041750.08355.jhb@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ivan Voras Subject: Re: svn commit: r184652 - in head/sys: dev/hwpmc fs/procfs kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 15:21:38 -0000 On Tue, Nov 4, 2008 at 2:50 PM, John Baldwin wrote: > On Tuesday 04 November 2008 05:22:47 pm Ivan Voras wrote: >> 2008/11/4 John Baldwin : >> > Author: jhb >> > Date: Tue Nov 4 19:04:01 2008 >> > New Revision: 184652 >> > URL: http://svn.freebsd.org/changeset/base/184652 >> > >> > Log: >> > Remove unnecessary locking around vn_fullpath(). The vnode lock for the >> >> Does this affect realpath(3)? (whose non-scalability is often reported >> for PHP web servers). > > realpath(3) calls getcwd(3) (which devolves to __getcwd(2) I think) once per > invocation (and that already did not lock the vnode). It then calls lstat() > for each component in the path. The lstat() calls should be using shared > locks (at least with the recent changes to use shared lookups for UFS in > HEAD). I imagine the bottleneck is more with lstat() than getcwd(3). > Neither is helped by the specific changes above. Hmm. Would it make sense to provide a helper syscall specifically for php to use for this? Without having looked at the php code, it sounds like it might be helpful to have a syscall that returns the path and an array of stat structs for each path component. Or is php only doing this because of compatability with non-atomic getcwd() implementations? Does php even need to do it? -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 15:26:09 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FF051065687; Thu, 6 Nov 2008 15:26:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EB9C8FC1A; Thu, 6 Nov 2008 15:26:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6FQ9hY058851; Thu, 6 Nov 2008 15:26:09 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6FQ9tR058850; Thu, 6 Nov 2008 15:26:09 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811061526.mA6FQ9tR058850@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2008 15:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184726 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 15:26:09 -0000 Author: bz Date: Thu Nov 6 15:26:09 2008 New Revision: 184726 URL: http://svn.freebsd.org/changeset/base/184726 Log: Include if_arp.h for IFP2AC so that the netgraph parts in if.c are happy even if compiled without INET or INET6. MFC after: 2 months Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Nov 6 13:34:49 2008 (r184725) +++ head/sys/net/if.c Thu Nov 6 15:26:09 2008 (r184726) @@ -60,6 +60,7 @@ #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 15:44:25 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF54B106567A; Thu, 6 Nov 2008 15:44:25 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by mx1.freebsd.org (Postfix) with ESMTP id AD8A28FC1C; Thu, 6 Nov 2008 15:44:24 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so512365fgb.35 for ; Thu, 06 Nov 2008 07:44:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=OdAy+fK41DtNzOvjmwySWcRWZ1YBvjJcPxvxO3e3rZY=; b=d0pr5MoZJreD3tj1PbX7ggX7x7Q991bZ6XKQjWsttRxJ2/I5gAx9YYo2kH2XR55aT2 67vtC5ELMaCBmElt+DaWzfY/VMBwSXyCLkMA6zsELFAhXp489wFczfqfFtI5M6qh98OF Tid0GgESsuxwaQ5GQ0bxicSk8lh9roeAWQxbg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=iT3qc5peuXlNKb4WI8i72ZGCsv9rot660PcvwH++oVf6T9L4XTm8shyuT6kIT2hTwd XYiH8ZxpTb33nO38PQWqiwXOIQZMqEKGg/2nbY+HAHDzEwFlLYUN7I2tqk2zKaT24moC iFwhd7MOhdax+UIvHEuKJDXpPDtqAVYrKjaCs= Received: by 10.180.233.15 with SMTP id f15mr702213bkh.188.1225986263037; Thu, 06 Nov 2008 07:44:23 -0800 (PST) Received: by 10.181.225.15 with HTTP; Thu, 6 Nov 2008 07:44:22 -0800 (PST) Message-ID: <9bbcef730811060744p6bb85393h297ac247d98a0d5d@mail.gmail.com> Date: Thu, 6 Nov 2008 16:44:23 +0100 From: "Ivan Voras" To: "Peter Wemm" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811041904.mA4J41dL005103@svn.freebsd.org> <9bbcef730811041422x5f1e7bfco45380390c64b3b1c@mail.gmail.com> <200811041750.08355.jhb@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r184652 - in head/sys: dev/hwpmc fs/procfs kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 15:44:25 -0000 2008/11/6 Peter Wemm : > On Tue, Nov 4, 2008 at 2:50 PM, John Baldwin wrote: > Hmm. Would it make sense to provide a helper syscall specifically for > php to use for this? Without having looked at the php code, it sounds > like it might be helpful to have a syscall that returns the path and > an array of stat structs for each path component. Or is php only > doing this because of compatability with non-atomic getcwd() > implementations? Does php even need to do it? Here's a discussion on the performance problem: http://lists.freebsd.org/pipermail/freebsd-performance/2008-January/003096.html I remember, but can't find the reference now, that the problem became visible because PHP introduced realpath() checking for include files in a minor release (like 5.1.6 or something like that) to work around a security problem. This is when users saw noticeable drops in performance (and I don't think it solved their security problem :) ). From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:10:50 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A325106567E; Thu, 6 Nov 2008 16:10:50 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 2BC968FC13; Thu, 6 Nov 2008 16:10:49 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl92-78.kln.forthnet.gr [77.49.59.78]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id mA6GAbTd010363 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 6 Nov 2008 18:10:43 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id mA6GAbxI031109; Thu, 6 Nov 2008 18:10:37 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id mA6GAau6031108; Thu, 6 Nov 2008 18:10:36 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Alexander Motin References: <200811051712.mA5HCIP7032611@svn.freebsd.org> Date: Thu, 06 Nov 2008 18:10:36 +0200 In-Reply-To: <200811051712.mA5HCIP7032611@svn.freebsd.org> (Alexander Motin's message of "Wed, 5 Nov 2008 17:12:18 +0000 (UTC)") Message-ID: <87r65okf7n.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: mA6GAbTd010363 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.856, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.54, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184695 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 16:10:50 -0000 On Wed, 5 Nov 2008 17:12:18 +0000 (UTC), Alexander Motin wrote: > Author: mav > Date: Wed Nov 5 17:12:18 2008 > New Revision: 184695 > URL: http://svn.freebsd.org/changeset/base/184695 > > Log: > Improve driver operation example description. > > Modified: > head/share/man/man4/snd_hda.4 Hi Alexander, There are a few places where we can probably improve the manpage a bit more. I am not sure I understand *all* the technical details of pins and association numbers, but does the following look like something worth committing? %%% diff -r ea818a53fb86 share/man/man4/snd_hda.4 --- a/share/man/man4/snd_hda.4 Thu Nov 06 07:04:46 2008 +0200 +++ b/share/man/man4/snd_hda.4 Thu Nov 06 18:09:06 2008 +0200 @@ -57,8 +57,8 @@ driver that allows the generic audio driver, .Xr sound 4 , to be used with this hardware. -.Nm -only supports audio functions. +Only audio functions are supported by +.Nm . Modem, HDMI and other possible functions are not implemented. .Pp The @@ -68,7 +68,7 @@ Universal Audio Architecture (UAA) draft (revision 0.7b) for handling audio devices. .Pp -According to HDA and UAA specifications, depending on number of HDA buses +According to HDA and UAA specifications, depending on the number of HDA buses and codecs present in system, their audio capabilities and BIOS provided configuration, the .Nm @@ -76,14 +76,16 @@ For example, one device for main rear 7.1 output and inputs, one device for independent headset connectors at front and one device for SPDIF or HDMI audio input/output. -Usually that assignment may be widely tuned by using device hints. -A lot of useful information about driver operation and present audio setup may -be obtained from the driver verbose boot messages. +The assignment of audio inputs and outputs may be tuned with +.Xr device.hints 5 . +The driver's verbose boot messages provide a lot of information about +the operation of the driver and present audio setup. .Pp -You can select audio device to use by default with hw.snd.default_unit -sysctl described in -.Xr sound 4 -or explicitly specify it in appliation settings. +The default audio device may be tuned by setting the +.Ar hw.snd.default_unit +sysctl, as described in +.Xr sound 4 , +or by explicitly specify it in application settings. .Ss Boot-time Configuration The following variables are available at boot-time through the .Xr device.hints 5 @@ -123,18 +125,26 @@ .Dq Li nofixedrate , will do the opposite and takes precedence. Options can be separated by whitespace and commas. -GPIO is a codecs General Purpose I/O pins which system integrators sometimes +.Dq Li GPIO Ns s +are a codec's General Purpose I/O pins, which system integrators sometimes use to control external muters, amplifiers and so on. -If you have no sound or sound volume is not adequate you may need to find a -GPIO combination required for your system. -ivrefX/ovrefX options controls voltage used to power external microphones -and so on. +If you have no sound, or sound volume is not adequate, you may have to +experiment a bit with the GPIO setup to find the optimal setup for your +system. +The +.Dq Li ivref Ns Ar X +and +.Dq Li ovref Ns Ar X +options control the voltage used to power external microphones. .It Va hint.hdac.%d.msi Controls MSI (Message Signaled Interrupts) support. .It Va hint.hdac.%d.cad%d.nid%d.config Overrides codec pin configuration set by BIOS. -May be specified as a 32bit HEX value with a leading "0x" or as a set of -space separated "option=value" pairs. +May be specified as a 32-bit hexadecimal value with a leading +.Dq 0x , +or as a set of space-separated +.Dq Ar option Ns = Ns Ar value +pairs. .El .Pp Pin configuration is the UAA driver's main source of information about codec @@ -143,33 +153,36 @@ by system integrators for specific system requirements. The .Nm -driver allows users to override it to fix integrator mistakes or to use codec -in alternative ways, for example, to get stereo output and 2 inputs -instead of a single 5.1 output. -Configuration includes the following options: +driver allows users to override it to fix integrator mistakes or to use the available codecs +in alternative ways (for example to get stereo output and 2 inputs +instead of a single 5.1 output). +.Pp +The following options are supported: .Bl -tag -width ".Va device=" -offset indent .It Va as Association number. -Associations are used to group individual pins to form a complex multipin +Associations are used to group individual pins to form a complex multi-pin device. -For example, to group 4 connectors for 7.1 output or to treat several +For example, to group 4 connectors for 7.1 output, or to treat several input connectors as sources for the same input device. -Can be specified as number from 0 to 15. -Association number 0 means disabled pin, number 15 is a set of independent -unassociated pins. -Each association includes only pins of the same direction (in/out) and -detected atomically - all pins or none. -For every pair of input+output associations in order of their numeration -separate PCM audio device is created. +Association numbers can be specified as numeric values from 0 to 15. +A value of 0 means disabled pin. +A value of 15 is a set of independent unassociated pins. +Each association includes only pins of the same direction (in/out) and is +detected atomically (all pins or none). +A separate PCM audio device is created for every pair of input and +output associations. .It Va seq Sequence number. -This unique inside every association number used to order pins inside -association. -Can be specified as a number from 0 to 15. -Sequence number 15 for output associations has also special meaning. -Output pin with sequence number 15 and device type Headhones will duplicate -(with automatic mute if jack detection is supported) the first pin in that -association. +A unique, per-association number used to order pins inside the +particular association. +Sequence numbers can be specified as numeric values from 0 to 15. +.Pp +The sequence number 15 has a special meaning for output associations. +Output pins with this number and device type +.Dq Ar Headphones +will duplicate (with automatic mute if jack detection is supported) the +first pin in that association. .It Va device Device type. Can be specified as a number from 0 to 15 or as a name: @@ -193,27 +206,31 @@ The device type also describes the pin direction (in/out). For example, .Dq Li CD -always means input pin, while +always means an input pin, while .Dq Li Headphones -always means output. +always means an output pin. .It Va conn Connection type. -Can be specified as a number from 0 to 3 or as a name: +Can be specified as a number from 0 to 3. +The connection type can also be specified as one of the special names .Dq Li Jack , .Dq Li None , .Dq Li Fixed , or .Dq Li Both . -Pins with +Pins with a connection type of .Dq Li None -connection type are disabled. +are disabled. .It Va ctype Connector physical type. Can be specified as a number from 0 to 15. -This is a reference only value which is ignored by the driver. +This is a reference only value. +It is ignored by the +.Nm +driver. .It Va color Connector color. -Can be specified as a number from 0 to 15 or as a name: +Can be specified as a number from 0 to 15 or as one of the names .Dq Li Unknown , .Dq Li Black , .Dq Li Grey , @@ -231,16 +248,23 @@ .Dq Li White , or .Dq Li Other . -This is a reference only value which is ignored by the driver. +This is a reference only value . +It is ignored by the +.Nm +driver. .It Va loc Connector physical location. Can be specified as a number from 0 to 63. -This is a reference only value which is ignored by the driver. +This is a reference only value. +It is ignored by the +.Nm +driver. .It Va misc Misc bits. Can be specified as a number from 0 to 15. -Bit 0, if set, tells that jack detection on this pin supported by the codec -is not implemented in hardware. +.Pp +Bit 0 has a special meaning. When set it means that jack detection is +not implemented in hardware. .El .Ss Runtime Configuration The following @@ -250,8 +274,9 @@ devices: .Bl -tag -width ".Va dev.hdac.%d.polling" -offset indent .It Va dev.hdac.%d.polling -Enables polling mode, where the driver operates by querying the device -state on timer ticks using +Enables polling mode. +In this mode the driver operates by querying the device state on timer +ticks using .Xr callout 9 instead of interrupts. Polling is disabled by default. @@ -264,14 +289,17 @@ capabilities and jack sense status to console and syslog. .El .Sh EXAMPLES -Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example. It has two +Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example. +This system has two audio connectors on a front side, three audio connectors on a rear side and one -internal speaker. According to verbose driver output and codec datasheet, -codec has five stereo DACs and two stereo ADCs, all of them are routable to -any codec pin (external connector). All codec pins are reversible. +internal speaker. +According to verbose driver output and the codec datasheet, +this codec has five stereo DACs and two stereo ADCs, all of them are routable to +any codec pin (external connector). +All codec pins are reversible. .Pp So high codec uniformity and flexibility allow driver to configure it in many -deferent ways, depending on requested pins usage decribed by pins configuration. +different ways, depending on requested pins usage decribed by pins configuration. Driver reports such default pin configuration when verbose messages enabled: .Bd -literal hdac0: nid 20 0x01014020 as 2 seq 0 Line-out Jack jack 1 loc 1 color Green misc 0 @@ -308,49 +336,83 @@ hdac0: Pin nid=25 seq=15 .Ed .Pp -Each pcm device uses two associations: one for playback and one for recording. -Associations processed and assigned to pcm devices in order of their numbers. -It means that association #0 (1) will become pcm0 device playback, using -internal speaker and headphones jack with speaker automute on headphones -connection. -Association #1 (2) will become pcm1 playback, using the Line-out jack. -Association #2 (3) will become pcm0 recording, using external microphones and -line-in jack. +Each +.Xr pcm 4 +device uses two associations: one for playback and one for recording. +Associations processed and assigned to +.Xr pcm 4 +devices in increasing numerical order. +In this case association #0 (1) will become +.Li pcm0 +device playback, using the internal speakers and headphones jack with +speaker automute of the headphones. +Association #1 (2) will become +.Li pcm1 +playback, using the +.Ar Line-out +jack. +Association #2 (3) will become +.Li pcm0 +recording, using the external microphones and the line-in jack. .Pp -Driver provides extensive set of verbose messages to diagnose it's operation -logic and description of resulted codec configuration. +The +.Nm +driver provides extensive verbose messages to diagnose its operation +logic and describe its current codec configuration. .Pp -Using device.hints it is possible to modify existing pins configuration to -create broad range of different audio setups. Here is examples of some setups -possible for the described hardware: +Using +.Xr device.hints 5 +it is possible to modify the configuration of the existing pins, +allowing a broad range of different audio setups. +Here are a few examples of some setups possible for this particular +hardware: .Ss Example 1 -Setting +Setting the +.Xr device.hints 5 +options .Bd -literal hint.hdac.0.cad0.nid20.config="as=1" hint.hdac.0.cad0.nid21.config="as=2" .Ed .Pp -will swap line-out and speaker functions. So pcm0 device will play to the -line-out and headphones jacks with line-out automute on headphones connection. -Recording on pcm0 will go from two external microphones and line-in jacks. -pcm1 playback will go to the internal speaker. +will swap line-out and speaker functions. +So the +.Li pcm0 +device will play to the line-out and headphones jacks, and line-out will +automute the headphones connection. +Recording on +.Li pcm0 +will go from two external microphones and line-in jacks. +.Li pcm1 +playback will go to the internal speaker. .Pp .Ss Example 2 -Setting +Setting the +.Xr device.hints 5 +options .Bd -literal hint.hdac.0.cad0.nid20.config="as=1 seq=15 device=Headphones" hint.hdac.0.cad0.nid27.config="as=2 seq=0" hint.hdac.0.cad0.nid25.config="as=4 seq=0" .Ed .Pp -will split headphones and one of mics to separate device. So pcm0 device will -play to the internal speaker and line-out jack with speaker automute on -line-out connection. Recording on pcm0 will go from one external microphone -and line-in jacks. pcm1 will be completely dedicated to headset (headphones and -mic) connected to the front connectors. +will split the headphones and one of the microphones to a separate device. +The +.Li pcm0 +device will play to the internal speaker and to the line-out jack, with +speaker automute on the line-out connection. +Recording on +.Li pcm0 +will use input from one external microphone and the line-in jacks. +The +.Li pcm1 +device will be completely dedicated to a headset (headphones and mic) +connected to the front connectors. .Pp .Ss Example 3 -Setting +Setting the +.Xr device.hints 5 +options .Bd -literal hint.hdac.0.cad0.nid20.config="as=1 seq=0" hint.hdac.0.cad0.nid26.config="as=2 seq=0" @@ -360,12 +422,21 @@ hint.hdac.0.cad0.nid21.config="as=6 seq=0" .Ed .Pp -will give 4 independent devices: pcm0 - line-out + line-in, pcm1 - headphones -+ mic, pcm2 - additional line-out via retasked rear mic jack, pcm3 - internal -speaker. +will give 4 independent devices: +.Li pcm0 +.Pq line-out and line-in , +.Li pcm1 +.Pq headphones and mic , +.Li pcm2 +.Pq additional line-out via retasked rear mic jack , +and +.Li pcm3 +.Pq internal speaker . .Pp .Ss Example 4 -Setting +Setting the +.Xr device.hints 5 +options .Bd -literal hint.hdac.0.cad0.nid20.config="as=1 seq=0" hint.hdac.0.cad0.nid24.config="as=1 seq=1 device=Line-out" @@ -373,10 +444,13 @@ hint.hdac.0.cad0.nid21.config="as=2 seq=0" .Ed .Pp -will give 2 devices: pcm0 - 5.1 playback via 3 rear (line-out and retasked -mic and line-in) connectors and front headphones with rear connectors automute -on headphones connection + front mic recording. pcm1 - internal speaker -playback. +will give 2 devices: +.Li pcm0 +for 5.1 playback via 3 rear connectors and front headphones (line-out, +retasked mic and line-in), with rear connectors automute on headphones +connection and front mic recording, and +.Li pcm1 +for internal speaker playback. .Sh HARDWARE The .Nm @@ -533,4 +607,4 @@ driver seems to attach and work, but without any sound. .Pp Due to OSS limitation multichannel (not multidevice) playback is not -supported. \ No newline at end of file +supported. %%% From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:20:27 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDEDF1065679; Thu, 6 Nov 2008 16:20:27 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B98868FC13; Thu, 6 Nov 2008 16:20:27 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6GKRaQ059922; Thu, 6 Nov 2008 16:20:27 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6GKRsr059912; Thu, 6 Nov 2008 16:20:27 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200811061620.mA6GKRsr059912@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 6 Nov 2008 16:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184728 - in head: lib/libkvm sys/arm/arm sys/arm/include sys/conf sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 16:20:27 -0000 Author: raj Date: Thu Nov 6 16:20:27 2008 New Revision: 184728 URL: http://svn.freebsd.org/changeset/base/184728 Log: Support kernel crash mini dumps on ARM architecture. Obtained from: Juniper Networks, Semihalf Added: head/lib/libkvm/kvm_minidump_arm.c (contents, props changed) head/sys/arm/arm/minidump_machdep.c (contents, props changed) head/sys/arm/include/minidump.h (contents, props changed) Modified: head/lib/libkvm/Makefile head/lib/libkvm/kvm_arm.c head/lib/libkvm/kvm_private.h head/sys/arm/arm/dump_machdep.c head/sys/arm/arm/pmap.c head/sys/arm/include/md_var.h head/sys/arm/include/pmap.h head/sys/conf/files.arm head/sys/vm/vm_page.c Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Thu Nov 6 15:32:02 2008 (r184727) +++ head/lib/libkvm/Makefile Thu Nov 6 16:20:27 2008 (r184728) @@ -11,7 +11,7 @@ CFLAGS+=-DSUN4V SRCS= kvm.c kvm_${MACHINE_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "arm" SRCS+= kvm_minidump_${MACHINE_ARCH}.c .endif INCS= kvm.h Modified: head/lib/libkvm/kvm_arm.c ============================================================================== --- head/lib/libkvm/kvm_arm.c Thu Nov 6 15:32:02 2008 (r184727) +++ head/lib/libkvm/kvm_arm.c Thu Nov 6 16:20:27 2008 (r184728) @@ -52,10 +52,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "kvm_private.h" +/* minidump must be the first item! */ struct vmstate { + int minidump; /* 1 = minidump mode */ pd_entry_t *l1pt; void *mmapbase; size_t mmapsize; @@ -107,6 +110,8 @@ void _kvm_freevtop(kvm_t *kd) { if (kd->vmst != 0) { + if (kd->vmst->minidump) + return (_kvm_minidump_freevtop(kd)); if (kd->vmst->mmapbase != NULL) munmap(kd->vmst->mmapbase, kd->vmst->mmapsize); free(kd->vmst); @@ -117,13 +122,25 @@ _kvm_freevtop(kvm_t *kd) int _kvm_initvtop(kvm_t *kd) { - struct vmstate *vm = _kvm_malloc(kd, sizeof(*vm)); + struct vmstate *vm; struct nlist nlist[2]; u_long kernbase, physaddr, pa; pd_entry_t *l1pt; Elf32_Ehdr *ehdr; size_t hdrsz; - + char minihdr[8]; + + if (!kd->rawdump) { + if (pread(kd->pmfd, &minihdr, 8, 0) == 8) { + if (memcmp(&minihdr, "minidump", 8) == 0) + return (_kvm_minidump_initvtop(kd)); + } else { + _kvm_err(kd, kd->program, "cannot read header"); + return (-1); + } + } + + vm = _kvm_malloc(kd, sizeof(*vm)); if (vm == 0) { _kvm_err(kd, kd->program, "cannot allocate vm"); return (-1); @@ -193,6 +210,9 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t pt_entry_t pte; u_long pte_pa; + if (kd->vmst->minidump) + return (_kvm_minidump_kvatop(kd, va, pa)); + if (vm->l1pt == NULL) return (_kvm_pa2off(kd, va, pa, PAGE_SIZE)); pd = vm->l1pt[L1_IDX(va)]; Added: head/lib/libkvm/kvm_minidump_arm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/kvm_minidump_arm.c Thu Nov 6 16:20:27 2008 (r184728) @@ -0,0 +1,262 @@ +/*- + * Copyright (c) 2008 Semihalf, Grzegorz Bernacki + * Copyright (c) 2006 Peter Wemm + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 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. + * + * From: FreeBSD: src/lib/libkvm/kvm_minidump_i386.c,v 1.2 2006/06/05 08:51:14 + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * ARM machine dependent routines for kvm and minidumps. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include "kvm_private.h" + +struct hpte { + struct hpte *next; + uint64_t pa; + int64_t off; +}; + +#define HPT_SIZE 1024 + +/* minidump must be the first field */ +struct vmstate { + int minidump; /* 1 = minidump mode */ + struct minidumphdr hdr; + void *hpt_head[HPT_SIZE]; + uint32_t *bitmap; + void *ptemap; +}; + +static void +hpt_insert(kvm_t *kd, uint64_t pa, int64_t off) +{ + struct hpte *hpte; + uint32_t fnv = FNV1_32_INIT; + + fnv = fnv_32_buf(&pa, sizeof(pa), fnv); + fnv &= (HPT_SIZE - 1); + hpte = malloc(sizeof(*hpte)); + hpte->pa = pa; + hpte->off = off; + hpte->next = kd->vmst->hpt_head[fnv]; + kd->vmst->hpt_head[fnv] = hpte; +} + +static int64_t +hpt_find(kvm_t *kd, uint64_t pa) +{ + struct hpte *hpte; + uint32_t fnv = FNV1_32_INIT; + + fnv = fnv_32_buf(&pa, sizeof(pa), fnv); + fnv &= (HPT_SIZE - 1); + for (hpte = kd->vmst->hpt_head[fnv]; hpte != NULL; hpte = hpte->next) + if (pa == hpte->pa) + return (hpte->off); + + return (-1); +} + +static int +inithash(kvm_t *kd, uint32_t *base, int len, off_t off) +{ + uint64_t idx, pa; + uint32_t bit, bits; + + for (idx = 0; idx < len / sizeof(*base); idx++) { + bits = base[idx]; + while (bits) { + bit = ffs(bits) - 1; + bits &= ~(1ul << bit); + pa = (idx * sizeof(*base) * NBBY + bit) * PAGE_SIZE; + hpt_insert(kd, pa, off); + off += PAGE_SIZE; + } + } + return (off); +} + +void +_kvm_minidump_freevtop(kvm_t *kd) +{ + struct vmstate *vm = kd->vmst; + + if (vm->bitmap) + free(vm->bitmap); + if (vm->ptemap) + free(vm->ptemap); + free(vm); + kd->vmst = NULL; +} + +int +_kvm_minidump_initvtop(kvm_t *kd) +{ + u_long pa; + struct vmstate *vmst; + off_t off; + + vmst = _kvm_malloc(kd, sizeof(*vmst)); + if (vmst == 0) { + _kvm_err(kd, kd->program, "cannot allocate vm"); + return (-1); + } + + kd->vmst = vmst; + vmst->minidump = 1; + + if (pread(kd->pmfd, &vmst->hdr, + sizeof(vmst->hdr), 0) != sizeof(vmst->hdr)) { + _kvm_err(kd, kd->program, "cannot read dump header"); + return (-1); + } + + if (strncmp(MINIDUMP_MAGIC, vmst->hdr.magic, + sizeof(vmst->hdr.magic)) != 0) { + _kvm_err(kd, kd->program, "not a minidump for this platform"); + return (-1); + } + if (vmst->hdr.version != MINIDUMP_VERSION) { + _kvm_err(kd, kd->program, "wrong minidump version. " + "Expected %d got %d", MINIDUMP_VERSION, vmst->hdr.version); + return (-1); + } + + /* Skip header and msgbuf */ + off = PAGE_SIZE + round_page(vmst->hdr.msgbufsize); + + vmst->bitmap = _kvm_malloc(kd, vmst->hdr.bitmapsize); + if (vmst->bitmap == NULL) { + _kvm_err(kd, kd->program, "cannot allocate %d bytes for " + "bitmap", vmst->hdr.bitmapsize); + return (-1); + } + + if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) != + vmst->hdr.bitmapsize) { + _kvm_err(kd, kd->program, "cannot read %d bytes for page bitmap", + vmst->hdr.bitmapsize); + return (-1); + } + off += round_page(vmst->hdr.bitmapsize); + + vmst->ptemap = _kvm_malloc(kd, vmst->hdr.ptesize); + if (vmst->ptemap == NULL) { + _kvm_err(kd, kd->program, "cannot allocate %d bytes for " + "ptemap", vmst->hdr.ptesize); + return (-1); + } + + if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != + vmst->hdr.ptesize) { + _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", + vmst->hdr.ptesize); + return (-1); + } + + off += vmst->hdr.ptesize; + + /* Build physical address hash table for sparse pages */ + inithash(kd, vmst->bitmap, vmst->hdr.bitmapsize, off); + + return (0); +} + +int +_kvm_minidump_kvatop(kvm_t *kd, u_long va, off_t *pa) +{ + struct vmstate *vm; + pt_entry_t pte; + u_long offset, pteindex, a; + off_t ofs; + uint32_t *ptemap; + int i; + + if (ISALIVE(kd)) { + _kvm_err(kd, 0, "kvm_kvatop called in live kernel!"); + return (0); + } + + vm = kd->vmst; + ptemap = vm->ptemap; + + if (va >= vm->hdr.kernbase) { + pteindex = (va - vm->hdr.kernbase) >> PAGE_SHIFT; + pte = ptemap[pteindex]; + if (!pte) { + _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid"); + goto invalid; + } + if ((pte & L2_TYPE_MASK) == L2_TYPE_L) { + offset = va & L2_L_OFFSET; + a = pte & L2_L_FRAME; + } else if ((pte & L2_TYPE_MASK) == L2_TYPE_S) { + offset = va & L2_S_OFFSET; + a = pte & L2_S_FRAME; + } else + goto invalid; + + ofs = hpt_find(kd, a); + if (ofs == -1) { + _kvm_err(kd, kd->program, "_kvm_vatop: physical " + "address 0x%lx not in minidump", a); + goto invalid; + } + + *pa = ofs + offset; + return (PAGE_SIZE - offset); + + } else + _kvm_err(kd, kd->program, "_kvm_vatop: virtual address 0x%lx " + "not minidumped", va); + +invalid: + _kvm_err(kd, 0, "invalid address (0x%lx)", va); + return (0); +} Modified: head/lib/libkvm/kvm_private.h ============================================================================== --- head/lib/libkvm/kvm_private.h Thu Nov 6 15:32:02 2008 (r184727) +++ head/lib/libkvm/kvm_private.h Thu Nov 6 16:20:27 2008 (r184728) @@ -79,7 +79,7 @@ void _kvm_syserr (kvm_t *kd, const char __printflike(3, 4); int _kvm_uvatop(kvm_t *, const struct proc *, u_long, u_long *); -#if defined(__amd64__) || defined(__i386__) +#if defined(__amd64__) || defined(__i386__) || defined(__arm__) void _kvm_minidump_freevtop(kvm_t *); int _kvm_minidump_initvtop(kvm_t *); int _kvm_minidump_kvatop(kvm_t *, u_long, off_t *); Modified: head/sys/arm/arm/dump_machdep.c ============================================================================== --- head/sys/arm/arm/dump_machdep.c Thu Nov 6 15:32:02 2008 (r184727) +++ head/sys/arm/arm/dump_machdep.c Thu Nov 6 16:20:27 2008 (r184728) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -44,6 +45,11 @@ __FBSDID("$FreeBSD$"); CTASSERT(sizeof(struct kerneldumpheader) == 512); +int do_minidump = 1; +TUNABLE_INT("debug.minidump", &do_minidump); +SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &do_minidump, 0, + "Enable mini crash dumps"); + /* * Don't touch the first SIZEOF_METADATA bytes on the dump device. This * is to protect us from metadata and to protect metadata from us. @@ -155,11 +161,10 @@ cb_dumpdata(struct md_pa *mdp, int seqnr vm_offset_t va; uint32_t pgs; size_t counter, sz, chunk; - int c, error, twiddle; + int c, error; error = 0; /* catch case in which chunk size is 0 */ - counter = 0; /* Update twiddle every 16MB */ - twiddle = 0; + counter = 0; va = 0; pgs = mdp->md_size / PAGE_SIZE; pa = mdp->md_start; @@ -264,7 +269,12 @@ dumpsys(struct dumperinfo *di) off_t hdrgap; size_t hdrsz; int error; - + + if (do_minidump) { + minidumpsys(di); + return; + } + bzero(&ehdr, sizeof(ehdr)); ehdr.e_ident[EI_MAG0] = ELFMAG0; ehdr.e_ident[EI_MAG1] = ELFMAG1; Added: head/sys/arm/arm/minidump_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/minidump_machdep.c Thu Nov 6 16:20:27 2008 (r184728) @@ -0,0 +1,483 @@ +/*- + * Copyright (c) 2008 Semihalf, Grzegorz Bernacki + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * from: FreeBSD: src/sys/i386/i386/minidump_machdep.c,v 1.6 2008/08/17 23:27:27 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +CTASSERT(sizeof(struct kerneldumpheader) == 512); + +/* + * Don't touch the first SIZEOF_METADATA bytes on the dump device. This + * is to protect us from metadata and to protect metadata from us. + */ +#define SIZEOF_METADATA (64*1024) + +uint32_t *vm_page_dump; +int vm_page_dump_size; + +static struct kerneldumpheader kdh; +static off_t dumplo; + +/* Handle chunked writes. */ +static size_t fragsz, offset; +static void *dump_va; +static uint64_t counter, progress; + +CTASSERT(sizeof(*vm_page_dump) == 4); + +static int +is_dumpable(vm_paddr_t pa) +{ + int i; + + for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { + if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) + return (1); + } + return (0); +} + +#define PG2MB(pgs) (((pgs) + (1 << 8) - 1) >> 8) + +static int +blk_flush(struct dumperinfo *di) +{ + int error; + + if (fragsz == 0) + return (0); + + error = dump_write(di, (char*)dump_va + offset, 0, dumplo, fragsz - offset); + dumplo += (fragsz - offset); + fragsz = 0; + offset = 0; + return (error); +} + +static int +blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) +{ + size_t len; + int error, i, c; + u_int maxdumpsz; + + maxdumpsz = di->maxiosize; + + if (maxdumpsz == 0) /* seatbelt */ + maxdumpsz = PAGE_SIZE; + + error = 0; + + if (ptr != NULL && pa != 0) { + printf("cant have both va and pa!\n"); + return (EINVAL); + } + + if (ptr != NULL) { + /* If we're doing a virtual dump, flush any pre-existing pa pages */ + error = blk_flush(di); + if (error) + return (error); + } + + while (sz) { + if (fragsz == 0) { + offset = pa & PAGE_MASK; + fragsz += offset; + } + len = maxdumpsz - fragsz; + if (len > sz) + len = sz; + counter += len; + progress -= len; + + if (counter >> 22) { + printf(" %lld", PG2MB(progress >> PAGE_SHIFT)); + counter &= (1<<22) - 1; + } + + if (ptr) { + error = dump_write(di, ptr, 0, dumplo, len); + if (error) + return (error); + dumplo += len; + ptr += len; + sz -= len; + } else { + for (i = 0; i < len; i += PAGE_SIZE) + dump_va = pmap_kenter_temp(pa + i, + (i + fragsz) >> PAGE_SHIFT); + fragsz += len; + pa += len; + sz -= len; + if (fragsz == maxdumpsz) { + error = blk_flush(di); + if (error) + return (error); + } + } + + /* Check for user abort. */ + c = cncheckc(); + if (c == 0x03) + return (ECANCELED); + if (c != -1) + printf(" (CTRL-C to abort) "); + } + + return (0); +} + +static int +blk_write_cont(struct dumperinfo *di, vm_paddr_t pa, size_t sz) +{ + int error; + + error = blk_write(di, 0, pa, sz); + if (error) + return (error); + + error = blk_flush(di); + if (error) + return (error); + + return (0); +} + +/* A fake page table page, to avoid having to handle both 4K and 2M pages */ +static pt_entry_t fakept[NPTEPG]; + +void +minidumpsys(struct dumperinfo *di) +{ + struct minidumphdr mdhdr; + uint64_t dumpsize; + uint32_t ptesize; + uint32_t bits; + uint32_t pa, prev_pa = 0, count = 0; + vm_offset_t va; + pd_entry_t *pdp; + pt_entry_t *pt, *ptp; + int i, k, bit, error; + char *addr; + + /* Flush cache */ + cpu_idcache_wbinv_all(); + cpu_l2cache_wbinv_all(); + + counter = 0; + /* Walk page table pages, set bits in vm_page_dump */ + ptesize = 0; + for (va = KERNBASE; va < kernel_vm_end; va += NBPDR) { + /* + * We always write a page, even if it is zero. Each + * page written corresponds to 2MB of space + */ + ptesize += L2_TABLE_SIZE_REAL; + pmap_get_pde_pte(pmap_kernel(), va, &pdp, &ptp); + if (pmap_pde_v(pdp) && pmap_pde_section(pdp)) { + /* This is a section mapping 1M page. */ + pa = (*pdp & L1_S_ADDR_MASK) | (va & ~L1_S_ADDR_MASK); + for (k = 0; k < (L1_S_SIZE / PAGE_SIZE); k++) { + if (is_dumpable(pa)) + dump_add_page(pa); + pa += PAGE_SIZE; + } + continue; + } + if (pmap_pde_v(pdp) && pmap_pde_page(pdp)) { + /* Set bit for each valid page in this 1MB block */ + addr = pmap_kenter_temp(*pdp & L1_C_ADDR_MASK, 0); + pt = (pt_entry_t*)(addr + + (((uint32_t)*pdp & L1_C_ADDR_MASK) & PAGE_MASK)); + for (k = 0; k < 256; k++) { + if ((pt[k] & L2_TYPE_MASK) == L2_TYPE_L) { + pa = (pt[k] & L2_L_FRAME) | + (va & L2_L_OFFSET); + for (i = 0; i < 16; i++) { + if (is_dumpable(pa)) + dump_add_page(pa); + k++; + pa += PAGE_SIZE; + } + } else if ((pt[k] & L2_TYPE_MASK) == L2_TYPE_S) { + pa = (pt[k] & L2_S_FRAME) | + (va & L2_S_OFFSET); + if (is_dumpable(pa)) + dump_add_page(pa); + } + } + } else { + /* Nothing, we're going to dump a null page */ + } + } + + /* Calculate dump size. */ + dumpsize = ptesize; + dumpsize += round_page(msgbufp->msg_size); + dumpsize += round_page(vm_page_dump_size); + + for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) { + bits = vm_page_dump[i]; + while (bits) { + bit = ffs(bits) - 1; + pa = (((uint64_t)i * sizeof(*vm_page_dump) * NBBY) + + bit) * PAGE_SIZE; + /* Clear out undumpable pages now if needed */ + if (is_dumpable(pa)) + dumpsize += PAGE_SIZE; + else + dump_drop_page(pa); + bits &= ~(1ul << bit); + } + } + + dumpsize += PAGE_SIZE; + + /* Determine dump offset on device. */ + if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + error = ENOSPC; + goto fail; + } + + dumplo = di->mediaoffset + di->mediasize - dumpsize; + dumplo -= sizeof(kdh) * 2; + progress = dumpsize; + + /* Initialize mdhdr */ + bzero(&mdhdr, sizeof(mdhdr)); + strcpy(mdhdr.magic, MINIDUMP_MAGIC); + mdhdr.version = MINIDUMP_VERSION; + mdhdr.msgbufsize = msgbufp->msg_size; + mdhdr.bitmapsize = vm_page_dump_size; + mdhdr.ptesize = ptesize; + mdhdr.kernbase = KERNBASE; + + mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_ARM_VERSION, dumpsize, + di->blocksize); + + printf("Physical memory: %u MB\n", ptoa((uintmax_t)physmem) / 1048576); + printf("Dumping %llu MB:", (long long)dumpsize >> 20); + + /* Dump leader */ + error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); + if (error) + goto fail; + dumplo += sizeof(kdh); + + /* Dump my header */ + bzero(&fakept, sizeof(fakept)); + bcopy(&mdhdr, &fakept, sizeof(mdhdr)); + error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); + if (error) + goto fail; + + /* Dump msgbuf up front */ + error = blk_write(di, (char *)msgbufp->msg_ptr, 0, round_page(msgbufp->msg_size)); + if (error) + goto fail; + + /* Dump bitmap */ + error = blk_write(di, (char *)vm_page_dump, 0, + round_page(vm_page_dump_size)); + if (error) + goto fail; + + /* Dump kernel page table pages */ + for (va = KERNBASE; va < kernel_vm_end; va += NBPDR) { + /* We always write a page, even if it is zero */ + pmap_get_pde_pte(pmap_kernel(), va, &pdp, &ptp); + + if (pmap_pde_v(pdp) && pmap_pde_section(pdp)) { + if (count) { + error = blk_write_cont(di, prev_pa, + count * L2_TABLE_SIZE_REAL); + if (error) + goto fail; + count = 0; + prev_pa = 0; + } + /* This is a single 2M block. Generate a fake PTP */ + pa = (*pdp & L1_S_ADDR_MASK) | (va & ~L1_S_ADDR_MASK); + for (k = 0; k < (L1_S_SIZE / PAGE_SIZE); k++) { + fakept[k] = L2_S_PROTO | (pa + (k * PAGE_SIZE)) | + L2_S_PROT(PTE_KERNEL, + VM_PROT_READ | VM_PROT_WRITE); + } + error = blk_write(di, (char *)&fakept, 0, + L2_TABLE_SIZE_REAL); + if (error) + goto fail; + /* Flush, in case we reuse fakept in the same block */ + error = blk_flush(di); + if (error) + goto fail; + continue; + } + if (pmap_pde_v(pdp) && pmap_pde_page(pdp)) { + pa = *pdp & L1_C_ADDR_MASK; + if (!count) { + prev_pa = pa; + count++; + } + else { + if (pa == (prev_pa + count * L2_TABLE_SIZE_REAL)) + count++; + else { + error = blk_write_cont(di, prev_pa, + count * L2_TABLE_SIZE_REAL); + if (error) + goto fail; + count = 1; + prev_pa = pa; + } + } + } else { + if (count) { + error = blk_write_cont(di, prev_pa, + count * L2_TABLE_SIZE_REAL); + if (error) + goto fail; + count = 0; + prev_pa = 0; + } + bzero(fakept, sizeof(fakept)); + error = blk_write(di, (char *)&fakept, 0, + L2_TABLE_SIZE_REAL); + if (error) + goto fail; + /* Flush, in case we reuse fakept in the same block */ + error = blk_flush(di); + if (error) + goto fail; + } + } + + if (count) { + error = blk_write_cont(di, prev_pa, count * L2_TABLE_SIZE_REAL); + if (error) + goto fail; + count = 0; + prev_pa = 0; + } + + /* Dump memory chunks */ + for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) { + bits = vm_page_dump[i]; + while (bits) { + bit = ffs(bits) - 1; + pa = (((uint64_t)i * sizeof(*vm_page_dump) * NBBY) + + bit) * PAGE_SIZE; + if (!count) { + prev_pa = pa; + count++; + } else { + if (pa == (prev_pa + count * PAGE_SIZE)) + count++; + else { + error = blk_write_cont(di, prev_pa, + count * PAGE_SIZE); + if (error) + goto fail; + count = 1; + prev_pa = pa; + } + } + bits &= ~(1ul << bit); + } + } + if (count) { + error = blk_write_cont(di, prev_pa, count * PAGE_SIZE); + if (error) + goto fail; + count = 0; + prev_pa = 0; + } + + /* Dump trailer */ + error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); + if (error) + goto fail; + dumplo += sizeof(kdh); + + /* Signal completion, signoff and exit stage left. */ + dump_write(di, NULL, 0, 0, 0); + printf("\nDump complete\n"); + return; + +fail: + if (error < 0) + error = -error; + + if (error == ECANCELED) + printf("\nDump aborted\n"); + else if (error == ENOSPC) + printf("\nDump failed. Partition too small.\n"); + else + printf("\n** DUMP FAILED (ERROR %d) **\n", error); +} + +void +dump_add_page(vm_paddr_t pa) +{ + int idx, bit; + + pa >>= PAGE_SHIFT; + idx = pa >> 5; /* 2^5 = 32 */ + bit = pa & 31; + atomic_set_int(&vm_page_dump[idx], 1ul << bit); +} + +void +dump_drop_page(vm_paddr_t pa) +{ + int idx, bit; + + pa >>= PAGE_SHIFT; + idx = pa >> 5; /* 2^5 = 32 */ + bit = pa & 31; + atomic_clear_int(&vm_page_dump[idx], 1ul << bit); +} Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Thu Nov 6 15:32:02 2008 (r184727) +++ head/sys/arm/arm/pmap.c Thu Nov 6 16:20:27 2008 (r184728) @@ -270,6 +270,11 @@ union pmap_cache_state *pmap_cache_state struct msgbuf *msgbufp = 0; +/* + * Crashdump maps. + */ +static caddr_t crashdumpmap; + extern void bcopy_page(vm_offset_t, vm_offset_t); extern void bzero_page(vm_offset_t); @@ -2455,6 +2460,8 @@ pmap_bootstrap(vm_offset_t firstaddr, vm pmap_alloc_specials(&virtual_avail, 1, (vm_offset_t*)&_tmppt, NULL); + pmap_alloc_specials(&virtual_avail, + MAXDUMPPGS, (vm_offset_t *)&crashdumpmap, NULL); SLIST_INIT(&l1_list); TAILQ_INIT(&l1_lru_list); mtx_init(&l1_lru_lock, "l1 list lock", NULL, MTX_DEF); @@ -2793,6 +2800,20 @@ pmap_kenter_section(vm_offset_t va, vm_o } /* + * Make a temporary mapping for a physical address. This is only intended + * to be used for panic dumps. + */ +void * +pmap_kenter_temp(vm_paddr_t pa, int i) +{ + vm_offset_t va; + + va = (vm_offset_t)crashdumpmap + (i * PAGE_SIZE); + pmap_kenter(va, pa); + return ((void *)crashdumpmap); +} + +/* * add a wired page to the kva * note that in order for the mapping to take effect -- you * should do a invltlb after doing the pmap_kenter... Modified: head/sys/arm/include/md_var.h ============================================================================== --- head/sys/arm/include/md_var.h Thu Nov 6 15:32:02 2008 (r184727) +++ head/sys/arm/include/md_var.h Thu Nov 6 16:20:27 2008 (r184728) @@ -35,6 +35,8 @@ extern char sigcode[]; extern int szsigcode; +extern uint32_t *vm_page_dump; +extern int vm_page_dump_size; extern int (*_arm_memcpy)(void *, void *, int, int); extern int (*_arm_bzero)(void *, int, int); @@ -46,7 +48,11 @@ extern int _min_bzero_size; #define SRC_IS_USER 0x2 #define IS_PHYSICAL 0x4 +struct dumperinfo; extern int busdma_swi_pending; void busdma_swi(void); +void dump_add_page(vm_paddr_t); +void dump_drop_page(vm_paddr_t); +void minidumpsys(struct dumperinfo *); #endif /* !_MACHINE_MD_VAR_H_ */ Added: head/sys/arm/include/minidump.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/include/minidump.h Thu Nov 6 16:20:27 2008 (r184728) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2006 Peter Wemm + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * From: FreeBSD: src/sys/i386/include/minidump.h,v 1.1 2006/04/21 04:28:43 + * $FreeBSD$ + */ + +#ifndef _MACHINE_MINIDUMP_H_ +#define _MACHINE_MINIDUMP_H_ 1 + +#define MINIDUMP_MAGIC "minidump FreeBSD/arm" +#define MINIDUMP_VERSION 1 + +struct minidumphdr { + char magic[24]; + uint32_t version; + uint32_t msgbufsize; + uint32_t bitmapsize; + uint32_t ptesize; + uint32_t kernbase; +}; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:25:12 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B404106568D; Thu, 6 Nov 2008 16:25:12 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A5C08FC25; Thu, 6 Nov 2008 16:25:12 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6GPCjk060047; Thu, 6 Nov 2008 16:25:12 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6GPCRg060046; Thu, 6 Nov 2008 16:25:12 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200811061625.mA6GPCRg060046@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 6 Nov 2008 16:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184729 - head/sys/arm/mv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 16:25:12 -0000 Author: raj Date: Thu Nov 6 16:25:12 2008 New Revision: 184729 URL: http://svn.freebsd.org/changeset/base/184729 Log: Auto-size kernel page tables allocation on Marvell systems. This allows mini dumps to fully work for these platforms. Obtained from: Juniper Networks, Semihalf Modified: head/sys/arm/mv/mv_machdep.c Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Thu Nov 6 16:20:27 2008 (r184728) +++ head/sys/arm/mv/mv_machdep.c Thu Nov 6 16:25:12 2008 (r184729) @@ -93,9 +93,6 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif -#define KERNEL_PT_SYS 0 /* Page table for mapping proc0 zero page */ -#define KERNEL_PT_KERN 1 - /* * This is the number of L2 page tables required for covering max * (hypothetical) memsize of 4GB and all kernel mappings (vectors, msgbuf, @@ -366,7 +363,7 @@ initarm(void *mdp, void *unused __unused struct bi_mem_region *mr; void *kmdp; u_int l1pagetable; - int i = 0; + int i = 0, j = 0; kmdp = NULL; lastaddr = 0; @@ -465,13 +462,14 @@ initarm(void *mdp, void *unused __unused if (!(i % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) { valloc_pages(kernel_pt_table[i], L2_TABLE_SIZE / PAGE_SIZE); + j = i; } else { - kernel_pt_table[i].pv_va = freemempos - - (i % (PAGE_SIZE / L2_TABLE_SIZE_REAL)) * - L2_TABLE_SIZE_REAL; + kernel_pt_table[i].pv_va = kernel_pt_table[j].pv_va + + L2_TABLE_SIZE_REAL * (i - j); kernel_pt_table[i].pv_pa = kernel_pt_table[i].pv_va - KERNVIRTADDR + KERNPHYSADDR; + } } /* @@ -506,7 +504,7 @@ initarm(void *mdp, void *unused __unused l2_start = lastaddr & ~(L1_S_OFFSET); for (i = 0 ; i < l2size - 1; i++) pmap_link_l2pt(l1pagetable, l2_start + i * L1_S_SIZE, - &kernel_pt_table[KERNEL_PT_KERN + i]); + &kernel_pt_table[i]); pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE; @@ -532,7 +530,7 @@ initarm(void *mdp, void *unused __unused /* Link and map the vector page */ pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH, - &kernel_pt_table[KERNEL_PT_SYS]); + &kernel_pt_table[l2size - 1]); pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); @@ -603,8 +601,8 @@ initarm(void *mdp, void *unused __unused arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); - dump_avail[0] = KERNPHYSADDR; - dump_avail[1] = KERNPHYSADDR + memsize; + dump_avail[0] = 0; + dump_avail[1] = memsize; dump_avail[2] = 0; dump_avail[3] = 0; From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:28:29 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B72F1065670; Thu, 6 Nov 2008 16:28:29 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A6D58FC12; Thu, 6 Nov 2008 16:28:29 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6GSSHo060129; Thu, 6 Nov 2008 16:28:28 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6GSSYR060128; Thu, 6 Nov 2008 16:28:28 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200811061628.mA6GSSYR060128@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 6 Nov 2008 16:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184730 - head/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 16:28:29 -0000 Author: raj Date: Thu Nov 6 16:28:28 2008 New Revision: 184730 URL: http://svn.freebsd.org/changeset/base/184730 Log: ARM pmap style(9) and cosmetics. Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Thu Nov 6 16:25:12 2008 (r184729) +++ head/sys/arm/arm/pmap.c Thu Nov 6 16:28:28 2008 (r184730) @@ -1214,7 +1214,7 @@ pmap_l2cache_wbinv_range(pmap_t pm, vm_o CTR4(KTR_PMAP, "pmap_l2cache_wbinv_range: pmap %p is_kernel %d " "va 0x%08x len 0x%x ", pm, pm == pmap_kernel(), va, rest); if (pmap_get_pde_pte(pm, va, &pde, &ptep) && l2pte_valid(*ptep)) - cpu_l2cache_wb_range(va, rest); + cpu_l2cache_wb_range(va, rest); len -= rest; va += rest; @@ -1246,7 +1246,7 @@ pmap_l2cache_wb_range(pmap_t pm, vm_offs CTR4(KTR_PMAP, "pmap_l2cache_wb_range: pmap %p is_kernel %d " "va 0x%08x len 0x%x ", pm, pm == pmap_kernel(), va, rest); if (pmap_get_pde_pte(pm, va, &pde, &ptep) && l2pte_valid(*ptep)) - cpu_l2cache_wb_range(va, rest); + cpu_l2cache_wb_range(va, rest); len -= rest; va += rest; @@ -1281,6 +1281,7 @@ static PMAP_INLINE void pmap_dcache_wb_range(pmap_t pm, vm_offset_t va, vm_size_t len, boolean_t do_inv, boolean_t rd_only) { + CTR4(KTR_PMAP, "pmap_dcache_wb_range: pmap %p is_kernel %d va 0x%08x " "len 0x%x ", pm, pm == pmap_kernel(), va, len); CTR2(KTR_PMAP, " do_inv %d rd_only %d", do_inv, rd_only); @@ -1295,8 +1296,7 @@ pmap_dcache_wb_range(pmap_t pm, vm_offse cpu_dcache_wbinv_range(va, len); pmap_l2cache_wbinv_range(pm, va, len); } - } else - if (!rd_only) { + } else if (!rd_only) { cpu_dcache_wb_range(va, len); pmap_l2cache_wb_range(pm, va, len); } @@ -3979,7 +3979,7 @@ pmap_zero_page_generic(vm_paddr_t phys, * Hook in the page, zero it, invalidate the TLB as needed. * * Note the temporary zero-page mapping must be a non-cached page in - * ordert to work without corruption when write-allocate is enabled. + * order to work without corruption when write-allocate is enabled. */ *cdst_pte = L2_S_PROTO | phys | L2_S_PROT(PTE_KERNEL, VM_PROT_WRITE); cpu_tlb_flushD_SE(cdstp); From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:30:21 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DE5B1065672; Thu, 6 Nov 2008 16:30:21 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F13BB8FC14; Thu, 6 Nov 2008 16:30:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6GUKFs060200; Thu, 6 Nov 2008 16:30:20 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6GUKZY060199; Thu, 6 Nov 2008 16:30:20 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811061630.mA6GUKZY060199@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2008 16:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184731 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 16:30:21 -0000 Author: bz Date: Thu Nov 6 16:30:20 2008 New Revision: 184731 URL: http://svn.freebsd.org/changeset/base/184731 Log: Fix typo and while here another one. Reviewed by: keramida Reported by: keramida MFC after: 2 months (with r184720) Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Nov 6 16:28:28 2008 (r184730) +++ head/sys/netinet/tcp_input.c Thu Nov 6 16:30:20 2008 (r184731) @@ -1501,7 +1501,7 @@ tcp_do_segment(struct mbuf *m, struct tc * only accepting RSTs where the sequence number is equal to * last_ack_sent. In all other states (the states in which a * RST is more likely), the more permissive check is used. - * If we have multiple segments in flight, the intial reset + * If we have multiple segments in flight, the initial reset * segment sequence numbers will be to the left of last_ack_sent, * but they will eventually catch up. * In any case, it never made sense to trim reset segments to @@ -2849,7 +2849,7 @@ tcp_mss_update(struct tcpcb *tp, int off */ if (maxmtu == 0) { /* - * In case we return early we need to intialize metrics + * In case we return early we need to initialize metrics * to a defined state as tcp_hc_get() would do for us * if there was no cache hit. */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:30:32 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D06951065704; Thu, 6 Nov 2008 16:30:32 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF0908FC16; Thu, 6 Nov 2008 16:30:32 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6GUWPU060239; Thu, 6 Nov 2008 16:30:32 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6GUWCl060238; Thu, 6 Nov 2008 16:30:32 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200811061630.mA6GUWCl060238@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 6 Nov 2008 16:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184732 - head/lib/libstand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 16:30:33 -0000 Author: raj Date: Thu Nov 6 16:30:32 2008 New Revision: 184732 URL: http://svn.freebsd.org/changeset/base/184732 Log: Eliminate dead declarations in libstand. Modified: head/lib/libstand/stand.h Modified: head/lib/libstand/stand.h ============================================================================== --- head/lib/libstand/stand.h Thu Nov 6 16:30:20 2008 (r184731) +++ head/lib/libstand/stand.h Thu Nov 6 16:30:32 2008 (r184732) @@ -236,10 +236,6 @@ extern void *realloc(void *ptr, size_t s extern void *reallocf(void *ptr, size_t size); extern void mallocstats(void); -/* disklabel support (undocumented, may be junk) */ -struct disklabel; -extern char *getdisklabel(const char *, struct disklabel *); - extern int printf(const char *fmt, ...) __printflike(1, 2); extern void vprintf(const char *fmt, __va_list); extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, 3); From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:30:38 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E9591065815; Thu, 6 Nov 2008 16:30:38 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 523528FC12; Thu, 6 Nov 2008 16:30:38 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6GUcag060278; Thu, 6 Nov 2008 16:30:38 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6GUc41060276; Thu, 6 Nov 2008 16:30:38 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <200811061630.mA6GUc41060276@svn.freebsd.org> From: Max Laier Date: Thu, 6 Nov 2008 16:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184733 - head/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 16:30:38 -0000 Author: mlaier Date: Thu Nov 6 16:30:38 2008 New Revision: 184733 URL: http://svn.freebsd.org/changeset/base/184733 Log: Add two new options to du(1): -A Display the apparent size instead of the disk usage. This can be helpful when operating on compressed volumes or sparse files. -B blocksize Calculate block counts in blocksize byte blocks. This is differ- ent from the -k, -m options or setting BLOCKSIZE and gives an estimate of how much space the examined file hierachy would require on a filesystem with the given blocksize. Unless in -A mode, blocksize is rounded up to the next multiple of 512. The former is similar to GNU's du(1) --apparent-size. The latter is different from what GNU's du(1) -B does, which is equivalent to setting BLOCKSIZE in our implementation and is rather pointless as it doesn't add any real value (i.e. you can achieve the same with a simple awk-script). No change in the normal output or processing. Reviewed by: keramida@, Peter French Otherwise silience from: freebsd-hackers@ Modified: head/usr.bin/du/du.1 head/usr.bin/du/du.c Modified: head/usr.bin/du/du.1 ============================================================================== --- head/usr.bin/du/du.1 Thu Nov 6 16:30:32 2008 (r184732) +++ head/usr.bin/du/du.1 Thu Nov 6 16:30:38 2008 (r184733) @@ -32,7 +32,7 @@ .\" @(#)du.1 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd February 25, 2008 +.Dd November 6, 2008 .Dt DU 1 .Os .Sh NAME @@ -40,11 +40,12 @@ .Nd display disk usage statistics .Sh SYNOPSIS .Nm +.Op Fl A .Op Fl H | L | P .Op Fl a | s | d Ar depth .Op Fl c .Op Fl l -.Op Fl h | k | m +.Op Fl h | k | m | B Ar blocksize .Op Fl n .Op Fl x .Op Fl I Ar mask @@ -60,6 +61,25 @@ the current directory is displayed. .Pp The options are as follows: .Bl -tag -width indent +.It Fl A +Display the apparent size instead of the disk usage. +This can be helpful when operating on compressed volumes or sparse files. +.It Fl B Ar blocksize +Calculate block counts in +.Ar blocksize +byte blocks. +This is different from the +.Fl k, m +options or setting +.Ev BLOCKSIZE +and gives an estimate of how much space the examined file hierachy would +require on a filesystem with the given +.Ar blocksize . +Unless in +.Fl A +mode, +.Ar blocksize +is rounded up to the next multiple of 512. .It Fl H Symbolic links on the command line are followed, symbolic links in file hierarchies are not followed. @@ -136,14 +156,19 @@ followed is not counted or displayed. If the environment variable .Ev BLOCKSIZE is set, and the -.Fl k -option is not specified, the block counts will be displayed in units of that -size block. +.Fl k, m +or +.Fl h +options are not specified, the block counts will be displayed in units of +that block size. If .Ev BLOCKSIZE is not set, and the -.Fl k -option is not specified, the block counts will be displayed in 512-byte blocks. +.Fl k, m +or +.Fl h +options are not specified, the block counts will be displayed in 512-byte +blocks. .El .Sh SEE ALSO .Xr df 1 , Modified: head/usr.bin/du/du.c ============================================================================== --- head/usr.bin/du/du.c Thu Nov 6 16:30:32 2008 (r184732) +++ head/usr.bin/du/du.c Thu Nov 6 16:30:38 2008 (r184733) @@ -79,14 +79,15 @@ static void ignoreclean(void); static int ignorep(FTSENT *); static int nodumpflag = 0; +static int Aflag; +static long blocksize, cblocksize; int main(int argc, char *argv[]) { FTS *fts; FTSENT *p; - off_t savednumber; - long blocksize; + off_t savednumber, curblocks; int ftsoptions; int listall; int depth; @@ -98,16 +99,30 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = - lflag = 0; + lflag = Aflag = 0; save = argv; ftsoptions = 0; savednumber = 0; + cblocksize = DEV_BSIZE; + blocksize = 0; depth = INT_MAX; SLIST_INIT(&ignores); - while ((ch = getopt(argc, argv, "HI:LPasd:chklmnrx")) != -1) + while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrx")) != -1) switch (ch) { + case 'A': + Aflag = 1; + break; + case 'B': + errno = 0; + cblocksize = atoi(optarg); + if (errno == ERANGE || cblocksize <= 0) { + warnx("invalid argument to option B: %s", + optarg); + usage(); + } + break; case 'H': Hflag = 1; break; @@ -144,22 +159,18 @@ main(int argc, char *argv[]) cflag = 1; break; case 'h': - if (setenv("BLOCKSIZE", "512", 1) == -1) - warn("setenv: cannot set BLOCKSIZE=512"); hflag = 1; break; case 'k': hflag = 0; - if (setenv("BLOCKSIZE", "1024", 1) == -1) - warn("setenv: cannot set BLOCKSIZE=1024"); + blocksize = 1024; break; case 'l': lflag = 1; break; case 'm': hflag = 0; - if (setenv("BLOCKSIZE", "1048576", 1) == -1) - warn("setenv: cannot set BLOCKSIZE=1048576"); + blocksize = 1048576; break; case 'n': nodumpflag = 1; @@ -206,6 +217,9 @@ main(int argc, char *argv[]) if (Pflag) ftsoptions |= FTS_PHYSICAL; + if (!Aflag && (cblocksize % DEV_BSIZE) != 0) + cblocksize = howmany(cblocksize, DEV_BSIZE) * DEV_BSIZE; + listall = 0; if (aflag) { @@ -224,8 +238,13 @@ main(int argc, char *argv[]) argv[1] = NULL; } - (void)getbsize(¬used, &blocksize); - blocksize /= 512; + if (blocksize == 0) + (void)getbsize(¬used, &blocksize); + + if (!Aflag) { + cblocksize /= DEV_BSIZE; + blocksize /= DEV_BSIZE; + } rval = 0; @@ -242,17 +261,19 @@ main(int argc, char *argv[]) if (ignorep(p)) break; + curblocks = Aflag ? + howmany(p->fts_statp->st_size, cblocksize) : + howmany(p->fts_statp->st_blocks, cblocksize); p->fts_parent->fts_bignum += p->fts_bignum += - p->fts_statp->st_blocks; + curblocks; if (p->fts_level <= depth) { if (hflag) { - prthumanval(howmany(p->fts_bignum, - blocksize)); + prthumanval(p->fts_bignum); (void)printf("\t%s\n", p->fts_path); } else { (void)printf("%jd\t%s\n", - (intmax_t)howmany(p->fts_bignum, + howmany(p->fts_bignum * cblocksize, blocksize), p->fts_path); } } @@ -273,21 +294,22 @@ main(int argc, char *argv[]) linkchk(p)) break; + curblocks = Aflag ? + howmany(p->fts_statp->st_size, cblocksize) : + howmany(p->fts_statp->st_blocks, cblocksize); + if (listall || p->fts_level == 0) { if (hflag) { - prthumanval(howmany( - p->fts_statp->st_blocks, - blocksize)); + prthumanval(curblocks); (void)printf("\t%s\n", p->fts_path); } else { (void)printf("%jd\t%s\n", - (intmax_t)howmany( - p->fts_statp->st_blocks, - blocksize), p->fts_path); + howmany(curblocks * cblocksize, + blocksize), p->fts_path); } } - p->fts_parent->fts_bignum += p->fts_statp->st_blocks; + p->fts_parent->fts_bignum += curblocks; } savednumber = p->fts_parent->fts_bignum; } @@ -297,11 +319,11 @@ main(int argc, char *argv[]) if (cflag) { if (hflag) { - prthumanval(howmany(savednumber, blocksize)); + prthumanval(savednumber); (void)printf("\ttotal\n"); } else { (void)printf("%jd\ttotal\n", (intmax_t)howmany( - savednumber, blocksize)); + savednumber * cblocksize, blocksize)); } } @@ -448,7 +470,9 @@ prthumanval(int64_t bytes) { char buf[5]; - bytes *= DEV_BSIZE; + bytes *= cblocksize; + if (!Aflag) + bytes *= DEV_BSIZE; humanize_number(buf, sizeof(buf), bytes, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); @@ -460,8 +484,9 @@ static void usage(void) { (void)fprintf(stderr, - "usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] " - "[-l] [-h | -k | -m] [-n] [-x] [-I mask] [file ...]\n"); + "usage: du [-A] [-H | -L | -P] [-a | -s | -d depth] [-c] " + "[-l] [-h | -k | -m | -B bsize] [-n] [-x] [-I mask] " + "[file ...]\n"); exit(EX_USAGE); } From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:51:33 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E07281065687; Thu, 6 Nov 2008 16:51:33 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF5E38FC13; Thu, 6 Nov 2008 16:51:33 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6GpXfM060675; Thu, 6 Nov 2008 16:51:33 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6GpX1k060674; Thu, 6 Nov 2008 16:51:33 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200811061651.mA6GpX1k060674@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 6 Nov 2008 16:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184734 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 16:51:34 -0000 Author: marcel Date: Thu Nov 6 16:51:33 2008 New Revision: 184734 URL: http://svn.freebsd.org/changeset/base/184734 Log: Fix a panic caused by a corrupted table when the header is still valid. We were checking the state of the header and not the table. PR: 119868 Based on a patch from: Jaakko Heinonen MFC after: 1 week Modified: head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Thu Nov 6 16:30:38 2008 (r184733) +++ head/sys/geom/part/g_part_gpt.c Thu Nov 6 16:51:33 2008 (r184734) @@ -625,13 +625,16 @@ g_part_gpt_read(struct g_part_table *bas if (table->state[GPT_ELT_PRIHDR] == GPT_STATE_OK && table->state[GPT_ELT_SECHDR] == GPT_STATE_OK && !gpt_matched_hdrs(&prihdr, &sechdr)) { - if (table->state[GPT_ELT_PRITBL] == GPT_STATE_OK) + if (table->state[GPT_ELT_PRITBL] == GPT_STATE_OK) { table->state[GPT_ELT_SECHDR] = GPT_STATE_INVALID; - else + table->state[GPT_ELT_SECTBL] = GPT_STATE_MISSING; + } else { table->state[GPT_ELT_PRIHDR] = GPT_STATE_INVALID; + table->state[GPT_ELT_PRITBL] = GPT_STATE_MISSING; + } } - if (table->state[GPT_ELT_PRIHDR] != GPT_STATE_OK) { + if (table->state[GPT_ELT_PRITBL] != GPT_STATE_OK) { printf("GEOM: %s: the primary GPT table is corrupt or " "invalid.\n", pp->name); printf("GEOM: %s: using the secondary instead -- recovery " @@ -641,7 +644,7 @@ g_part_gpt_read(struct g_part_table *bas if (pritbl != NULL) g_free(pritbl); } else { - if (table->state[GPT_ELT_SECHDR] != GPT_STATE_OK) { + if (table->state[GPT_ELT_SECTBL] != GPT_STATE_OK) { printf("GEOM: %s: the secondary GPT table is corrupt " "or invalid.\n", pp->name); printf("GEOM: %s: using the primary only -- recovery " From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 17:00:19 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C73F1065676; Thu, 6 Nov 2008 17:00:19 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B3FD8FC1B; Thu, 6 Nov 2008 17:00:19 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6H0JEi060935; Thu, 6 Nov 2008 17:00:19 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6H0JVq060934; Thu, 6 Nov 2008 17:00:19 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200811061700.mA6H0JVq060934@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 6 Nov 2008 17:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184735 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 17:00:19 -0000 Author: marcel Date: Thu Nov 6 17:00:19 2008 New Revision: 184735 URL: http://svn.freebsd.org/changeset/base/184735 Log: Fix copyright notice. Modified: head/sys/sys/cfictl.h Modified: head/sys/sys/cfictl.h ============================================================================== --- head/sys/sys/cfictl.h Thu Nov 6 16:51:33 2008 (r184734) +++ head/sys/sys/cfictl.h Thu Nov 6 17:00:19 2008 (r184735) @@ -14,17 +14,17 @@ * may be used to endorse or promote products derived from this software * without specific prior written permission. * - * 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 Bill Paul 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. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 17:02:44 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E6D01065677; Thu, 6 Nov 2008 17:02:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 0B8098FC25; Thu, 6 Nov 2008 17:02:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mA6H0pgC053626; Thu, 6 Nov 2008 10:00:52 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 06 Nov 2008 10:02:06 -0700 (MST) Message-Id: <20081106.100206.-1889957246.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: <864p2l5hf1.fsf@ds4.des.no> References: <86skq6gxtn.fsf@ds4.des.no> <20081105.144840.-432836001.imp@bsdimp.com> <864p2l5hf1.fsf@ds4.des.no> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, alfred@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: 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... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 17:02:44 -0000 In message: <864p2l5hf1.fsf@ds4.des.no> Dag-Erling_Sm=F8rgrav writes: : "M. Warner Losh" writes: : > Dag-Erling_Sm=F8rgrav writes: : > > It looks like whoever wrote this went out of their way to find ne= w and : > > creative ways to break just about every style rule we have. : > Not just coding style, but also style of /dev entries, the modules : > style, etc. : = : So the question is, why was this code imported at all? Because it is useful. The current usb stack is in disrepair and people thought it could be fixed up after the import. This is an experiment, one that may well fail, to see if that's the case. Warner From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 17:02:45 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBA23106568E; Thu, 6 Nov 2008 17:02:45 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 9876C8FC08; Thu, 6 Nov 2008 17:02:45 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mA6H295k053629; Thu, 6 Nov 2008 10:02:09 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 06 Nov 2008 10:03:23 -0700 (MST) Message-Id: <20081106.100323.195417660.imp@bsdimp.com> To: danfe@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20081106101156.GA40311@FreeBSD.org> References: <20081105.144840.-432836001.imp@bsdimp.com> <864p2l5hf1.fsf@ds4.des.no> <20081106101156.GA40311@FreeBSD.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, des@des.no, svn-src-all@FreeBSD.org, alfred@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: 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... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 17:02:46 -0000 In message: <20081106101156.GA40311@FreeBSD.org> Alexey Dokuchaev writes: : On Thu, Nov 06, 2008 at 10:32:02AM +0100, Dag-Erling Sm??rgrav wrote: : > "M. Warner Losh" writes: : > > Dag-Erling_Sm??rgrav writes: : > > > It looks like whoever wrote this went out of their way to find new and : > > > creative ways to break just about every style rule we have. : > > Not just coding style, but also style of /dev entries, the modules : > > style, etc. : > : > So the question is, why was this code imported at all? : : Seconded, especially since it says the code was reviewed by you Warner in : the commit log. Unfortunately, most of my reviews were ignored, as were those of a great many other people. There's lots of pressure for this code from the user community. It is an experiment, one that may well ultimately fail. Warner From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 17:26:13 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B27D106564A; Thu, 6 Nov 2008 17:26:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 187BE8FC20; Thu, 6 Nov 2008 17:26:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6HQD9U061413; Thu, 6 Nov 2008 17:26:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6HQCfm061397; Thu, 6 Nov 2008 17:26:12 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811061726.mA6HQCfm061397@svn.freebsd.org> From: Warner Losh Date: Thu, 6 Nov 2008 17:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184736 - head/sys/dev/usb2/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 17:26:13 -0000 Author: imp Date: Thu Nov 6 17:26:12 2008 New Revision: 184736 URL: http://svn.freebsd.org/changeset/base/184736 Log: Bring in http://perforce.freebsd.org/chv.cgi?CH=152584 from hps. Submitted by: hps Modified: head/sys/dev/usb2/serial/uark2.c head/sys/dev/usb2/serial/ubsa2.c head/sys/dev/usb2/serial/ubser2.c head/sys/dev/usb2/serial/uchcom2.c head/sys/dev/usb2/serial/ucycom2.c head/sys/dev/usb2/serial/ufoma2.c head/sys/dev/usb2/serial/uftdi2.c head/sys/dev/usb2/serial/ugensa2.c head/sys/dev/usb2/serial/uipaq2.c head/sys/dev/usb2/serial/umct2.c head/sys/dev/usb2/serial/umodem2.c head/sys/dev/usb2/serial/umoscom2.c head/sys/dev/usb2/serial/uplcom2.c head/sys/dev/usb2/serial/usb2_serial.c head/sys/dev/usb2/serial/uvisor2.c head/sys/dev/usb2/serial/uvscom2.c Modified: head/sys/dev/usb2/serial/uark2.c ============================================================================== --- head/sys/dev/usb2/serial/uark2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/uark2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -174,7 +174,6 @@ static driver_t uark_driver = { DRIVER_MODULE(uark, ushub, uark_driver, uark_devclass, NULL, 0); MODULE_DEPEND(uark, usb2_serial, 1, 1, 1); MODULE_DEPEND(uark, usb2_core, 1, 1, 1); -MODULE_DEPEND(uark, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); static const struct usb2_device_id uark_devs[] = { {USB_VPI(USB_VENDOR_ARKMICRO, USB_PRODUCT_ARKMICRO_ARK3116, 0)}, Modified: head/sys/dev/usb2/serial/ubsa2.c ============================================================================== --- head/sys/dev/usb2/serial/ubsa2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/ubsa2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -313,7 +313,6 @@ static driver_t ubsa_driver = { DRIVER_MODULE(ubsa, ushub, ubsa_driver, ubsa_devclass, NULL, 0); MODULE_DEPEND(ubsa, usb2_serial, 1, 1, 1); MODULE_DEPEND(ubsa, usb2_core, 1, 1, 1); -MODULE_DEPEND(ubsa, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); static int ubsa_probe(device_t dev) Modified: head/sys/dev/usb2/serial/ubser2.c ============================================================================== --- head/sys/dev/usb2/serial/ubser2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/ubser2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -227,7 +227,6 @@ static driver_t ubser_driver = { DRIVER_MODULE(ubser, ushub, ubser_driver, ubser_devclass, NULL, 0); MODULE_DEPEND(ubser, usb2_serial, 1, 1, 1); MODULE_DEPEND(ubser, usb2_core, 1, 1, 1); -MODULE_DEPEND(ubser, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); static int ubser_probe(device_t dev) Modified: head/sys/dev/usb2/serial/uchcom2.c ============================================================================== --- head/sys/dev/usb2/serial/uchcom2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/uchcom2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -1035,4 +1035,3 @@ static devclass_t uchcom_devclass; DRIVER_MODULE(uchcom, ushub, uchcom_driver, uchcom_devclass, NULL, 0); MODULE_DEPEND(uchcom, usb2_serial, 1, 1, 1); MODULE_DEPEND(uchcom, usb2_core, 1, 1, 1); -MODULE_DEPEND(uchcom, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); Modified: head/sys/dev/usb2/serial/ucycom2.c ============================================================================== --- head/sys/dev/usb2/serial/ucycom2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/ucycom2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -173,7 +173,6 @@ static driver_t ucycom_driver = { DRIVER_MODULE(ucycom, ushub, ucycom_driver, ucycom_devclass, NULL, 0); MODULE_DEPEND(ucycom, usb2_serial, 1, 1, 1); MODULE_DEPEND(ucycom, usb2_core, 1, 1, 1); -MODULE_DEPEND(ucycom, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); /* * Supported devices Modified: head/sys/dev/usb2/serial/ufoma2.c ============================================================================== --- head/sys/dev/usb2/serial/ufoma2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/ufoma2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -335,7 +335,6 @@ static driver_t ufoma_driver = { DRIVER_MODULE(ufoma, ushub, ufoma_driver, ufoma_devclass, NULL, 0); MODULE_DEPEND(ufoma, usb2_serial, 1, 1, 1); MODULE_DEPEND(ufoma, usb2_core, 1, 1, 1); -MODULE_DEPEND(ufoma, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); static int ufoma_probe(device_t dev) Modified: head/sys/dev/usb2/serial/uftdi2.c ============================================================================== --- head/sys/dev/usb2/serial/uftdi2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/uftdi2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -222,7 +222,6 @@ static driver_t uftdi_driver = { DRIVER_MODULE(uftdi, ushub, uftdi_driver, uftdi_devclass, NULL, 0); MODULE_DEPEND(uftdi, usb2_serial, 1, 1, 1); MODULE_DEPEND(uftdi, usb2_core, 1, 1, 1); -MODULE_DEPEND(uftdi, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); static struct usb2_device_id uftdi_devs[] = { {USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL_8U100AX, UFTDI_TYPE_SIO)}, Modified: head/sys/dev/usb2/serial/ugensa2.c ============================================================================== --- head/sys/dev/usb2/serial/ugensa2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/ugensa2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -172,7 +172,6 @@ static driver_t ugensa_driver = { DRIVER_MODULE(ugensa, ushub, ugensa_driver, ugensa_devclass, NULL, 0); MODULE_DEPEND(ugensa, usb2_serial, 1, 1, 1); MODULE_DEPEND(ugensa, usb2_core, 1, 1, 1); -MODULE_DEPEND(ugensa, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); static const struct usb2_device_id ugensa_devs[] = { {USB_VPI(USB_VENDOR_AIRPRIME, USB_PRODUCT_AIRPRIME_PC5220, 0)}, Modified: head/sys/dev/usb2/serial/uipaq2.c ============================================================================== --- head/sys/dev/usb2/serial/uipaq2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/uipaq2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -1094,7 +1094,6 @@ static driver_t uipaq_driver = { DRIVER_MODULE(uipaq, ushub, uipaq_driver, uipaq_devclass, NULL, 0); MODULE_DEPEND(uipaq, usb2_serial, 1, 1, 1); MODULE_DEPEND(uipaq, usb2_core, 1, 1, 1); -MODULE_DEPEND(uipaq, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); static int uipaq_probe(device_t dev) Modified: head/sys/dev/usb2/serial/umct2.c ============================================================================== --- head/sys/dev/usb2/serial/umct2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/umct2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -237,7 +237,6 @@ static driver_t umct_driver = { DRIVER_MODULE(umct, ushub, umct_driver, umct_devclass, NULL, 0); MODULE_DEPEND(umct, usb2_serial, 1, 1, 1); MODULE_DEPEND(umct, usb2_core, 1, 1, 1); -MODULE_DEPEND(umct, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); static int umct_probe(device_t dev) Modified: head/sys/dev/usb2/serial/umodem2.c ============================================================================== --- head/sys/dev/usb2/serial/umodem2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/umodem2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -278,7 +278,6 @@ static driver_t umodem_driver = { DRIVER_MODULE(umodem, ushub, umodem_driver, umodem_devclass, NULL, 0); MODULE_DEPEND(umodem, usb2_serial, 1, 1, 1); MODULE_DEPEND(umodem, usb2_core, 1, 1, 1); -MODULE_DEPEND(umodem, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); MODULE_VERSION(umodem, UMODEM_MODVER); static int Modified: head/sys/dev/usb2/serial/umoscom2.c ============================================================================== --- head/sys/dev/usb2/serial/umoscom2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/umoscom2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -296,7 +296,6 @@ static driver_t umoscom_driver = { DRIVER_MODULE(umoscom, ushub, umoscom_driver, umoscom_devclass, NULL, 0); MODULE_DEPEND(umoscom, usb2_serial, 1, 1, 1); MODULE_DEPEND(umoscom, usb2_core, 1, 1, 1); -MODULE_DEPEND(umoscom, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); static const struct usb2_device_id umoscom_devs[] = { {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7703, 0)} Modified: head/sys/dev/usb2/serial/uplcom2.c ============================================================================== --- head/sys/dev/usb2/serial/uplcom2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/uplcom2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -331,7 +331,6 @@ static driver_t uplcom_driver = { DRIVER_MODULE(uplcom, ushub, uplcom_driver, uplcom_devclass, NULL, 0); MODULE_DEPEND(uplcom, usb2_serial, 1, 1, 1); MODULE_DEPEND(uplcom, usb2_core, 1, 1, 1); -MODULE_DEPEND(uplcom, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); MODULE_VERSION(uplcom, UPLCOM_MODVER); static int Modified: head/sys/dev/usb2/serial/usb2_serial.c ============================================================================== --- head/sys/dev/usb2/serial/usb2_serial.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/usb2_serial.c Thu Nov 6 17:26:12 2008 (r184736) @@ -147,8 +147,7 @@ static struct ttydevsw usb2_com_class = .tsw_free = usb2_com_free, }; -MODULE_DEPEND(ucom, usb2_core, 1, 1, 1); -MODULE_VERSION(ucom, UCOM_MODVER); +MODULE_DEPEND(usb2_serial, usb2_core, 1, 1, 1); MODULE_VERSION(usb2_serial, 1); #define UCOM_UNIT_MAX 0x1000 /* exclusive */ Modified: head/sys/dev/usb2/serial/uvisor2.c ============================================================================== --- head/sys/dev/usb2/serial/uvisor2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/uvisor2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -256,7 +256,6 @@ static driver_t uvisor_driver = { DRIVER_MODULE(uvisor, ushub, uvisor_driver, uvisor_devclass, NULL, 0); MODULE_DEPEND(uvisor, usb2_serial, 1, 1, 1); MODULE_DEPEND(uvisor, usb2_core, 1, 1, 1); -MODULE_DEPEND(uvisor, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); static const struct usb2_device_id uvisor_devs[] = { {USB_VPI(USB_VENDOR_ACEECA, USB_PRODUCT_ACEECA_MEZ1000, UVISOR_FLAG_PALM4)}, Modified: head/sys/dev/usb2/serial/uvscom2.c ============================================================================== --- head/sys/dev/usb2/serial/uvscom2.c Thu Nov 6 17:00:19 2008 (r184735) +++ head/sys/dev/usb2/serial/uvscom2.c Thu Nov 6 17:26:12 2008 (r184736) @@ -283,7 +283,6 @@ static driver_t uvscom_driver = { DRIVER_MODULE(uvscom, ushub, uvscom_driver, uvscom_devclass, NULL, 0); MODULE_DEPEND(uvscom, usb2_serial, 1, 1, 1); MODULE_DEPEND(uvscom, usb2_core, 1, 1, 1); -MODULE_DEPEND(uvscom, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); MODULE_VERSION(uvscom, UVSCOM_MODVER); static int From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 17:31:45 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8C1C1065676; Thu, 6 Nov 2008 17:31:45 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id A73588FC12; Thu, 6 Nov 2008 17:31:45 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id mA6HViAK008614 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 Nov 2008 09:31:45 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <49132A00.6090900@freebsd.org> Date: Thu, 06 Nov 2008 09:31:44 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: Warner Losh References: <200811061726.mA6HQCfm061397@svn.freebsd.org> In-Reply-To: <200811061726.mA6HQCfm061397@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184736 - head/sys/dev/usb2/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 17:31:46 -0000 Warner Losh wrote: > Author: imp > Date: Thu Nov 6 17:26:12 2008 > New Revision: 184736 > URL: http://svn.freebsd.org/changeset/base/184736 > > Log: > Bring in http://perforce.freebsd.org/chv.cgi?CH=152584 from hps. > > Submitted by: hps > > Please call out the reason for a change. Indirect references easily go stale and do not help people track/understand changes when offline. Sam From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 17:51:58 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02C1A106564A; Thu, 6 Nov 2008 17:51:58 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id B6A1C8FC1C; Thu, 6 Nov 2008 17:51:57 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mA6HlvPl054344; Thu, 6 Nov 2008 10:47:57 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 06 Nov 2008 10:49:11 -0700 (MST) Message-Id: <20081106.104911.514365389.imp@bsdimp.com> To: sam@freebsd.org From: "M. Warner Losh" In-Reply-To: <49132A00.6090900@freebsd.org> References: <200811061726.mA6HQCfm061397@svn.freebsd.org> <49132A00.6090900@freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184736 - head/sys/dev/usb2/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 17:51:58 -0000 In message: <49132A00.6090900@freebsd.org> Sam Leffler writes: : Warner Losh wrote: : > Author: imp : > Date: Thu Nov 6 17:26:12 2008 : > New Revision: 184736 : > URL: http://svn.freebsd.org/changeset/base/184736 : > : > Log: : > Bring in http://perforce.freebsd.org/chv.cgi?CH=152584 from hps. : > : > Submitted by: hps : > : > : Please call out the reason for a change. Indirect references easily go : stale and do not help people track/understand changes when offline. Good point. I recall seeing that that's no way to do a forced commit with svn to explain. The reason for the change was that the new serial modules were referencing the old serial module name mistakenly, causing module load ordering issues. Warner From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 19:17:59 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 544B0106567F; Thu, 6 Nov 2008 19:17:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41D768FC27; Thu, 6 Nov 2008 19:17:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6JHxh0063771; Thu, 6 Nov 2008 19:17:59 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6JHx9i063769; Thu, 6 Nov 2008 19:17:59 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200811061917.mA6JHx9i063769@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 6 Nov 2008 19:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184737 - in head: sys/cddl/contrib/opensolaris/uts/common/fs/zfs tools/regression/fstest/tests/rename X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 19:17:59 -0000 Author: trasz Date: Thu Nov 6 19:17:58 2008 New Revision: 184737 URL: http://svn.freebsd.org/changeset/base/184737 Log: Change ZFS behaviour to match UFS: when moving (rename(2)) a subdirectory from one parent directory to another, in addition to the usual access checks one also needs write access to the subdirectory being moved. Approved by: rwatson (mentor), pjd Added: head/tools/regression/fstest/tests/rename/21.t (contents, props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Nov 6 17:26:12 2008 (r184736) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Nov 6 19:17:58 2008 (r184737) @@ -1580,7 +1580,14 @@ zfs_zaccess_rename(znode_t *sdzp, znode_ /* * Rename permissions are combination of delete permission + * add file/subdir permission. + * + * BSD operating systems also require write permission + * on the directory being moved. */ + if (ZTOV(szp)->v_type == VDIR) { + if (error = zfs_zaccess(szp, ACE_WRITE_DATA, cr)) + return (error); + } /* * first make sure we do the delete portion. Added: head/tools/regression/fstest/tests/rename/21.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/fstest/tests/rename/21.t Thu Nov 6 19:17:58 2008 (r184737) @@ -0,0 +1,38 @@ +#!/bin/sh +# $FreeBSD$ + +desc="write access to subdirectory is required to move it to another directory" + +dir=`dirname $0` +. ${dir}/../misc.sh + +echo "1..12" + +n0=`namegen` +n1=`namegen` +n2=`namegen` +n3=`namegen` + +expect 0 mkdir ${n2} 0777 +expect 0 mkdir ${n3} 0777 +cdir=`pwd` + +# Check that write permission on containing directory (${n2}) is not enough +# to move subdirectory (${n0}) from that directory. +expect 0 mkdir ${n2}/${n0} 0700 +expect EACCES -u 65534 -g 65534 rename ${n2}/${n0} ${n3}/${n0} + +expect 0 rmdir ${n2}/${n0} +expect ENOENT rmdir ${n2}/${n0} + +# Check that write permission on containing directory (${n2}) is enough +# to move file (${n0}) from that directory. +expect 0 create ${n2}/${n0} 0755 +expect 0 -u 65534 -g 65534 rename ${n2}/${n0} ${n3}/${n0} + +expect 0 unlink ${n3}/${n0} +expect ENOENT unlink ${n2}/${n0} + +expect 0 rmdir ${n3} +expect 0 rmdir ${n2} + From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 20:10:09 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7DCB106567C; Thu, 6 Nov 2008 20:10:09 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by mx1.freebsd.org (Postfix) with ESMTP id 23E2D8FC25; Thu, 6 Nov 2008 20:10:09 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 9AA041A80E2; Thu, 6 Nov 2008 15:10:08 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 06 Nov 2008 15:10:08 -0500 X-Sasl-enc: 05gUrm1q5MV+PzZHvjcPBHFeR97MFOnFb25Wkrahtn9l 1226002208 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 93BB63BDF7; Thu, 6 Nov 2008 15:10:05 -0500 (EST) Message-ID: <49134F1C.2000102@FreeBSD.org> Date: Thu, 06 Nov 2008 20:10:04 +0000 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.14 (X11/20080514) MIME-Version: 1.0 To: "M. Warner Losh" References: <20081105.144840.-432836001.imp@bsdimp.com> <864p2l5hf1.fsf@ds4.des.no> <20081106101156.GA40311@FreeBSD.org> <20081106.100323.195417660.imp@bsdimp.com> In-Reply-To: <20081106.100323.195417660.imp@bsdimp.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: danfe@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, alfred@FreeBSD.org, svn-src-head@FreeBSD.org, des@des.no Subject: Re: 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... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 20:10:09 -0000 M. Warner Losh wrote: > ... > : > So the question is, why was this code imported at all? > : > : Seconded, especially since it says the code was reviewed by you Warner in > : the commit log. > > Unfortunately, most of my reviews were ignored, as were those of a > great many other people. There's lots of pressure for this code from > the user community. It is an experiment, one that may well ultimately > fail. Or ultimately succeed. I have every confidence in Alfred's ability to see things through. It is better that this is happening now, after the SVN import, therefore the change cost may not be so great as it may have been with CVS. One of the long-standing problems with FreeBSD is that we have been too conservative in what we've allowed into the code base. There are sound and compelling reasons why we have such rules, however, it's worth remembering that competition has been able to get a foothold in various key areas that could have been expanded into. The fact is, at the end of the day, it's about how things get used, so perhaps an experiment in user-driven development isn't so bad (for some value of "user" other than large corporate sponsor giving code away 6-12 months after something happened). cheers BMS From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 21:14:35 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EA091065670; Thu, 6 Nov 2008 21:14:35 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id B1FD68FC26; Thu, 6 Nov 2008 21:14:34 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mA6LCLwb057102; Thu, 6 Nov 2008 14:12:21 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 06 Nov 2008 14:13:36 -0700 (MST) Message-Id: <20081106.141336.-2063499770.imp@bsdimp.com> To: bms@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <49134F1C.2000102@FreeBSD.org> References: <20081106101156.GA40311@FreeBSD.org> <20081106.100323.195417660.imp@bsdimp.com> <49134F1C.2000102@FreeBSD.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: danfe@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, alfred@FreeBSD.org, svn-src-head@FreeBSD.org, des@des.no Subject: Re: 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... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 21:14:35 -0000 In message: <49134F1C.2000102@FreeBSD.org> "Bruce M. Simpson" writes: : M. Warner Losh wrote: : > ... : > : > So the question is, why was this code imported at all? : > : : > : Seconded, especially since it says the code was reviewed by you Warner in : > : the commit log. : > : > Unfortunately, most of my reviews were ignored, as were those of a : > great many other people. There's lots of pressure for this code from : > the user community. It is an experiment, one that may well ultimately : > fail. : : Or ultimately succeed. I have every confidence in Alfred's ability to : see things through. Alfred doesn't matter so much here. Not to minimize his work to date in coordination for usb2, but it won't succeed or fail based on him alone. The success or failure of this will be how well hps can cope with the code being shared. How well the FreeBSD developers adapt the code to be closer to FreeBSD standard in a number of areas. How well people are able to fix the flaws that grew into this code base as it developed in isolation. : It is better that this is happening now, after the SVN import, therefore : the change cost may not be so great as it may have been with CVS. This is true. : One of the long-standing problems with FreeBSD is that we have been too : conservative in what we've allowed into the code base. There are sound : and compelling reasons why we have such rules, however, it's worth : remembering that competition has been able to get a foothold in various : key areas that could have been expanded into. I'm not so sure I agree with this. The problems with the usb import was social, not technical. Warner From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 21:47:03 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F122C1065678; Thu, 6 Nov 2008 21:47:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE6608FC16; Thu, 6 Nov 2008 21:47:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6Ll29g066405; Thu, 6 Nov 2008 21:47:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6Ll2Vp066404; Thu, 6 Nov 2008 21:47:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200811062147.mA6Ll2Vp066404@svn.freebsd.org> From: Alexander Motin Date: Thu, 6 Nov 2008 21:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184738 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 21:47:03 -0000 Author: mav Date: Thu Nov 6 21:47:02 2008 New Revision: 184738 URL: http://svn.freebsd.org/changeset/base/184738 Log: A lot of spelling fixes. Submitted by: keramida Modified: head/share/man/man4/snd_hda.4 Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Thu Nov 6 19:17:58 2008 (r184737) +++ head/share/man/man4/snd_hda.4 Thu Nov 6 21:47:02 2008 (r184738) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2008 +.Dd November 6, 2008 .Dt SND_HDA 4 .Os .Sh NAME @@ -57,8 +57,8 @@ driver is a HDA bus controller driver an driver that allows the generic audio driver, .Xr sound 4 , to be used with this hardware. +Only audio functions are supported by .Nm -only supports audio functions. Modem, HDMI and other possible functions are not implemented. .Pp The @@ -68,7 +68,7 @@ Definition Audio specification and tries Universal Audio Architecture (UAA) draft (revision 0.7b) for handling audio devices. .Pp -According to HDA and UAA specifications, depending on number of HDA buses +According to HDA and UAA specifications, depending on the number of HDA buses and codecs present in system, their audio capabilities and BIOS provided configuration, the .Nm @@ -76,14 +76,16 @@ driver often provides several PCM audio For example, one device for main rear 7.1 output and inputs, one device for independent headset connectors at front and one device for SPDIF or HDMI audio input/output. -Usually that assignment may be widely tuned by using device hints. -A lot of useful information about driver operation and present audio setup may -be obtained from the driver verbose boot messages. -.Pp -You can select audio device to use by default with hw.snd.default_unit -sysctl described in -.Xr sound 4 -or explicitly specify it in appliation settings. +The assignment of audio inputs and outputs may be tuned with +.Xr device.hints 5 . +The driver's verbose boot messages provide a lot of information about +the operation of the driver and present audio setup. +.Pp +The default audio device may be tuned by setting the +.Ar hw.snd.default_unit +sysctl, as described in +.Xr sound 4 , +or explicitly specified it in application settings. .Ss Boot-time Configuration The following variables are available at boot-time through the .Xr device.hints 5 @@ -123,18 +125,26 @@ such as .Dq Li nofixedrate , will do the opposite and takes precedence. Options can be separated by whitespace and commas. -GPIO is a codecs General Purpose I/O pins which system integrators sometimes +.Dq Li GPIO Ns s +are a codec's General Purpose I/O pins which system integrators sometimes use to control external muters, amplifiers and so on. -If you have no sound or sound volume is not adequate you may need to find a -GPIO combination required for your system. -ivrefX/ovrefX options controls voltage used to power external microphones -and so on. +If you have no sound, or sound volume is not adequate, you may have to +experiment a bit with the GPIO setup to find the optimal setup for your +system. +The +.Dq Li ivref Ns Ar X +and +.Dq Li ovref Ns Ar X +options control the voltage used to power external microphones. .It Va hint.hdac.%d.msi Controls MSI (Message Signaled Interrupts) support. .It Va hint.hdac.%d.cad%d.nid%d.config Overrides codec pin configuration set by BIOS. -May be specified as a 32bit HEX value with a leading "0x" or as a set of -space separated "option=value" pairs. +May be specified as a 32-bit hexadecimal value with a leading +.Dq 0x , +or as a set of space-separated +.Dq Ar option Ns = Ns Ar value +pairs. .El .Pp Pin configuration is the UAA driver's main source of information about codec @@ -143,33 +153,36 @@ This information is usually provided by by system integrators for specific system requirements. The .Nm -driver allows users to override it to fix integrator mistakes or to use codec -in alternative ways, for example, to get stereo output and 2 inputs -instead of a single 5.1 output. -Configuration includes the following options: +driver allows users to override it to fix integrator mistakes or to use the +available codec in alternative ways (for example to get stereo output and 2 +inputs instead of a single 5.1 output). +.Pp +The following options are supported: .Bl -tag -width ".Va device=" -offset indent .It Va as Association number. -Associations are used to group individual pins to form a complex multipin +Associations are used to group individual pins to form a complex multi-pin device. -For example, to group 4 connectors for 7.1 output or to treat several +For example, to group 4 connectors for 7.1 output, or to treat several input connectors as sources for the same input device. -Can be specified as number from 0 to 15. -Association number 0 means disabled pin, number 15 is a set of independent -unassociated pins. -Each association includes only pins of the same direction (in/out) and -detected atomically - all pins or none. -For every pair of input+output associations in order of their numeration -separate PCM audio device is created. +Association numbers can be specified as numeric values from 0 to 15. +A value of 0 means disabled pin. +A value of 15 is a set of independent unassociated pins. +Each association includes only pins of the same direction (in/out) and is +detected atomically (all pins or none). +A separate PCM audio device is created for every pair of input and +output associations. .It Va seq Sequence number. -This unique inside every association number used to order pins inside -association. -Can be specified as a number from 0 to 15. -Sequence number 15 for output associations has also special meaning. -Output pin with sequence number 15 and device type Headhones will duplicate -(with automatic mute if jack detection is supported) the first pin in that -association. +A unique, per-association number used to order pins inside the +particular association. +Sequence numbers can be specified as numeric values from 0 to 15. +.Pp +The sequence number 15 has a special meaning for output associations. +Output pins with this number and device type +.Dq Ar Headphones +will duplicate (with automatic mute if jack detection is supported) the +first pin in that association. .It Va device Device type. Can be specified as a number from 0 to 15 or as a name: @@ -193,27 +206,31 @@ or The device type also describes the pin direction (in/out). For example, .Dq Li CD -always means input pin, while +always means an input pin, while .Dq Li Headphones -always means output. +always means an output. .It Va conn Connection type. -Can be specified as a number from 0 to 3 or as a name: +Can be specified as a number from 0 to 3. +The connection type can also be specified as one of the special names .Dq Li Jack , .Dq Li None , .Dq Li Fixed , or .Dq Li Both . -Pins with +Pins with a connection type of .Dq Li None -connection type are disabled. +are disabled. .It Va ctype Connector physical type. Can be specified as a number from 0 to 15. -This is a reference only value which is ignored by the driver. +This is a reference only value. +It is ignored by the +.Nm +driver. .It Va color Connector color. -Can be specified as a number from 0 to 15 or as a name: +Can be specified as a number from 0 to 15 or as one of the names .Dq Li Unknown , .Dq Li Black , .Dq Li Grey , @@ -231,16 +248,22 @@ Can be specified as a number from 0 to 1 .Dq Li White , or .Dq Li Other . -This is a reference only value which is ignored by the driver. +This is a reference only value. +It is ignored by the +.Nm +driver. .It Va loc Connector physical location. Can be specified as a number from 0 to 63. -This is a reference only value which is ignored by the driver. +This is a reference only value. +It is ignored by the +.Nm +driver. .It Va misc Misc bits. Can be specified as a number from 0 to 15. -Bit 0, if set, tells that jack detection on this pin supported by the codec -is not implemented in hardware. +Bit 0 has a special meaning. When set it means that jack detection is +not implemented in hardware. .El .Ss Runtime Configuration The following @@ -250,8 +273,9 @@ variables are available in addition to t devices: .Bl -tag -width ".Va dev.hdac.%d.polling" -offset indent .It Va dev.hdac.%d.polling -Enables polling mode, where the driver operates by querying the device -state on timer ticks using +Enables polling mode. +In this mode the driver operates by querying the device state on timer +ticks using .Xr callout 9 instead of interrupts. Polling is disabled by default. @@ -264,14 +288,16 @@ Setting this to a non-zero value dumps t capabilities and jack sense status to console and syslog. .El .Sh EXAMPLES -Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example. It has two -audio connectors on a front side, three audio connectors on a rear side and one -internal speaker. According to verbose driver output and codec datasheet, -codec has five stereo DACs and two stereo ADCs, all of them are routable to -any codec pin (external connector). All codec pins are reversible. +Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example. +This system has two audio connectors on a front side, three audio connectors +on a rear side and one internal speaker. +According to verbose driver output and the codec datasheet, +this codec has five stereo DACs and two stereo ADCs, all of them are routable to +any codec pin (external connector). +All codec pins are reversible (could be configured either as input or output). .Pp So high codec uniformity and flexibility allow driver to configure it in many -deferent ways, depending on requested pins usage decribed by pins configuration. +defferent ways, depending on requested pins usage decribed by pins configuration. Driver reports such default pin configuration when verbose messages enabled: .Bd -literal hdac0: nid 20 0x01014020 as 2 seq 0 Line-out Jack jack 1 loc 1 color Green misc 0 @@ -308,49 +334,86 @@ hdac0: Pin nid=26 seq=1 hdac0: Pin nid=25 seq=15 .Ed .Pp -Each pcm device uses two associations: one for playback and one for recording. -Associations processed and assigned to pcm devices in order of their numbers. -It means that association #0 (1) will become pcm0 device playback, using -internal speaker and headphones jack with speaker automute on headphones -connection. -Association #1 (2) will become pcm1 playback, using the Line-out jack. -Association #2 (3) will become pcm0 recording, using external microphones and -line-in jack. -.Pp -Driver provides extensive set of verbose messages to diagnose it's operation -logic and description of resulted codec configuration. -.Pp -Using device.hints it is possible to modify existing pins configuration to -create broad range of different audio setups. Here is examples of some setups -possible for the described hardware: +Each +.Xr pcm 4 +device uses two associations: one for playback and one for recording. +Associations processed and assigned to +.Xr pcm 4 +devices in increasing numerical order. +In this case association #0 (1) will become +.Li pcm0 +device playback, using the internal speakers and +.Ar Headphones +jack with speaker automute on the headphones jack connection. +Association #1 (2) will become +.Li pcm1 +playback, using the +.Ar Line-out +jack. +Association #2 (3) will become +.Li pcm0 +recording, using the external microphones and the +.Ar Line-in +jack. +.Pp +The +.Nm +driver provides extensive verbose messages to diagnose its operation +logic and describe its current codec configuration. +.Pp +Using +.Xr device.hints 5 +it is possible to modify the configuration of the existing pins, +allowing a broad range of different audio setups. +Here are a few examples of some setups possible for this particular +hardware: .Ss Example 1 -Setting +Setting the +.Xr device.hints 5 +options .Bd -literal hint.hdac.0.cad0.nid20.config="as=1" hint.hdac.0.cad0.nid21.config="as=2" .Ed .Pp -will swap line-out and speaker functions. So pcm0 device will play to the -line-out and headphones jacks with line-out automute on headphones connection. -Recording on pcm0 will go from two external microphones and line-in jacks. -pcm1 playback will go to the internal speaker. +will swap line-out and speaker functions. +So the +.Li pcm0 +device will play to the line-out and headphones jacks. Line-out will +be muted on the headphones jack connection. +Recording on +.Li pcm0 +will go from two external microphones and line-in jacks. +.Li pcm1 +playback will go to the internal speaker. .Pp .Ss Example 2 -Setting +Setting the +.Xr device.hints 5 +options .Bd -literal hint.hdac.0.cad0.nid20.config="as=1 seq=15 device=Headphones" hint.hdac.0.cad0.nid27.config="as=2 seq=0" hint.hdac.0.cad0.nid25.config="as=4 seq=0" .Ed .Pp -will split headphones and one of mics to separate device. So pcm0 device will -play to the internal speaker and line-out jack with speaker automute on -line-out connection. Recording on pcm0 will go from one external microphone -and line-in jacks. pcm1 will be completely dedicated to headset (headphones and -mic) connected to the front connectors. +will split the headphones and one of the microphones to a separate device. +The +.Li pcm0 +device will play to the internal speaker and to the line-out jack, with +speaker automute on the line-out jack connection. +Recording on +.Li pcm0 +will use input from one external microphone and the line-in jacks. +The +.Li pcm1 +device will be completely dedicated to a headset (headphones and mic) +connected to the front connectors. .Pp .Ss Example 3 -Setting +Setting the +.Xr device.hints 5 +options .Bd -literal hint.hdac.0.cad0.nid20.config="as=1 seq=0" hint.hdac.0.cad0.nid26.config="as=2 seq=0" @@ -360,12 +423,21 @@ hint.hdac.0.cad0.nid24.config="as=5 seq= hint.hdac.0.cad0.nid21.config="as=6 seq=0" .Ed .Pp -will give 4 independent devices: pcm0 - line-out + line-in, pcm1 - headphones -+ mic, pcm2 - additional line-out via retasked rear mic jack, pcm3 - internal -speaker. +will give 4 independent devices: +.Li pcm0 +.Pq line-out and line-in , +.Li pcm1 +.Pq headphones and mic , +.Li pcm2 +.Pq additional line-out via retasked rear mic jack , +and +.Li pcm3 +.Pq internal speaker . .Pp .Ss Example 4 -Setting +Setting the +.Xr device.hints 5 +options .Bd -literal hint.hdac.0.cad0.nid20.config="as=1 seq=0" hint.hdac.0.cad0.nid24.config="as=1 seq=1 device=Line-out" @@ -373,10 +445,13 @@ hint.hdac.0.cad0.nid26.config="as=1 seq= hint.hdac.0.cad0.nid21.config="as=2 seq=0" .Ed .Pp -will give 2 devices: pcm0 - 5.1 playback via 3 rear (line-out and retasked -mic and line-in) connectors and front headphones with rear connectors automute -on headphones connection + front mic recording. pcm1 - internal speaker -playback. +will give 2 devices: +.Li pcm0 +for 5.1 playback via 3 rear connectors (line-out and retasked +mic and line-in) and headset (headphones and mic) at front connectors. +.Li pcm1 +for internal speaker playback. +On headphones connection rear connectors will be muted. .Sh HARDWARE The .Nm @@ -521,9 +596,10 @@ driver was written by and .An Alexander Motin Aq mav@FreeBSD.org . This manual page was written by -.An Joel Dahl Aq joel@FreeBSD.org +.An Joel Dahl Aq joel@FreeBSD.org , +.An Alexander Motin Aq mav@FreeBSD.org and -.An Alexander Motin Aq mav@FreeBSD.org . +.An Giorgos Keramidas Aq keramida@FreeBSD.org . .Sh BUGS A few Hardware/OEM vendors tend to screw up BIOS settings, thus rendering the @@ -533,4 +609,4 @@ driver useless, which usually results in driver seems to attach and work, but without any sound. .Pp Due to OSS limitation multichannel (not multidevice) playback is not -supported. \ No newline at end of file +supported. From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 21:49:24 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99FFE106564A; Thu, 6 Nov 2008 21:49:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id B10B68FC12; Thu, 6 Nov 2008 21:49:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 227193284; Thu, 06 Nov 2008 23:49:22 +0200 Message-ID: <49136661.9060004@FreeBSD.org> Date: Thu, 06 Nov 2008 23:49:21 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.17 (X11/20081029) MIME-Version: 1.0 To: Giorgos Keramidas References: <200811051712.mA5HCIP7032611@svn.freebsd.org> <87r65okf7n.fsf@kobe.laptop> In-Reply-To: <87r65okf7n.fsf@kobe.laptop> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184695 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 21:49:24 -0000 Hi. Giorgos Keramidas wrote: > There are a few places where we can probably improve the manpage a bit > more. I am not sure I understand *all* the technical details of pins > and association numbers, but does the following look like something > worth committing? I have changed some incorrect peaces, but mostly committed as is. Thanks! -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 22:11:58 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6730E106567C; Thu, 6 Nov 2008 22:11:58 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 537168FC08; Thu, 6 Nov 2008 22:11:58 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6MBwik066992; Thu, 6 Nov 2008 22:11:58 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6MBvdU066984; Thu, 6 Nov 2008 22:11:57 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <200811062211.mA6MBvdU066984@svn.freebsd.org> From: Julian Elischer Date: Thu, 6 Nov 2008 22:11:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184739 - in stable/7/sys: . modules/cxgb net netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 22:11:58 -0000 Author: julian Date: Thu Nov 6 22:11:57 2008 New Revision: 184739 URL: http://svn.freebsd.org/changeset/base/184739 Log: MFC a rewrite of rt_check(). also revert the addition of rt_check_fib() which we discovered is not needed. fixes some hangs people have seen Approved by: re (ken) Modified: stable/7/sys/ (props changed) stable/7/sys/modules/cxgb/ (props changed) stable/7/sys/net/if_atmsubr.c stable/7/sys/net/if_fwsubr.c stable/7/sys/net/if_iso88025subr.c stable/7/sys/net/route.c stable/7/sys/net/route.h stable/7/sys/netinet/if_ether.c stable/7/sys/netinet/in_rmx.c stable/7/sys/netinet/in_var.h Modified: stable/7/sys/net/if_atmsubr.c ============================================================================== --- stable/7/sys/net/if_atmsubr.c Thu Nov 6 21:47:02 2008 (r184738) +++ stable/7/sys/net/if_atmsubr.c Thu Nov 6 22:11:57 2008 (r184739) @@ -158,8 +158,7 @@ atm_output(struct ifnet *ifp, struct mbu * check route */ if (rt0 != NULL) { - error = rt_check_fib(&rt, &rt0, - dst, rt0->rt_fibnum); + error = rt_check(&rt, &rt0, dst); if (error) goto bad; RT_UNLOCK(rt); Modified: stable/7/sys/net/if_fwsubr.c ============================================================================== --- stable/7/sys/net/if_fwsubr.c Thu Nov 6 21:47:02 2008 (r184738) +++ stable/7/sys/net/if_fwsubr.c Thu Nov 6 22:11:57 2008 (r184739) @@ -103,7 +103,7 @@ firewire_output(struct ifnet *ifp, struc } if (rt0 != NULL) { - error = rt_check_fib(&rt, &rt0, dst, rt0->rt_fibnum); + error = rt_check(&rt, &rt0, dst); if (error) goto bad; RT_UNLOCK(rt); Modified: stable/7/sys/net/if_iso88025subr.c ============================================================================== --- stable/7/sys/net/if_iso88025subr.c Thu Nov 6 21:47:02 2008 (r184738) +++ stable/7/sys/net/if_iso88025subr.c Thu Nov 6 22:11:57 2008 (r184739) @@ -259,8 +259,7 @@ iso88025_output(ifp, m, dst, rt0) /* Calculate routing info length based on arp table entry */ /* XXX any better way to do this ? */ if (rt0 != NULL) { -/* XXX MRT *//* Guess only */ - error = rt_check_fib(&rt, &rt0, dst, rt0->rt_fibnum); + error = rt_check(&rt, &rt0, dst); if (error) goto bad; RT_UNLOCK(rt); Modified: stable/7/sys/net/route.c ============================================================================== --- stable/7/sys/net/route.c Thu Nov 6 21:47:02 2008 (r184738) +++ stable/7/sys/net/route.c Thu Nov 6 22:11:57 2008 (r184739) @@ -1549,84 +1549,120 @@ rtinit(struct ifaddr *ifa, int cmd, int * final destination if directly reachable); * *lrt0 points to the cached route to the final destination; * *lrt is not meaningful; - * fibnum is the index to the correct network fib for this packet + * (*lrt0 has no ref held on it by us so REMREF is not needed. + * Refs only account for major structural references and not usages, + * which is actually a bit of a problem.) * * === Operation === * If the route is marked down try to find a new route. If the route * to the gateway is gone, try to setup a new route. Otherwise, * if the route is marked for packets to be rejected, enforce that. + * Note that rtalloc returns an rtentry with an extra REF that we may + * need to lose. * * === On return === * *dst is unchanged; * *lrt0 points to the (possibly new) route to the final destination - * *lrt points to the route to the next hop + * *lrt points to the route to the next hop [LOCKED] * * Their values are meaningful ONLY if no error is returned. + * + * To follow this you have to remember that: + * RT_REMREF reduces the reference count by 1 but doesn't check it for 0 (!) + * RTFREE_LOCKED includes an RT_REMREF (or an rtfree if refs == 1) + * and an RT_UNLOCK + * RTFREE does an RT_LOCK and an RTFREE_LOCKED + * The gwroute pointer counts as a reference on the rtentry to which it points. + * so when we add it we use the ref that rtalloc gives us and when we lose it + * we need to remove the reference. + * RT_TEMP_UNLOCK does an RT_ADDREF before freeing the lock, and + * RT_RELOCK locks it (it can't have gone away due to the ref) and + * drops the ref, possibly freeing it and zeroing the pointer if + * the ref goes to 0 (unlocking in the process). */ int rt_check(struct rtentry **lrt, struct rtentry **lrt0, struct sockaddr *dst) { - return (rt_check_fib(lrt, lrt0, dst, 0)); -} - -int -rt_check_fib(struct rtentry **lrt, struct rtentry **lrt0, struct sockaddr *dst, - u_int fibnum) -{ struct rtentry *rt; struct rtentry *rt0; - int error; + u_int fibnum; KASSERT(*lrt0 != NULL, ("rt_check")); - rt = rt0 = *lrt0; + rt0 = *lrt0; + rt = NULL; + fibnum = rt0->rt_fibnum; /* NB: the locking here is tortuous... */ - RT_LOCK(rt); - if ((rt->rt_flags & RTF_UP) == 0) { - RT_UNLOCK(rt); - rt = rtalloc1_fib(dst, 1, 0UL, fibnum); - if (rt != NULL) { - RT_REMREF(rt); - /* XXX what about if change? */ - } else + RT_LOCK(rt0); +retry: + if (rt0 && (rt0->rt_flags & RTF_UP) == 0) { + /* Current rt0 is useless, try get a replacement. */ + RT_UNLOCK(rt0); + rt0 = NULL; + } + if (rt0 == NULL) { + rt0 = rtalloc1_fib(dst, 1, 0UL, fibnum); + if (rt0 == NULL) { return (EHOSTUNREACH); - rt0 = rt; + } + RT_REMREF(rt0); /* don't need the reference. */ } - /* XXX BSD/OS checks dst->sa_family != AF_NS */ - if (rt->rt_flags & RTF_GATEWAY) { - if (rt->rt_gwroute == NULL) - goto lookup; - rt = rt->rt_gwroute; - RT_LOCK(rt); /* NB: gwroute */ - if ((rt->rt_flags & RTF_UP) == 0) { - RTFREE_LOCKED(rt); /* unlock gwroute */ - rt = rt0; - rt0->rt_gwroute = NULL; - lookup: - RT_UNLOCK(rt0); -/* XXX MRT link level looked up in table 0 */ - rt = rtalloc1_fib(rt->rt_gateway, 1, 0UL, 0); - if (rt == rt0) { - RT_REMREF(rt0); - RT_UNLOCK(rt0); + + if (rt0->rt_flags & RTF_GATEWAY) { + if ((rt = rt0->rt_gwroute) != NULL) { + RT_LOCK(rt); /* NB: gwroute */ + if ((rt->rt_flags & RTF_UP) == 0) { + /* gw route is dud. ignore/lose it */ + RTFREE_LOCKED(rt); /* unref (&unlock) gwroute */ + rt = rt0->rt_gwroute = NULL; + } + } + + if (rt == NULL) { /* NOT AN ELSE CLAUSE */ + RT_TEMP_UNLOCK(rt0); /* MUST return to undo this */ + rt = rtalloc1_fib(rt0->rt_gateway, 1, 0UL, fibnum); + if ((rt == rt0) || (rt == NULL)) { + /* the best we can do is not good enough */ + if (rt) { + RT_REMREF(rt); /* assumes ref > 0 */ + RT_UNLOCK(rt); + } + RTFREE(rt0); /* lock, unref, (unlock) */ return (ENETUNREACH); } - RT_LOCK(rt0); - if (rt0->rt_gwroute != NULL) - RTFREE(rt0->rt_gwroute); - rt0->rt_gwroute = rt; - if (rt == NULL) { - RT_UNLOCK(rt0); - return (EHOSTUNREACH); + /* + * Relock it and lose the added reference. + * All sorts of things could have happenned while we + * had no lock on it, so check for them. + */ + RT_RELOCK(rt0); + if (rt0 == NULL || ((rt0->rt_flags & RTF_UP) == 0)) + /* Ru-roh.. what we had is no longer any good */ + goto retry; + /* + * While we were away, someone replaced the gateway. + * Since a reference count is involved we can't just + * overwrite it. + */ + if (rt0->rt_gwroute) { + if (rt0->rt_gwroute != rt) { + RTFREE_LOCKED(rt); + goto retry; + } + } else { + rt0->rt_gwroute = rt; } } + RT_LOCK_ASSERT(rt); RT_UNLOCK(rt0); + } else { + /* think of rt as having the lock from now on.. */ + rt = rt0; } /* XXX why are we inspecting rmx_expire? */ - error = (rt->rt_flags & RTF_REJECT) && - (rt->rt_rmx.rmx_expire == 0 || - time_uptime < rt->rt_rmx.rmx_expire); - if (error) { + if ((rt->rt_flags & RTF_REJECT) && + (rt->rt_rmx.rmx_expire == 0 || + time_uptime < rt->rt_rmx.rmx_expire)) { RT_UNLOCK(rt); return (rt == rt0 ? EHOSTDOWN : EHOSTUNREACH); } Modified: stable/7/sys/net/route.h ============================================================================== --- stable/7/sys/net/route.h Thu Nov 6 21:47:02 2008 (r184738) +++ stable/7/sys/net/route.h Thu Nov 6 22:11:57 2008 (r184739) @@ -312,19 +312,35 @@ struct rt_addrinfo { } while (0) #define RTFREE_LOCKED(_rt) do { \ - if ((_rt)->rt_refcnt <= 1) \ - rtfree(_rt); \ - else { \ - RT_REMREF(_rt); \ - RT_UNLOCK(_rt); \ - } \ - /* guard against invalid refs */ \ - _rt = 0; \ - } while (0) + if ((_rt)->rt_refcnt <= 1) \ + rtfree(_rt); \ + else { \ + RT_REMREF(_rt); \ + RT_UNLOCK(_rt); \ + } \ + /* guard against invalid refs */ \ + _rt = 0; \ +} while (0) #define RTFREE(_rt) do { \ - RT_LOCK(_rt); \ - RTFREE_LOCKED(_rt); \ - } while (0) + RT_LOCK(_rt); \ + RTFREE_LOCKED(_rt); \ +} while (0) + +#define RT_TEMP_UNLOCK(_rt) do { \ + RT_ADDREF(_rt); \ + RT_UNLOCK(_rt); \ +} while (0) + +#define RT_RELOCK(_rt) do { \ + RT_LOCK(_rt); \ + if ((_rt)->rt_refcnt <= 1) { \ + rtfree(_rt); \ + _rt = 0; /* signal that it went away */ \ + } else { \ + RT_REMREF(_rt); \ + /* note that _rt is still valid */ \ + } \ +} while (0) extern struct radix_node_head *rt_tables[][AF_MAX+1]; @@ -352,6 +368,7 @@ int rt_setgate(struct rtentry *, struct int rtexpunge(struct rtentry *); void rtfree(struct rtentry *); +int rt_check(struct rtentry **, struct rtentry **, struct sockaddr *); /* XXX MRT COMPAT VERSIONS THAT SET UNIVERSE to 0 */ /* Thes are used by old code not yet converted to use multiple FIBS */ @@ -366,7 +383,6 @@ void rtredirect(struct sockaddr *, stru int rtrequest(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **); int rtrequest1(int, struct rt_addrinfo *, struct rtentry **); -int rt_check(struct rtentry **, struct rtentry **, struct sockaddr *); /* defaults to "all" FIBs */ int rtinit_fib(struct ifaddr *, int, int); @@ -385,7 +401,6 @@ void rtredirect_fib(struct sockaddr *, int rtrequest_fib(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); int rtrequest1_fib(int, struct rt_addrinfo *, struct rtentry **, u_int); -int rt_check_fib(struct rtentry **, struct rtentry **, struct sockaddr *, u_int); #include typedef void (*rtevent_arp_update_fn)(void *, struct rtentry *, uint8_t *, struct sockaddr *); Modified: stable/7/sys/netinet/if_ether.c ============================================================================== --- stable/7/sys/netinet/if_ether.c Thu Nov 6 21:47:02 2008 (r184738) +++ stable/7/sys/netinet/if_ether.c Thu Nov 6 22:11:57 2008 (r184739) @@ -362,7 +362,7 @@ arpresolve(struct ifnet *ifp, struct rte struct rtentry *rt = NULL; struct sockaddr_dl *sdl; int error; - int fibnum = 0; + int fibnum = -1; if (m) { @@ -379,7 +379,7 @@ arpresolve(struct ifnet *ifp, struct rte if (rt0 != NULL) { /* Look for a cached arp (ll) entry. */ - error = in_rt_check(&rt, &rt0, dst, fibnum); + error = rt_check(&rt, &rt0, dst); if (error) { m_freem(m); return error; @@ -388,14 +388,23 @@ arpresolve(struct ifnet *ifp, struct rte if (la == NULL) RT_UNLOCK(rt); } + + /* + * If we had no mbuf and no route, then hope the caller + * has a fib in mind because we are running out of ideas. + * I think this should not happen in current code. + * (kmacy would know). + */ + if (fibnum == -1) + fibnum = curthread->td_proc->p_fibnum; /* last gasp */ + if (la == NULL) { /* * We enter this block if rt0 was NULL, - * or if rt found by in_rt_check() didn't have llinfo. - * we should get a cloned route, which since it should - * come from the local interface should have a ll entry. - * if may be incoplete but that's ok. - * XXXMRT if we haven't found a fibnum is that OK? + * or if rt found by rt_check() didn't have llinfo. + * We should get a cloned route from the local interface, + * so it should have an ll entry. + * It may be incomplete but that's ok. */ rt = arplookup(SIN(dst)->sin_addr.s_addr, 1, 0, fibnum); if (rt == NULL) { Modified: stable/7/sys/netinet/in_rmx.c ============================================================================== --- stable/7/sys/netinet/in_rmx.c Thu Nov 6 21:47:02 2008 (r184738) +++ stable/7/sys/netinet/in_rmx.c Thu Nov 6 22:11:57 2008 (r184739) @@ -465,13 +465,6 @@ in_rtalloc1(struct sockaddr *dst, int re return (rtalloc1_fib(dst, report, ignflags, fibnum)); } -int -in_rt_check(struct rtentry **lrt, struct rtentry **lrt0, - struct sockaddr *dst, u_int fibnum) -{ - return (rt_check_fib(lrt, lrt0, dst, fibnum)); -} - void in_rtredirect(struct sockaddr *dst, struct sockaddr *gateway, Modified: stable/7/sys/netinet/in_var.h ============================================================================== --- stable/7/sys/netinet/in_var.h Thu Nov 6 21:47:02 2008 (r184738) +++ stable/7/sys/netinet/in_var.h Thu Nov 6 22:11:57 2008 (r184739) @@ -314,7 +314,6 @@ void in_rtredirect(struct sockaddr *, s struct sockaddr *, int, struct sockaddr *, u_int); int in_rtrequest(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); -int in_rt_check(struct rtentry **, struct rtentry **, struct sockaddr *, u_int); #if 0 int in_rt_getifa(struct rt_addrinfo *, u_int fibnum); From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 22:28:04 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56A041065672; Thu, 6 Nov 2008 22:28:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44C338FC08; Thu, 6 Nov 2008 22:28:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6MS40l067375; Thu, 6 Nov 2008 22:28:04 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6MS45S067374; Thu, 6 Nov 2008 22:28:04 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200811062228.mA6MS45S067374@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 6 Nov 2008 22:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184740 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 22:28:04 -0000 Author: trasz Date: Thu Nov 6 22:28:04 2008 New Revision: 184740 URL: http://svn.freebsd.org/changeset/base/184740 Log: Backoff the last patch. It was overly restrictive - we want to check for write permission on target only when moving the target between two directories. Approved by: rwatson (mentor) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Nov 6 22:11:57 2008 (r184739) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Nov 6 22:28:04 2008 (r184740) @@ -1580,14 +1580,7 @@ zfs_zaccess_rename(znode_t *sdzp, znode_ /* * Rename permissions are combination of delete permission + * add file/subdir permission. - * - * BSD operating systems also require write permission - * on the directory being moved. */ - if (ZTOV(szp)->v_type == VDIR) { - if (error = zfs_zaccess(szp, ACE_WRITE_DATA, cr)) - return (error); - } /* * first make sure we do the delete portion. From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 22:32:20 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F3E81065700; Thu, 6 Nov 2008 22:32:20 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CA0B8FC1E; Thu, 6 Nov 2008 22:32:20 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6MWKdO067495; Thu, 6 Nov 2008 22:32:20 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6MWKD4067493; Thu, 6 Nov 2008 22:32:20 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <200811062232.mA6MWKD4067493@svn.freebsd.org> From: Peter Wemm Date: Thu, 6 Nov 2008 22:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184741 - in stable/7/sys: . kern modules/cxgb sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 22:32:20 -0000 Author: peter Date: Thu Nov 6 22:32:19 2008 New Revision: 184741 URL: http://svn.freebsd.org/changeset/base/184741 Log: MFC: r184492 - add offset / fileid / fsid to KERN_PROC_VMMAP sysctl for the benefit of valgrind. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/kern/kern_proc.c stable/7/sys/modules/cxgb/ (props changed) stable/7/sys/sys/user.h Modified: stable/7/sys/kern/kern_proc.c ============================================================================== --- stable/7/sys/kern/kern_proc.c Thu Nov 6 22:28:04 2008 (r184740) +++ stable/7/sys/kern/kern_proc.c Thu Nov 6 22:32:19 2008 (r184741) @@ -1346,6 +1346,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR unsigned int last_timestamp; char *fullpath, *freepath; struct kinfo_vmentry *kve; + struct vattr va; + struct ucred *cred; int error, *name; struct vnode *vp; struct proc *p; @@ -1405,6 +1407,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR lobj = tobj; } + kve->kve_fileid = 0; + kve->kve_fsid = 0; freepath = NULL; fullpath = ""; if (lobj) { @@ -1446,6 +1450,11 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR curthread); vn_fullpath(curthread, vp, &fullpath, &freepath); + cred = curthread->td_ucred; + if (VOP_GETATTR(vp, &va, cred) == 0) { + kve->kve_fileid = va.va_fileid; + kve->kve_fsid = va.va_fsid; + } vput(vp); VFS_UNLOCK_GIANT(vfslocked); } @@ -1457,6 +1466,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_start = (void*)entry->start; kve->kve_end = (void*)entry->end; + kve->kve_offset = (off_t)entry->offset; if (entry->protection & VM_PROT_READ) kve->kve_protection |= KVME_PROT_READ; Modified: stable/7/sys/sys/user.h ============================================================================== --- stable/7/sys/sys/user.h Thu Nov 6 22:28:04 2008 (r184740) +++ stable/7/sys/sys/user.h Thu Nov 6 22:32:19 2008 (r184741) @@ -320,7 +320,10 @@ struct kinfo_vmentry { int kve_shadow_count; /* VM obj shadow count. */ char kve_path[PATH_MAX]; /* Path to VM obj, if any. */ void *_kve_pspare[8]; /* Space for more stuff. */ - int _kve_ispare[8]; /* Space for more stuff. */ + off_t kve_offset; /* Mapping offset in object */ + uint64_t kve_fileid; /* inode number of vnode */ + dev_t kve_fsid; /* dev_t of vnode location */ + int _kve_ispare[3]; /* Space for more stuff. */ }; /* From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 23:55:29 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 343EF106567A; Thu, 6 Nov 2008 23:55:29 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 237438FC1A; Thu, 6 Nov 2008 23:55:29 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA6NtTP1068949; Thu, 6 Nov 2008 23:55:29 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA6NtTed068948; Thu, 6 Nov 2008 23:55:29 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <200811062355.mA6NtTed068948@svn.freebsd.org> From: Max Laier Date: Thu, 6 Nov 2008 23:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184742 - head/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2008 23:55:29 -0000 Author: mlaier Date: Thu Nov 6 23:55:28 2008 New Revision: 184742 URL: http://svn.freebsd.org/changeset/base/184742 Log: Restore (intmax_t) casts I lost during the last change & unbreak the build. Modified: head/usr.bin/du/du.c Modified: head/usr.bin/du/du.c ============================================================================== --- head/usr.bin/du/du.c Thu Nov 6 22:32:19 2008 (r184741) +++ head/usr.bin/du/du.c Thu Nov 6 23:55:28 2008 (r184742) @@ -273,8 +273,9 @@ main(int argc, char *argv[]) (void)printf("\t%s\n", p->fts_path); } else { (void)printf("%jd\t%s\n", - howmany(p->fts_bignum * cblocksize, - blocksize), p->fts_path); + (intmax_t)howmany(p->fts_bignum * + cblocksize, blocksize), + p->fts_path); } } break; @@ -304,8 +305,9 @@ main(int argc, char *argv[]) (void)printf("\t%s\n", p->fts_path); } else { (void)printf("%jd\t%s\n", - howmany(curblocks * cblocksize, - blocksize), p->fts_path); + (intmax_t)howmany(curblocks * + cblocksize, blocksize), + p->fts_path); } } From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 03:36:07 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACBC1106568E; Fri, 7 Nov 2008 03:36:07 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 272B58FC19; Fri, 7 Nov 2008 03:36:06 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from kobe.laptop (adsl202-73.kln.forthnet.gr [79.103.15.73]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id mA73ZuWp001561 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 7 Nov 2008 05:36:01 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id mA73ZtVo002543; Fri, 7 Nov 2008 05:35:56 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id mA73ZtMk002542; Fri, 7 Nov 2008 05:35:55 +0200 (EET) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Alexander Motin References: <200811051712.mA5HCIP7032611@svn.freebsd.org> <87r65okf7n.fsf@kobe.laptop> <49136661.9060004@FreeBSD.org> Date: Fri, 07 Nov 2008 05:35:55 +0200 In-Reply-To: <49136661.9060004@FreeBSD.org> (Alexander Motin's message of "Thu, 06 Nov 2008 23:49:21 +0200") Message-ID: <87zlkcnr6s.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: mA73ZuWp001561 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.062, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.34, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184695 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 03:36:07 -0000 On Thu, 06 Nov 2008 23:49:21 +0200, Alexander Motin wrote: > Giorgos Keramidas wrote: >> There are a few places where we can probably improve the manpage a bit >> more. I am not sure I understand *all* the technical details of pins >> and association numbers, but does the following look like something >> worth committing? > > I have changed some incorrect peaces, but mostly committed as is. Excellent, thanks! I knew you could do a better job with the manpage text than some of the guesses I had to make :) From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 07:02:29 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FBEF106568D; Fri, 7 Nov 2008 07:02:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DF5E8FC12; Fri, 7 Nov 2008 07:02:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA772TWd076505; Fri, 7 Nov 2008 07:02:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA772TN7076504; Fri, 7 Nov 2008 07:02:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200811070702.mA772TN7076504@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 7 Nov 2008 07:02:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184743 - head/sys/dev/age X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 07:02:29 -0000 Author: yongari Date: Fri Nov 7 07:02:28 2008 New Revision: 184743 URL: http://svn.freebsd.org/changeset/base/184743 Log: Remove informational messages left. These messages were intended to show up in verbose boot mode. Reported by: pluknet ( pluknet<> gmail DOT com ) Modified: head/sys/dev/age/if_age.c Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Thu Nov 6 23:55:28 2008 (r184742) +++ head/sys/dev/age/if_age.c Fri Nov 7 07:02:28 2008 (r184743) @@ -429,17 +429,17 @@ age_get_macaddr(struct age_softc *sc) ea[1] &= 0xFFFF; if ((ea[0] == 0 && ea[1] == 0) || (ea[0] == 0xFFFFFFFF && ea[1] == 0xFFFF)) { - if (1 || bootverbose) + if (bootverbose) device_printf(sc->age_dev, "invalid ethernet address " "returned from VPD.\n"); vpd_error = EINVAL; } } - if (vpd_error != 0 && (1 || bootverbose)) + if (vpd_error != 0 && (bootverbose)) device_printf(sc->age_dev, "VPD access failure!\n"); } else { - if (1 || bootverbose) + if (bootverbose) device_printf(sc->age_dev, "PCI VPD capability not found!\n"); } @@ -538,7 +538,7 @@ age_attach(device_t dev) sc->age_rev = pci_get_revid(dev); sc->age_chip_rev = CSR_READ_4(sc, AGE_MASTER_CFG) >> MASTER_CHIP_REV_SHIFT; - if (1 || bootverbose) { + if (bootverbose) { device_printf(dev, "PCI device revision : 0x%04x\n", sc->age_rev); device_printf(dev, "Chip id/revision : 0x%04x\n", sc->age_chip_rev); @@ -565,7 +565,7 @@ age_attach(device_t dev) /* Allocate IRQ resources. */ msixc = pci_msix_count(dev); msic = pci_msi_count(dev); - if (1 || bootverbose) { + if (bootverbose) { device_printf(dev, "MSIX count : %d\n", msixc); device_printf(dev, "MSI count : %d\n", msic); } @@ -612,7 +612,7 @@ age_attach(device_t dev) /* Max payload size. */ sc->age_dma_wr_burst = ((burst >> 5) & 0x07) << DMA_CFG_WR_BURST_SHIFT; - if (1 || bootverbose) { + if (bootverbose) { device_printf(dev, "Read request size : %d bytes.\n", 128 << ((burst >> 12) & 0x07)); device_printf(dev, "TLP payload size : %d bytes.\n", @@ -2685,7 +2685,7 @@ age_init_locked(struct age_softc *sc) else reg |= MASTER_ITIMER_ENB; CSR_WRITE_4(sc, AGE_MASTER_CFG, reg); - if (1 || bootverbose) + if (bootverbose) device_printf(sc->age_dev, "interrupt moderation is %d us.\n", sc->age_int_mod); CSR_WRITE_2(sc, AGE_INTR_CLR_TIMER, AGE_USECS(1000)); From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 10:43:01 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B79221065690; Fri, 7 Nov 2008 10:43:01 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A625F8FC0A; Fri, 7 Nov 2008 10:43:01 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA7Ah1Fh081564; Fri, 7 Nov 2008 10:43:01 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA7Ah1jd081563; Fri, 7 Nov 2008 10:43:01 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811071043.mA7Ah1jd081563@svn.freebsd.org> From: Doug Rabson Date: Fri, 7 Nov 2008 10:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184744 - head/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 10:43:01 -0000 Author: dfr Date: Fri Nov 7 10:43:01 2008 New Revision: 184744 URL: http://svn.freebsd.org/changeset/base/184744 Log: Range-check NFSv2 procedure numbers before converting to NFSv3. Submitted by: csjp Modified: head/sys/nfsserver/nfs_fha.c Modified: head/sys/nfsserver/nfs_fha.c ============================================================================== --- head/sys/nfsserver/nfs_fha.c Fri Nov 7 07:02:28 2008 (r184743) +++ head/sys/nfsserver/nfs_fha.c Fri Nov 7 10:43:01 2008 (r184744) @@ -180,11 +180,16 @@ fha_extract_info(struct svc_req *req, st i->locktype = LK_EXCLUSIVE; /* - * Extract the procnum and convert to v3 form if necessary. + * Extract the procnum and convert to v3 form if necessary, + * taking care to deal with out-of-range procnums. Caller will + * ensure that rq_vers is either 2 or 3. */ procnum = req->rq_proc; - if (!v3) + if (!v3) { + if (procnum > NFSV2PROC_STATFS) + goto out; procnum = nfsrv_nfsv3_procid[procnum]; + } /* * We do affinity for most. However, we divide a realm of affinity From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 11:07:57 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6261106567B; Fri, 7 Nov 2008 11:07:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D42E48FC16; Fri, 7 Nov 2008 11:07:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA7B7v5L082105; Fri, 7 Nov 2008 11:07:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA7B7vZF082104; Fri, 7 Nov 2008 11:07:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200811071107.mA7B7vZF082104@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 7 Nov 2008 11:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184746 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 11:07:58 -0000 Author: kib Date: Fri Nov 7 11:07:57 2008 New Revision: 184746 URL: http://svn.freebsd.org/changeset/base/184746 Log: This is direct commit to stable/7 to accomodate KPI difference between HEAD and the branch. Provide struct thread * argument to VOP_GETATTR. Approved by: re (rwatson) Modified: stable/7/sys/kern/kern_proc.c Modified: stable/7/sys/kern/kern_proc.c ============================================================================== --- stable/7/sys/kern/kern_proc.c Fri Nov 7 10:46:15 2008 (r184745) +++ stable/7/sys/kern/kern_proc.c Fri Nov 7 11:07:57 2008 (r184746) @@ -1451,7 +1451,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR vn_fullpath(curthread, vp, &fullpath, &freepath); cred = curthread->td_ucred; - if (VOP_GETATTR(vp, &va, cred) == 0) { + if (VOP_GETATTR(vp, &va, cred, curthread) == 0) { kve->kve_fileid = va.va_fileid; kve->kve_fsid = va.va_fsid; } From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 11:42:02 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFD411065672; Fri, 7 Nov 2008 11:42:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE01A8FC1A; Fri, 7 Nov 2008 11:42:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA7Bg2s4082738; Fri, 7 Nov 2008 11:42:02 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA7Bg2Bx082737; Fri, 7 Nov 2008 11:42:02 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200811071142.mA7Bg2Bx082737@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 7 Nov 2008 11:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184747 - in stable/7/sys: . modules/cxgb netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 11:42:02 -0000 Author: bz Date: Fri Nov 7 11:42:02 2008 New Revision: 184747 URL: http://svn.freebsd.org/changeset/base/184747 Log: MFC: r183014 (which was missed with r184739: r183013,r183017,r183032,r183034) Original commit message from HEAD: Julian: "oops commit the version that compiles" Unbreak RELENG_7 including the missing sys/proc.h header file. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/modules/cxgb/ (props changed) stable/7/sys/netinet/if_ether.c Modified: stable/7/sys/netinet/if_ether.c ============================================================================== --- stable/7/sys/netinet/if_ether.c Fri Nov 7 11:07:57 2008 (r184746) +++ stable/7/sys/netinet/if_ether.c Fri Nov 7 11:42:02 2008 (r184747) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 12:35:42 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EE501065670 for ; Fri, 7 Nov 2008 12:35:42 +0000 (UTC) (envelope-from joao.barros@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by mx1.freebsd.org (Postfix) with ESMTP id 0253F8FC08 for ; Fri, 7 Nov 2008 12:35:41 +0000 (UTC) (envelope-from joao.barros@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so922291fgb.35 for ; Fri, 07 Nov 2008 04:35:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Poabl71N4r6bOumqToc74axDrUZ6xC1yuFl0+y+kjbc=; b=l7ihWbh0GhAkP2mbaBTmdkmHUcN4iVTqo9bbKMdEAe9M6Jdd0E4H+h7ARIFj0txDz6 tHqKHAgQiyG7qZCyVBcmZNOwr8clASYvWPeUvl3SpRr+BlGLfcu880BX+seE58Be/Gyv HIpEc2Fk5YEF5LF2WwV9rr/gP0S+nKeHpQF14= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=l1dOsrkZyS+t1w4ablNBXseFhIpLQmSzEizOZRtYP+l4Nxyr9DcZFhT1pTrF5IvLeG d1zhYwdnDRqdzz46MXTimk6YxS3fq0MJITLhd8yIDV097KZl8XUfPPlePwoZEZow3xXA vxsmZX0K3HtlZuoRcdgfGH2dwHrLVxnRqJtfI= Received: by 10.180.255.1 with SMTP id c1mr1027033bki.36.1226059804403; Fri, 07 Nov 2008 04:10:04 -0800 (PST) Received: by 10.181.55.1 with HTTP; Fri, 7 Nov 2008 04:10:04 -0800 (PST) Message-ID: <70e8236f0811070410t751240f4m5d81e9dfe9590c3d@mail.gmail.com> Date: Fri, 7 Nov 2008 12:10:04 +0000 From: "Joao Barros" To: "=?ISO-8859-1?Q?S=F8ren_Schmidt?=" In-Reply-To: <200810091256.m99Cuvex062502@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200810091256.m99Cuvex062502@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r183724 - in head/sys: conf dev/ata dev/ata/chipsets modules/ata modules/ata/ata modules/ata/atacore modules/ata/atadevel modules/ata/atapci modules/ata/atapci/chipsets modules/ata/atap... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 12:35:42 -0000 On Thu, Oct 9, 2008 at 12:56 PM, S=F8ren Schmidt wrote: > > Author: sos > Date: Thu Oct 9 12:56:57 2008 > New Revision: 183724 > URL: http://svn.freebsd.org/changeset/base/183724 > > Log: > This is the roumored ATA modulerisation works, and it needs a little exp= lanation. > > If you just config KERNEL as usual there should be no apparent changes, = you'll get all chipset support code compiled in. > > However there is now a way to only compile in code for chipsets needed o= n a pr vendor basis. ATA now has the following "device" entries: > > atacore: ATA core functionality, always needed for any ATA setup > > atacard: CARDBUS support > atacbus: PC98 cbus support > ataisa: ISA bus support > atapci: PCI bus support only generic chipset support. > > ataahci: AHCI support, also pulled in by some vendor modules. > > ataacard, ataacerlabs, ataadaptec, ataamd, ataati, atacenatek, atacypres= s, atacyrix, atahighpoint, ataintel, ataite, atajmicron, atamarvell, atamic= ron, atanational, atanetcell, atanvidia, atapromise, ataserverworks, atasil= iconimage, atasis, atavia; Vendor support, ie atavia for VIA chipsets > > atadisk: ATA disk driver > ataraid: ATA softraid driver > > atapicd: ATAPI cd/dvd driver > atapifd: ATAPI floppy/flashdisk driver > atapist: ATAPI tape driver > > atausb: ATA<>USB bridge > atapicam: ATA<>CAM bridge > > This makes it possible to config a kernel with just VIA chipset support = by having the following ATA lines in the kernel config file: > > device atacore > device atapci > device atavia > > And then you need the atadisk, atapicd etc lines in there just as usual. > > If you use ATA as modules loaded at boot there is few changes except the= rename of the "ata" module to "atacore", things looks just as usual. > However under atapci you now have a whole bunch of vendor specific drive= rs, that you can kldload individually depending on you needs. Drivers have = the same names as used in the kernel config explained above. (snip) > > Deleted: > head/sys/dev/ata/ata-chipset.c > head/sys/modules/ata/ata/Makefile > Modified: > head/sys/conf/files > head/sys/dev/ata/ata-all.c > head/sys/dev/ata/ata-all.h > head/sys/dev/ata/ata-dma.c > head/sys/dev/ata/ata-pci.c > head/sys/dev/ata/ata-pci.h Hi S=F8ren, There is a stale reference to ata-chipset.c and ident functions in ata-pci-h after this change: /* global prototypes ata-chipset.c */ int ata_generic_ident(device_t); int ata_ahci_ident(device_t); int ata_acard_ident(device_t); int ata_ali_ident(device_t); int ata_amd_ident(device_t); int ata_ati_ident(device_t); int ata_cyrix_ident(device_t); int ata_cypress_ident(device_t); int ata_highpoint_ident(device_t); int ata_intel_ident(device_t); int ata_ite_ident(device_t); int ata_jmicron_ident(device_t); int ata_marvell_ident(device_t); int ata_national_ident(device_t); int ata_nvidia_ident(device_t); int ata_netcell_ident(device_t); int ata_promise_ident(device_t); int ata_serverworks_ident(device_t); int ata_sii_ident(device_t); int ata_sis_ident(device_t); int ata_via_ident(device_t); int ata_legacy(device_t); -- Joao Barros From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 13:15:46 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4DF01065691; Fri, 7 Nov 2008 13:15:46 +0000 (UTC) (envelope-from sos@FreeBSD.org) Received: from deepcore.dk (adsl.deepcore.dk [87.63.29.106]) by mx1.freebsd.org (Postfix) with ESMTP id 4A9608FC2C; Fri, 7 Nov 2008 13:15:45 +0000 (UTC) (envelope-from sos@FreeBSD.org) Received: from [192.168.0.138] ([192.168.0.138]) by deepcore.dk (8.14.3/8.14.2) with ESMTP id mA7DFgUo040694; Fri, 7 Nov 2008 14:15:43 +0100 (CET) (envelope-from sos@FreeBSD.org) Message-Id: <60256C21-4DC2-4998-97C1-214027C2B994@FreeBSD.org> From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= To: Joao Barros In-Reply-To: <70e8236f0811070410t751240f4m5d81e9dfe9590c3d@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v929.2) Date: Fri, 7 Nov 2008 14:15:43 +0100 References: <200810091256.m99Cuvex062502@svn.freebsd.org> <70e8236f0811070410t751240f4m5d81e9dfe9590c3d@mail.gmail.com> X-Mailer: Apple Mail (2.929.2) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (deepcore.dk [87.63.29.106]); Fri, 07 Nov 2008 14:15:43 +0100 (CET) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r183724 - in head/sys: conf dev/ata dev/ata/chipsets modules/ata modules/ata/ata modules/ata/atacore modules/ata/atadevel modules/ata/atapci modules/ata/atapci/chipsets modules/ata/atap... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 13:15:46 -0000 On 7Nov, 2008, at 13:10 , Joao Barros wrote: > On Thu, Oct 9, 2008 at 12:56 PM, S=F8ren Schmidt =20 > wrote: >> >> Author: sos >> Date: Thu Oct 9 12:56:57 2008 >> New Revision: 183724 >> URL: http://svn.freebsd.org/changeset/base/183724 >> (snip) >> >> Deleted: >> head/sys/dev/ata/ata-chipset.c >> head/sys/modules/ata/ata/Makefile >> Modified: >> head/sys/conf/files >> head/sys/dev/ata/ata-all.c >> head/sys/dev/ata/ata-all.h >> head/sys/dev/ata/ata-dma.c >> head/sys/dev/ata/ata-pci.c >> head/sys/dev/ata/ata-pci.h > > > Hi S=F8ren, > There is a stale reference to ata-chipset.c and ident functions in > ata-pci-h after this change: > > /* global prototypes ata-chipset.c */ > int ata_generic_ident(device_t); > int ata_ahci_ident(device_t); > int ata_acard_ident(device_t); > int ata_ali_ident(device_t); > int ata_amd_ident(device_t); > int ata_ati_ident(device_t); > int ata_cyrix_ident(device_t); > int ata_cypress_ident(device_t); > int ata_highpoint_ident(device_t); > int ata_intel_ident(device_t); > int ata_ite_ident(device_t); > int ata_jmicron_ident(device_t); > int ata_marvell_ident(device_t); > int ata_national_ident(device_t); > int ata_nvidia_ident(device_t); > int ata_netcell_ident(device_t); > int ata_promise_ident(device_t); > int ata_serverworks_ident(device_t); > int ata_sii_ident(device_t); > int ata_sis_ident(device_t); > int ata_via_ident(device_t); > int ata_legacy(device_t); Yeah I know, it will be gone in the next cleanup phase, but thanks for =20= the reminder!! -S=F8ren From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 13:24:56 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B427106564A; Fri, 7 Nov 2008 13:24:56 +0000 (UTC) (envelope-from sos@freebsd.org) Received: from deepcore.dk (adsl.deepcore.dk [87.63.29.106]) by mx1.freebsd.org (Postfix) with ESMTP id F35A68FC1E; Fri, 7 Nov 2008 13:24:55 +0000 (UTC) (envelope-from sos@freebsd.org) Received: from [192.168.0.138] ([192.168.0.138]) by deepcore.dk (8.14.3/8.14.2) with ESMTP id mA7DOsAw040798; Fri, 7 Nov 2008 14:24:54 +0100 (CET) (envelope-from sos@freebsd.org) Message-Id: <93415C48-08D8-416D-9EC9-1B35291FF54B@freebsd.org> From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= To: =?ISO-8859-1?Q?S=F8ren_Schmidt?= In-Reply-To: <60256C21-4DC2-4998-97C1-214027C2B994@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v929.2) Date: Fri, 7 Nov 2008 14:24:54 +0100 References: <200810091256.m99Cuvex062502@svn.freebsd.org> <70e8236f0811070410t751240f4m5d81e9dfe9590c3d@mail.gmail.com> <60256C21-4DC2-4998-97C1-214027C2B994@FreeBSD.org> X-Mailer: Apple Mail (2.929.2) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (deepcore.dk [87.63.29.106]); Fri, 07 Nov 2008 14:24:54 +0100 (CET) Cc: svn-src-head@freebsd.org, Joao Barros , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r183724 - in head/sys: conf dev/ata dev/ata/chipsets modules/ata modules/ata/ata modules/ata/atacore modules/ata/atadevel modules/ata/atapci modules/ata/atapci/chipsets modules/ata/atap... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 13:24:56 -0000 On 7Nov, 2008, at 14:15 , S=F8ren Schmidt wrote: > On 7Nov, 2008, at 13:10 , Joao Barros wrote: >> >> Hi S=F8ren, >> There is a stale reference to ata-chipset.c and ident functions in >> ata-pci-h after this change: >> >> /* global prototypes ata-chipset.c */ >> int ata_generic_ident(device_t); >> int ata_ahci_ident(device_t); >> int ata_acard_ident(device_t); >> int ata_ali_ident(device_t); >> int ata_amd_ident(device_t); >> int ata_ati_ident(device_t); >> int ata_cyrix_ident(device_t); >> int ata_cypress_ident(device_t); >> int ata_highpoint_ident(device_t); >> int ata_intel_ident(device_t); >> int ata_ite_ident(device_t); >> int ata_jmicron_ident(device_t); >> int ata_marvell_ident(device_t); >> int ata_national_ident(device_t); >> int ata_nvidia_ident(device_t); >> int ata_netcell_ident(device_t); >> int ata_promise_ident(device_t); >> int ata_serverworks_ident(device_t); >> int ata_sii_ident(device_t); >> int ata_sis_ident(device_t); >> int ata_via_ident(device_t); >> int ata_legacy(device_t); > > Yeah I know, it will be gone in the next cleanup phase, but thanks =20 > for the reminder!! Actually I did commit those changes now that I just checked to make =20 sure they got over next time, you must have some stale changes in your =20= tree. -S=F8ren From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 14:45:42 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59218106568C; Fri, 7 Nov 2008 14:45:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48DBA8FC1B; Fri, 7 Nov 2008 14:45:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA7Ejg8s085995; Fri, 7 Nov 2008 14:45:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA7EjgSx085994; Fri, 7 Nov 2008 14:45:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200811071445.mA7EjgSx085994@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 7 Nov 2008 14:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184748 - head/tools/regression/fstest/tests X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 14:45:42 -0000 Author: trasz Date: Fri Nov 7 14:45:42 2008 New Revision: 184748 URL: http://svn.freebsd.org/changeset/base/184748 Log: Improve output when a test fails. Approved by: rwatson (mentor) Modified: head/tools/regression/fstest/tests/misc.sh Modified: head/tools/regression/fstest/tests/misc.sh ============================================================================== --- head/tools/regression/fstest/tests/misc.sh Fri Nov 7 11:42:02 2008 (r184747) +++ head/tools/regression/fstest/tests/misc.sh Fri Nov 7 14:45:42 2008 (r184748) @@ -27,7 +27,7 @@ expect() if [ $? -eq 0 ]; then echo "ok ${ntest}" else - echo "not ok ${ntest}" + echo "not ok ${ntest} - tried '$*', expected ${e}, got ${r}" fi ntest=`expr $ntest + 1` } @@ -43,7 +43,7 @@ jexpect() if [ $? -eq 0 ]; then echo "ok ${ntest}" else - echo "not ok ${ntest}" + echo "not ok ${ntest} - tried '$*', expected ${e}, got ${r}" fi ntest=`expr $ntest + 1` } From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 14:46:46 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A92D1106567F; Fri, 7 Nov 2008 14:46:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96DB48FC1B; Fri, 7 Nov 2008 14:46:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA7Ekkkr086048; Fri, 7 Nov 2008 14:46:46 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA7EkkXb086047; Fri, 7 Nov 2008 14:46:46 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200811071446.mA7EkkXb086047@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 7 Nov 2008 14:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184749 - head/tools/regression/fstest/tests/rename X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 14:46:46 -0000 Author: trasz Date: Fri Nov 7 14:46:46 2008 New Revision: 184749 URL: http://svn.freebsd.org/changeset/base/184749 Log: Make test for write access to the directory being moved a little more specific. Approved by: rwatson (mentor) Modified: head/tools/regression/fstest/tests/rename/21.t Modified: head/tools/regression/fstest/tests/rename/21.t ============================================================================== --- head/tools/regression/fstest/tests/rename/21.t Fri Nov 7 14:45:42 2008 (r184748) +++ head/tools/regression/fstest/tests/rename/21.t Fri Nov 7 14:46:46 2008 (r184749) @@ -6,7 +6,7 @@ desc="write access to subdirectory is re dir=`dirname $0` . ${dir}/../misc.sh -echo "1..12" +echo "1..13" n0=`namegen` n1=`namegen` @@ -17,13 +17,17 @@ expect 0 mkdir ${n2} 0777 expect 0 mkdir ${n3} 0777 cdir=`pwd` +# Check that write permission on containing directory (${n2}) is enough +# to rename subdirectory (${n0}). +expect 0 mkdir ${n2}/${n0} 0700 +expect 0 -u 65534 -g 65534 rename ${n2}/${n0} ${n2}/${n1} + # Check that write permission on containing directory (${n2}) is not enough # to move subdirectory (${n0}) from that directory. -expect 0 mkdir ${n2}/${n0} 0700 -expect EACCES -u 65534 -g 65534 rename ${n2}/${n0} ${n3}/${n0} +expect EACCES -u 65534 -g 65534 rename ${n2}/${n1} ${n3}/${n0} -expect 0 rmdir ${n2}/${n0} -expect ENOENT rmdir ${n2}/${n0} +expect 0 rmdir ${n2}/${n1} +expect ENOENT rmdir ${n2}/${n1} # Check that write permission on containing directory (${n2}) is enough # to move file (${n0}) from that directory. From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 14:53:54 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2C83106564A; Fri, 7 Nov 2008 14:53:54 +0000 (UTC) (envelope-from joao.barros@gmail.com) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.185]) by mx1.freebsd.org (Postfix) with ESMTP id DF0068FC12; Fri, 7 Nov 2008 14:53:53 +0000 (UTC) (envelope-from joao.barros@gmail.com) Received: by fk-out-0910.google.com with SMTP id k31so1500644fkk.11 for ; Fri, 07 Nov 2008 06:53:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=UuGf3kloi/jiJspuoeK/oXsFE5DsdUAaVVk46tB0BF4=; b=AhQaq1SU9UWJxwt86hGD6wK4jC/UnHtKx2R/jBN+TuOY8jW2hO55uxr0taesnirETD x1o6lEwYIRgg726ErlrbhjgMdqZWvz2omvqCY6M8XGBHyKa40ztfgXy1fB59JTjcicxC GjnU3r/Ze3H5K4lH6cDmheGQdoHQDb8lyn/KU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=xXgT2UsTV3wXucxzSUQ2MoDOhIwbH+EFVP2NDhuBv0Eut+tuXVqKkv5Q4pHnnsex1h IB84aJSz6AMnoQfMADaCqT7l+DjwX930HAMa8XF6HZbzP4ECB4kFsa2nk/2ViwkWN13D TshshY1FkFQmpv1xZvIn6uZRDzTpBfEEm6T/s= Received: by 10.181.60.14 with SMTP id n14mr1070806bkk.79.1226069632452; Fri, 07 Nov 2008 06:53:52 -0800 (PST) Received: by 10.181.55.1 with HTTP; Fri, 7 Nov 2008 06:53:52 -0800 (PST) Message-ID: <70e8236f0811070653m5af02ee3p5bbba050ad6e5c79@mail.gmail.com> Date: Fri, 7 Nov 2008 14:53:52 +0000 From: "Joao Barros" To: "=?ISO-8859-1?Q?S=F8ren_Schmidt?=" In-Reply-To: <93415C48-08D8-416D-9EC9-1B35291FF54B@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200810091256.m99Cuvex062502@svn.freebsd.org> <70e8236f0811070410t751240f4m5d81e9dfe9590c3d@mail.gmail.com> <60256C21-4DC2-4998-97C1-214027C2B994@FreeBSD.org> <93415C48-08D8-416D-9EC9-1B35291FF54B@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r183724 - in head/sys: conf dev/ata dev/ata/chipsets modules/ata modules/ata/ata modules/ata/atacore modules/ata/atadevel modules/ata/atapci modules/ata/atapci/chipsets modules/ata/atap... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 14:53:55 -0000 On Fri, Nov 7, 2008 at 1:24 PM, S=F8ren Schmidt wrote: > On 7Nov, 2008, at 14:15 , S=F8ren Schmidt wrote: > >> On 7Nov, 2008, at 13:10 , Joao Barros wrote: >>> >>> Hi S=F8ren, >>> There is a stale reference to ata-chipset.c and ident functions in >>> ata-pci-h after this change: >>> >>> /* global prototypes ata-chipset.c */ >>> int ata_generic_ident(device_t); >>> int ata_ahci_ident(device_t); >>> int ata_acard_ident(device_t); >>> int ata_ali_ident(device_t); >>> int ata_amd_ident(device_t); >>> int ata_ati_ident(device_t); >>> int ata_cyrix_ident(device_t); >>> int ata_cypress_ident(device_t); >>> int ata_highpoint_ident(device_t); >>> int ata_intel_ident(device_t); >>> int ata_ite_ident(device_t); >>> int ata_jmicron_ident(device_t); >>> int ata_marvell_ident(device_t); >>> int ata_national_ident(device_t); >>> int ata_nvidia_ident(device_t); >>> int ata_netcell_ident(device_t); >>> int ata_promise_ident(device_t); >>> int ata_serverworks_ident(device_t); >>> int ata_sii_ident(device_t); >>> int ata_sis_ident(device_t); >>> int ata_via_ident(device_t); >>> int ata_legacy(device_t); >> >> Yeah I know, it will be gone in the next cleanup phase, but thanks for t= he >> reminder!! > > Actually I did commit those changes now that I just checked to make sure > they got over next time, you must have some stale changes in your tree. > > -S=F8ren You're right, I was looking at it through cvsweb and the last commit is for RELENG_7, not CURRENT. Sorry for the noise. --=20 Joao Barros From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 15:01:40 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD9DA1065674; Fri, 7 Nov 2008 15:01:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D6568FC08; Fri, 7 Nov 2008 15:01:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA7F1ev7086340; Fri, 7 Nov 2008 15:01:40 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA7F1ewh086339; Fri, 7 Nov 2008 15:01:40 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200811071501.mA7F1ewh086339@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 7 Nov 2008 15:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184750 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 15:01:40 -0000 Author: trasz Date: Fri Nov 7 15:01:40 2008 New Revision: 184750 URL: http://svn.freebsd.org/changeset/base/184750 Log: Add one more EACCES clause to rename.2. Approved by: rwatson (mentor) Modified: head/lib/libc/sys/rename.2 Modified: head/lib/libc/sys/rename.2 ============================================================================== --- head/lib/libc/sys/rename.2 Fri Nov 7 14:46:46 2008 (r184749) +++ head/lib/libc/sys/rename.2 Fri Nov 7 15:01:40 2008 (r184750) @@ -156,6 +156,11 @@ A component of either path prefix denies .It Bq Er EACCES The requested link requires writing in a directory with a mode that denies write permission. +.It Bq Er EACCES +The directory pointed at by the +.Fa from +argument denies write permission, and the operation would move +it to another parent directory. .It Bq Er EPERM The file pointed at by the .Fa from From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 17:55:10 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22CCC106567A; Fri, 7 Nov 2008 17:55:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 122248FC22; Fri, 7 Nov 2008 17:55:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA7Ht9eZ089483; Fri, 7 Nov 2008 17:55:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA7Ht9vS089482; Fri, 7 Nov 2008 17:55:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200811071755.mA7Ht9vS089482@svn.freebsd.org> From: Alexander Motin Date: Fri, 7 Nov 2008 17:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184751 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 17:55:10 -0000 Author: mav Date: Fri Nov 7 17:55:09 2008 New Revision: 184751 URL: http://svn.freebsd.org/changeset/base/184751 Log: Two minor fixes. Modified: head/share/man/man4/snd_hda.4 Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Fri Nov 7 15:01:40 2008 (r184750) +++ head/share/man/man4/snd_hda.4 Fri Nov 7 17:55:09 2008 (r184751) @@ -58,7 +58,7 @@ driver that allows the generic audio dri .Xr sound 4 , to be used with this hardware. Only audio functions are supported by -.Nm +.Nm . Modem, HDMI and other possible functions are not implemented. .Pp The @@ -85,7 +85,7 @@ The default audio device may be tuned by .Ar hw.snd.default_unit sysctl, as described in .Xr sound 4 , -or explicitly specified it in application settings. +or explicitly specified in application settings. .Ss Boot-time Configuration The following variables are available at boot-time through the .Xr device.hints 5 From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 19:51:07 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E55A31065673; Fri, 7 Nov 2008 19:51:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3E548FC19; Fri, 7 Nov 2008 19:51:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA7Jp7Nl091487; Fri, 7 Nov 2008 19:51:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA7Jp7wu091486; Fri, 7 Nov 2008 19:51:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200811071951.mA7Jp7wu091486@svn.freebsd.org> From: Alexander Motin Date: Fri, 7 Nov 2008 19:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184752 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 19:51:08 -0000 Author: mav Date: Fri Nov 7 19:51:07 2008 New Revision: 184752 URL: http://svn.freebsd.org/changeset/base/184752 Log: Don't assign completely meaningless name to the node on creation. As soon as node is created from the netgraph side now, it can be found without using this. Allow application to assign whatever name it want later. Modified: head/sys/netgraph/ng_tty.c Modified: head/sys/netgraph/ng_tty.c ============================================================================== --- head/sys/netgraph/ng_tty.c Fri Nov 7 17:55:09 2008 (r184751) +++ head/sys/netgraph/ng_tty.c Fri Nov 7 19:51:07 2008 (r184752) @@ -94,8 +94,6 @@ struct ngt_softc { }; typedef struct ngt_softc *sc_p; -static int ngt_unit; - /* Flags */ #define FLG_DEBUG 0x0002 @@ -157,7 +155,6 @@ static int ngt_constructor(node_p node) { sc_p sc; - char name[sizeof(NG_TTY_NODE_TYPE) + 8]; /* Allocate private structure */ sc = malloc(sizeof(*sc), M_NETGRAPH, M_NOWAIT | M_ZERO); @@ -170,14 +167,6 @@ ngt_constructor(node_p node) mtx_init(&sc->outq.ifq_mtx, "ng_tty node+queue", NULL, MTX_DEF); IFQ_SET_MAXLEN(&sc->outq, IFQ_MAXLEN); - atomic_add_int(&ngt_unit, 1); - snprintf(name, sizeof(name), "%s%d", typestruct.name, ngt_unit); - - /* Assign node its name */ - if (ng_name_node(node, name)) - log(LOG_WARNING, "%s: can't name node %s\n", - __func__, name); - /* Done */ return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 22:01:31 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E2CF10656DD; Fri, 7 Nov 2008 22:01:31 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6FF8FC0A; Fri, 7 Nov 2008 22:01:31 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA7M1VqN093905; Fri, 7 Nov 2008 22:01:31 GMT (envelope-from blackend@svn.freebsd.org) Received: (from blackend@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA7M1VlX093904; Fri, 7 Nov 2008 22:01:31 GMT (envelope-from blackend@svn.freebsd.org) Message-Id: <200811072201.mA7M1VlX093904@svn.freebsd.org> From: Marc Fonvieille Date: Fri, 7 Nov 2008 22:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184753 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 22:01:31 -0000 Author: blackend (doc committer) Date: Fri Nov 7 22:01:31 2008 New Revision: 184753 URL: http://svn.freebsd.org/changeset/base/184753 Log: Update ports number and size of Ports Collection. Modified: head/usr.sbin/sysinstall/dist.c Modified: head/usr.sbin/sysinstall/dist.c ============================================================================== --- head/usr.sbin/sysinstall/dist.c Fri Nov 7 19:51:07 2008 (r184752) +++ head/usr.sbin/sysinstall/dist.c Fri Nov 7 22:01:31 2008 (r184753) @@ -304,8 +304,8 @@ distMaybeSetPorts(dialogMenuItem *self) { dialog_clear_norefresh(); if (!msgYesNo("Would you like to install the FreeBSD ports collection?\n\n" - "This will give you ready access to over 17,000 ported software packages,\n" - "at a cost of around 400MB of disk space when \"clean\" and possibly\n" + "This will give you ready access to over 19,000 ported software packages,\n" + "at a cost of around 445MB of disk space when \"clean\" and possibly\n" "much more than that when a lot of the distribution tarballs are loaded\n" "(unless you have the extra discs available from a FreeBSD CD/DVD distribution\n" "and can mount them on /cdrom, in which case this is far less of a problem).\n\n" From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 22:06:06 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5750D1065677; Fri, 7 Nov 2008 22:06:06 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 448838FC19; Fri, 7 Nov 2008 22:06:06 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA7M64A1094012; Fri, 7 Nov 2008 22:06:04 GMT (envelope-from blackend@svn.freebsd.org) Received: (from blackend@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA7M64P5094011; Fri, 7 Nov 2008 22:06:04 GMT (envelope-from blackend@svn.freebsd.org) Message-Id: <200811072206.mA7M64P5094011@svn.freebsd.org> From: Marc Fonvieille Date: Fri, 7 Nov 2008 22:06:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184754 - stable/7/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 22:06:06 -0000 Author: blackend (doc committer) Date: Fri Nov 7 22:06:04 2008 New Revision: 184754 URL: http://svn.freebsd.org/changeset/base/184754 Log: MFC: r184753 Update ports number and size of Ports Collection. Approved by: re (kib) Modified: stable/7/usr.sbin/sysinstall/dist.c Modified: stable/7/usr.sbin/sysinstall/dist.c ============================================================================== --- stable/7/usr.sbin/sysinstall/dist.c Fri Nov 7 22:01:31 2008 (r184753) +++ stable/7/usr.sbin/sysinstall/dist.c Fri Nov 7 22:06:04 2008 (r184754) @@ -304,8 +304,8 @@ distMaybeSetPorts(dialogMenuItem *self) { dialog_clear_norefresh(); if (!msgYesNo("Would you like to install the FreeBSD ports collection?\n\n" - "This will give you ready access to over 17,000 ported software packages,\n" - "at a cost of around 400MB of disk space when \"clean\" and possibly\n" + "This will give you ready access to over 19,000 ported software packages,\n" + "at a cost of around 445MB of disk space when \"clean\" and possibly\n" "much more than that when a lot of the distribution tarballs are loaded\n" "(unless you have the extra discs available from a FreeBSD CD/DVD distribution\n" "and can mount them on /cdrom, in which case this is far less of a problem).\n\n" From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 22:06:50 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F10551065670; Fri, 7 Nov 2008 22:06:50 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE8138FC16; Fri, 7 Nov 2008 22:06:50 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA7M6omV094057; Fri, 7 Nov 2008 22:06:50 GMT (envelope-from blackend@svn.freebsd.org) Received: (from blackend@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA7M6oKx094056; Fri, 7 Nov 2008 22:06:50 GMT (envelope-from blackend@svn.freebsd.org) Message-Id: <200811072206.mA7M6oKx094056@svn.freebsd.org> From: Marc Fonvieille Date: Fri, 7 Nov 2008 22:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184755 - stable/6/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 22:06:51 -0000 Author: blackend (doc committer) Date: Fri Nov 7 22:06:50 2008 New Revision: 184755 URL: http://svn.freebsd.org/changeset/base/184755 Log: MFC: rev. 184753 Update ports number and size of Ports Collection. Approved by: re (kib) Modified: stable/6/usr.sbin/sysinstall/dist.c Modified: stable/6/usr.sbin/sysinstall/dist.c ============================================================================== --- stable/6/usr.sbin/sysinstall/dist.c Fri Nov 7 22:06:04 2008 (r184754) +++ stable/6/usr.sbin/sysinstall/dist.c Fri Nov 7 22:06:50 2008 (r184755) @@ -303,8 +303,8 @@ distMaybeSetPorts(dialogMenuItem *self) { dialog_clear_norefresh(); if (!msgYesNo("Would you like to install the FreeBSD ports collection?\n\n" - "This will give you ready access to over 14,900 ported software packages,\n" - "at a cost of around 440MB of disk space when \"clean\" and possibly\n" + "This will give you ready access to over 19,000 ported software packages,\n" + "at a cost of around 445MB of disk space when \"clean\" and possibly\n" "much more than that when a lot of the distribution tarballs are loaded\n" "(unless you have the extra discs available from a FreeBSD CD/DVD distribution\n" "and can mount them on /cdrom, in which case this is far less of a problem).\n\n" From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 22:07:28 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 274961065673; Fri, 7 Nov 2008 22:07:28 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1481D8FC23; Fri, 7 Nov 2008 22:07:28 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA7M7SEf094109; Fri, 7 Nov 2008 22:07:28 GMT (envelope-from blackend@svn.freebsd.org) Received: (from blackend@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA7M7Sk8094108; Fri, 7 Nov 2008 22:07:28 GMT (envelope-from blackend@svn.freebsd.org) Message-Id: <200811072207.mA7M7Sk8094108@svn.freebsd.org> From: Marc Fonvieille Date: Fri, 7 Nov 2008 22:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184756 - releng/6.4/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 22:07:28 -0000 Author: blackend (doc committer) Date: Fri Nov 7 22:07:27 2008 New Revision: 184756 URL: http://svn.freebsd.org/changeset/base/184756 Log: MFC: rev. 184753 Update ports number and size of Ports Collection. Approved by: re (kib) Modified: releng/6.4/usr.sbin/sysinstall/dist.c Modified: releng/6.4/usr.sbin/sysinstall/dist.c ============================================================================== --- releng/6.4/usr.sbin/sysinstall/dist.c Fri Nov 7 22:06:50 2008 (r184755) +++ releng/6.4/usr.sbin/sysinstall/dist.c Fri Nov 7 22:07:27 2008 (r184756) @@ -303,8 +303,8 @@ distMaybeSetPorts(dialogMenuItem *self) { dialog_clear_norefresh(); if (!msgYesNo("Would you like to install the FreeBSD ports collection?\n\n" - "This will give you ready access to over 14,900 ported software packages,\n" - "at a cost of around 440MB of disk space when \"clean\" and possibly\n" + "This will give you ready access to over 19,000 ported software packages,\n" + "at a cost of around 445MB of disk space when \"clean\" and possibly\n" "much more than that when a lot of the distribution tarballs are loaded\n" "(unless you have the extra discs available from a FreeBSD CD/DVD distribution\n" "and can mount them on /cdrom, in which case this is far less of a problem).\n\n" From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 00:28:27 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A25D1065674; Sat, 8 Nov 2008 00:28:27 +0000 (UTC) (envelope-from rabe@uugrn.org) Received: from mail.uugrn.org (mail.uugrn.org [195.49.138.123]) by mx1.freebsd.org (Postfix) with ESMTP id 6E53B8FC1E; Sat, 8 Nov 2008 00:28:25 +0000 (UTC) (envelope-from rabe@uugrn.org) Received: from rabe.uugrn.org (root@rabe.uugrn.org [195.49.138.102]) by mail.uugrn.org (8.13.8/8.13.8) with ESMTP id mA80AHlT085295; Sat, 8 Nov 2008 01:10:27 +0100 (CET) (envelope-from rabe@uugrn.org) Received: from daemon.ma.sigsys.de (rabe@rabe.uugrn.org [195.49.138.102]) by rabe.uugrn.org (8.13.8/8.13.8) with ESMTP id mA80AG8O085291; Sat, 8 Nov 2008 01:10:17 +0100 (CET) (envelope-from rabe@uugrn.org) Received: from daemon.ma.sigsys.de (localhost.ma.sigsys.de [127.0.0.1]) by daemon.ma.sigsys.de (8.14.3/8.14.2) with ESMTP id mA80AXUA024002; Sat, 8 Nov 2008 01:10:33 +0100 (CET) (envelope-from rabe@uugrn.org) Received: (from rabe@localhost) by daemon.ma.sigsys.de (8.14.3/8.14.2/Submit) id mA80AW9N024001; Sat, 8 Nov 2008 01:10:32 +0100 (CET) (envelope-from rabe@uugrn.org) X-Authentication-Warning: daemon.ma.sigsys.de: rabe set sender to rabe@uugrn.org using -f Date: Sat, 8 Nov 2008 01:10:32 +0100 From: Raphael Becker To: Marc Fonvieille Message-ID: <20081108001032.GA21542@ma.sigsys.de> References: <200811072201.mA7M1VlX093904@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TB36FDmn/VVEgNH/" Content-Disposition: inline In-Reply-To: <200811072201.mA7M1VlX093904@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r184753 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 00:28:27 -0000 --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 07, 2008 at 10:01:31PM +0000, Marc Fonvieille wrote: > + "This will give you ready access to over 19,000 ported software pack= ages,\n" > + "at a cost of around 445MB of disk space when \"clean\" and possibly= \n" I see around 700M here, my ports are configured "read-only", so all work/, packages/ distfiles/ and so on are outside /usr/ports, updates are done by cvsup: # df -mi /usr/ports/ Filesystem 1M-blocks Used Avail Capacity iused ifree %iused Mounted on /dev/md0 1039 712 119 86% 129743 478895 21% /usr/ports # du -sm /usr/ports/=20 713 /usr/ports/ It heavily depends on inode-sizes. I have about 130k inodes in use which cause a "theoretical minimum"=20 of 508MB disk on filesystems with 4k inode-density, about 1G with 8k inodes (default is 8k, see by newfs(8)) -i bytes Specify the density of inodes in the file system. The default is to create an inode for every (4 * frag-size) bytes of data space. -f frag-size The fragment size of the file system in bytes. It must be a power of two ranging in value between blocksize/8 and blocksize. The default is 2048 bytes. An uncompressed tarball (without the "inode-overhead") of=20 /usr/ports/ is around 600MB here: # tar cf - /usr/ports/ | wc -c tar: Removing leading '/' from member names 629196800 or 600MB. How did you measure / calculate 445MB?=20 Regards Raphael --=20 Raphael Becker http://rabe.uugrn.org/ GnuPG: E7B2 1D66 3AF2 EDC7 9828 6D7A 9CDA 3E7B 10CA 9F2D =2E........|.........|.........|.........|.........|.........|.........|.. --TB36FDmn/VVEgNH/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFJFNj4nNo+exDKny0RAnqfAJ0Xuw3sQImr/6wt0DgRSE0JXZEcSwCgtB0H jChT/EgDsJwV/rrljAGqMYw= =Cuw9 -----END PGP SIGNATURE----- --TB36FDmn/VVEgNH/-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 02:05:41 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8AF5106564A; Sat, 8 Nov 2008 02:05:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A80D08FC08; Sat, 8 Nov 2008 02:05:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA825f79098377; Sat, 8 Nov 2008 02:05:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA825fux098376; Sat, 8 Nov 2008 02:05:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200811080205.mA825fux098376@svn.freebsd.org> From: Alexander Motin Date: Sat, 8 Nov 2008 02:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184760 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 02:05:41 -0000 Author: mav Date: Sat Nov 8 02:05:41 2008 New Revision: 184760 URL: http://svn.freebsd.org/changeset/base/184760 Log: Assign new cookie to the node to reflect API change. All applications will have to be adapted and rebuilt. Modified: head/sys/netgraph/ng_tty.h Modified: head/sys/netgraph/ng_tty.h ============================================================================== --- head/sys/netgraph/ng_tty.h Sat Nov 8 02:02:13 2008 (r184759) +++ head/sys/netgraph/ng_tty.h Sat Nov 8 02:05:41 2008 (r184760) @@ -47,7 +47,7 @@ /* Node type name and magic cookie */ #define NG_TTY_NODE_TYPE "tty" -#define NGM_TTY_COOKIE 886279262 +#define NGM_TTY_COOKIE 1226109660 /* Default hot char */ #define NG_TTY_DFL_HOTCHAR 0x7e /* PPP flag byte */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 04:43:24 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 965121065676; Sat, 8 Nov 2008 04:43:24 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82D588FC14; Sat, 8 Nov 2008 04:43:24 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA84hOcQ001695; Sat, 8 Nov 2008 04:43:24 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA84hOLe001689; Sat, 8 Nov 2008 04:43:24 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200811080443.mA84hOLe001689@svn.freebsd.org> From: Tim Kientzle Date: Sat, 8 Nov 2008 04:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184761 - head/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 04:43:24 -0000 Author: kientzle Date: Sat Nov 8 04:43:24 2008 New Revision: 184761 URL: http://svn.freebsd.org/changeset/base/184761 Log: New command-line parser for bsdtar. This replaces the getopt()/getopt_long() wrapper, the old-style argument rewriter and the associated configuration glue with a more straightforward custom command parser. In particular, this ensures that bsdtar will have consistent option parsing on every platform, regardless of whether the platform supports getopt_long(). MFC after: 30 days Added: head/usr.bin/tar/cmdline.c (contents, props changed) Modified: head/usr.bin/tar/Makefile head/usr.bin/tar/bsdtar.1 head/usr.bin/tar/bsdtar.c head/usr.bin/tar/bsdtar.h head/usr.bin/tar/config_freebsd.h Modified: head/usr.bin/tar/Makefile ============================================================================== --- head/usr.bin/tar/Makefile Sat Nov 8 02:05:41 2008 (r184760) +++ head/usr.bin/tar/Makefile Sat Nov 8 04:43:24 2008 (r184761) @@ -2,7 +2,7 @@ PROG= bsdtar BSDTAR_VERSION_STRING=2.5.5 -SRCS= bsdtar.c getdate.y matching.c read.c siginfo.c subst.c tree.c util.c write.c +SRCS= bsdtar.c cmdline.c getdate.y matching.c read.c siginfo.c subst.c tree.c util.c write.c WARNS?= 5 DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} LDADD= -larchive -lbz2 -lz @@ -11,6 +11,7 @@ CFLAGS+= -DPLATFORM_CONFIG_H=\"config_fr CFLAGS+= -I${.CURDIR} SYMLINKS= bsdtar ${BINDIR}/tar MLINKS= bsdtar.1 tar.1 +DEBUG_FLAGS=-g .PHONY: check test check test: $(PROG) bsdtar.1.gz Modified: head/usr.bin/tar/bsdtar.1 ============================================================================== --- head/usr.bin/tar/bsdtar.1 Sat Nov 8 02:05:41 2008 (r184760) +++ head/usr.bin/tar/bsdtar.1 Sat Nov 8 04:43:24 2008 (r184761) @@ -144,21 +144,21 @@ In c and r mode, this changes the direct the following files. In x mode, change directories after opening the archive but before extracting entries from the archive. -.It Fl -check-links ( Fl W Cm check-links ) +.It Fl -check-links (c and r modes only) Issue a warning message unless all links to each file are archived. -.It Fl -chroot ( Fl W Cm chroot ) +.It Fl -chroot (x mode only) .Fn chroot to the current directory after processing any .Fl C options and before extracting any files. -.It Fl -exclude Ar pattern ( Fl W Cm exclude Ns = Ns Ar pattern ) +.It Fl -exclude Ar pattern Do not process files or directories that match the specified pattern. Note that exclusions take precedence over patterns or filenames specified on the command line. -.It Fl -format Ar format ( Fl W Cm format Ns = Ns Ar format ) +.It Fl -format Ar format (c, r, u mode only) Use the specified format for the created archive. Supported formats include @@ -193,7 +193,7 @@ Synonym for .It Fl I Synonym for .Fl T . -.It Fl -include Ar pattern ( Fl W Cm include Ns = Ns Ar pattern ) +.It Fl -include Ar pattern Process only files or directories that match the specified pattern. Note that exclusions specified with .Fl -exclude @@ -225,7 +225,7 @@ automatically when reading archives. Do not overwrite existing files. In particular, if a file appears more than once in an archive, later copies will not overwrite earlier copies. -.It Fl -keep-newer-files ( Fl W Cm keep-newer-files ) +.It Fl -keep-newer-files (x mode only) Do not overwrite existing files that are newer than the versions appearing in the archive being extracted. @@ -245,28 +245,28 @@ By default, the modification time is set .It Fl n (c, r, u modes only) Do not recursively archive the contents of directories. -.It Fl -newer Ar date ( Fl W Cm newer Ns = Ns Ar date ) +.It Fl -newer Ar date (c, r, u modes only) Only include files and directories newer than the specified date. This compares ctime entries. -.It Fl -newer-mtime Ar date ( Fl W Cm newer-mtime Ns = Ns Ar date ) +.It Fl -newer-mtime Ar date (c, r, u modes only) Like .Fl -newer , except it compares mtime entries instead of ctime entries. -.It Fl -newer-than Pa file ( Fl W Cm newer-than Ns = Ns Pa file ) +.It Fl -newer-than Pa file (c, r, u modes only) Only include files and directories newer than the specified file. This compares ctime entries. -.It Fl -newer-mtime-than Pa file ( Fl W Cm newer-mtime-than Ns = Ns Pa file ) +.It Fl -newer-mtime-than Pa file (c, r, u modes only) Like .Fl -newer-than , except it compares mtime entries instead of ctime entries. -.It Fl -nodump ( Fl W Cm nodump ) +.It Fl -nodump (c and r modes only) Honor the nodump file flag by skipping this file. -.It Fl -null ( Fl W Cm null ) +.It Fl -null (use with .Fl I , .Fl T , @@ -302,7 +302,7 @@ the archive will be discarded. (c, r, u mode) A synonym for .Fl -format Ar ustar -.It Fl -one-file-system ( Fl W Cm one-file-system ) +.It Fl -one-file-system (c, r, and u modes) Do not cross mount points. .It Fl P @@ -345,8 +345,8 @@ Extract files as sparse files. For every block on disk, check first if it contains only NULL bytes and seek over it otherwise. This works similiar to the conv=sparse option of dd. -.It Fl -strip-components Ar count ( Fl W Cm strip-components Ns = Ns Ar count ) -(x and t mode only) +.It Fl -strip-components Ar count +(x mode only) Remove the specified number of leading path elements. Pathnames with fewer elements will be silently skipped. Note that the pathname is edited after checking inclusion/exclusion patterns @@ -418,16 +418,6 @@ Print version of and .Nm libarchive , and exit. -.It Fl W Ar longopt=value -Long options (preceded by -.Fl - ) -are only supported directly on systems that have the -.Xr getopt_long 3 -function. -The -.Fl W -option can be used to access long options on systems that -do not support this function. .It Fl w Ask for confirmation for every action. .It Fl X Ar filename Modified: head/usr.bin/tar/bsdtar.c ============================================================================== --- head/usr.bin/tar/bsdtar.c Sat Nov 8 02:05:41 2008 (r184760) +++ head/usr.bin/tar/bsdtar.c Sat Nov 8 04:43:24 2008 (r184761) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2003-2008 Tim Kientzle * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,18 +38,6 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_FCNTL_H #include #endif -#ifdef HAVE_GETOPT_LONG -#include -#else -struct option { - const char *name; - int has_arg; - int *flag; - int val; -}; -#define no_argument 0 -#define required_argument 1 -#endif #ifdef HAVE_LANGINFO_H #include #endif @@ -78,14 +66,6 @@ struct option { #include "bsdtar.h" -#if !HAVE_DECL_OPTARG -extern int optarg; -#endif - -#if !HAVE_DECL_OPTIND -extern int optind; -#endif - /* * Per POSIX.1-1988, tar defaults to reading/writing archives to/from * the default tape device for the system. Pick something reasonable here. @@ -101,133 +81,12 @@ extern int optind; /* External function to parse a date/time string (from getdate.y) */ time_t get_date(const char *); -static int bsdtar_getopt(struct bsdtar *, const char *optstring, - const struct option **poption); static void long_help(struct bsdtar *); static void only_mode(struct bsdtar *, const char *opt, const char *valid); -static char ** rewrite_argv(struct bsdtar *, - int *argc, char ** src_argv, - const char *optstring); static void set_mode(struct bsdtar *, char opt); static void version(void); -/* - * The leading '+' here forces the GNU version of getopt() (as well as - * both the GNU and BSD versions of getopt_long) to stop at the first - * non-option. Otherwise, GNU getopt() permutes the arguments and - * screws up -C processing. - */ -static const char *tar_opts = "+Bb:C:cf:HhI:jkLlmnOoPpqrts:ST:UuvW:wX:xyZz"; - -/* - * Most of these long options are deliberately not documented. They - * are provided only to make life easier for people who also use GNU tar. - * The only long options documented in the manual page are the ones - * with no corresponding short option, such as --exclude, --nodump, - * and --fast-read. - * - * On systems that lack getopt_long, long options can be specified - * using -W longopt and -W longopt=value, e.g. "-W nodump" is the same - * as "--nodump" and "-W exclude=pattern" is the same as "--exclude - * pattern". This does not rely the GNU getopt() "W;" extension, so - * should work correctly on any system with a POSIX-compliant getopt(). - */ - -/* Fake short equivalents for long options that otherwise lack them. */ -enum { - OPTION_CHECK_LINKS = 1, - OPTION_CHROOT, - OPTION_EXCLUDE, - OPTION_FORMAT, - OPTION_HELP, - OPTION_INCLUDE, - OPTION_KEEP_NEWER_FILES, - OPTION_NEWER_CTIME, - OPTION_NEWER_CTIME_THAN, - OPTION_NEWER_MTIME, - OPTION_NEWER_MTIME_THAN, - OPTION_NODUMP, - OPTION_NO_SAME_OWNER, - OPTION_NO_SAME_PERMISSIONS, - OPTION_NULL, - OPTION_NUMERIC_OWNER, - OPTION_ONE_FILE_SYSTEM, - OPTION_POSIX, - OPTION_STRIP_COMPONENTS, - OPTION_TOTALS, - OPTION_USE_COMPRESS_PROGRAM, - OPTION_VERSION -}; - -/* - * If you add anything, be very careful to keep this list properly - * sorted, as the -W logic relies on it. - */ -static const struct option tar_longopts[] = { - { "absolute-paths", no_argument, NULL, 'P' }, - { "append", no_argument, NULL, 'r' }, - { "block-size", required_argument, NULL, 'b' }, - { "bunzip2", no_argument, NULL, 'j' }, - { "bzip", no_argument, NULL, 'j' }, - { "bzip2", no_argument, NULL, 'j' }, - { "cd", required_argument, NULL, 'C' }, - { "check-links", no_argument, NULL, OPTION_CHECK_LINKS }, - { "chroot", no_argument, NULL, OPTION_CHROOT }, - { "compress", no_argument, NULL, 'Z' }, - { "confirmation", no_argument, NULL, 'w' }, - { "create", no_argument, NULL, 'c' }, - { "dereference", no_argument, NULL, 'L' }, - { "directory", required_argument, NULL, 'C' }, - { "exclude", required_argument, NULL, OPTION_EXCLUDE }, - { "exclude-from", required_argument, NULL, 'X' }, - { "extract", no_argument, NULL, 'x' }, - { "fast-read", no_argument, NULL, 'q' }, - { "file", required_argument, NULL, 'f' }, - { "files-from", required_argument, NULL, 'T' }, - { "format", required_argument, NULL, OPTION_FORMAT }, - { "gunzip", no_argument, NULL, 'z' }, - { "gzip", no_argument, NULL, 'z' }, - { "help", no_argument, NULL, OPTION_HELP }, - { "include", required_argument, NULL, OPTION_INCLUDE }, - { "interactive", no_argument, NULL, 'w' }, - { "insecure", no_argument, NULL, 'P' }, - { "keep-newer-files", no_argument, NULL, OPTION_KEEP_NEWER_FILES }, - { "keep-old-files", no_argument, NULL, 'k' }, - { "list", no_argument, NULL, 't' }, - { "modification-time", no_argument, NULL, 'm' }, - { "newer", required_argument, NULL, OPTION_NEWER_CTIME }, - { "newer-ctime", required_argument, NULL, OPTION_NEWER_CTIME }, - { "newer-ctime-than", required_argument, NULL, OPTION_NEWER_CTIME_THAN }, - { "newer-mtime", required_argument, NULL, OPTION_NEWER_MTIME }, - { "newer-mtime-than", required_argument, NULL, OPTION_NEWER_MTIME_THAN }, - { "newer-than", required_argument, NULL, OPTION_NEWER_CTIME_THAN }, - { "nodump", no_argument, NULL, OPTION_NODUMP }, - { "norecurse", no_argument, NULL, 'n' }, - { "no-recursion", no_argument, NULL, 'n' }, - { "no-same-owner", no_argument, NULL, OPTION_NO_SAME_OWNER }, - { "no-same-permissions",no_argument, NULL, OPTION_NO_SAME_PERMISSIONS }, - { "null", no_argument, NULL, OPTION_NULL }, - { "numeric-owner", no_argument, NULL, OPTION_NUMERIC_OWNER }, - { "one-file-system", no_argument, NULL, OPTION_ONE_FILE_SYSTEM }, - { "posix", no_argument, NULL, OPTION_POSIX }, - { "preserve-permissions", no_argument, NULL, 'p' }, - { "read-full-blocks", no_argument, NULL, 'B' }, - { "same-permissions", no_argument, NULL, 'p' }, - { "strip-components", required_argument, NULL, OPTION_STRIP_COMPONENTS }, - { "to-stdout", no_argument, NULL, 'O' }, - { "totals", no_argument, NULL, OPTION_TOTALS }, - { "uncompress", no_argument, NULL, 'Z' }, - { "unlink", no_argument, NULL, 'U' }, - { "unlink-first", no_argument, NULL, 'U' }, - { "update", no_argument, NULL, 'u' }, - { "use-compress-program", - required_argument, NULL, OPTION_USE_COMPRESS_PROGRAM }, - { "verbose", no_argument, NULL, 'v' }, - { "version", no_argument, NULL, OPTION_VERSION }, - { NULL, 0, NULL, 0 } -}; - /* A basic set of security flags to request from libarchive. */ #define SECURITY \ (ARCHIVE_EXTRACT_SECURE_SYMLINKS \ @@ -237,7 +96,6 @@ int main(int argc, char **argv) { struct bsdtar *bsdtar, bsdtar_storage; - const struct option *option; int opt, t; char option_o; char possible_help_request; @@ -295,33 +153,29 @@ main(int argc, char **argv) bsdtar->extract_flags |= ARCHIVE_EXTRACT_FFLAGS; } - /* Rewrite traditional-style tar arguments, if used. */ - argv = rewrite_argv(bsdtar, &argc, argv, tar_opts); - bsdtar->argv = argv; bsdtar->argc = argc; - /* Process all remaining arguments now. */ /* * Comments following each option indicate where that option * originated: SUSv2, POSIX, GNU tar, star, etc. If there's * no such comment, then I don't know of anyone else who * implements that option. */ - while ((opt = bsdtar_getopt(bsdtar, tar_opts, &option)) != -1) { + while ((opt = bsdtar_getopt(bsdtar)) != -1) { switch (opt) { case 'B': /* GNU tar */ /* libarchive doesn't need this; just ignore it. */ break; case 'b': /* SUSv2 */ - t = atoi(optarg); + t = atoi(bsdtar->optarg); if (t <= 0 || t > 1024) bsdtar_errc(bsdtar, 1, 0, "Argument to -b is out of range (1..1024)"); bsdtar->bytes_per_block = 512 * t; break; case 'C': /* GNU tar */ - set_chdir(bsdtar, optarg); + set_chdir(bsdtar, bsdtar->optarg); break; case 'c': /* SUSv2 */ set_mode(bsdtar, opt); @@ -333,15 +187,15 @@ main(int argc, char **argv) bsdtar->option_chroot = 1; break; case OPTION_EXCLUDE: /* GNU tar */ - if (exclude(bsdtar, optarg)) + if (exclude(bsdtar, bsdtar->optarg)) bsdtar_errc(bsdtar, 1, 0, - "Couldn't exclude %s\n", optarg); + "Couldn't exclude %s\n", bsdtar->optarg); break; case OPTION_FORMAT: /* GNU tar, others */ - bsdtar->create_format = optarg; + bsdtar->create_format = bsdtar->optarg; break; case 'f': /* SUSv2 */ - bsdtar->filename = optarg; + bsdtar->filename = bsdtar->optarg; if (strcmp(bsdtar->filename, "-") == 0) bsdtar->filename = NULL; break; @@ -368,7 +222,7 @@ main(int argc, char **argv) * permissions without having to create those * permissions on disk. */ - bsdtar->names_from_file = optarg; + bsdtar->names_from_file = bsdtar->optarg; break; case OPTION_INCLUDE: /* @@ -376,10 +230,10 @@ main(int argc, char **argv) * noone else needs this to filter entries * when transforming archives. */ - if (include(bsdtar, optarg)) + if (include(bsdtar, bsdtar->optarg)) bsdtar_errc(bsdtar, 1, 0, "Failed to add %s to inclusion list", - optarg); + bsdtar->optarg); break; case 'j': /* GNU tar */ #if HAVE_LIBBZ2 @@ -389,7 +243,8 @@ main(int argc, char **argv) bsdtar->create_compression); bsdtar->create_compression = opt; #else - bsdtar_warnc(bsdtar, 0, "-j compression not supported by this version of bsdtar"); + bsdtar_warnc(bsdtar, 0, + "bzip2 compression not supported by this version of bsdtar"); usage(bsdtar); #endif break; @@ -420,28 +275,28 @@ main(int argc, char **argv) * TODO: Add corresponding "older" options to reverse these. */ case OPTION_NEWER_CTIME: /* GNU tar */ - bsdtar->newer_ctime_sec = get_date(optarg); + bsdtar->newer_ctime_sec = get_date(bsdtar->optarg); break; case OPTION_NEWER_CTIME_THAN: { struct stat st; - if (stat(optarg, &st) != 0) + if (stat(bsdtar->optarg, &st) != 0) bsdtar_errc(bsdtar, 1, 0, - "Can't open file %s", optarg); + "Can't open file %s", bsdtar->optarg); bsdtar->newer_ctime_sec = st.st_ctime; bsdtar->newer_ctime_nsec = ARCHIVE_STAT_CTIME_NANOS(&st); } break; case OPTION_NEWER_MTIME: /* GNU tar */ - bsdtar->newer_mtime_sec = get_date(optarg); + bsdtar->newer_mtime_sec = get_date(bsdtar->optarg); break; case OPTION_NEWER_MTIME_THAN: { struct stat st; - if (stat(optarg, &st) != 0) + if (stat(bsdtar->optarg, &st) != 0) bsdtar_errc(bsdtar, 1, 0, - "Can't open file %s", optarg); + "Can't open file %s", bsdtar->optarg); bsdtar->newer_mtime_sec = st.st_mtime; bsdtar->newer_mtime_nsec = ARCHIVE_STAT_MTIME_NANOS(&st); @@ -509,17 +364,18 @@ main(int argc, char **argv) break; case 's': /* NetBSD pax-as-tar */ #if HAVE_REGEX_H - add_substitution(bsdtar, optarg); + add_substitution(bsdtar, bsdtar->optarg); #else - bsdtar_warnc(bsdtar, 0, "-s is not supported by this version of bsdtar"); + bsdtar_warnc(bsdtar, 0, + "-s is not supported by this version of bsdtar"); usage(bsdtar); #endif break; case OPTION_STRIP_COMPONENTS: /* GNU tar 1.15 */ - bsdtar->strip_components = atoi(optarg); + bsdtar->strip_components = atoi(bsdtar->optarg); break; case 'T': /* GNU tar */ - bsdtar->names_from_file = optarg; + bsdtar->names_from_file = bsdtar->optarg; break; case 't': /* SUSv2 */ set_mode(bsdtar, opt); @@ -544,19 +400,19 @@ main(int argc, char **argv) #if 0 /* * The -W longopt feature is handled inside of - * bsdtar_getop(), so -W is not available here. + * bsdtar_getopt(), so -W is not available here. */ - case 'W': /* Obscure, but useful GNU convention. */ + case 'W': /* Obscure GNU convention. */ break; #endif case 'w': /* SUSv2 */ bsdtar->option_interactive = 1; break; case 'X': /* GNU tar */ - if (exclude_from_file(bsdtar, optarg)) + if (exclude_from_file(bsdtar, bsdtar->optarg)) bsdtar_errc(bsdtar, 1, 0, "failed to process exclusions from file %s", - optarg); + bsdtar->optarg); break; case 'x': /* SUSv2 */ set_mode(bsdtar, opt); @@ -569,7 +425,8 @@ main(int argc, char **argv) bsdtar->create_compression); bsdtar->create_compression = opt; #else - bsdtar_warnc(bsdtar, 0, "-y compression not supported by this version of bsdtar"); + bsdtar_warnc(bsdtar, 0, + "bzip2 compression not supported by this version of bsdtar"); usage(bsdtar); #endif break; @@ -588,12 +445,13 @@ main(int argc, char **argv) bsdtar->create_compression); bsdtar->create_compression = opt; #else - bsdtar_warnc(bsdtar, 0, "-z compression not supported by this version of bsdtar"); + bsdtar_warnc(bsdtar, 0, + "gzip compression not supported by this version of bsdtar"); usage(bsdtar); #endif break; case OPTION_USE_COMPRESS_PROGRAM: - bsdtar->compress_program = optarg; + bsdtar->compress_program = bsdtar->optarg; break; default: usage(bsdtar); @@ -668,9 +526,6 @@ main(int argc, char **argv) if (bsdtar->strip_components != 0) only_mode(bsdtar, "--strip-components", "xt"); - bsdtar->argc -= optind; - bsdtar->argv += optind; - switch(bsdtar->mode) { case 'c': tar_mode_c(bsdtar); @@ -722,72 +577,6 @@ only_mode(struct bsdtar *bsdtar, const c } -/*- - * Convert traditional tar arguments into new-style. - * For example, - * tar tvfb file.tar 32 --exclude FOO - * will be converted to - * tar -t -v -f file.tar -b 32 --exclude FOO - * - * This requires building a new argv array. The initial bundled word - * gets expanded into a new string that looks like "-t\0-v\0-f\0-b\0". - * The new argv array has pointers into this string intermingled with - * pointers to the existing arguments. Arguments are moved to - * immediately follow their options. - * - * The optstring argument here is the same one passed to getopt(3). - * It is used to determine which option letters have trailing arguments. - */ -char ** -rewrite_argv(struct bsdtar *bsdtar, int *argc, char **src_argv, - const char *optstring) -{ - char **new_argv, **dest_argv; - const char *p; - char *src, *dest; - - if (src_argv[0] == NULL || src_argv[1] == NULL || - src_argv[1][0] == '-' || src_argv[1][0] == '\0') - return (src_argv); - - *argc += strlen(src_argv[1]) - 1; - new_argv = malloc((*argc + 1) * sizeof(new_argv[0])); - if (new_argv == NULL) - bsdtar_errc(bsdtar, 1, errno, "No Memory"); - - dest_argv = new_argv; - *dest_argv++ = *src_argv++; - - dest = malloc(strlen(*src_argv) * 3); - if (dest == NULL) - bsdtar_errc(bsdtar, 1, errno, "No memory"); - for (src = *src_argv++; *src != '\0'; src++) { - *dest_argv++ = dest; - *dest++ = '-'; - *dest++ = *src; - *dest++ = '\0'; - /* If option takes an argument, insert that into the list. */ - for (p = optstring; p != NULL && *p != '\0'; p++) { - if (*p != *src) - continue; - if (p[1] != ':') /* No arg required, done. */ - break; - if (*src_argv == NULL) /* No arg available? Error. */ - bsdtar_errc(bsdtar, 1, 0, - "Option %c requires an argument", - *src); - *dest_argv++ = *src_argv++; - break; - } - } - - /* Copy remaining arguments, including trailing NULL. */ - while ((*dest_argv++ = *src_argv++) != NULL) - ; - - return (new_argv); -} - void usage(struct bsdtar *bsdtar) { @@ -799,11 +588,7 @@ usage(struct bsdtar *bsdtar) fprintf(stderr, " List: %s -tf \n", p); fprintf(stderr, " Extract: %s -xf \n", p); fprintf(stderr, " Create: %s -cf [filenames...]\n", p); -#ifdef HAVE_GETOPT_LONG fprintf(stderr, " Help: %s --help\n", p); -#else - fprintf(stderr, " Help: %s -h\n", p); -#endif exit(1); } @@ -828,11 +613,7 @@ static const char *long_help_msg = " , add these items to archive\n" " -z, -j Compress archive with gzip/bzip2\n" " --format {ustar|pax|cpio|shar} Select archive format\n" -#ifdef HAVE_GETOPT_LONG " --exclude Skip files that match pattern\n" -#else - " -W exclude= Skip files that match pattern\n" -#endif " -C Change to before processing remaining files\n" " @ Add entries from to output\n" "List: %p -t [options] []\n" @@ -880,80 +661,3 @@ long_help(struct bsdtar *bsdtar) } version(); } - -static int -bsdtar_getopt(struct bsdtar *bsdtar, const char *optstring, - const struct option **poption) -{ - char *p, *q; - const struct option *option; - int opt; - int option_index; - size_t option_length; - - option_index = -1; - *poption = NULL; - -#ifdef HAVE_GETOPT_LONG - opt = getopt_long(bsdtar->argc, bsdtar->argv, optstring, - tar_longopts, &option_index); - if (option_index > -1) - *poption = tar_longopts + option_index; -#else - opt = getopt(bsdtar->argc, bsdtar->argv, optstring); -#endif - - /* Support long options through -W longopt=value */ - if (opt == 'W') { - p = optarg; - q = strchr(optarg, '='); - if (q != NULL) { - option_length = (size_t)(q - p); - optarg = q + 1; - } else { - option_length = strlen(p); - optarg = NULL; - } - option = tar_longopts; - while (option->name != NULL && - (strlen(option->name) < option_length || - strncmp(p, option->name, option_length) != 0 )) { - option++; - } - - if (option->name != NULL) { - *poption = option; - opt = option->val; - - /* If the first match was exact, we're done. */ - if (strncmp(p, option->name, strlen(option->name)) == 0) { - while (option->name != NULL) - option++; - } else { - /* Check if there's another match. */ - option++; - while (option->name != NULL && - (strlen(option->name) < option_length || - strncmp(p, option->name, option_length) != 0)) { - option++; - } - } - if (option->name != NULL) - bsdtar_errc(bsdtar, 1, 0, - "Ambiguous option %s " - "(matches both %s and %s)", - p, (*poption)->name, option->name); - - if ((*poption)->has_arg == required_argument - && optarg == NULL) - bsdtar_errc(bsdtar, 1, 0, - "Option \"%s\" requires argument", p); - } else { - opt = '?'; - /* TODO: Set up a fake 'struct option' for - * error reporting... ? ? ? */ - } - } - - return (opt); -} Modified: head/usr.bin/tar/bsdtar.h ============================================================================== --- head/usr.bin/tar/bsdtar.h Sat Nov 8 02:05:41 2008 (r184760) +++ head/usr.bin/tar/bsdtar.h Sat Nov 8 04:43:24 2008 (r184761) @@ -80,6 +80,7 @@ struct bsdtar { const char *progname; int argc; char **argv; + const char *optarg; size_t gs_width; /* For 'list_item' in read.c */ size_t u_width; /* for 'list_item' in read.c */ uid_t user_uid; /* UID running this program */ @@ -102,8 +103,36 @@ struct bsdtar { struct substitution *substitution; /* for subst.c */ }; +/* Fake short equivalents for long options that otherwise lack them. */ +enum { + OPTION_CHECK_LINKS = 1, + OPTION_CHROOT, + OPTION_EXCLUDE, + OPTION_FORMAT, + OPTION_HELP, + OPTION_INCLUDE, + OPTION_KEEP_NEWER_FILES, + OPTION_NEWER_CTIME, + OPTION_NEWER_CTIME_THAN, + OPTION_NEWER_MTIME, + OPTION_NEWER_MTIME_THAN, + OPTION_NODUMP, + OPTION_NO_SAME_OWNER, + OPTION_NO_SAME_PERMISSIONS, + OPTION_NULL, + OPTION_NUMERIC_OWNER, + OPTION_ONE_FILE_SYSTEM, + OPTION_POSIX, + OPTION_STRIP_COMPONENTS, + OPTION_TOTALS, + OPTION_USE_COMPRESS_PROGRAM, + OPTION_VERSION +}; + + void bsdtar_errc(struct bsdtar *, int _eval, int _code, const char *fmt, ...) __dead2; +int bsdtar_getopt(struct bsdtar *); void bsdtar_warnc(struct bsdtar *, int _code, const char *fmt, ...); void cleanup_exclusions(struct bsdtar *); void do_chdir(struct bsdtar *); Added: head/usr.bin/tar/cmdline.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/tar/cmdline.c Sat Nov 8 04:43:24 2008 (r184761) @@ -0,0 +1,376 @@ +/*- + * Copyright (c) 2003-2008 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``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(S) 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. + */ + +/* + * Command line parser for tar. + */ + +#include "bsdtar_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif + +#include "bsdtar.h" + +/* + * Short options for tar. Please keep this sorted. + */ +static const char *short_options + = "Bb:C:cf:HhI:jkLlmnOoPpqrSs:T:tUuvW:wX:xyZz"; + +/* + * Long options for tar. Please keep this list sorted. + * + * The symbolic names for options that lack a short equivalent are + * defined in bsdtar.h. Also note that so far I've found no need + * to support optional arguments to long options. That would be + * a small change to the code below. + */ + +static struct option { + const char *name; + int required; /* 1 if this option requires an argument. */ + int equivalent; /* Equivalent short option. */ +} tar_longopts[] = { + { "absolute-paths", 0, 'P' }, + { "append", 0, 'r' }, + { "block-size", 1, 'b' }, + { "bunzip2", 0, 'j' }, + { "bzip", 0, 'j' }, + { "bzip2", 0, 'j' }, + { "cd", 1, 'C' }, + { "check-links", 0, OPTION_CHECK_LINKS }, + { "chroot", 0, OPTION_CHROOT }, + { "compress", 0, 'Z' }, + { "confirmation", 0, 'w' }, + { "create", 0, 'c' }, + { "dereference", 0, 'L' }, + { "directory", 1, 'C' }, + { "exclude", 1, OPTION_EXCLUDE }, + { "exclude-from", 1, 'X' }, + { "extract", 0, 'x' }, + { "fast-read", 0, 'q' }, + { "file", 1, 'f' }, + { "files-from", 1, 'T' }, + { "format", 1, OPTION_FORMAT }, + { "gunzip", 0, 'z' }, + { "gzip", 0, 'z' }, + { "help", 0, OPTION_HELP }, + { "include", 1, OPTION_INCLUDE }, + { "interactive", 0, 'w' }, + { "insecure", 0, 'P' }, + { "keep-newer-files", 0, OPTION_KEEP_NEWER_FILES }, + { "keep-old-files", 0, 'k' }, + { "list", 0, 't' }, + { "modification-time", 0, 'm' }, + { "newer", 1, OPTION_NEWER_CTIME }, + { "newer-ctime", 1, OPTION_NEWER_CTIME }, + { "newer-ctime-than", 1, OPTION_NEWER_CTIME_THAN }, + { "newer-mtime", 1, OPTION_NEWER_MTIME }, + { "newer-mtime-than", 1, OPTION_NEWER_MTIME_THAN }, + { "newer-than", 1, OPTION_NEWER_CTIME_THAN }, + { "nodump", 0, OPTION_NODUMP }, + { "norecurse", 0, 'n' }, + { "no-recursion", 0, 'n' }, + { "no-same-owner", 0, OPTION_NO_SAME_OWNER }, + { "no-same-permissions", 0, OPTION_NO_SAME_PERMISSIONS }, + { "null", 0, OPTION_NULL }, + { "numeric-owner", 0, OPTION_NUMERIC_OWNER }, + { "one-file-system", 0, OPTION_ONE_FILE_SYSTEM }, + { "posix", 0, OPTION_POSIX }, + { "preserve-permissions", 0, 'p' }, + { "read-full-blocks", 0, 'B' }, + { "same-permissions", 0, 'p' }, + { "strip-components", 1, OPTION_STRIP_COMPONENTS }, + { "to-stdout", 0, 'O' }, + { "totals", 0, OPTION_TOTALS }, + { "uncompress", 0, 'Z' }, + { "unlink", 0, 'U' }, + { "unlink-first", 0, 'U' }, + { "update", 0, 'u' }, + { "use-compress-program", 1, OPTION_USE_COMPRESS_PROGRAM }, + { "verbose", 0, 'v' }, + { "version", 0, OPTION_VERSION }, + { NULL, 0, 0 } +}; + +/* + * This getopt implementation has two key features that common + * getopt_long() implementations lack. Apart from those, it's a + * straightforward option parser, considerably simplified by not + * needing to support the wealth of exotic getopt_long() features. It + * has, of course, been shamelessly tailored for bsdtar. (If you're + * looking for a generic getopt_long() implementation for your + * project, I recommend Gregory Pietsch's public domain getopt_long() + * implementation.) The two additional features are: + * + * Old-style tar arguments: The original tar implementation treated + * the first argument word as a list of single-character option + * letters. All arguments follow as separate words. For example, + * tar xbf 32 /dev/tape + * Here, the "xbf" is three option letters, "32" is the argument for + * "b" and "/dev/tape" is the argument for "f". We support this usage + * if the first command-line argument does not begin with '-'. We + * also allow regular short and long options to follow, e.g., + * tar xbf 32 /dev/tape -P --format=pax + * + * -W long options: There's an obscure GNU convention (only rarely + * supported even there) that allows "-W option=argument" as an + * alternative way to support long options. This was supported in + * early bsdtar as a way to access long options on platforms that did + * not support getopt_long() and is preserved here for backwards + * compatibility. (Of course, if I'd started with a custom + * command-line parser from the beginning, I would have had normal + * long option support on every platform so that hack wouldn't have + * been necessary. Oh, well. Some mistakes you just have to live + * with.) + * + * TODO: We should be able to use this to pull files and intermingled + * options (such as -C) from the command line in write mode. That + * will require a little rethinking of the argument handling in + * bsdtar.c. + * + * TODO: If we want to support arbitrary command-line options from -T + * input (as GNU tar does), we may need to extend this to handle option + * words from sources other than argv/arc. I'm not really sure if I + * like that feature of GNU tar, so it's certainly not a priority. + */ + +int +bsdtar_getopt(struct bsdtar *bsdtar) +{ + enum { state_start = 0, state_old_tar, state_next_word, + state_short, state_long }; + static int state = state_start; + static char *opt_word; + + const struct option *popt, *match = NULL, *match2 = NULL; + const char *p, *long_prefix = "--"; + size_t optlength; + int opt = '?'; + int required = 0; + + bsdtar->optarg = NULL; + + /* First time through, initialize everything. */ + if (state == state_start) { + /* Skip program name. */ + ++bsdtar->argv; + --bsdtar->argc; + if (*bsdtar->argv == NULL) + return (-1); + /* Decide between "new style" and "old style" arguments. */ + if (bsdtar->argv[0][0] == '-') { + state = state_next_word; + } else { + state = state_old_tar; + opt_word = *bsdtar->argv++; + --bsdtar->argc; + } + } + + /* + * We're parsing old-style tar arguments + */ + if (state == state_old_tar) { + /* Get the next option character. */ + opt = *opt_word++; + if (opt == '\0') { + /* New-style args can follow old-style. */ + state = state_next_word; + } else { + /* See if it takes an argument. */ + p = strchr(short_options, opt); + if (p == NULL) + return ('?'); + if (p[1] == ':') { + bsdtar->optarg = *bsdtar->argv; + if (bsdtar->optarg == NULL) { + bsdtar_warnc(bsdtar, 0, + "Option %c requires an argument", + opt); + return ('?'); + } + ++bsdtar->argv; + --bsdtar->argc; + } + } + } + + /* + * We're ready to look at the next word in argv. + */ + if (state == state_next_word) { + /* No more arguments, so no more options. */ + if (bsdtar->argv[0] == NULL) + return (-1); + /* Doesn't start with '-', so no more options. */ + if (bsdtar->argv[0][0] != '-') + return (-1); + /* "--" marks end of options; consume it and return. */ + if (strcmp(bsdtar->argv[0], "--") == 0) { + ++bsdtar->argv; + --bsdtar->argc; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 06:25:57 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6618C1065676; Sat, 8 Nov 2008 06:25:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 566E88FC19; Sat, 8 Nov 2008 06:25:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA86PvQg003487; Sat, 8 Nov 2008 06:25:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA86Pvhw003486; Sat, 8 Nov 2008 06:25:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200811080625.mA86Pvhw003486@svn.freebsd.org> From: Alexander Motin Date: Sat, 8 Nov 2008 06:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184762 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 06:25:57 -0000 Author: mav Date: Sat Nov 8 06:25:57 2008 New Revision: 184762 URL: http://svn.freebsd.org/changeset/base/184762 Log: Don't use curthread to resolve file descriptor. Request may be queued, so thread will be different. Instead require sender to send process ID together with file descriptor. Modified: head/sys/netgraph/ng_tty.c Modified: head/sys/netgraph/ng_tty.c ============================================================================== --- head/sys/netgraph/ng_tty.c Sat Nov 8 04:43:24 2008 (r184761) +++ head/sys/netgraph/ng_tty.c Sat Nov 8 06:25:57 2008 (r184762) @@ -73,6 +73,7 @@ #include #include #include +#include #include #include @@ -250,7 +251,8 @@ ngt_shutdown(node_p node) static int ngt_rcvmsg(node_p node, item_p item, hook_p lasthook) { - struct thread *td = curthread; /* XXX */ + struct proc *p; + struct thread *td; const sc_p sc = NG_NODE_PRIVATE(node); struct ng_mesg *msg, *resp = NULL; int error = 0; @@ -262,8 +264,14 @@ ngt_rcvmsg(node_p node, item_p item, hoo case NGM_TTY_SET_TTY: if (sc->tp != NULL) return (EBUSY); - error = ttyhook_register(&sc->tp, td, *(int *)msg->data, + + p = pfind(((int *)msg->data)[0]); + if (p == NULL) + return (ESRCH); + td = FIRST_THREAD_IN_PROC(p); + error = ttyhook_register(&sc->tp, td, ((int *)msg->data)[1], &ngt_hook, sc); + PROC_UNLOCK(p); if (error != 0) return (error); break; From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 13:13:49 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 588961065678; Sat, 8 Nov 2008 13:13:49 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by mx1.freebsd.org (Postfix) with ESMTP id 5A7918FC0A; Sat, 8 Nov 2008 13:13:47 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1379370fgb.35 for ; Sat, 08 Nov 2008 05:13:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=xDaOPJwPXAhvwxnWf8NTarj/6JuEKR9GzED+sG26W5c=; b=dzGxXEcGlNg1GbQttpt+y27rWnOE29txJGtAreC6Rr8FKQY49f9p5B8PdhFGt0/B1c 1NR6EHaEvutGaIEJ5hH2+1JKiHGKCjkigzKCGELcdnLQX99DjrEbA6rvzyXPnWSqAoN9 UyCLibB1rugE9ykKEOuUEfAqLAiQeA4LrL56A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=FTGMgKY6ZBk6Eb46W5uWXLGX4dwIXkCAbPi+HuLEXPk0m3/aHZd67c713ueGjOknCX 1+FnhwHiNk5vcCi1WuV4lm80oKplLiQUT0t/KRz+0viM7j8QJctBXikOl/d72bORqici 85QflF8uCcEPOIbo4nfUbbtFDA6O+4Q/gi0kI= Received: by 10.86.23.17 with SMTP id 17mr5056510fgw.0.1226150026920; Sat, 08 Nov 2008 05:13:46 -0800 (PST) Received: by 10.86.2.18 with HTTP; Sat, 8 Nov 2008 05:13:46 -0800 (PST) Message-ID: <3bbf2fe10811080513x2b8bd201gcf24562360374494@mail.gmail.com> Date: Sat, 8 Nov 2008 14:13:46 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Alexander Motin" In-Reply-To: <200811080625.mA86Pvhw003486@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811080625.mA86Pvhw003486@svn.freebsd.org> X-Google-Sender-Auth: a25e4c198f0343e2 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184762 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 13:13:49 -0000 2008/11/8, Alexander Motin : > Author: mav > Date: Sat Nov 8 06:25:57 2008 > New Revision: 184762 > URL: http://svn.freebsd.org/changeset/base/184762 > > Log: > Don't use curthread to resolve file descriptor. Request may be queued, so > thread will be different. Instead require sender to send process ID > together with file descriptor. > > Modified: > head/sys/netgraph/ng_tty.c > > Modified: head/sys/netgraph/ng_tty.c > ============================================================================== > --- head/sys/netgraph/ng_tty.c Sat Nov 8 04:43:24 2008 (r184761) > +++ head/sys/netgraph/ng_tty.c Sat Nov 8 06:25:57 2008 (r184762) > @@ -73,6 +73,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -250,7 +251,8 @@ ngt_shutdown(node_p node) > static int > ngt_rcvmsg(node_p node, item_p item, hook_p lasthook) > { > - struct thread *td = curthread; /* XXX */ > + struct proc *p; > + struct thread *td; > const sc_p sc = NG_NODE_PRIVATE(node); > struct ng_mesg *msg, *resp = NULL; > int error = 0; > @@ -262,8 +264,14 @@ ngt_rcvmsg(node_p node, item_p item, hoo > case NGM_TTY_SET_TTY: > if (sc->tp != NULL) > return (EBUSY); > - error = ttyhook_register(&sc->tp, td, *(int *)msg->data, > + > + p = pfind(((int *)msg->data)[0]); > + if (p == NULL) > + return (ESRCH); > + td = FIRST_THREAD_IN_PROC(p); > + error = ttyhook_register(&sc->tp, td, ((int *)msg->data)[1], > &ngt_hook, sc); > + PROC_UNLOCK(p); > if (error != 0) > return (error); > break; The threads iterator in strcut proc should be proc_slock protected, so you need to grab/release it around FIRST_THREAD_IN_PROC(). Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 14:07:56 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9F5E1065676; Sat, 8 Nov 2008 14:07:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 64BBC8FC17; Sat, 8 Nov 2008 14:07:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KyoTj-0007ur-Cj; Sat, 08 Nov 2008 16:07:55 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id mA8E7p7S075098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 8 Nov 2008 16:07:51 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id mA8E7p6O040537; Sat, 8 Nov 2008 16:07:51 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id mA8E7p8u040536; Sat, 8 Nov 2008 16:07:51 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 8 Nov 2008 16:07:50 +0200 From: Kostik Belousov To: Attilio Rao Message-ID: <20081108140750.GI18100@deviant.kiev.zoral.com.ua> References: <200811080625.mA86Pvhw003486@svn.freebsd.org> <3bbf2fe10811080513x2b8bd201gcf24562360374494@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0ne7FPUD+ABQNzTq" Content-Disposition: inline In-Reply-To: <3bbf2fe10811080513x2b8bd201gcf24562360374494@mail.gmail.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1KyoTj-0007ur-Cj c1bec0b5b9a363ef23bfe4e91dc135df X-Terabit: YES Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r184762 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 14:07:57 -0000 --0ne7FPUD+ABQNzTq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 08, 2008 at 02:13:46PM +0100, Attilio Rao wrote: > 2008/11/8, Alexander Motin : > > Author: mav > > Date: Sat Nov 8 06:25:57 2008 > > New Revision: 184762 > > URL: http://svn.freebsd.org/changeset/base/184762 > > > > Log: > > Don't use curthread to resolve file descriptor. Request may be queued= , so > > thread will be different. Instead require sender to send process ID > > together with file descriptor. > > > > Modified: > > head/sys/netgraph/ng_tty.c > > > > Modified: head/sys/netgraph/ng_tty.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/netgraph/ng_tty.c Sat Nov 8 04:43:24 2008 (r1847= 61) > > +++ head/sys/netgraph/ng_tty.c Sat Nov 8 06:25:57 2008 (r1847= 62) > > @@ -73,6 +73,7 @@ > > #include > > #include > > #include > > +#include > > > > #include > > #include > > @@ -250,7 +251,8 @@ ngt_shutdown(node_p node) > > static int > > ngt_rcvmsg(node_p node, item_p item, hook_p lasthook) > > { > > - struct thread *td =3D curthread; /* XXX */ > > + struct proc *p; > > + struct thread *td; > > const sc_p sc =3D NG_NODE_PRIVATE(node); > > struct ng_mesg *msg, *resp =3D NULL; > > int error =3D 0; > > @@ -262,8 +264,14 @@ ngt_rcvmsg(node_p node, item_p item, hoo > > case NGM_TTY_SET_TTY: > > if (sc->tp !=3D NULL) > > return (EBUSY); > > - error =3D ttyhook_register(&sc->tp, td, *(int = *)msg->data, > > + > > + p =3D pfind(((int *)msg->data)[0]); > > + if (p =3D=3D NULL) > > + return (ESRCH); > > + td =3D FIRST_THREAD_IN_PROC(p); > > + error =3D ttyhook_register(&sc->tp, td, ((int = *)msg->data)[1], > > &ngt_hook, sc); > > + PROC_UNLOCK(p); > > if (error !=3D 0) > > return (error); > > break; >=20 > The threads iterator in strcut proc should be proc_slock protected, so > you need to grab/release it around FIRST_THREAD_IN_PROC(). I do not believe that process slock is needed there, since code just dereference a pointer. The process lock seems to be taken to guarantee that td is alive. On the other hand, ttyhook_register locks filedesc sx, that causes sleepable lock acquition after non-sleepable. I believe this is an actual problem with the change. Probably, this is even the problem with KPI of ttyhook_register, since caller need to somehow protect td from going away, and proc lock is a right lock to held. --0ne7FPUD+ABQNzTq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkkVnTYACgkQC3+MBN1Mb4iSpACgicliFnkeSuGSowkg1mkmfg7Z tVUAn3A4KqCxgaQafJj5XDS9wXCAzKcY =+bB6 -----END PGP SIGNATURE----- --0ne7FPUD+ABQNzTq-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 14:18:46 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 423F61065670 for ; Sat, 8 Nov 2008 14:18:46 +0000 (UTC) (envelope-from marc@blackend.org) Received: from abigail.blackend.org (ns0.blackend.org [82.227.222.164]) by mx1.freebsd.org (Postfix) with ESMTP id 828C18FC08 for ; Sat, 8 Nov 2008 14:18:45 +0000 (UTC) (envelope-from marc@blackend.org) Received: from gothic.blackend.org (gothic.blackend.org [192.168.1.203]) by abigail.blackend.org (8.13.4/8.13.3) with ESMTP id mA8E8DV0061304; Sat, 8 Nov 2008 15:08:14 +0100 (CET) (envelope-from marc@abigail.blackend.org) Received: from gothic.blackend.org (localhost [127.0.0.1]) by gothic.blackend.org (8.14.3/8.14.1) with ESMTP id mA8E8DkT001650; Sat, 8 Nov 2008 15:08:13 +0100 (CET) (envelope-from marc@gothic.blackend.org) Received: (from marc@localhost) by gothic.blackend.org (8.14.3/8.14.3/Submit) id mA8E8DiX001649; Sat, 8 Nov 2008 15:08:13 +0100 (CET) (envelope-from marc) Date: Sat, 8 Nov 2008 15:08:13 +0100 From: Marc Fonvieille To: Raphael Becker Message-ID: <20081108140813.GA1039@gothic.blackend.org> References: <200811072201.mA7M1VlX093904@svn.freebsd.org> <20081108001032.GA21542@ma.sigsys.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vkogqOf2sHV7VnPd" Content-Disposition: inline In-Reply-To: <20081108001032.GA21542@ma.sigsys.de> X-Useless-Header: blackend.org X-Operating-System: FreeBSD 7.1-PRERELEASE User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r184753 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 14:18:46 -0000 --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 08, 2008 at 01:10:32AM +0100, Raphael Becker wrote: > On Fri, Nov 07, 2008 at 10:01:31PM +0000, Marc Fonvieille wrote: > > + "This will give you ready access to over 19,000 ported software pa= ckages,\n" > > + "at a cost of around 445MB of disk space when \"clean\" and possib= ly\n" >=20 >=20 > I see around 700M here, my ports are configured "read-only", so all > work/, packages/ distfiles/ and so on are outside /usr/ports, updates > are done by cvsup: >=20 > # df -mi /usr/ports/ > Filesystem 1M-blocks Used Avail Capacity iused ifree %iused Mounted on > /dev/md0 1039 712 119 86% 129743 478895 21% /usr/ports >=20 > # du -sm /usr/ports/=20 > 713 /usr/ports/ >=20 > It heavily depends on inode-sizes. >=20 > I have about 130k inodes in use which cause a "theoretical minimum"=20 > of 508MB disk on filesystems with 4k inode-density, about 1G with 8k > inodes (default is 8k, see by newfs(8)) >=20 > -i bytes > Specify the density of inodes in the file system. The default is > to create an inode for every (4 * frag-size) bytes of data space. >=20 > -f frag-size > The fragment size of the file system in bytes. It must be a > power of two ranging in value between blocksize/8 and blocksize. > The default is 2048 bytes. >=20 >=20 > An uncompressed tarball (without the "inode-overhead") of=20 > /usr/ports/ is around 600MB here: >=20 > # tar cf - /usr/ports/ | wc -c > tar: Removing leading '/' from member names > 629196800 >=20 > or 600MB. >=20 > How did you measure / calculate 445MB?=20 >=20 If I do a csup after a rm -rf /usr/ports I get 402M according to "du -sh", so if we add INDEXes we should be close to 440M. I used 445MB to be consistent with what we have in http://www.freebsd.org/cgi/cvsweb.cgi/doc/share/sgml/freebsd.ent.diff?r1=3D= 1.100;r2=3D1.101 --=20 Marc --vkogqOf2sHV7VnPd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFJFZ1MzQ9RwE+OdOgRApJGAKCUjG0DQOoJ2g0h8tRZcNSEYxNA2ACeJTVF ngi7ODM7A/FTr9H4PuuXaXA= =daqS -----END PGP SIGNATURE----- --vkogqOf2sHV7VnPd-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 14:39:56 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8601106567D; Sat, 8 Nov 2008 14:39:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id C82BC8FC21; Sat, 8 Nov 2008 14:39:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 227345779; Sat, 08 Nov 2008 16:39:54 +0200 Message-ID: <4915A4BA.6090701@FreeBSD.org> Date: Sat, 08 Nov 2008 16:39:54 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.17 (X11/20081029) MIME-Version: 1.0 To: Attilio Rao References: <200811080625.mA86Pvhw003486@svn.freebsd.org> <3bbf2fe10811080513x2b8bd201gcf24562360374494@mail.gmail.com> In-Reply-To: <3bbf2fe10811080513x2b8bd201gcf24562360374494@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184762 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 14:39:56 -0000 Attilio Rao wrote: > 2008/11/8, Alexander Motin : >> @@ -262,8 +264,14 @@ ngt_rcvmsg(node_p node, item_p item, hoo >> case NGM_TTY_SET_TTY: >> if (sc->tp != NULL) >> return (EBUSY); >> - error = ttyhook_register(&sc->tp, td, *(int *)msg->data, >> + >> + p = pfind(((int *)msg->data)[0]); >> + if (p == NULL) >> + return (ESRCH); >> + td = FIRST_THREAD_IN_PROC(p); >> + error = ttyhook_register(&sc->tp, td, ((int *)msg->data)[1], >> &ngt_hook, sc); >> + PROC_UNLOCK(p); >> if (error != 0) >> return (error); >> break; > > The threads iterator in strcut proc should be proc_slock protected, so > you need to grab/release it around FIRST_THREAD_IN_PROC(). thread_find() also asserts process locked, but then it traverses/dereferences/returns threads without any additional locking. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 14:47:43 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF5B61065670; Sat, 8 Nov 2008 14:47:42 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id EBF398FC16; Sat, 8 Nov 2008 14:47:41 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1406086fgb.35 for ; Sat, 08 Nov 2008 06:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=EYNvg8wFf75ix5yoqg1s5XxDVDScAZcn7C6suY7CtK0=; b=cq+jOM80Op+5pYwQTfk+BfUfdDR5HoRW7nEGMn9EEcDIg08yrVu1WvO5j9hr+46T16 jD08cE+qDIAvDrO7elHlRyusF1O7rKxlC56ow0T1tL2GnLnFlOKG0+VMpxtzmknNLEgt vsm+Xu+hvvSIH/bz+1VHzHglYg498BZF6u070= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=Y6FIvqD9kG7UX2GvdKNy96Y6W7vvn1k6U8axk9FOpb1scmTdOkR+YoUA+Sd5uBG7jB slljWNl8QHqZ8YGTAHoTkhb2buyz/enRkVuHn07K+MBqv86gEQGMOyv2RXCk8hEpTWIm umepke1kPyGLWVhpeoXXczG60V8gnpMiAX+n8= Received: by 10.86.62.3 with SMTP id k3mr5130726fga.6.1226155660728; Sat, 08 Nov 2008 06:47:40 -0800 (PST) Received: by 10.86.2.18 with HTTP; Sat, 8 Nov 2008 06:47:40 -0800 (PST) Message-ID: <3bbf2fe10811080647n3f43c0d5k19a6e673c34b868c@mail.gmail.com> Date: Sat, 8 Nov 2008 15:47:40 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Kostik Belousov" In-Reply-To: <20081108140750.GI18100@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811080625.mA86Pvhw003486@svn.freebsd.org> <3bbf2fe10811080513x2b8bd201gcf24562360374494@mail.gmail.com> <20081108140750.GI18100@deviant.kiev.zoral.com.ua> X-Google-Sender-Auth: dc0dd88b6809d427 Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r184762 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 14:47:43 -0000 2008/11/8, Kostik Belousov : > On Sat, Nov 08, 2008 at 02:13:46PM +0100, Attilio Rao wrote: > > 2008/11/8, Alexander Motin : > > > Author: mav > > > Date: Sat Nov 8 06:25:57 2008 > > > New Revision: 184762 > > > URL: http://svn.freebsd.org/changeset/base/184762 > > > > > > Log: > > > Don't use curthread to resolve file descriptor. Request may be queued, so > > > thread will be different. Instead require sender to send process ID > > > together with file descriptor. > > > > > > Modified: > > > head/sys/netgraph/ng_tty.c > > > > > > Modified: head/sys/netgraph/ng_tty.c > > > ============================================================================== > > > --- head/sys/netgraph/ng_tty.c Sat Nov 8 04:43:24 2008 (r184761) > > > +++ head/sys/netgraph/ng_tty.c Sat Nov 8 06:25:57 2008 (r184762) > > > @@ -73,6 +73,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > > > > #include > > > #include > > > @@ -250,7 +251,8 @@ ngt_shutdown(node_p node) > > > static int > > > ngt_rcvmsg(node_p node, item_p item, hook_p lasthook) > > > { > > > - struct thread *td = curthread; /* XXX */ > > > + struct proc *p; > > > + struct thread *td; > > > const sc_p sc = NG_NODE_PRIVATE(node); > > > struct ng_mesg *msg, *resp = NULL; > > > int error = 0; > > > @@ -262,8 +264,14 @@ ngt_rcvmsg(node_p node, item_p item, hoo > > > case NGM_TTY_SET_TTY: > > > if (sc->tp != NULL) > > > return (EBUSY); > > > - error = ttyhook_register(&sc->tp, td, *(int *)msg->data, > > > + > > > + p = pfind(((int *)msg->data)[0]); > > > + if (p == NULL) > > > + return (ESRCH); > > > + td = FIRST_THREAD_IN_PROC(p); > > > + error = ttyhook_register(&sc->tp, td, ((int *)msg->data)[1], > > > &ngt_hook, sc); > > > + PROC_UNLOCK(p); > > > if (error != 0) > > > return (error); > > > break; > > > > The threads iterator in strcut proc should be proc_slock protected, so > > you need to grab/release it around FIRST_THREAD_IN_PROC(). > > > I do not believe that process slock is needed there, since code > just dereference a pointer. The process lock seems to be taken to > guarantee that td is alive. > > On the other hand, ttyhook_register locks filedesc sx, that causes > sleepable lock acquition after non-sleepable. I believe this is > an actual problem with the change. > > Probably, this is even the problem with KPI of ttyhook_register, since > caller need to somehow protect td from going away, and proc lock is > a right lock to held. I spoke briefly with Kostik on IRC and the problem he exposes is real. He suggested to use directly a struct file object to be passed and it seems fine by me. Also, as you are not interested in what thread is returned as first, you probabilly don't need the proc_slock. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 16:05:54 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40DF91065674 for ; Sat, 8 Nov 2008 16:05:54 +0000 (UTC) (envelope-from cokane@FreeBSD.org) Received: from mail-out1.fuse.net (mail-out1.fuse.net [216.68.8.175]) by mx1.freebsd.org (Postfix) with ESMTP id EDA308FC19 for ; Sat, 8 Nov 2008 16:05:53 +0000 (UTC) (envelope-from cokane@FreeBSD.org) X-CNFS-Analysis: v=1.0 c=1 a=Bc8KKkShqL4A:10 a=2vOcqf6hHJoA:10 a=LkYvsgB9u1MH7Ao0BLhsLg==:17 a=YhDHSQKWlupPK_3HE14A:9 a=EjPhc1oBjWTnK4hYsbxOcr9oKp0A:4 a=LY0hPdMaydYA:10 a=CjAOIJoOdyQSOca-ZGwA:9 a=MLREc5Zfs9xeyAEpDwuxJstusJ8A:4 a=rPt6xJ-oxjAA:10 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine Received: from [74.215.227.9] ([74.215.227.9:50240] helo=mail.cokane.org) by mail-out1.fuse.net (ecelerity 2.1.1.22 r(17669)) with ESMTP id EE/8D-06843-F25B5194 for ; Sat, 08 Nov 2008 10:50:21 -0500 Received: by mail.cokane.org (Postfix, from userid 103) id 55FF61DB2FA; Sat, 8 Nov 2008 10:50:07 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.1.8-gr1 (2007-02-13) on discordia X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DNS_FROM_SECURITYSAGE autolearn=no version=3.1.8-gr1 Received: from [172.20.1.3] (erwin.int.cokane.org [172.20.1.3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cokane.org (Postfix) with ESMTP id 437231DB2F9; Sat, 8 Nov 2008 10:50:01 -0500 (EST) From: Coleman Kane To: Tim Kientzle In-Reply-To: <491264B8.80602@freebsd.org> References: <200811051508.mA5F89XD030040@svn.freebsd.org> <20081105.150108.1649771743.imp@bsdimp.com> <9bbcef730811051526p3a978848uf904a149cb81fbce@mail.gmail.com> <20081105.163911.420518480.imp@bsdimp.com> <491264B8.80602@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-KmcpgDyE4Ow9CfAbsz3Y" Organization: FreeBSD Project Date: Sat, 08 Nov 2008 10:46:48 -0500 Message-Id: <1226159208.2183.16.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 FreeBSD GNOME Team Port Cc: src-committers@freebsd.org, ivoras@gmail.com, svn-src-all@freebsd.org, "M. Warner Losh" , svn-src-head@freebsd.org, des@freebsd.org Subject: Re: svn commit: r184691 - head/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 16:05:54 -0000 --=-KmcpgDyE4Ow9CfAbsz3Y Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2008-11-05 at 19:30 -0800, Tim Kientzle wrote: > > : This is why there's such a big push to get systems to properly suppor= t > > : UTF-8. FreeBSD had a SoC project this year that was supposed to > > : properly implement Unicode collations... > >=20 > > That makes sense. >=20 > Yes, UTF-8 is good. More UTF-8, please. >=20 > Tim I third that motion. --=20 Coleman Kane --=-KmcpgDyE4Ow9CfAbsz3Y Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkkVtGIACgkQcMSxQcXat5d/fwCfW0ZzRDSKhv61x53y0iwUlKCH 9KYAoIIIToJhTOwvIVU2BTgKHZ7LjKZ7 =Fkr7 -----END PGP SIGNATURE----- --=-KmcpgDyE4Ow9CfAbsz3Y-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 17:45:47 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2AB5106568B; Sat, 8 Nov 2008 17:45:47 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F6608FC14; Sat, 8 Nov 2008 17:45:47 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA8Hjlqb018646; Sat, 8 Nov 2008 17:45:47 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA8Hjlcu018645; Sat, 8 Nov 2008 17:45:47 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200811081745.mA8Hjlcu018645@svn.freebsd.org> From: Giorgos Keramidas Date: Sat, 8 Nov 2008 17:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184769 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 17:45:47 -0000 Author: keramida (doc committer) Date: Sat Nov 8 17:45:47 2008 New Revision: 184769 URL: http://svn.freebsd.org/changeset/base/184769 Log: Spell 'different' correctly. Modified: head/share/man/man4/snd_hda.4 Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Sat Nov 8 11:49:58 2008 (r184768) +++ head/share/man/man4/snd_hda.4 Sat Nov 8 17:45:47 2008 (r184769) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 6, 2008 +.Dd November 8, 2008 .Dt SND_HDA 4 .Os .Sh NAME @@ -297,7 +297,7 @@ any codec pin (external connector). All codec pins are reversible (could be configured either as input or output). .Pp So high codec uniformity and flexibility allow driver to configure it in many -defferent ways, depending on requested pins usage decribed by pins configuration. +different ways, depending on requested pins usage decribed by pins configuration. Driver reports such default pin configuration when verbose messages enabled: .Bd -literal hdac0: nid 20 0x01014020 as 2 seq 0 Line-out Jack jack 1 loc 1 color Green misc 0 From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 19:56:33 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5C911065677; Sat, 8 Nov 2008 19:56:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A15658FC12; Sat, 8 Nov 2008 19:56:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA8JuW3h020935; Sat, 8 Nov 2008 19:56:32 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA8JuWdj020934; Sat, 8 Nov 2008 19:56:32 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200811081956.mA8JuWdj020934@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 8 Nov 2008 19:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184770 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 19:56:33 -0000 Author: trasz Date: Sat Nov 8 19:56:32 2008 New Revision: 184770 URL: http://svn.freebsd.org/changeset/base/184770 Log: Require write access on a directory being moved from one parent directory to another in ZFS. Approved by: rwatson (mentor), pjd Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Sat Nov 8 17:45:47 2008 (r184769) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Sat Nov 8 19:56:32 2008 (r184770) @@ -1580,7 +1580,15 @@ zfs_zaccess_rename(znode_t *sdzp, znode_ /* * Rename permissions are combination of delete permission + * add file/subdir permission. + * + * BSD operating systems also require write permission + * on the directory being moved from one parent directory + * to another. */ + if (ZTOV(szp)->v_type == VDIR && ZTOV(sdzp) != ZTOV(tdzp)) { + if (error = zfs_zaccess(szp, ACE_WRITE_DATA, cr)) + return (error); + } /* * first make sure we do the delete portion. From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 20:40:40 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 923BD106567A; Sat, 8 Nov 2008 20:40:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E91B8FC0A; Sat, 8 Nov 2008 20:40:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mA8KeeJ9021791; Sat, 8 Nov 2008 20:40:40 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mA8KeewQ021788; Sat, 8 Nov 2008 20:40:40 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200811082040.mA8KeewQ021788@svn.freebsd.org> From: Ed Schouten Date: Sat, 8 Nov 2008 20:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184771 - in head/sys: dev/syscons kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 20:40:40 -0000 Author: ed Date: Sat Nov 8 20:40:39 2008 New Revision: 184771 URL: http://svn.freebsd.org/changeset/base/184771 Log: Reduce the default baud rate of PTY's to 9600. On RELENG_6 (and probably RELENG_7) we see our syscons windows and pseudo-terminals have the following buffer sizes: | LINE RAW CAN OUT IHIWT ILOWT OHWT LWT COL STATE SESS PGID DISC | ttyv0 0 0 0 7680 6720 2052 256 7 OCcl 1146 1146 term | ttyp0 0 0 0 7680 6720 1296 256 0 OCc 82033 82033 term These buffer sizes make no sense, because we often have much more output than input, but I guess having higher input buffer sizes improves guarantees of the system. On MPSAFE TTY I just sent both the input and output buffer sizes to 7 KB, which is pretty big on a standard FreeBSD install with 8 syscons windows and some PTY's. Reduce the baud rate to 9600 baud, which means we now have the following buffer sizes: | LINE INQ CAN LIN LOW OUTQ USE LOW COL SESS PGID STATE | ttyv0 1920 0 0 192 1984 0 199 7 2401 2401 Oil | pts/0 1920 0 0 192 1984 0 199 5631 1305 2526 Oi This is a lot smaller, but for pseudo-devices this should be good enough. You need to do a lot of punching to fill up a 7.5 KB input buffer. If it turns out things don't work out this way, we'll just switch to 19200 baud. Modified: head/sys/dev/syscons/sysmouse.c head/sys/kern/tty.c head/sys/sys/ttydefaults.h Modified: head/sys/dev/syscons/sysmouse.c ============================================================================== --- head/sys/dev/syscons/sysmouse.c Sat Nov 8 19:56:32 2008 (r184770) +++ head/sys/dev/syscons/sysmouse.c Sat Nov 8 20:40:39 2008 (r184771) @@ -148,7 +148,7 @@ smdev_param(struct tty *tp, struct termi * Set the output baud rate to zero. The mouse device supports * no output, so we don't want to waste buffers. */ - t->c_ispeed = TTYDEF_SPEED_PSEUDO; + t->c_ispeed = TTYDEF_SPEED; t->c_ospeed = B0; return (0); Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sat Nov 8 19:56:32 2008 (r184770) +++ head/sys/kern/tty.c Sat Nov 8 20:40:39 2008 (r184771) @@ -802,7 +802,7 @@ ttydevsw_defparam(struct tty *tp, struct { /* Use a fake baud rate, we're not a real device. */ - t->c_ispeed = t->c_ospeed = TTYDEF_SPEED_PSEUDO; + t->c_ispeed = t->c_ospeed = TTYDEF_SPEED; return (0); } Modified: head/sys/sys/ttydefaults.h ============================================================================== --- head/sys/sys/ttydefaults.h Sat Nov 8 19:56:32 2008 (r184770) +++ head/sys/sys/ttydefaults.h Sat Nov 8 20:40:39 2008 (r184771) @@ -52,7 +52,6 @@ #define TTYDEF_LFLAG TTYDEF_LFLAG_ECHO #define TTYDEF_CFLAG (CREAD | CS8 | HUPCL) #define TTYDEF_SPEED (B9600) -#define TTYDEF_SPEED_PSEUDO (B38400) /* * Control Character Defaults