From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 1 19:05:16 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E1D6C16A591 for ; Tue, 1 Aug 2006 19:05:16 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.FreeBSD.org (Postfix) with ESMTP id B228A43D78 for ; Tue, 1 Aug 2006 19:05:05 +0000 (GMT) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-19-236.belrs4.nsw.optusnet.com.au [220.239.19.236]) by mail03.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id k71J4sVr029387 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 2 Aug 2006 05:04:55 +1000 Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.6/8.13.6) with ESMTP id k71J4rbQ003217; Wed, 2 Aug 2006 05:04:53 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.6/8.13.6/Submit) id k71J4r05003216; Wed, 2 Aug 2006 05:04:53 +1000 (EST) (envelope-from peter) Date: Wed, 2 Aug 2006 05:04:53 +1000 From: Peter Jeremy To: Eric Anderson Message-ID: <20060801190453.GD717@turion.vk2pj.dyndns.org> References: <44CE199C.2020500@centtech.com> <17614.8289.134373.387558@bhuda.mired.org> <96b30c400607310847s1d2f845eo212b234d03f51e9a@mail.gmail.com> <17614.10982.499561.139268@bhuda.mired.org> <20060801072611.GA717@turion.vk2pj.dyndns.org> <20060801171150.GB3413@megan.kiwi-computer.com> <44CF8F1A.5090506@centtech.com> <20060801174048.GE3413@megan.kiwi-computer.com> <44CF94A4.3000306@centtech.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SO98HVl1bnMOfKZd" Content-Disposition: inline In-Reply-To: <44CF94A4.3000306@centtech.com> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.11 Cc: freebsd-hackers@freebsd.org, rick-freebsd@kiwi-computer.com Subject: Re: [PATCH] adding two new options to 'cp' 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, 01 Aug 2006 19:05:17 -0000 --SO98HVl1bnMOfKZd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, 2006-Aug-01 12:51:32 -0500, Eric Anderson wrote: >string of zeros larger than the block size, or it needs to 'do the right= =20 >thing' and determine if it's sparse or not. You can do this by comparing stat.st_size with stat.st_blocks - a sparse file will have fewer blocks than its size requires. What you can't do is accurately determine where the holes are. Note that st_blksize is not nessarily the allocation blocksize and therefore is unrelated to the size of holes in the filesystem. Also, on FreeBSD, the designation of "optimal" is a misnomer and I/O operations should be much larger than this for optimal efficiency. --=20 Peter Jeremy --SO98HVl1bnMOfKZd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (FreeBSD) iD8DBQFEz6XU/opHv/APuIcRAvE4AJoDnQ182fq7H5d8xPFjdM9eWHO4HQCfY1Rc bRpeb1FabKXVxYvM9sfwV5I= =RNRl -----END PGP SIGNATURE----- --SO98HVl1bnMOfKZd--