int ntfs_file_fsync (struct file * filp, struct dentry * dentry, int datasync);
Data integrity sync of a file to disk. Used for fsync, fdatasync, and msync system calls. This function is inspired by fs/buffer.c::file_fsync.
If datasync is false, write the mft record and all associated extent mft records as well as the $DATA attribute and then sync the block device.
If datasync is true and the attribute is non-resident, we skip the writing of the mft record and all associated extent mft records (this might still happen due to the write_inode_now call).
Also, if datasync is true, we do not wait on the inode to be written out but we always wait on the page cache pages to be written out.
In the past filp could be NULL so we ignore it as we don't need it anyway.
Caller must hold i_sem on the inode.
We should probably also write all attribute/index inodes associated with this inode but since we have no simple way of getting to them we ignore this problem for now.