[Yaffs] Fw: read and write operation

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: S. K.
Date:  
To: yaffs@lists.aleph1.co.uk
Subject: [Yaffs] Fw: read and write operation


Thanks again for reply.




About the process of writing, I follow the similar way:

vfs_write calls do_sync_read
do_sync_write calls aio_write
it is generic_file_aio_write in YAFFS
it calls __generic_file_aio_write

??????????===============>> What does happen in this level? I have searched for somewhere calls writepage but, I could not find it!

finally call yaffs_writepage



Could you help me with that please?(I do not know kernel codes very good.)

-------------------------------------------------------------------------------------------



 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_





________________________________
From: Charles Manning <>
To: S. K. <>
Sent: Friday, July 27, 2012 2:56 AM
Subject: Re: [Yaffs] read and write operation

On Thursday 26 July 2012 17:16:51 S. K. wrote:
> Hello Charles!
>
> Thanks a lot. Your explanation was really helpful.
>
>
>
> Is there a same operation for writing too?


It is similar, but not the same.

>
>
> and another question: the functions yaffs_file_rd() and yaffs_do_file_wr()
> in the yaffs_guts.c have no role in reading or writing a file!?


Yes they do. The read and write paths in yaffs_vfs_multi/single call them.

> What do
> they work exactly?


I would think it pretty obvious from reading the functions: they read and
write data from/to the files.


>
>
>
> With many thanks.
>
>
>
>
> ________________________________
>  From: Charles Manning <>
>

To: ; S. K. <>
> Sent: Thursday, July 26, 2012 1:10 AM
> 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