X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=yaffs_fs.c;h=cc4f68abdd3c5e042c67ff3d0665bb60e28c0d74;hb=bd35c2f6448ff816f8aa04b644eab3b648dab6df;hp=fb3c13010ee93b55653b87cfc60ef2a6909e152a;hpb=7a728046bdec33880e74646228fb801790017608;p=yaffs2.git diff --git a/yaffs_fs.c b/yaffs_fs.c index fb3c130..cc4f68a 100644 --- a/yaffs_fs.c +++ b/yaffs_fs.c @@ -31,7 +31,7 @@ */ const char *yaffs_fs_c_version = - "$Id: yaffs_fs.c,v 1.38 2005-12-15 20:27:56 charles Exp $"; + "$Id: yaffs_fs.c,v 1.40 2006-01-25 01:21:08 tpoynor Exp $"; extern const char *yaffs_guts_c_version; #include @@ -171,6 +171,10 @@ static struct file_operations yaffs_file_operations = { .mmap = generic_file_mmap, .flush = yaffs_file_flush, .fsync = yaffs_sync_object, +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) + .sendfile = generic_file_sendfile, +#endif + }; static struct inode_operations yaffs_file_inode_operations = { @@ -624,9 +628,9 @@ static int yaffs_commit_write(struct file *f, struct page *pg, unsigned offset, T(YAFFS_TRACE_OS, (KERN_DEBUG "yaffs_commit_write returning %d\n", - nWritten == nBytes ? 0 : -1)); + nWritten == nBytes ? 0 : nWritten)); - return nWritten == nBytes ? 0 : -1; + return nWritten == nBytes ? 0 : nWritten; } @@ -784,8 +788,7 @@ static ssize_t yaffs_file_write(struct file *f, const char *buf, size_t n, } yaffs_GrossUnlock(dev); - - return nWritten != n ? -ENOSPC : nWritten; + return nWritten == 0 ? -ENOSPC : nWritten; } static int yaffs_readdir(struct file *f, void *dirent, filldir_t filldir)