linux kernel - When is storage allocated for a newly created ext2 inode? -



linux kernel - When is storage allocated for a newly created ext2 inode? -

i'm reading in understanding linux kernel, 3rd edition on how create new regular file on ext2fs. (book available online @ multiple places: not sure legalities. later version of relevant chapter @ o'reilly's site - not have relevant data)

see it, linux kernel has create new inode, , allocate necessary blocks it.

book outlines next procedures:

creating inodes (p. 758) allocating info block (p. 764)

what don't understand when kernel allocate new inode's info blocks.

near end (para. 14) of creating inodes procedure, see following:

invokes ext2_preread_inode() read disk block containing inode , set block in page cache. type of read-ahead done because created inode written soon.

so, prior - seems me logical place allocate inode's blocks. however, may ext2 architects decided allocation @ different time.

does know when storage allocated newly created ext2 inode?

iirc, on modern compilers reply "when flushing fiile disk cache". may appear quite late, remember ext2 tries avoid fragmentation. if can delay allocation of blocks until whole file in disk cache, know how big , can allocate 1 contiguous block.

linux-kernel filesystems inode ext3 ext2

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -