For direct I/O writes, generic_write_sync() gets called twice, once with iomap_dio_complete() and the next time in btrfs_file_write_iter(). Move it within btrfs_buffered_write(). In the process, we have to move btrfs_inode->last_sub_trans as well to btrfs_buffered_write() and btrfs_dio_iomap_end() respectively. Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>