"tar tfv /dev/cd0" speedup patch; Linux compatibility patches
Juergen Lock
nox at jelal.kn-bremen.de
Tue Feb 23 22:00:11 UTC 2010
On Mon, Feb 22, 2010 at 08:47:57PM -0800, Tim Kientzle wrote:
> Juergen Lock wrote:
> > On Sun, Feb 21, 2010 at 05:17:37PM -0800, Tim Kientzle wrote:
> >>
> >> Could you try the current version of read_open_filename from:
> >>
> >> http://libarchive.googlecode.com/svn/trunk/libarchive/archive_read_open_filename.c
> >
> > Small but important bug:
> >
> > Index: archive_read_open_filename.c
> > @@ -94,7 +94,7 @@ archive_read_open_filename(struct archiv
> > struct read_file_data *mine;
> > void *buffer;
> > int fd;
> > - int is_disk_like;
> > + int is_disk_like = 0;
>
> Ah. Good catch!
>
> > Btw... the lseek + read combinations could also be replaced with
> > pread(2), for the least amount of syscalls. :)
>
> Unfortunately, pread() isn't as portable. It's
> an interesting idea, though; maybe I'll play with that.
>
Yeah this probably needs to be conditional on HAVE_PREAD etc.
> > (Especially since I
> > noticed this version at least when ran on an optical disc with iso9660
> > ends up doing lots of lseek()s towards the end without ever reading
> > anything from the disc anymore...)
>
> Fortunately, because there are no reads, those lseek()
> requests are pretty cheap. But you're right, it
> wouldn't be hard to eliminate the unnecessary system
> calls.
>
> > Patches are here: (made on stable/8, if they don't apply on head
> > I'll have to make extra versions for that...)
> > http://people.freebsd.org/~nox/linuxdisk-blk.patch [1]
> > http://people.freebsd.org/~nox/lseek-seek_end.patch [2]
>
> I'll let someone more familiar with the linuxolator code
> comment on those.
I now made that an extra thread also on -emulation.
Cheers,
Juergen
More information about the freebsd-hackers
mailing list