Re: internel implemention of file operation

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

 



> in this vm_operations_struct , there are open/close functions ,  are there necessary  relations between file operations and this struct ?
well not really for open/close of vm_ops are of interest to filesystems, but page fault handler and making page writable is where filesystem come into picture. Have a look at ext4_file_vm_ops, it implements operations of interest.

static const struct vm_operations_struct ext4_file_vm_ops = {
        .fault          = filemap_fault,
        .page_mkwrite   = ext4_page_mkwrite,
}

Note that only filesystem knows how to fill up this page.


On Thu, Jan 3, 2013 at 3:39 PM, horseriver <horserivers@xxxxxxxxx> wrote:
On Thu, Jan 03, 2013 at 01:16:06PM +0530, Rajat Sharma wrote:

> > will it be maped with vm_area struct ?
> Yes if it is accessed via mmap system call.

you know that , in the struct vm_area_struct,there is a struct vm_operations_struct * vm_ops;

in this vm_operations_struct , there are open/close functions ,  are there necessary  relations between file

operations and this struct ?

thanks!

>
> > what is the relation between page-cache and file operation?
> file operations for data access like read/write will look into page-cache
> first before going to disk.
>
> -Rajat
>

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[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