Re: RFC: [PATCH-2.6] Add helper function to lock multiple page cachepages.

From: Anton Altaparmakov
Date: Sun Feb 06 2005 - 14:44:44 EST


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 <aia21 at cam.ac.uk> (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/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/