From owner-freebsd-hackers@FreeBSD.ORG Sun Feb 21 05:22:38 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 D88411065670 for ; Sun, 21 Feb 2010 05:22:38 +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 8D3E38FC12 for ; Sun, 21 Feb 2010 05:22:38 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.3/8.14.3) id o1L5Mjgr011034; Sun, 21 Feb 2010 05:22:46 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 y7gxiu66hsxbqdukma9kzd6evs; Sun, 21 Feb 2010 05:22:45 +0000 (UTC) (envelope-from kientzle@freebsd.org) Message-ID: <4B80C359.6070707@freebsd.org> Date: Sat, 20 Feb 2010 21:23:37 -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: Duane.Hesser@gmail.com References: <20100217215940.GA19713@triton8.kn-bremen.de> <20100219181247.GA35702@triton8.kn-bremen.de> <4B7F711E.6040402@freebsd.org> <201002200100.48161.jkim@FreeBSD.org> <201002210046.o1L0kmDt026041@belinda.androcles.org> In-Reply-To: <201002210046.o1L0kmDt026041@belinda.androcles.org> 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: Sun, 21 Feb 2010 05:22:38 -0000 Duane H. Hesser wrote: > > I have a couple of suggestions which may help you with what you are > trying to do. > > First, though, I can confirm that Unix character special tape > drivers since at least V7 have always ignored seeks. They happily > return the requested offset without feeling the need to actually > *do* anything. The FreeBSD scsi_sa driver continues this tradition. Duane, Thank you very, very much for taking the time to write up this information. I'm going to definitely archive your message for future reference. To clarify "what we are trying to do": For some time now, libarchive format handlers have issued "skip" requests internally for things like skipping unnecessary file bodies. Depending on the device you're talking to, these internal skip requests can be translated into seek operations or can be handled by reading and discarding data. As Juergen found when he tried to do "tar tf /dev/cd0", my earlier code was pretty conservative: It only translated skip requests into lseek() operations for regular files. Juergen took a stab at improving that so that operations on raw disk devices would use lseek(). With your information, it should be pretty easy to translate skip requests into mtio operations on tape drives. Libarchive's core already supports rounding skip operations to multiples of the block size, so this should be an easy addition. As it happens, I'm just starting this week to look into multi-volume support for libarchive. I'm hoping to get that into good shape this year. Your notes on size estimation will be quite helpful once I get further into that. Thanks again, and I may be in touch over the next few months with more questions.... ;-) Tim