public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
* Question about do_sync_read()
@ 2008-02-09  8:52 Manish Katiyar
  2008-02-12  8:44 ` Benny Halevy
  0 siblings, 1 reply; 2+ messages in thread
From: Manish Katiyar @ 2008-02-09  8:52 UTC (permalink / raw)
  To: linux-newbie, linux-fsdevel

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..

-- 
Thanks & Regards,
********************************************
Manish Katiyar  ( http://mkatiyar.googlepages.com )
3rd Floor, Fair Winds Block
EGL Software Park
Off Intermediate Ring Road
Bangalore 560071, India
***********************************************

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-12  8:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-09  8:52 Question about do_sync_read() Manish Katiyar
2008-02-12  8:44 ` Benny Halevy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox