From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkiMX-0004DX-2w for qemu-devel@nongnu.org; Wed, 14 May 2014 19:13:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkiMQ-0003kR-Un for qemu-devel@nongnu.org; Wed, 14 May 2014 19:13:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkiMQ-0003jx-Nv for qemu-devel@nongnu.org; Wed, 14 May 2014 19:13:18 -0400 Message-ID: <5373F888.5030100@redhat.com> Date: Thu, 15 May 2014 01:13:12 +0200 From: Max Reitz MIME-Version: 1.0 References: <1399402854-24559-1-git-send-email-mreitz@redhat.com> <20140511172605.GA9761@lst.de> In-Reply-To: <20140511172605.GA9761@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] block/raw-posix: Try both FIEMAP and SEEK_HOLE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi On 11.05.2014 19:26, Christoph Hellwig wrote: > On Tue, May 06, 2014 at 09:00:54PM +0200, Max Reitz wrote: >> The current version of raw-posix always uses ioctl(FS_IOC_FIEMAP) if >> FIEMAP is available; lseek with SEEK_HOLE/SEEK_DATA are not even >> compiled in in this case. However, there may be implementations which >> support the latter but not the former (e.g., NFSv4.2) as well as vice >> versa. >> >> To cover both cases, always try SEEK_HOLE/SEEK_DATA (as this will >> probably be covered by POSIX soon) and if that does not work, fall back >> to FIEMAP; and if that does not work either, treat everything as >> allocated. > Btw, while I think that SEEK_HOLE/SEEK_DATA generally is the better API > for qemu, the NFS 4.2 SEEK operation will be sufficient for a proper FIEMAP > implementation, and we'll implement it for the Linux NFS client. Hm, great, in that case this patch will probably never be put to the test. *g* Max