From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5vIz-00005n-GU for qemu-devel@nongnu.org; Fri, 09 Mar 2012 03:36:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5vIb-0003Cl-P8 for qemu-devel@nongnu.org; Fri, 09 Mar 2012 03:36:05 -0500 Received: from parsec.stupidest.org ([71.6.196.126]:39874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5vIb-0003CA-H2 for qemu-devel@nongnu.org; Fri, 09 Mar 2012 03:35:41 -0500 Date: Fri, 9 Mar 2012 00:35:39 -0800 From: Chris Wedgwood Message-ID: <20120309083539.GA28349@puku.stupidest.org> References: <1331226917-6658-1-git-send-email-pbonzini@redhat.com> <1331226917-6658-15-git-send-email-pbonzini@redhat.com> <20120309082041.GA28158@puku.stupidest.org> <4F59BFE3.4070907@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F59BFE3.4070907@redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH 14/17] block: support FALLOC_FL_PUNCH_HOLE trimming List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org > SEEK_HOLE could provide a very simple heuristic to detect preallocated > files (unfortunately ext4 does not implement SEEK_HOLE yet). SEEK_HOLE is a weird (confusing and no intuitive) API (IMO). There is FIEMAP or whatever it's called which seems somewhat saner. XFS specific there is also GETBMAP[X]. Simplest still compare the blocks allocated by the file to it's length (ie. stat.st_blocks != stat.st_size>>9).