- struct inode *inode = page->mapping->host;
- loff_t pos = ((loff_t)page->index << PAGE_CACHE_SHIFT) + to;
+ void *addr = page_address(pg) + offset;
+ loff_t pos = (((loff_t)pg->index) << PAGE_CACHE_SHIFT) + offset;
+ int nBytes = to - offset;
+ int nWritten;
+
+ unsigned spos = pos;
+ unsigned saddr = addr;
+
+ T((KERN_DEBUG"yaffs_commit_write addr %x pos %x nBytes %d\n",saddr,spos,nBytes));
+
+ nWritten = yaffs_file_write(f,addr, nBytes, &pos);
+
+ if(nWritten != nBytes)
+ {
+ T((KERN_DEBUG"yaffs_commit_write not same size nWritten %d nBytes %d\n",nWritten,nBytes));
+ SetPageError(pg);
+ ClearPageUptodate(pg);
+ }