From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Tinguely Subject: Re: [PATCH 1/2] fiemap: add freespace mapping to FS_IOC_FIEMAP Date: Thu, 08 Nov 2012 15:01:27 -0600 Message-ID: <509C1DA7.5090902@sgi.com> References: <1350537079-16246-1-git-send-email-david@fromorbit.com> <1350537079-16246-2-git-send-email-david@fromorbit.com> <509BE2E9.1070702@sgi.com> <20121108205648.GO6434@dastard> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com To: Dave Chinner Return-path: Received: from relay2.sgi.com ([192.48.179.30]:35843 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756640Ab2KHVBh (ORCPT ); Thu, 8 Nov 2012 16:01:37 -0500 In-Reply-To: <20121108205648.GO6434@dastard> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 11/08/12 14:56, Dave Chinner wrote: > On Thu, Nov 08, 2012 at 10:50:49AM -0600, Mark Tinguely wrote: >> On 10/18/12 00:11, Dave Chinner wrote: >>> From: Dave Chinner >>> >>> fiemap is used to map extents of used space on files. it's just an >>> array of extents, though, so there's no reason it can only index >>> *used* space. >>> >>> Ther eis need for getting freespace layout information into >>> userspace. For example, defragmentation programs would find it >>> useful to be able to map the free space in the filesystem to >>> work out where it is best to move data to defragment it. >>> Alternatively, knowing where free space is enables us to identify >>> extents that need to be moved to defragment free space. >>> >>> Hence, extend fiemap with the FIEMAP_FLAG_FREESPACE to indicate that >>> the caller wants to map free space in the range fm_start bytes from >>> the start of the filesystem for fm_length bytes. >>> >>> Because XFS can report extents in size order without needing to >>> sort, and this information is useful to xfs_fsr, also add >>> FIEMAP_FLAG_FREESPACE_SIZE to tell the filesystem to return a >>> freespace map ordered by extent size rather than offset. If there >>> are multiple extents of the same size, then they are ordered by >>> offset. >>> >>> Signed-off-by: Dave Chinner >>> --- >> >> ... >> >>> -------------- >>> diff --git a/include/linux/fiemap.h b/include/linux/fiemap.h >>> index d830747..f4fbb9f 100644 >>> --- a/include/linux/fiemap.h >>> +++ b/include/linux/fiemap.h >> >> include/uabi/linux/fiemap.h >> ^^^^ >> other than that, it looks good. > > include/uapi/ actaully, but that change was made after I posted the > patches so there's no surprise that It didn't apply. > > As it is, this needs to be redone into an FS_IOC_FIEMAPFS ioctl in > response to other reviews. I've already done that work (a week ago), > I just haven't fully tested it yet so I haven't reported it... > > Cheers, > > Dave. Okay. Thank-you for the update. --Mark.