From 822225d321b1a0b7fce0c72ff5caf10b616bb78e Mon Sep 17 00:00:00 2001 From: mckusick Date: Sun, 14 Jul 2013 18:44:33 +0000 Subject: Update to comments describing block allocation policy. Submitted by: Bruce Evans --- sys/ufs/ffs/ffs_alloc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'sys/ufs') diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 287ccbb..cf1d953 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -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) -- cgit v1.1