Re: [Yaffs] read and write operation

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs, S. K.
Subject: Re: [Yaffs] read and write operation
On Wednesday 25 July 2012 18:34:21 S. K. wrote:
> Good Day!
>
>
> I am looking for the serial operations that happen when read and write
> operation use in a ubuntu system that use yaffs2 as the filesystem.
>
> As I understood, for these operations: os tells to the vfs and the vfs
> tells to the yaffs to do read or write, then yaffs_file_operations in the
> yaffs_vfs_multi looks at its structure and call do_sync_read or
> do_sync_write. these files exist in the kernel and do the read and write
> operation.
>
> Is there any thing I missing?
>
> Is this sequence explained correctly? If not, would you explain the correct
> one?
>


Have a look at http://lxr.linux.no/ This provides a cross reference to Linux
code.

Basically, the read issued by the application does a system call which then
ends up at vfs_read().

Look up vfs_read in the LXR and you will see it calls file->f_op->read() if
that exists otherwise it calls do_sync_read(). Yaffs uses do_sync_read().

That calls aio_read() which, for yaffs is generic_file_aio_read.

generic_file_aio_read() sets up a page in the page cache and calls readpage
which is the yaffs_readpage() function in vfs_vfs_multi.c

The configuration of which of the plug-in functions gets called is defined in
the yaffs_file_operations table in yaffs_vfs_multi.c