From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 18 06:37:34 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 1B7CD1065670 for ; Thu, 18 Feb 2010 06:37:34 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id D05EC8FC12 for ; Thu, 18 Feb 2010 06:37:33 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.3/8.14.3) id o1I6bcw1070970; Thu, 18 Feb 2010 06:37:38 GMT (envelope-from kientzle@freebsd.org) Received: from dark.x.kientzle.com (fw2.kientzle.com [10.123.1.2]) by kientzle.com with SMTP id ia59izfsjt8rfbxyf46m363fha; Thu, 18 Feb 2010 06:37:38 +0000 (UTC) (envelope-from kientzle@freebsd.org) Message-ID: <4B7CE066.4030403@freebsd.org> Date: Wed, 17 Feb 2010 22:38:30 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.21) Gecko/20090601 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Juergen Lock References: <20100217215940.GA19713@triton8.kn-bremen.de> In-Reply-To: <20100217215940.GA19713@triton8.kn-bremen.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: "tar tfv /dev/cd0" speedup patch 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: Thu, 18 Feb 2010 06:37:34 -0000 Juergen Lock wrote: > > ... since bsdtar/libarchive know iso9660 I just did the command in the > Subject. It worked, but it was sloow... :( Apparently it read all of > the disc without seeking. The following patch fixes this, is something > like this desired? If yes I could look how to do the same for Linux, Juergen, This is great! If you can figure out how to get this right, I would really appreciate it. If you have a tape drive handy, definitely test with that. My first attempts here actually broke reading from tape drives, which is why the current code is so conservative. Minor style comments: > else if (S_ISCHR(st.st_mode) && > !ioctl(fd, DIOCGMEDIASIZE, &mediasize) && mediasize) { Please be explicit: S_ISCHR() && ioctl() == 0 && mediasize > 0 > archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino); extract_skip_file isn't needed here; we don't read the contents of device nodes. Let me know as soon as you have something you're confident of. Cheers, Tim