Added VM_DIRTY flag for file-backed objects and their pages.

Now file flushing in both munmap() and fsync() caters for VM_DIRTY.
Also write_cache_pages() and write faults set this bit on pages and their objects.
This commit is contained in:
Bahadir Balban
2008-10-30 11:09:15 +02:00
parent 13b1b405a5
commit a2d2574eac
4 changed files with 20 additions and 4 deletions

View File

@@ -338,6 +338,13 @@ int write_file_pages(struct vm_file *f, unsigned long pfn_start,
{
int err;
/* We have only thought of vfs files for this */
BUG_ON(f->type != VM_FILE_VFS);
/* Need not flush files that haven't been written */
if (!(f->vm_obj.flags & VM_DIRTY))
return 0;
BUG_ON(pfn_end != __pfn(page_align_up(f->length)));
for (int f_offset = pfn_start; f_offset < pfn_end; f_offset++) {
err = f->vm_obj.pager->ops.page_out(&f->vm_obj, f_offset);