tl;dr: The proposed S_IOMAP_IMMUTABLE mechanism
The daxfile proposal a few weeks back  sought to piggy back on the
swapfile implementation to approximate a block map immutable file. This
is an idea Dave originated last year to solve the dax "flush from
userspace" problem .
The discussion yielded several results. First, Christoph pointed out that
swapfiles are subtly broken . Second, Darrick 
and Dave  proposed how to properly implement a block map immutable file.
Finally, Dave identified some improvements to swapfiles that can be
built on the block-map-immutable mecahanism. These patches seek to
implement the first part of the proposal and save the swapfile work to
build on top once the base mechanism is complete.
While the initial motivation for this feature is support for
byte-addressable updates of persistent memory and managing cache
maintenance from userspace, the applications of the feature are broader.
In addition to being the start of a better swapfile mechanism it can
also support a DMA-to-storage use case. This use case enables
data-acquisition hardware to DMA directly to a storage device address
while being safe in the knowledge that storage mappings will not change.
These patches are relative to Darrick's 'devel' tree. Patch 3 is likely
wrong in the way it sets the new XFS_DIFLAG2_IOMAP_IMMUTABLE flag, but
seems to work with a basic test. The test just turns the flag on and
off, checks that the file is fully allocated and immutable, and
validates that the state persists over a umount / mount cycle. A proper
xfstest is in the works, but comments on this first draft are welcome.
Dan Williams (3):
fs, xfs: introduce S_IOMAP_IMMUTABLE
fs, xfs: introduce FALLOC_FL_SEAL_BLOCK_MAP
xfs: persist S_IOMAP_IMMUTABLE in di_flags2
fs/attr.c | 10 ++++
fs/namei.c | 3 +
fs/open.c | 28 ++++++++++++
fs/read_write.c | 3 +
fs/xfs/libxfs/xfs_format.h | 5 ++
fs/xfs/xfs_bmap_util.c | 98 ++++++++++++++++++++++++++++++++++++++++++-
fs/xfs/xfs_bmap_util.h | 4 +-
fs/xfs/xfs_file.c | 14 ++++--
fs/xfs/xfs_ioctl.c | 10 ++++
fs/xfs/xfs_iops.c | 8 ++--
include/linux/falloc.h | 3 +
include/linux/fs.h | 2 +
include/uapi/linux/falloc.h | 19 ++++++++
mm/filemap.c | 9 ++++
14 files changed, 200 insertions(+), 16 deletions(-)