diff options
author | Mingming Cao <cmm@us.ibm.com> | 2009-09-28 15:48:41 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-09-28 15:48:41 -0400 |
commit | 4c0425ff68b1b87b802ffeda7b6a46ff7da7241c (patch) | |
tree | a8718f5f4574af8e15fd876b24f4aec88d62451b /fs/btrfs/delayed-ref.h | |
parent | 0031462b5b392f90d17f1d75abb795883c44e969 (diff) |
ext4: Use end_io callback to avoid direct I/O fallback to buffered I/O
Currently the DIO VFS code passes create = 0 when writing to the
middle of file. It does this to avoid block allocation for holes, so
as not to expose stale data out when there is a parallel buffered read
(which does not hold the i_mutex lock). Direct I/O writes into holes
falls back to buffered IO for this reason.
Since preallocated extents are treated as holes when doing a
get_block() look up (buffer is not mapped), direct IO over fallocate
also falls back to buffered IO. Thus ext4 actually silently falls
back to buffered IO in above two cases, which is undesirable.
To fix this, this patch creates unitialized extents when a direct I/O
write into holes in sparse files, and registering an end_io callback which
converts the uninitialized extent to an initialized extent after the
I/O is completed.
Singed-Off-By: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/btrfs/delayed-ref.h')
0 files changed, 0 insertions, 0 deletions