diff options
| author | Anton Altaparmakov <aia21@cam.ac.uk> | 2005-03-07 17:54:10 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-03-07 17:54:10 -0800 |
| commit | f3f28e49a723a2ded9dedf61398c7f5f3bb8235c (patch) | |
| tree | ce7b3e731585c8aaf369589a38126ba93a3f4836 /lib | |
| parent | 20b0bb36b2cf703fecc5a8bbbcdc126642cd44c7 (diff) | |
[PATCH] a_ops-based loop I/O
Implements fallback to file_operations->write in the case that
aops->{prepare,commit}_write are not present on the backing filesystem.
The fallback happens in two different ways:
- For normal loop devices, i.e. ones which do not do transformation on
the data but simply pass it along, we simply call fops->write. This
should be pretty much just as fast as using aops->{prepare,commit}_write
directly.
- For all other loop devices (e.g. xor and cryptoloop), i.e. all the
ones which may be doing transformations on the data, we allocate and map
a page (once for each bio), then for each bio vec we copy the bio vec
page data to our mapped page, apply the loop transformation, and use
fops->write to write out the transformed data from our page. Once all
bio vecs from the bio are done, we unmap and free the page.
This approach is the absolute minimum of overhead I could come up with and
for performance hungry people, as you can see I left the address space
operations method in place for filesystems which implement
aops->{prepare,commit}_write.
I have tested this patch with normal loop devices using
aops->{prepare,commit}_write on the backing filesystem, with normal loop
devices using the fops->write code path and with cryptoloop devices using
the double buffering + fops->write code path.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions
