summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2013-07-14 18:44:33 +0000
committermckusick <mckusick@FreeBSD.org>2013-07-14 18:44:33 +0000
commit822225d321b1a0b7fce0c72ff5caf10b616bb78e (patch)
tree655529b1e7940eaab1bffe76a7a10f09f02e2acd /sys/ufs
parent80bd92a170a5645f7796369a96b56e91fd0edc83 (diff)
downloadFreeBSD-src-822225d321b1a0b7fce0c72ff5caf10b616bb78e.zip
FreeBSD-src-822225d321b1a0b7fce0c72ff5caf10b616bb78e.tar.gz
Update to comments describing block allocation policy.
Submitted by: Bruce Evans
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c13
1 files changed, 6 insertions, 7 deletions
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)
OpenPOWER on IntegriCloud