2004-10-11 11:22:07

by Can Sar

[permalink] [raw]
Subject: Page/Buffer Cache: Traversing Dirty Buffers

Hi,

I know this is not really the right place for asking general questions,
but I have read the source and searched the web and LKML archives for 2
days without much avail.
I am writing a driver for a research project, and need to be able to
traverse all dirty buffers in the buffer cache, for this device. I have
read through buffer.c and several other files a dozen times, but have
not been able to pin down exactly how to get access to the buffer
cache. If someone could point any files that I should look at, to get a
pointer to all the dirty buffers associated with a device, I would be
very happy.

Thank you very much for your help,
Can Sar


2004-10-12 14:26:54

by Marcelo Tosatti

[permalink] [raw]
Subject: Re: Page/Buffer Cache: Traversing Dirty Buffers

On Mon, Oct 11, 2004 at 04:22:02AM -0700, Can Sar wrote:
> Hi,
>
> I know this is not really the right place for asking general questions,
> but I have read the source and searched the web and LKML archives for 2
> days without much avail.
> I am writing a driver for a research project, and need to be able to
> traverse all dirty buffers in the buffer cache, for this device. I have
> read through buffer.c and several other files a dozen times, but have
> not been able to pin down exactly how to get access to the buffer
> cache. If someone could point any files that I should look at, to get a
> pointer to all the dirty buffers associated with a device, I would be
> very happy.
>
> Thank you very much for your help,
> Can Sar

What kernel version are you using?

Look at fs/buffer.c sync_buffers() & related functions.