-
Andrew Morton authored
From: Nathan Scott <nathans@sgi.com> This patch adds a mechanism by which a filesystem can register an interest in the completion of direct I/O. The completion routine will be given the inode, an offset and a length, and an optional filesystem-private field. We have extended the use of the buffer_head-based interface (i.e. get_block_t) for direct I/O such that the b_private field is now utilised. It is defined to be initially zero at the start of I/O, and will be passed into the filesystem unmodified by the VFS with each map request, while setting up the direct I/O. Once I/O has completed the final value of this pointer will be passed into a filesystems I/O completion handler. This mechanism can be used to keep track of all of the mapping requests which encompass an individual direct I/O request. This has been implemented specifically for XFS, but is done so as to be as generic as possible. XFS uses this mechanism to provide support for unwritten extents - these are file extents which have been pre-allocated on-disk, but not yet written to (once written, these become regular file extents, but only once I/O is complete).
359a5de1