/* It may be more efficient to read the page first if the file is open for reading in addition to writing, the page is not marked as Uptodate, it is not dirty or waiting to be committed, indicating that it was previously allocated and then modified, that there were valid bytes of data in that range of the file, and that the new data won't completely replace the old data in that range of the file.  */
static int nfs_want_read_modify_write(struct file *file, struct page *page, loff_t pos, unsigned len)
/* It may be more efficient to read the page first if the file is open for reading in addition to writing, the page is not marked as Uptodate, it is not dirty or waiting to be committed, indicating that it was previously allocated and then modified, that there were valid bytes of data in that range of the file, and that the new data won't completely replace the old data in that range of the file.  */
static int nfs_want_read_modify_write(struct file *file, struct page *page, loff_t pos, unsigned len)
{
	unsigned int pglen = nfs_page_length(page);
	unsigned int offset = pos & (PAGE_CACHE_SIZE - 1);
	unsigned int end = offset + len;
	if ((file->f_mode & FMODE_READ) &&
	    !PageUptodate(page) &&
	    !PagePrivate(page) &&
	    pglen &&
	    (end < pglen || offset))
		return 1;
	return 0;
}