kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: horserivers@gmail.com (horseriver)
To: kernelnewbies@lists.kernelnewbies.org
Subject: internel implemention of file operation
Date: Fri, 11 Jan 2013 06:01:34 +0800	[thread overview]
Message-ID: <20130110220134.GB4817@debian.localdomain> (raw)
In-Reply-To: <CAAYFAvoQi8kcfnOueabs02P4=SmrBOFEN2Wrs7tUhRjX=Oe3YA@mail.gmail.com>

On Fri, Jan 11, 2013 at 12:39:26PM +0530, Rajat Sharma wrote:

> Default read/write inerfaces are better suited for sequential read/write
> within your program. Although you can seek to any location within the file,
> you still have overhead to issue system calls to get data. However mmap
> allows you to map a section of file into program address space. 

  Default read/write inerfaces does not move file's data to process address space ?

  when  r/w a file descript which returnd by open() , how do the file data move from one place to another place ?

  For each time the write function being  called  , will kernel  call filesystem's driver's write  to respond  ??
  In my opinion,kernel will passed a  buffer's head address  which is passed form user-layer into driver,then driver will fill this buffer with file's
  data which is got by filesystem's read operation ?

  Am I right?   
  
  Thanks! 
> 
> 
> -Rajat
> 
> 
> On Fri, Jan 11, 2013 at 2:44 AM, horseriver <horserivers@gmail.com> wrote:
> 
> > hi:
> >
> >   these two wayes of operating one file :
> >
> >   1.use open/write interface call .
> >
> >   2.mmap this file into memory , then access this memory area and do r/w .
> >
> >   what is the essential difference between this teo wayes?
> >
> > thanks!
> >

  reply	other threads:[~2013-01-10 22:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-03  6:59 internel implemention of file operation horseriver
2013-01-03  7:18 ` Rajat Sharma
2013-01-03  7:31   ` horseriver
2013-01-03  7:46     ` Rajat Sharma
2013-01-03 10:09       ` horseriver
2013-01-03 10:31         ` Rajat Sharma
2013-01-10 21:14   ` horseriver
2013-01-11  7:09     ` Rajat Sharma
2013-01-10 22:01       ` horseriver [this message]
2013-01-11  9:06         ` Rajat Sharma
  -- strict thread matches above, loose matches on Subject: below --
2013-02-01 18:09 dspjmt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130110220134.GB4817@debian.localdomain \
    --to=horserivers@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).