aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2015-06-03 19:18:18 -0400
committerDave Chinner <david@fromorbit.com>2015-06-03 19:18:18 -0400
commite842f2903908934187af7232fb5b21da527d1757 (patch)
tree5fe6e2da05d58519d0f9360cf5116662a766906a /include/linux/fs.h
parentec56b1f1fdc69599963574ce94cc5693d535dd64 (diff)
dax: don't abuse get_block mapping for endio callbacks
dax_fault() currently relies on the get_block callback to attach an io completion callback to the mapping buffer head so that it can run unwritten extent conversion after zeroing allocated blocks. Instead of this hack, pass the conversion callback directly into dax_fault() similar to the get_block callback. When the filesystem allocates unwritten extents, it will set the buffer_unwritten() flag, and hence the dax_fault code can call the completion function in the contexts where it is necessary without overloading the mapping buffer head. Note: The changes to ext4 to use this interface are suspect at best. In fact, the way ext4 did this end_io assignment in the first place looks suspect because it only set a completion callback when there wasn't already some other write() call taking place on the same inode. The ext4 end_io code looks rather intricate and fragile with all it's reference counting and passing to different contexts for modification via inode private pointers that aren't protected by locks... Signed-off-by: Dave Chinner <dchinner@redhat.com> Acked-by: Jan Kara <jack@suse.cz> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 35ec87e490b1..c9b4cca9e08d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -70,6 +70,7 @@ typedef int (get_block_t)(struct inode *inode, sector_t iblock,
70 struct buffer_head *bh_result, int create); 70 struct buffer_head *bh_result, int create);
71typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, 71typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
72 ssize_t bytes, void *private); 72 ssize_t bytes, void *private);
73typedef void (dax_iodone_t)(struct buffer_head *bh_map, int uptodate);
73 74
74#define MAY_EXEC 0x00000001 75#define MAY_EXEC 0x00000001
75#define MAY_WRITE 0x00000002 76#define MAY_WRITE 0x00000002
@@ -2627,9 +2628,10 @@ ssize_t dax_do_io(struct kiocb *, struct inode *, struct iov_iter *, loff_t,
2627int dax_clear_blocks(struct inode *, sector_t block, long size); 2628int dax_clear_blocks(struct inode *, sector_t block, long size);
2628int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t); 2629int dax_zero_page_range(struct inode *, loff_t from, unsigned len, get_block_t);
2629int dax_truncate_page(struct inode *, loff_t from, get_block_t); 2630int dax_truncate_page(struct inode *, loff_t from, get_block_t);
2630int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t); 2631int dax_fault(struct vm_area_struct *, struct vm_fault *, get_block_t,
2632 dax_iodone_t);
2631int dax_pfn_mkwrite(struct vm_area_struct *, struct vm_fault *); 2633int dax_pfn_mkwrite(struct vm_area_struct *, struct vm_fault *);
2632#define dax_mkwrite(vma, vmf, gb) dax_fault(vma, vmf, gb) 2634#define dax_mkwrite(vma, vmf, gb, iod) dax_fault(vma, vmf, gb, iod)
2633 2635
2634#ifdef CONFIG_BLOCK 2636#ifdef CONFIG_BLOCK
2635typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode, 2637typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode,