2000-11-14 20:13:57

by Juan Piernas Canovas

[permalink] [raw]
Subject: Addressing logically the buffer cache

Hi!.

Is there any patch or project to address logically the buffer cache?.
Now, you use three parameters to find a buffer in cache: device, block
number, and block size. But, what about if I want to find a buffer using
a super block, an inode number, and a block number within the file
specified by the inode number.

This mechanism would be very useful for a log-structured file system,
for example.

Thanks in advance
--
D. Juan Piernas C?novas
Departamento de Ingenier?a y Tecnolog?a de Computadores
Facultad de Inform?tica. Universidad de Murcia
Campus de Espinardo - 30080 Murcia (SPAIN)
Tel.: +34968364633 Fax: +34968364151
email: [email protected]
PGP public key:
http://pgp.rediris.es:11371/pks/lookup?search=piernas%40ditec.um.es&op=index


2000-11-14 20:17:02

by Alexander Viro

[permalink] [raw]
Subject: Re: Addressing logically the buffer cache



On Tue, 14 Nov 2000, Juan wrote:

> Hi!.
>
> Is there any patch or project to address logically the buffer cache?.
> Now, you use three parameters to find a buffer in cache: device, block
> number, and block size. But, what about if I want to find a buffer using
> a super block, an inode number, and a block number within the file
> specified by the inode number.

What's wrong with using the pagecache and per-page buffer_heads?

2000-11-14 23:19:25

by Juan Piernas Canovas

[permalink] [raw]
Subject: Re: Addressing logically the buffer cache

Alexander Viro escribi?:
>
> On Tue, 14 Nov 2000, Juan wrote:
>
> > Hi!.
> >
> > Is there any patch or project to address logically the buffer cache?.
> > Now, you use three parameters to find a buffer in cache: device, block
> > number, and block size. But, what about if I want to find a buffer using
> > a super block, an inode number, and a block number within the file
> > specified by the inode number.
>
> What's wrong with using the pagecache and per-page buffer_heads?

Suppose you are implementing a log-structured file system and a process
adds a new logical block to a file. Besides, suppose that the segment is
512 KBytes in size. Usually, you don't want to write the segment before
it is full. The logical block hasn't got a physical address because you
don't build the segment until it is written to disk. So, what happens if
another process wants to access to the new block?.

You can't assign a physical address to the new block because the address
can change when the buffer is written to disk.

Perhaps, I'm wrong, but I think that the implementation of the BSD-LFS
needs to address logically the buffer cache.

Bye!

P.D.: sorry for my bad English ;-)
--
D. Juan Piernas C?novas
Departamento de Ingenier?a y Tecnolog?a de Computadores
Facultad de Inform?tica. Universidad de Murcia
Campus de Espinardo - 30080 Murcia (SPAIN)
Tel.: +34968364633 Fax: +34968364151
email: [email protected]
PGP public key:
http://pgp.rediris.es:11371/pks/lookup?search=piernas%40ditec.um.es&op=index

2000-11-16 17:00:32

by Eric W. Biederman

[permalink] [raw]
Subject: Re: Addressing logically the buffer cache

Juan <[email protected]> writes:

> Alexander Viro escribi?:
> >
> > On Tue, 14 Nov 2000, Juan wrote:
> >
> > > Hi!.
> > >
> > > Is there any patch or project to address logically the buffer cache?.
> > > Now, you use three parameters to find a buffer in cache: device, block
> > > number, and block size. But, what about if I want to find a buffer using
> > > a super block, an inode number, and a block number within the file
> > > specified by the inode number.
> >
> > What's wrong with using the pagecache and per-page buffer_heads?
>
> Suppose you are implementing a log-structured file system and a process
> adds a new logical block to a file. Besides, suppose that the segment is
> 512 KBytes in size. Usually, you don't want to write the segment before
> it is full. The logical block hasn't got a physical address because you
> don't build the segment until it is written to disk. So, what happens if
> another process wants to access to the new block?.
>
> You can't assign a physical address to the new block because the address
> can change when the buffer is written to disk.

So you don't assign a buffer head until you make the final decision.
There are some interesting issues with how you track that your data
is dirty but otherwise all is well.
>
> Perhaps, I'm wrong, but I think that the implementation of the BSD-LFS
> needs to address logically the buffer cache.

The linux vfs is quite different from the berkley one. The linux page
cache is much closer to the berkley block cache, then the depricated
linux block cache.

Eric