*** empty log message ***
[yaffs/.git] / yaffs_fs.c
index 8bea30d64da5090206be08bca0b13668efa8f90f..b0608f9198953893df6a591077b2753962a5b1d3 100644 (file)
@@ -109,7 +109,7 @@ static struct address_space_operations yaffs_file_address_operations = {
 
 
 static struct file_operations yaffs_file_operations = {
-#if CONFIG_YAFFS_USE_GENERIC_RW
+#ifdef CONFIG_YAFFS_USE_GENERIC_RW
        read:           generic_file_read,
        write:          generic_file_write,
 #else
@@ -341,7 +341,7 @@ static int yaffs_commit_write(struct file *f, struct page *pg, unsigned offset,
 
        T((KERN_DEBUG"yaffs_commit_write returning %d\n",nWritten));
        
-       return nWritten /* != nBytes ? -ENOMEM : 0 */ ;
+       return nWritten;
 
 }
 
@@ -445,6 +445,7 @@ static ssize_t yaffs_file_read(struct file *f, char *buf, size_t n, loff_t *pos)
        
 }
 
+
 static ssize_t yaffs_file_write(struct file *f, const char *buf, size_t n, loff_t *pos)
 {
        yaffs_Object *obj;
@@ -489,7 +490,7 @@ static ssize_t yaffs_file_write(struct file *f, const char *buf, size_t n, loff_
                }
                
        }
-       return nWritten;        
+       return nWritten != n ? -ENOSPC : nWritten;      
 }