From mboxrd@z Thu Jan 1 00:00:00 1970 From: Trond Myklebust Subject: Re: [PATCH] 2.4.20 Direct IO patch for NFS. (Note: a trivial API change...) Date: Mon, 30 Sep 2002 20:57:58 +0200 Sender: nfs-admin@lists.sourceforge.net Message-ID: <15768.40630.512787.879557@charged.uio.no> References: <15768.39196.468797.249573@charged.uio.no> <20020930195235.P18377@parcelfarce.linux.theplanet.co.uk> Reply-To: trond.myklebust@fys.uio.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Trond Myklebust , Marcelo Tosatti , Chuck Lever , Linux Kernel , Linux FSdevel , NFS maillist Return-path: Received: from mons.uio.no ([129.240.130.14]) by usw-sf-list1.sourceforge.net with esmtp (Exim 3.31-VA-mm2 #1 (Debian)) id 17w5kU-0006RZ-00 for ; Mon, 30 Sep 2002 11:58:30 -0700 To: Matthew Wilcox In-Reply-To: <20020930195235.P18377@parcelfarce.linux.theplanet.co.uk> Errors-To: nfs-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Id: Discussion of NFS under Linux development, interoperability, and testing. List-Unsubscribe: , List-Archive: >>>>> " " == Matthew Wilcox writes: >> -static int blkdev_direct_IO(int rw, struct inode * inode, >> struct kiobuf * iobuf, unsigned long blocknr, int blocksize) >> +static int blkdev_direct_IO(int rw, struct file * filp, struct >> kiobuf * iobuf, unsigned long blocknr, int blocksize) { >> + struct inode * inode = >> filp->f_dentry->d_inode->i_mapping->host; >> return generic_direct_IO(rw, inode, iobuf, blocknr, blocksize, >> blkdev_get_block); } >> > isn't that two dereferences more than necessary for a local > filesystem? IIRC this is an issue with block filesystems: the i_mapping->host may differ from d_inode. It is in any case just the exact same dereference that is being made in the current version of generic_file_direct_IO(). The API change simply moves this dereference down into the filesystem code. Cheers, Trond ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 30 Sep 2002 14:52:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 30 Sep 2002 14:52:47 -0400 Received: from mons.uio.no ([129.240.130.14]:53129 "EHLO mons.uio.no") by vger.kernel.org with ESMTP id ; Mon, 30 Sep 2002 14:52:45 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15768.40630.512787.879557@charged.uio.no> Date: Mon, 30 Sep 2002 20:57:58 +0200 To: Matthew Wilcox Cc: Trond Myklebust , Marcelo Tosatti , Chuck Lever , Linux Kernel , Linux FSdevel , NFS maillist Subject: Re: [PATCH] 2.4.20 Direct IO patch for NFS. (Note: a trivial API change...) In-Reply-To: <20020930195235.P18377@parcelfarce.linux.theplanet.co.uk> References: <15768.39196.468797.249573@charged.uio.no> <20020930195235.P18377@parcelfarce.linux.theplanet.co.uk> X-Mailer: VM 7.00 under 21.4 (patch 6) "Common Lisp" XEmacs Lucid Reply-To: trond.myklebust@fys.uio.no From: Trond Myklebust Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org >>>>> " " == Matthew Wilcox writes: >> -static int blkdev_direct_IO(int rw, struct inode * inode, >> struct kiobuf * iobuf, unsigned long blocknr, int blocksize) >> +static int blkdev_direct_IO(int rw, struct file * filp, struct >> kiobuf * iobuf, unsigned long blocknr, int blocksize) { >> + struct inode * inode = >> filp->f_dentry->d_inode->i_mapping->host; >> return generic_direct_IO(rw, inode, iobuf, blocknr, blocksize, >> blkdev_get_block); } >> > isn't that two dereferences more than necessary for a local > filesystem? IIRC this is an issue with block filesystems: the i_mapping->host may differ from d_inode. It is in any case just the exact same dereference that is being made in the current version of generic_file_direct_IO(). The API change simply moves this dereference down into the filesystem code. Cheers, Trond