Re: [RFC] Heads up on sys_fallocate()
From: Eric Sandeen <hidden>
Date: 2007-03-05 21:41:00
Also in:
linux-fsdevel, lkml
Jan Kara wrote:
quoted
I am wondering if it is useful to add another mode to advise block allocation policy? Something like indicating which physical block/block group to allocate from (goal), and whether ask for strict contigous blocks. This will help preallocation or reservation to choose the right blocks for the file.Yes, I also think this would be useful so you can "guide" preallocation for things like defragmentation (e.g. preallocate space for the file being defragmented and move the file to it).
Hints & policies for allocation would certainly be useful, but I think they belong outside this interface. i.e. you could flag an inode for whatever allocation you choose, and -then- call posix_fallocate so that the allocator will take the hints you've given it. See also this blurb from the posix_fallocate definition: "It is implementation-defined whether a previous posix_fadvise() call influences allocation strategy." FWIW I don't see a lot of point in asking for "strict contiguous blocks" - the allocator will presumeably try to do this in any case, and I'm not sure when you would want to fail if you get more than one extent...? -Eric