After we mmap a file, we can write back the dirty pages of the file either
by calling msync() or fsync(). After reading the source code, it seems to
me that they actually does the same thing.  msync() will eventually call
VOP_FSYNC() as fsync() does. Since msync() has already call the routine
vm_object_page_clean() to write back the dirty pages of the file,
VOP_FSYNC() really does not have much left to do except update the inode. 

So is there any real differnce between msync() and fsync() on mmapped
files? Or are they simply provided to do the same thing in an alternate
way?

Thanks for any help.

--------------------------------------------------
Zhihui Zhang.  Please visit http://www.freebsd.org
--------------------------------------------------



To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to