+
+}
+
+static int yaffs_commit_write(struct file *f, struct page *pg, unsigned offset, unsigned 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);
+ }
+ else
+ {
+ SetPageUptodate(pg);
+ }
+
+ T((KERN_DEBUG"yaffs_commit_write returning %d\n",nWritten));
+
+ return nWritten;
+