Merge branch 'iomap-4.19-merge' into linux-gfs2/for-next
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 24 Jul 2018 22:06:59 +0000 (00:06 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 24 Jul 2018 22:08:20 +0000 (00:08 +0200)
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 <agruenba@redhat.com>
1  2 
fs/gfs2/bmap.c

diff --cc fs/gfs2/bmap.c
index 49a6ab919bd7faa06c6b79d75094da96e02b4d73,ed6699705c13c5ca462be1f22cfb5dee7edec38f..89f1f7d3186de2984f4b9a0d31205f3d9321aa11
@@@ -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);