diff options
author | Mingming Cao <cmm@us.ibm.com> | 2009-09-28 23:48:29 +0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-09-28 23:48:29 +0400 |
commit | 8d5d02e6b176565c77ff03604908b1453a22044d (patch) | |
tree | 0d29e4f28233f24960c7921c1c0a7608077bf713 /fs/ext4/fsync.c | |
parent | 4c0425ff68b1b87b802ffeda7b6a46ff7da7241c (diff) | |
download | linux-8d5d02e6b176565c77ff03604908b1453a22044d.tar.xz |
ext4: async direct IO for holes and fallocate support
For async direct IO that covers holes or fallocate, the end_io
callback function now queued the convertion work on workqueue but
don't flush the work rightaway as it might take too long to afford.
But when fsync is called after all the data is completed, user expects
the metadata also being updated before fsync returns.
Thus we need to flush the conversion work when fsync() is called.
This patch keep track of a listed of completed async direct io that
has a work queued on workqueue. When fsync() is called, it will go
through the list and do the conversion.
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Diffstat (limited to 'fs/ext4/fsync.c')
-rw-r--r-- | fs/ext4/fsync.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index 07475740b512..2b1531266ee2 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c @@ -44,6 +44,8 @@ * * What we do is just kick off a commit and wait on it. This will snapshot the * inode to disk. + * + * i_mutex lock is held when entering and exiting this function */ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync) @@ -56,6 +58,9 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync) trace_ext4_sync_file(file, dentry, datasync); + ret = flush_aio_dio_completed_IO(inode); + if (ret < 0) + goto out; /* * data=writeback: * The caller's filemap_fdatawrite()/wait will sync the data. |