From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5vNk-0002Jr-6a for qemu-devel@nongnu.org; Fri, 09 Mar 2012 03:41:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5vNe-0004HT-M5 for qemu-devel@nongnu.org; Fri, 09 Mar 2012 03:40:59 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:60178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5vNe-0004H6-Em for qemu-devel@nongnu.org; Fri, 09 Mar 2012 03:40:54 -0500 Received: by iafj26 with SMTP id j26so2042140iaf.4 for ; Fri, 09 Mar 2012 00:40:52 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4F59C20E.9040402@redhat.com> Date: Fri, 09 Mar 2012 09:40:46 +0100 From: Paolo Bonzini MIME-Version: 1.0 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> <20120309083539.GA28349@puku.stupidest.org> In-Reply-To: <20120309083539.GA28349@puku.stupidest.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: Chris Wedgwood Cc: qemu-devel@nongnu.org Il 09/03/2012 09:35, Chris Wedgwood ha scritto: >> 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. FIEMAP is a powertool, we need a butter knife only (cit.). > Simplest still compare the blocks allocated by the file > to it's length (ie. stat.st_blocks != stat.st_size>>9). But yes, you're right about this. Paolo