From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anton Altaparmakov Subject: Re: RFC: [PATCH-2.6] Add helper function to lock multiple page cache pages. Date: Sun, 6 Feb 2005 19:42:17 +0000 (GMT) Message-ID: References: <20050202143422.41c29202.akpm@osdl.org> <1107427057.9010.18.camel@imp.csi.cam.ac.uk> <20050203024755.1792b6c0.akpm@osdl.org> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: nathans@sgi.com, viro@parcelfarce.linux.theplanet.co.uk, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Received: from ppsw-5.csi.cam.ac.uk ([131.111.8.135]:52365 "EHLO ppsw-5.csi.cam.ac.uk") by vger.kernel.org with ESMTP id S261291AbVBFTmX (ORCPT ); Sun, 6 Feb 2005 14:42:23 -0500 To: Andrew Morton In-Reply-To: <20050203024755.1792b6c0.akpm@osdl.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, 3 Feb 2005, Andrew Morton wrote: > I did a patch which switched loop to use the file_operations.read/write > about a year ago. Forget what happened to it. It always seemed the right > thing to do.. How did you implement the write? At the moment the loop driver gets hold of both source and destination pages (the latter via grab_cache_page() and aops->prepare_write()) and copies/transforms directly from the source to the destination page (and then calls commit_write() on the destination page). Did you allocate a buffer for each request, copy/transform to the buffer and then submit the buffer via file_operations->write? That would clearly be not very efficient but given fops->write() is not atomic I don't see how that could be optimised further... Perhaps the loop driver should work as is when aops->{prepare,commit}_write() are not NULL and should fall back to a buffered fops->write() otherwise? Or have I missed some way in which the fops->write() case can be optimized? Best regards, Anton -- Anton Altaparmakov (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/