Added flushing of file pages to do_munmap() for file-backed mappings.

This commit is contained in:
Bahadir Balban
2008-10-29 19:03:19 +02:00
parent 94a126dcde
commit 51af9968c2
4 changed files with 49 additions and 6 deletions

View File

@@ -355,9 +355,13 @@ int write_file_pages(struct vm_file *f, unsigned long pfn_start,
/* Flush all dirty file pages and update file stats */
int flush_file_pages(struct vm_file *f)
{
write_file_pages(f, 0, __pfn(page_align_up(f->length)));
int err;
vfs_update_file_stats(f);
if ((err = write_file_pages(f, 0, __pfn(page_align_up(f->length)))) < 0)
return err;
if ((err = vfs_update_file_stats(f)) < 0)
return err;
return 0;
}
@@ -647,7 +651,7 @@ int sys_read(struct tcb *task, int fd, void *buf, int count)
*
* Error:
* We find the page buffer is in, and then copy from the *start* of the page
* rather than buffer's offset in that page.
* rather than buffer's offset in that page. - I think this is fixed.
*/
int sys_write(struct tcb *task, int fd, void *buf, int count)
{