lkml.org 
[lkml]   [1999]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjecthow to write get_block?
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



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.077 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site