int ntfs_commit_write (struct file * file, struct page * page, unsigned from, unsigned to);
This is called from generic_file_write with i_sem held on the inode (page->mapping->host). The page is locked but not kmapped. The source data has already been copied into the page. ntfs_prepare_write has been called before the data copied and it returned success so we can take the results of various BUG checks and some error handling for granted.
Need to mark modified blocks dirty so they get written out later when ntfs_writepage is invoked by the VM.
Return 0 on success or -errno on error.
Should be using generic_commit_write. This marks buffers uptodate and dirty, sets the page uptodate if all buffers in the page are uptodate, and updates i_size if the end of io is beyond i_size. In that case, it also marks the inode dirty.
Cannot use generic_commit_write due to ntfs specialities but can look at it for implementation guidance.
If things have gone as outlined in ntfs_prepare_write, then we do not need to do any page content modifications here at all, except in the write to resident attribute case, where we need to do the uptodate bringing here which we combine with the copying into the mft record which means we save one atomic kmap.