.\" 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 "__SYNC_INODES" "9" "09 October 2005" "" ""
.SH NAME
__sync_inodes \- writes all inodes to disk
.SH SYNOPSIS
"SYNOPSIS"
.sp
\fB
.sp
void __sync_inodes (int \fIwait\fB);
\fR
.SH "ARGUMENTS"
.TP
\fB\fIwait\fB\fR
wait for completion
.SH "DESCRIPTION"
.PP
\fBsync_inodes\fR goes through each super block's dirty inode list, writes the
inodes out, waits on the writeout and puts the inodes back on the normal
list.
.PP
This is for \fBsys_sync\fR\&. \fBfsync_dev\fR uses the same algorithm. The subtle
part of the sync functions is that the blockdev ``superblock'' is processed
last. This is because the \fBwrite_inode\fR function of a typical fs will
perform no I/O, but will mark buffers in the blockdev mapping as dirty.
What we want to do is to perform all that dirtying first, and then write
back all those inode blocks via the blockdev mapping in one sweep. So the
additional (somewhat redundant) \fBsync_blockdev\fR calls here are to make
sure that really happens. Because if we call sync_inodes_sb(wait=1) with
outstanding dirty inodes, the writeback goes block-at-a-time within the
filesystem's \fBwrite_inode\fR\&. This is extremely slow.