From owner-svn-src-all@FreeBSD.ORG Sun Jul 14 18:44:33 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 C8C61ED8; Sun, 14 Jul 2013 18:44:33 +0000 (UTC) (envelope-from mckusick@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 BA549D86; Sun, 14 Jul 2013 18:44:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6EIiX0f062655; Sun, 14 Jul 2013 18:44:33 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6EIiXEi062654; Sun, 14 Jul 2013 18:44:33 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201307141844.r6EIiXEi062654@svn.freebsd.org> From: Kirk McKusick Date: Sun, 14 Jul 2013 18:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253341 - head/sys/ufs/ffs 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: Sun, 14 Jul 2013 18:44:33 -0000 Author: mckusick Date: Sun Jul 14 18:44:33 2013 New Revision: 253341 URL: http://svnweb.freebsd.org/changeset/base/253341 Log: Update to comments describing block allocation policy. Submitted by: Bruce Evans Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun Jul 14 18:26:47 2013 (r253340) +++ head/sys/ufs/ffs/ffs_alloc.c Sun Jul 14 18:44:33 2013 (r253341) @@ -1196,7 +1196,8 @@ ffs_dirpref(pip) /* * Select the desired position for the next block in a file. The file is * logically divided into sections. The first section is composed of the - * direct blocks. Each additional section contains fs_maxbpg blocks. + * direct blocks and the next fs_maxbpg blocks. Each additional section + * contains fs_maxbpg blocks. * * If no blocks have been allocated in the first section, the policy is to * request a block in the same cylinder group as the inode that describes @@ -1214,14 +1215,12 @@ ffs_dirpref(pip) * cylinder group from which the previous allocation was made. The sweep * continues until a cylinder group with greater than the average number * of free blocks is found. If the allocation is for the first block in an - * indirect block, the information on the previous allocation is unavailable; - * here a best guess is made based upon the logical block number being - * allocated. + * indirect block or the previous block is a hole, then the information on + * the previous allocation is unavailable; here a best guess is made based + * on the logical block number being allocated. * * If a section is already partially allocated, the policy is to - * contiguously allocate fs_maxcontig blocks. The end of one of these - * contiguous blocks and the beginning of the next is laid out - * contiguously if possible. + * allocate blocks contiguously within the section if possible. */ ufs2_daddr_t ffs_blkpref_ufs1(ip, lbn, indx, bap)