Hi.

I'm porting my HPFS driver to 2.3.18 and I don't know how to write
get_block properly. When user does lseek(far beyond file end) and
write(), get_block must allocate a lot of sectors and clear them (HPFS
doesn't support holes). The question is: what call should I use to
clear these sectors?

Using bread/mark_buffer_dirty/brelse is bad idea - when the block is
read to page cache later, there are two buffers pointing to the same block
=> data corruption.

Calling page cache functions to create buffers? get_block is called from
page cache layer, thus calling anything from there makes possible deadlock
condition. 

Modifying page cache directly ... black magic.

What should I do with it? Is there any function that I didn't notice? Of
course I could write routines to directly touch page cache and attach
buffer there, but I think it's dirty. Especially when other filesystem
also need to do the same (fat currently crashes when writing beyond file
end, other filesystems aren't ported yet) 

Mikulas Patocka

Reply via email to