From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Manish Katiyar" Subject: Question about do_sync_read() Date: Sat, 9 Feb 2008 14:22:58 +0530 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit To: linux-newbie@vger.kernel.org, linux-fsdevel@vger.kernel.org Return-path: Received: from wf-out-1314.google.com ([209.85.200.169]:30800 "EHLO wf-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751718AbYBIIw7 (ORCPT ); Sat, 9 Feb 2008 03:52:59 -0500 Received: by wf-out-1314.google.com with SMTP id 28so61885wff.4 for ; Sat, 09 Feb 2008 00:52:59 -0800 (PST) Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 ***********************************************