From owner-svn-src-all@FreeBSD.ORG Wed Feb 13 15:09:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6FF4F3FF; Wed, 13 Feb 2013 15:09:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4BFCA8D0; Wed, 13 Feb 2013 15:09:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1DF9HAK011499; Wed, 13 Feb 2013 15:09:17 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1DF9GdM011497; Wed, 13 Feb 2013 15:09:16 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201302131509.r1DF9GdM011497@svn.freebsd.org> From: Ian Lepore Date: Wed, 13 Feb 2013 15:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246763 - in head: lib/libc/sys sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages 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, 13 Feb 2013 15:09:17 -0000 Author: ian Date: Wed Feb 13 15:09:16 2013 New Revision: 246763 URL: http://svnweb.freebsd.org/changeset/base/246763 Log: Make the F_READAHEAD option to fcntl(2) work as documented: a value of zero now disables read-ahead. It used to effectively restore the system default readahead hueristic if it had been changed; a negative value now restores the default. Reviewed by: kib Modified: head/lib/libc/sys/fcntl.2 head/sys/kern/kern_descrip.c Modified: head/lib/libc/sys/fcntl.2 ============================================================================== --- head/lib/libc/sys/fcntl.2 Wed Feb 13 14:57:54 2013 (r246762) +++ head/lib/libc/sys/fcntl.2 Wed Feb 13 15:09:16 2013 (r246763) @@ -28,7 +28,7 @@ .\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd July 27, 2012 +.Dd February 8, 2013 .Dt FCNTL 2 .Os .Sh NAME @@ -171,7 +171,7 @@ argument, which is rounded up to the nearest block size. A zero value in .Fa arg -turns off read ahead. +turns off read ahead, a negative value restores the system default. .It Dv F_RDAHEAD Equivalent to Darwin counterpart which sets read ahead amount of 128KB when the third argument, Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Feb 13 14:57:54 2013 (r246762) +++ head/sys/kern/kern_descrip.c Wed Feb 13 15:09:16 2013 (r246763) @@ -776,7 +776,7 @@ kern_fcntl(struct thread *td, int fd, in } fhold(fp); FILEDESC_SUNLOCK(fdp); - if (arg != 0) { + if (arg >= 0) { vp = fp->f_vnode; error = vn_lock(vp, LK_SHARED); if (error != 0) {