.\" 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_COMMIT_WRITE" "" "06 October 2005" "" ""
.SH NAME
ntfs_commit_write \- commit the received data
.SH SYNOPSIS
"SYNOPSIS"
.sp
\fB
.sp
int ntfs_commit_write (struct file * \fIfile\fB, struct page * \fIpage\fB, unsigned \fIfrom\fB, unsigned \fIto\fB);
\fR
.SH "ARGUMENTS"
.TP
\fB\fIfile\fB\fR
-- undescribed --
.TP
\fB\fIpage\fB\fR
-- undescribed --
.TP
\fB\fIfrom\fB\fR
-- undescribed --
.TP
\fB\fIto\fB\fR
-- undescribed --
.SH "DESCRIPTION"
.PP
.PP
This is called from \fBgeneric_file_write\fR with i_sem held on the inode
(\fIpage\fR->mapping->host). The \fIpage\fR is locked and \fBkmap\fRped so \fBpage_address\fR
can simply be used. The source data has already been copied into the \fIpage\fR\&.
.PP
Need to mark modified blocks dirty so they get written out later when
\fBntfs_writepage\fR is invoked by the VM.
.PP
Return 0 on success or -errno on error.
.PP
Should be using \fBgeneric_commit_write\fR\&. This marks buffers uptodate and
dirty, sets the page uptodate if all buffers in the page are uptodate, and
updates i_size if the end of io is beyond i_size. In that case, it also
marks the inode dirty. - We could still use this (obviously except for
\fBNInoMstProtected\fR attributes, where we will need to duplicate the core code
because we need our own async_io completion handler) but we could just do
the i_size update in prepare write, when we resize the attribute. Then
we would avoid the i_size update and \fBmark_inode_dirty\fR happening here.
.PP
Can't use \fBgeneric_commit_write\fR due to ntfs specialities but can look at
it for implementation guidance.
.PP
If things have gone as outlined in \fBntfs_prepare_write\fR, then we do not
need to do any page content modifications here at all, except in the write
to resident attribute case, where we need to do the uptodate bringing here
which we combine with the copying into the mft record which means we only
need to map the mft record and find the attribute record in it only once.