Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mappedfiles

From: Linus Torvalds
Date: Fri Jan 18 2008 - 13:45:37 EST




On Fri, 18 Jan 2008, Miklos Szeredi wrote:
>
> That would need a new page flag (PG_mmap_dirty?). Do we have one
> available?

Yeah, that would be bad. We probably have flags free, but those page flags
are always a pain. Scratch that.

How about just setting a per-vma dirty flag, and then instead of updating
the mtime when taking the dirty-page fault, we just set that flag?

Then, on unmap and msync, we just do

if (vma->dirty-flag) {
vma->dirty_flag = 0;
update_file_times(vma->vm_file);
}

and be done with it?


Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/