On 12 August, 2016, I submitted patches to make GFS2 use a new iomap interface for its fiemap implementation. I received lots of good feedback, including bugs and other suggestions. Since that time, the iomap implementation has also gone upstream and changed. This new set of 4 patches is my latest attempt to revive this effort.
The four patches are as follows: 1. GFS2: Remove bh_map requirements from gfs2_bmap_alloc Steve Whitehouse suggested we implement GFS2's blockmap function so that it can use the new iomap interface under the covers. In order to do that, I had to decouple the bh_map from function gfs2_bmap_alloc. This patch does that, in favor of more generic mapping details. It was either that, or implement a multi-block allocation path with iomap, which I didn't want to do with this iteration. 2. GFS2: Make height info part of metapath This patch is another "decoupling" needed to make the GFS2 blockmap function work with iomap under the covers. In this case, it eliminates the height parameters from function gfs2_bmap_alloc in favor of simply fetching the values from the metapath. 3. GFS2: Implement iomap for block_map With those things decoupled, this patch now implements the new GFS2 get_iomap function, and makes gfs2_block_map use it under the covers. Eventually we might be able to eliminate it in favor of the iomap stuff only, but only after we've sorted out multi-block allocations with iomap. Andreas's bugs are now hopefully fixed and his other suggestions implemented as well. 4. GFS2: Switch fiemap implementation to use iomap This patch switches GFS2's fiemap implementation to use the new iomap interface. It also uses a "select" in Kconfig to pull it all in, as Christoph had suggested. This has been tested with large holey files, up to 1EB, and I also tested some boundary conditions as well, such as 1PB plus and minus 1 byte, and 1PB plus and minus 4K. I also ran Chris Mason's fiemap_test against it with those same files. That's not to say it's perfect, but it seems to have basic functionality and excellent performance. Feedback is encouraged. Signed-off-by: Bob Peterson <[email protected]> --- Bob Peterson (4): GFS2: Remove bh_map requirements from gfs2_bmap_alloc GFS2: Make height info part of metapath GFS2: Implement iomap for block_map GFS2: Switch fiemap implementation to use iomap fs/gfs2/Kconfig | 1 + fs/gfs2/bmap.c | 333 +++++++++++++++++++++++++++++++++++--------------- fs/gfs2/bmap.h | 4 + fs/gfs2/inode.c | 60 +++++++-- include/linux/iomap.h | 1 + 5 files changed, 288 insertions(+), 111 deletions(-) -- 2.7.4
