On Mon, 1 Nov 1999 [EMAIL PROTECTED] wrote:

> I agree with this, it feels closer to the linux page cache, the terminology in
> the XFS white paper is a little confusing here.
> 
> XFS on Irix caches file data in buffers, but not in the regular buffer cache,
> they are cached off the vnode and organized by logical file offset rather
> than by disk block number, the memory in these buffers comes from the page
> subsystem, the page tag being the vnode and file offset. These buffers do

Then it _is_ page cache.

> not have to have a physical disk block associated with them, XFS allows you
> to reserve blocks on the disk for a file without picking which blocks. At

It can be done with 2.3 pagecache. You will need a new function in
buffer.c, but that's about it. Just make sure that ->writepage() does
allocation for fragments that are not mapped to disk blocks and pass the
new (lazy) variant of block_write_partial_page to the generic_file_write.

> some point when the data needs to be written (memory pressure, or sync
> activity etc), the filesystem is asked to allocate physical blocks for the
> data, these are associated with the buffers and they get written out.

Yup.

> Delaying the allocation allows us to collect together multiple small writes
> into one big allocation request. It also means that we can bypass allocation
> altogether if the file is truncated before it is flushed to disk.

Hmm... It may make sense for other filesystems too - all allocators tend
to work better if they are asked to grab big lumps... Interesting.

But yes, the thing you are describing _is_ the page cache.

Reply via email to