-   Linux - Kernel (
-   -   How delayed allocation is done in xfs, ext4fs ? (

PankajDS 02-03-2008 02:51 AM

How delayed allocation is done in xfs, ext4fs ?
Hi all,
How delayed allocation is done in xfs, ext4fs ?
Thank you...........

unSpawn 02-08-2008 07:36 AM

From the ext2 docs (which should apply to ext3 and 4 as well as far as I've read Cao's and Tso's work):

Basically delayed allocation defers allocation of blocks from prepare_write() and employs extent walking, together with the multiple block allocation feature (described in the next section), for clustering block allocations maximally into contiguous blocks. Instead of allocating the disk block in prepare_write(), the the page is marked as needing block reservation. The commit_write() function calculates the required number of blocks, and reserves them to make sure that there are enough free blocks in the filesystem to satisfy the write. When the pages get flushed to disk by writepage() or writepages(), these functions will walk all the dirty pages in the specified inode, cluster the logically contiguous ones, and submit the page or pages to the bio layer. After the block allocation is complete, the reservation is dropped. A single block I/O request (or BIO) is submitted for write out of pages processed whenever a new allocated extent (or the next mapped extent if already allocated) on the disk is not adjacent to the previous one, or when writepages() completes.
If you mean how it is done code-wise then read the code ;-p

All times are GMT -5. The time now is 06:49 PM.