Re: About generic_file_read()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/6/06, prasad Musale <prasad.musale@xxxxxxxxx> wrote:
> Hello ,
>  Generic_file_read() reads from cached pages. That means the file pages r
> already in page cache. But if I want to read file from disk, How these pages
> comes in page cache. Ext2 & vfat call this generic_file_read() as their read
> operation. I analyzed the sys_read() code but didn't get how file is read
> from disk. Can anyone tell me about that?

generic_file_read not only reads from the cache but can also do read
from the physical medium (in the case of read-ahead, and cache miss)
and for this it actually calls filp->mappings->a_ops->readpage or
readpages .... which are the function pointers and file systems
assigned it with their functions and normal file-systems like ext2
again from this function calls mpage_readpage function of kernel
(AFAIR) found in mpage.c !

You can see the code of generic_file_read till calling the
a_ops->readpage function  and then consult file-system and the
function called from it like mpage_readpage code.

--
Fawad Lateef

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux