From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joel Becker Subject: Re: [RFC][PATCH 0/5] Fiemap, an extent mapping ioctl Date: Thu, 29 May 2008 14:47:43 -0700 Message-ID: <20080529214743.GD2655@mail.oracle.com> References: <20080525194203.GB24328@infradead.org> <20080527185622.GR8325@wotan.suse.de> <20080527203124.GC27827@mail.oracle.com> <20080528160201.GA7263@webber.adilger.int> <20080528170419.GA6031@mail.oracle.com> <20080529005134.GB12405@disturbed> <20080529130254.GB21299@infradead.org> <483ECCB5.5060909@hp.com> <20080529185616.GA2655@mail.oracle.com> <20080529214123.GH2985@webber.adilger.int> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: jim owens , Christoph Hellwig , Mark Fasheh , linux-fsdevel@vger.kernel.org To: Andreas Dilger Return-path: Received: from agminet01.oracle.com ([141.146.126.228]:22313 "EHLO agminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756220AbYE2Vsv (ORCPT ); Thu, 29 May 2008 17:48:51 -0400 Content-Disposition: inline In-Reply-To: <20080529214123.GH2985@webber.adilger.int> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, May 29, 2008 at 03:41:23PM -0600, Andreas Dilger wrote: > So, to clarify, you are suggesting that FIEMAP_FLAG_NUM_EXTENTS isn't > needed, and returning the extent count should just be detected by calling > FIEMAP with fm_extent_count == 0? I'm OK with that also, since calling > it with fm_extent_count == 0 doesn't make sense otherwise. I'd always set fm_extent_count to whatever covers the range. So, like snprintf(3), you always know when you were truncated and by how much. Then, passing fm_extent_count=0 in is just a special case of it. Like estimating a printf buffer with len = snprintf(NULL, 0, fmt, ...); Joel -- "Reader, suppose you were and idiot. And suppose you were a member of Congress. But I repeat myself." - Mark Twain Joel Becker Principal Software Developer Oracle E-mail: joel.becker@oracle.com Phone: (650) 506-8127