From: steve@chygwyn.com Subject: Re: [PATCH 3/4] generic block based fiemap implementation Date: Mon, 6 Oct 2008 12:35:06 +0100 Message-ID: <20081006113506.GA23889@fogou.chygwyn.com> References: <1223071147-27180-1-git-send-email-tytso@mit.edu> <1223071147-27180-2-git-send-email-tytso@mit.edu> <1223071147-27180-3-git-send-email-tytso@mit.edu> <1223071147-27180-4-git-send-email-tytso@mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, Josef Bacik , Mark Fasheh To: Theodore Ts'o Return-path: Received: from fogou.chygwyn.com ([195.171.2.24]:59615 "EHLO fogou.chygwyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751788AbYJFLhP (ORCPT ); Mon, 6 Oct 2008 07:37:15 -0400 Content-Disposition: inline In-Reply-To: <1223071147-27180-4-git-send-email-tytso@mit.edu> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, On Fri, Oct 03, 2008 at 05:59:06PM -0400, Theodore Ts'o wrote: > From: Josef Bacik > > Any block based fs (this patch includes ext3) just has to declare its own > fiemap() function and then call this generic function with its own > get_block_t. This works well for block based filesystems that will map > multiple contiguous blocks at one time, but will work for filesystems that > only map one block at a time, you will just end up with an "extent" for each > block. One gotcha is this will not play nicely where there is hole+data > after the EOF. This function will assume its hit the end of the data as soon > as it hits a hole after the EOF, so if there is any data past that it will > not pick that up. AFAIK no block based fs does this anyway, but its in the > comments of the function anyway just in case. > > Signed-off-by: Josef Bacik > Signed-off-by: Mark Fasheh > Signed-off-by: "Theodore Ts'o" > Cc: linux-fsdevel@vger.kernel.org Would it be possible to move the inode mutex out of generic_block_fiemap() and into the callers? The defined lock ordering in GFS2 is inode mutex -> inode glock, and thus we want to be able to lock in that order. We should be able to use generic_block_fiemap() for GFS2 in that case. Thanks, Steve.