gfs2: Further iomap cleanups
authorAndreas Gruenbacher <agruenba@redhat.com>
Sun, 24 Jun 2018 09:43:49 +0000 (10:43 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 2 Jul 2018 15:26:01 +0000 (16:26 +0100)
commitd505a96a3b16f46455035dc0296bc2da6014e163
tree73cd1a7f5abe80185084ea9785f37d178158808e
parente184fde6f3f5353040dd4b5637f823fc87436e55
gfs2: Further iomap cleanups

In gfs2_iomap_alloc, set the type of newly allocated extents to
IOMAP_MAPPED so that iomap_to_bh will set the bh states correctly:
otherwise, the bhs would not be marked as mapped, confusing
__mpage_writepage.  This means that we need to check for the IOMAP_F_NEW
flag in fallocate_chunk now.

Further clean up gfs2_iomap_get and implement gfs2_stuffed_iomap here
directly.  For reads beyond the end of the file, return holes instead of
failing with -ENOENT so that we can get rid of that special case in
gfs2_block_map.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/bmap.c
fs/gfs2/file.c