All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: Manish Katiyar <mkatiyar@gmail.com>
Cc: linux-newbie@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: Question about do_sync_read()
Date: Tue, 12 Feb 2008 10:44:30 +0200	[thread overview]
Message-ID: <47B15C6E.4030003@panasas.com> (raw)
In-Reply-To: <ea11fea30802090052o22a77f0bkb8867cc8f570572e@mail.gmail.com>

On Feb. 09, 2008, 10:52 +0200, "Manish Katiyar" <mkatiyar@gmail.com> wrote:
> Hi,
> 
> In the implementation of file systems for 2.6 kernels,
> generic_file_read is often replaced with do_sync_read(). In this
> function we call "filp->f_op->aio_read" unconditionally.
> where most of the times aio_read is intialized as
> generic_file_aio_read(). Wouldn't it be a good idea to change the
> following code
> 
> 241  for (;;) {
> 242   ret = filp->f_op->aio_read(&kiocb, &iov, 1, kiocb.ki_pos);
> 243   if (ret != -EIOCBRETRY)
> 244    break;
> 245   wait_on_retry_sync_kiocb(&kiocb);
> 
> to
> 
> 241  for (;;) {
> 242     if(filp->f_op->aio_read)
> 243         ret = filp->f_op->aio_read(&kiocb, &iov, 1, kiocb.ki_pos);
> 244     else
> 245              ret = generic_file_aio_read(&kiocb, &iov, 1, kiocb.ki_pos);
> 246   if (ret != -EIOCBRETRY)
> 247    break;
> 248   wait_on_retry_sync_kiocb(&kiocb);
> 
> Just to have a fall back mechanism as we do at many places in the VFS layer..
> 

FWIW, it's a bit more efficient to set aio_read to generic_file_aio_read and
call it unconditionally.

Benny


      reply	other threads:[~2008-02-12  8:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-09  8:52 Question about do_sync_read() Manish Katiyar
2008-02-12  8:44 ` Benny Halevy [this message]

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=47B15C6E.4030003@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-newbie@vger.kernel.org \
    --cc=mkatiyar@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.