From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:40264 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757077AbcCDULn (ORCPT ); Fri, 4 Mar 2016 15:11:43 -0500 From: Bob Peterson To: Cc: Jan Kara , Al Viro , Dave Chinner , Christoph Hellwig Subject: [vfs PATCH v3 0/4] vfs: Expand iomap interface to fiemap Date: Fri, 4 Mar 2016 15:11:36 -0500 Message-Id: <1457122300-28514-1-git-send-email-rpeterso@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Patch set history: ------------------ o Back in October 2014, I proposed an improvement to fiemap to accomodate very large sparse files. This was done because the existing blockmap-based code skips holes one block at a time, which is extremely slow when it comes to large holes. For example, doing fiemap on a 1PB file whose only byte exists at EOF can take an extremely long time. To recreate: dd if=/dev/zero of=/mnt/holey-P bs=1 count=1 seek=1P time filefrag -v /mnt/holey-P At that time, someone suggested I use the iomap interface proposed by Dave Chinner a long time ago, and so my patches never got off the ground (until now). Since then, Christoph apparently added the basics of iomap to exportfs.h. which today is minimal, and limited to exportfs users. o On 11 January 2016, I posted a vfs patch that expanded the use of the iomap infrastructure, but iomap was added to address_space_operations. o On 21 January 2016, Jan Kara suggested it NOT be included as an a_op, but rather, to have the new iomap function be passed in, similar to get_blocks(), along with some pretty generic flags, rather than a set of commands. o on 03 March, I posted a v2 patch set to implement Jan's suggestions. o on 04 March, Christoph made some suggestions. This v3 patch set is an attempt to implement those suggestions. Patch description: ------------------ The first patch only moves the iomap declares from exportfs.h to its own iomap.h. The second patch declares a new iomap_get_t function, similar to get_block_t, to be used to get iomap information, much like get_block_t is used to get block information. It adds a new __generic_iomap_fiemap interface to be used by file systems who choose to use it. My original version of this function looked nearly identical to the blockmap version, but this one is smaller and simpler. So if people don't like my implementation, I can revert to that one. The third patch introduces a new __gfs2_io_map function to the GFS2 file system. The fourth patch hooks the new function into GFS2's fiemap to take advantage of the new code. The result: for a 1PB sparse file, filefrag takes milliseconds rather than a week. Signed-off-by: Bob Peterson --- Bob Peterson (4): VFS: move iomap from exportfs.h to iomap.h VFS: Add new __generic_iomap_fiemap interface GFS2: Add function gfs2_get_iomap GFS2: Use new iomap interface for fiemap fs/gfs2/bmap.c | 151 +++++++++++++++++++++++++++++++++++++++++++++++ fs/gfs2/bmap.h | 2 + fs/gfs2/inode.c | 4 +- fs/ioctl.c | 96 ++++++++++++++++++++++++++++++ include/linux/exportfs.h | 16 +---- include/linux/fs.h | 11 +++- include/linux/iomap.h | 25 ++++++++ 7 files changed, 287 insertions(+), 18 deletions(-) create mode 100644 include/linux/iomap.h -- 2.5.0