aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorMingming Cao <cmm@us.ibm.com>2009-09-28 15:48:29 -0400
committerTheodore Ts'o <tytso@mit.edu>2009-09-28 15:48:29 -0400
commit8d5d02e6b176565c77ff03604908b1453a22044d (patch)
tree0d29e4f28233f24960c7921c1c0a7608077bf713 /fs/ext4/ext4.h
parent4c0425ff68b1b87b802ffeda7b6a46ff7da7241c (diff)
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/ext4.h')
-rw-r--r--fs/ext4/ext4.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index ccb4dbf359c4..b491576e11c3 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -127,10 +127,11 @@ struct mpage_da_data {
127 int pages_written; 127 int pages_written;
128 int retval; 128 int retval;
129}; 129};
130 130#define DIO_AIO_UNWRITTEN 0x1
131typedef struct ext4_io_end { 131typedef struct ext4_io_end {
132 struct list_head list; /* per-file finished AIO list */
132 struct inode *inode; /* file being written to */ 133 struct inode *inode; /* file being written to */
133 unsigned int flag; /* sync IO or AIO */ 134 unsigned int flag; /* unwritten or not */
134 int error; /* I/O error code */ 135 int error; /* I/O error code */
135 ext4_lblk_t offset; /* offset in the file */ 136 ext4_lblk_t offset; /* offset in the file */
136 size_t size; /* size of the extent */ 137 size_t size; /* size of the extent */
@@ -690,6 +691,11 @@ struct ext4_inode_info {
690 __u16 i_extra_isize; 691 __u16 i_extra_isize;
691 692
692 spinlock_t i_block_reservation_lock; 693 spinlock_t i_block_reservation_lock;
694
695 /* completed async DIOs that might need unwritten extents handling */
696 struct list_head i_aio_dio_complete_list;
697 /* current io_end structure for async DIO write*/
698 ext4_io_end_t *cur_aio_dio;
693}; 699};
694 700
695/* 701/*
@@ -1419,7 +1425,7 @@ extern int ext4_block_truncate_page(handle_t *handle,
1419 struct address_space *mapping, loff_t from); 1425 struct address_space *mapping, loff_t from);
1420extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); 1426extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);
1421extern qsize_t ext4_get_reserved_space(struct inode *inode); 1427extern qsize_t ext4_get_reserved_space(struct inode *inode);
1422 1428extern int flush_aio_dio_completed_IO(struct inode *inode);
1423/* ioctl.c */ 1429/* ioctl.c */
1424extern long ext4_ioctl(struct file *, unsigned int, unsigned long); 1430extern long ext4_ioctl(struct file *, unsigned int, unsigned long);
1425extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long); 1431extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long);