.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "NTFS_FILE_FSYNC" "9" "09 October 2005" "" "" .SH NAME ntfs_file_fsync \- sync a file to disk .SH SYNOPSIS "SYNOPSIS" .sp \fB .sp int ntfs_file_fsync (struct file * \fIfilp\fB, struct dentry * \fIdentry\fB, int \fIdatasync\fB); \fR .SH "ARGUMENTS" .TP \fB\fIfilp\fB\fR file to be synced .TP \fB\fIdentry\fB\fR dentry describing the file to sync .TP \fB\fIdatasync\fB\fR if non-zero only flush user data and not metadata .SH "DESCRIPTION" .PP Data integrity sync of a file to disk. Used for fsync, fdatasync, and msync system calls. This function is inspired by fs/buffer.c::\fBfile_fsync\fR\&. .PP If \fIdatasync\fR is false, write the mft record and all associated extent mft records as well as the \fB$DATA\fR attribute and then sync the block device. .PP If \fIdatasync\fR is true and the attribute is non-resident, we skip the writing of the mft record and all associated extent mft records (this might still happen due to the \fBwrite_inode_now\fR call). .PP Also, if \fIdatasync\fR is true, we do not wait on the inode to be written out but we always wait on the page cache pages to be written out. .SH "NOTE" .PP In the past \fIfilp\fR could be NULL so we ignore it as we don't need it anyway. .SH "LOCKING" .PP Caller must hold i_sem on the inode. .SH "TODO" .PP We should probably also write all attribute/index inodes associated with this inode but since we have no simple way of getting to them we ignore this problem for now.