I've got a couple of code comments. In xfs_write, there is a
call to bhv_vop_flushinval_pages(). It appears that this function call
is not needed because the call to generic_file_direct_write() done
later in xfs_write does the same work.
generic_file_direct_write -> generic_file_direct_IO ->
(filemap_write_and_wait + invalidate_inode_pages2_range)
bhv_vop_flushinval_pages -> fs_flushinval_pages ->
(filemap_write_and_wait + truncate_inode_pages)
The code isn't exactly the same, but it appears to do the same work.
Also, within xfs_swap_extents() the code fixes up on-disk inode block
counts, but doesn't change the block counts for the Linux inode.