NTFS_FILE_FSYNC

Section: (9)
Updated: 09 October 2005
Index Return to Main Contents

 

NAME

ntfs_file_fsync - sync a file to disk  

SYNOPSIS

"SYNOPSIS"

int ntfs_file_fsync (struct file * filp, struct dentry * dentry, int datasync);  

ARGUMENTS

filp
file to be synced
dentry
dentry describing the file to sync
datasync
if non-zero only flush user data and not metadata
 

DESCRIPTION

Data integrity sync of a file to disk. Used for fsync, fdatasync, and msync system calls. This function is inspired by fs/buffer.c::file_fsync.

If datasync is false, write the mft record and all associated extent mft records as well as the $DATA attribute and then sync the block device.

If datasync 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 write_inode_now call).

Also, if datasync 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.  

NOTE

In the past filp could be NULL so we ignore it as we don't need it anyway.  

LOCKING

Caller must hold i_sem on the inode.  

TODO

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.


 

Index

NAME
SYNOPSIS
ARGUMENTS
DESCRIPTION
NOTE
LOCKING
TODO

This document was created by man2html, using the manual pages.
Time: 00:02:33 GMT, October 09, 2005