From: Andreas Gruenbacher Date: Tue, 24 Jul 2018 22:06:59 +0000 (+0200) Subject: Merge branch 'iomap-4.19-merge' into linux-gfs2/for-next X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=0ed91eca1130e6c0fe66e01fa6ea92965e81900c;p=openwrt%2Fstaging%2Fblogic.git Merge branch 'iomap-4.19-merge' into linux-gfs2/for-next Merge xfs branch 'iomap-4.19-merge' into linux-gfs2/for-next. This brings in readpage and direct I/O support for inline data. The IOMAP_F_BUFFER_HEAD flag introduced in commit "iomap: add initial support for writes without buffer heads" needs to be set for gfs2 as well, so do that in the merge. Signed-off-by: Andreas Gruenbacher --- 0ed91eca1130e6c0fe66e01fa6ea92965e81900c diff --cc fs/gfs2/bmap.c index 49a6ab919bd7,ed6699705c13..89f1f7d3186d --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@@ -890,7 -845,7 +890,7 @@@ unstuff iomap->addr = be64_to_cpu(*ptr) << inode->i_blkbits; iomap->length = len << inode->i_blkbits; iomap->type = IOMAP_MAPPED; -- iomap->flags = IOMAP_F_MERGED; ++ iomap->flags |= IOMAP_F_MERGED; if (eob) iomap->flags |= IOMAP_F_GFS2_BOUNDARY; @@@ -1084,9 -879,12 +1084,11 @@@ static int gfs2_iomap_begin(struct inod struct metapath mp = { .mp_aheight = 1, }; int ret; ++ iomap->flags |= IOMAP_F_BUFFER_HEAD; ++ trace_gfs2_iomap_start(ip, pos, length, flags); - if (flags & IOMAP_WRITE) { - ret = gfs2_iomap_get(inode, pos, length, flags, iomap, &mp); - if (!ret && iomap->type == IOMAP_HOLE) - ret = gfs2_iomap_alloc(inode, iomap, flags, &mp); - release_metapath(&mp); + if ((flags & IOMAP_WRITE) && !(flags & IOMAP_DIRECT)) { + ret = gfs2_iomap_begin_write(inode, pos, length, flags, iomap); } else { ret = gfs2_iomap_get(inode, pos, length, flags, iomap, &mp); release_metapath(&mp);