virtiofs: implement FUSE_INIT map_alignment field
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 19 Aug 2020 22:19:49 +0000 (18:19 -0400)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 10 Sep 2020 09:39:22 +0000 (11:39 +0200)
commitfd1a1dc6f5aa7361e3562790336e116935f8fcfa
tree24d0bb3c17423ad0a1ef503ff8fe5212f4048f8a
parent45f2348eceb6a2a5b248ef44ea7dc2c4ede88b30
virtiofs: implement FUSE_INIT map_alignment field

The device communicates FUSE_SETUPMAPPING/FUSE_REMOVMAPPING alignment
constraints via the FUST_INIT map_alignment field.  Parse this field and
ensure our DAX mappings meet the alignment constraints.

We don't actually align anything differently since our mappings are
already 2MB aligned.  Just check the value when the connection is
established.  If it becomes necessary to honor arbitrary alignments in
the future we'll have to adjust how mappings are sized.

The upshot of this commit is that we can be confident that mappings will
work even when emulating x86 on Power and similar combinations where the
host page sizes are different.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/dax.c
fs/fuse/fuse_i.h
fs/fuse/inode.c
include/uapi/linux/fuse.h