Here is another update to loop.c, as a patch against
pristine linux-2.5.31.
This patch adds support for loop devices backed by
files on file systems that do not provide
address_space_operations->{prepare,commit}_write, by using
file_operations->{read,write} instead. The change is based on patches
by Jari Ruusu and Andrew Morton. It includes an optimization,
pointed out by Andrew Morton, that avoids an extra data copy
in the common case of using a loop device that has no data
tranformation and is backed by a tmpfs file.
I've also dropped the "bio remapping" optimization that I
actually got working in my previous patch, because it only optimized
the case of a loop device backed by a block device with no data
transformation, in which case there isn't much need for the loop
device.
There is some code in this version to preallocate a page
for dealing with memory allocation failures in the IO path, but
I have not put in the IO path changes to make use of it yet.
The primary difference between this approach and Jari's is
that I want to reserve just one page (or queue->hardsect_size
bytes if that is more than a page) and be able to handle bio's
bigger than that (by splitting them up in the event of memory
allocation failure).
-- Adam J. Richter __ ______________ 575 Oroville Road adam@yggdrasil.com \ / Milpitas, California 95035 +1 408 309-6081 | g g d r a s i l United States of America "Free Software For The Rest Of Us."
This archive was generated by hypermail 2b29 : Thu Aug 15 2002 - 22:00:39 EST