int ntfs_prepare_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 not yet been copied into the page.
Need to extend the attribute/fill in holes if necessary, create blocks and make partially overwritten blocks uptodate,
i_size is not to be modified yet.
Return 0 on success or -errno on error.
Should be using block_prepare_write [support for sparse files] or cont_prepare_write [no support for sparse files]. Cannot do that due to ntfs specifics but can look at them for implementation guidance.
In the range, from is inclusive and to is exclusive, i.e. from is the first byte in the page that will be written to and to is the first byte after the last byte that will be written to.