patch-2.3.5 linux/mm/filemap.c
Next file: linux/net/802/llc_macinit.c
Previous file: linux/init/main.c
Back to the patch index
Back to the overall index
- Lines: 47
- Date:
Wed Jun 2 13:47:49 1999
- Orig file:
v2.3.4/linux/mm/filemap.c
- Orig date:
Mon May 31 22:28:07 1999
diff -u --recursive --new-file v2.3.4/linux/mm/filemap.c linux/mm/filemap.c
@@ -1425,7 +1425,8 @@
*/
ssize_t
generic_file_write(struct file *file, const char *buf,
- size_t count, loff_t *ppos)
+ size_t count, loff_t *ppos,
+ writepage_t write_one_page)
{
struct dentry *dentry = file->f_dentry;
struct inode *inode = dentry->d_inode;
@@ -1434,10 +1435,7 @@
struct page *page, **hash;
unsigned long page_cache = 0;
unsigned long written;
- long status, sync;
-
- if (!inode->i_op || !inode->i_op->updatepage)
- return -EIO;
+ long status;
if (file->f_error) {
int error = file->f_error;
@@ -1445,7 +1443,6 @@
return error;
}
- sync = file->f_flags & O_SYNC;
written = 0;
if (file->f_flags & O_APPEND)
@@ -1501,15 +1498,7 @@
wait_on_page(page);
set_bit(PG_locked, &page->flags);
- /*
- * Do the real work.. If the writer ends up delaying the write,
- * the writer needs to increment the page use counts until he
- * is done with the page.
- */
- bytes -= copy_from_user((u8*)page_address(page) + offset, buf, bytes);
- status = -EFAULT;
- if (bytes)
- status = inode->i_op->updatepage(file, page, offset, bytes, sync);
+ status = write_one_page(file, page, offset, bytes, buf);
/* Mark it unlocked again and drop the page.. */
clear_bit(PG_locked, &page->flags);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)