From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Chinner Subject: Re: [PATCH][resend] fs: Add hooks for get_hole_size to generic_block_fiemap Date: Thu, 4 Sep 2014 06:26:35 +1000 Message-ID: <20140903202634.GI20473@dastard> References: <1623792099.11913714.1409074745372.JavaMail.zimbra@redhat.com> <1185431955.16078328.1409759545699.JavaMail.zimbra@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alexander Viro , linux-fsdevel@vger.kernel.org To: Bob Peterson Return-path: Received: from ipmail04.adl6.internode.on.net ([150.101.137.141]:4190 "EHLO ipmail04.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753661AbaICU0j (ORCPT ); Wed, 3 Sep 2014 16:26:39 -0400 Content-Disposition: inline In-Reply-To: <1185431955.16078328.1409759545699.JavaMail.zimbra@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Sep 03, 2014 at 11:52:25AM -0400, Bob Peterson wrote: > Hi, > > I sent this patch a few weeks back and it didn't receive any comments. > So I assume it's okay to add upstream? > > The problem: > If you do a fiemap operation on a very large sparse file, it can take > an extremely long amount of time (we're talking days here) because > function __generic_block_fiemap does a block-for-block search when it > encounters a hole. > > The solution: > Allow the underlying file system to return the hole size so that function > __generic_block_fiemap can quickly skip the hole. > > Preamble: > In cases where the fs-specific block_map() function finds a hole, it > can return the hole size in b_size. This is efficient because the file > system doesn't need to figure out block mapping a second time to > determine the hole size. The patch repurposes the buffer_meta flag > to tell when the fs-specific block_map() is passing back the hole_size: > If the fs-specific block_map() doesn't set the buffer_meta bit, Use of BH_Meta is a bit wierd. Mapping the data blocks of a file and expecting the return to have the BH_Meta flag set seems, well, A Little Bit Wrong. We're not short of buffer flags, perhaps adding a purpose sepcific flag for this? Cheers, Dave. -- Dave Chinner david@fromorbit.com