bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tar modification for small buffers and aligned reads/writes


From: Göran Uddeborg
Subject: Tar modification for small buffers and aligned reads/writes
Date: Tue, 6 May 2003 11:18:00 +0200

As I wrote a week ago or so, I'm trying to make tar do read and write
calls with aligned buffers.  (To be able to use /dev/raw on Linux in
conjunction with DVD+RW kernel patches from
http://fy.chalmers.se/~appro/linux/DVD+RW/)

While looking on how this could be done, I realised tar fails to do
multi-volume archives with blocking factors of 1 or 2.  Try

   tar --create --blocking-factor=1 --label=Testing --multi-volume \
       --listed-incremental=XXX --tape-length=512 --file=/dev/null \
       /boot/vmlinuz

for an example.  (Assuming XXX does not exist, and /boot/vmlinuz
exists and is larger than 512 kB.)  While probably not a very common
case, it still is a bug.

I submit for consideration some patches.  They both allow small
blocking factors, and make all reads and writed be aligned.  The cost
is some extra data movement, but since this movement only happens once
per volume, I don't consider that a problem.  I believe my patches
work in all cases, but there are so many modes in which tar can be
used, so a code review would certainly not hurt.

The patches are not in a completely polished state.  The configuration
should probably look for the presence of memmove in an
AC_REPLACE_FUNCS, with a corresponding implementation enclosed in lib.
I'm also not completely happy about having the rmtread call and
corresponding error checks repeated three times in flush_read.  But I
thought I'd hear your opinion about this before I spent too much time
on the final finish.  My level of ambition will be different if I do
it only for myself, or for everybody.

Attachment: tar.memalign.patch
Description: Tar patches for aligned read/write and small buffers.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]