aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/file.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2018-06-24 10:43:49 +0100
committerAndreas Gruenbacher <agruenba@redhat.com>2018-07-02 16:26:01 +0100
commitd505a96a3b16f46455035dc0296bc2da6014e163 (patch)
tree73cd1a7f5abe80185084ea9785f37d178158808e /fs/gfs2/file.c
parentiomap: add private pointer to struct iomap (diff)
downloadlinux-dev-d505a96a3b16f46455035dc0296bc2da6014e163.tar.xz
linux-dev-d505a96a3b16f46455035dc0296bc2da6014e163.zip
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>
Diffstat (limited to 'fs/gfs2/file.c')
-rw-r--r--fs/gfs2/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 7137db7b0119..6f6bbfbff13d 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -754,7 +754,7 @@ static int fallocate_chunk(struct inode *inode, loff_t offset, loff_t len,
if (error)
goto out;
offset = iomap.offset + iomap.length;
- if (iomap.type != IOMAP_HOLE)
+ if (!(iomap.flags & IOMAP_F_NEW))
continue;
error = sb_issue_zeroout(sb, iomap.addr >> inode->i_blkbits,
iomap.length >> inode->i_blkbits,