Skip to contentSkip to conversation

File and device pages and buffers

DISCUSSION Martin Jambor 1 participant 2 messages Apr 18, 2005 – Apr 21, 2005 VFS

lore
Share & tools
lore
#0 lore raw

There is one thing about cache pages and buffers that puzzles me and that I have not found in any documenatation and that is not quite obvious from the source.

What is the relationship between:
a) pages and their buffers associated with the device (tybically bh->bdev->bd_inode and its mapping) and

b) pages and their buffers associated with files on that device.

I am almost certain they are not the same but at the same time the relationship seems to be quite important, otherwise we wouldn't have such dark functions as unmap_underlying_metadata (why on earth is it called this way? - Does metadata mean, in true kernel naming confusion spirit, device pages/blocks?).

Can anyone tell me what the relationship exactly is and what one has to be aware of when manipulating either of these?

Thank you very much in advance,

Martin Jambor

#1 lore raw

Can I try to bring your attention once more to the following issue:

Quoted 4 lines · Martin Jambor

There is one thing about cache pages and buffers that puzzles me and that I have not found in any documenatation and that is not quite obvious from the source.

Quoted 8 lines

What is the relationship between:
a) pages and their buffers associated with the device (typically bh->bdev->bd_inode and its mapping) and

b) pages and their buffers associated with files on that device.

Can anyone tell me what the relationship exactly is and what one has to be aware of when manipulating either of these?

My conclusion from reading the source is that after mapping a file buffer (buffer belonging to a page that is a part of a file on a device) to a particular block on a device, one should call unmap_underlying_metadata to make sure any writing using a device buffer will not overwrite the file. And that one must not use device buffers to write to places which have been mapped to files.

Is that correct?

TIA

Martin