From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 23 22:00:11 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 416631065670; Tue, 23 Feb 2010 22:00:11 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id D335A8FC16; Tue, 23 Feb 2010 22:00:03 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id D00821E0012B; Tue, 23 Feb 2010 23:00:02 +0100 (CET) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id o1NLrd4P067826; Tue, 23 Feb 2010 22:53:39 +0100 (CET) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id o1NLrdp2067825; Tue, 23 Feb 2010 22:53:39 +0100 (CET) (envelope-from nox) From: Juergen Lock Date: Tue, 23 Feb 2010 22:53:38 +0100 To: Tim Kientzle Message-ID: <20100223215338.GA67810@triton8.kn-bremen.de> References: <20100217215940.GA19713@triton8.kn-bremen.de> <20100219181247.GA35702@triton8.kn-bremen.de> <4B7F711E.6040402@freebsd.org> <201002200100.48161.jkim@FreeBSD.org> <20100220103329.GA35467@triton8.kn-bremen.de> <4B81DB31.70201@freebsd.org> <20100222230311.GA19535@triton8.kn-bremen.de> <4B835DFD.5060507@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B835DFD.5060507@freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Mailman-Approved-At: Tue, 23 Feb 2010 22:36:46 +0000 Cc: freebsd-hackers@freebsd.org, Juergen Lock Subject: Re: "tar tfv /dev/cd0" speedup patch; Linux compatibility patches X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2010 22:00:11 -0000 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