adheer chandravanshi wrote:
>Why is an estimate based on file (index, offset) pairs not
>accurate enough for you?
The (mapping,index) gives the location of page on RAM. but I want its
physical address.
No, it tells you whether two pages are logically adjacent to
each other in a file.
Assuming that filesystems do a decent job of preventing
fragmentation, that may be a good approximation of physical
proximity on disk.
Even if it's only 98% accurate, it may still be good enough
since it is only an extra hint in your page replacement scheme.
What about using bmap( ) pointed by address_space_operations
<http://lxr.linux.no/ident?i=address_space_operations> *a_ops in
address_space object?
It gives the Logical Block Number(LBN) of the block..but now how can be
derive physical address from this LBN?
Why do you want the physical block anyway?
If two blocks are adjacent to each other in logical space,
what's the chance they are not also adjacent in physical
space?
--
What is important? What you want to be true, or what is true?
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/