summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_aops.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-04-06 08:34:30 +1000
committerDave Chinner <david@fromorbit.com>2016-04-06 08:34:30 +1000
commit0e51a8e191dbd9b9c7b7bb0a1c28d57cd2be8e6a (patch)
tree15c9f6f5bcdcbda2978889057780ec3d6b4c9cbe /fs/xfs/xfs_aops.h
parent37992c18bba3f578860c6448b7bae18a14e535d3 (diff)
downloadlinux-0e51a8e191dbd9b9c7b7bb0a1c28d57cd2be8e6a.tar.gz
linux-0e51a8e191dbd9b9c7b7bb0a1c28d57cd2be8e6a.tar.bz2
linux-0e51a8e191dbd9b9c7b7bb0a1c28d57cd2be8e6a.zip
xfs: optimize bio handling in the buffer writeback path
This patch implements two closely related changes: First it embeds a bio the ioend structure so that we don't have to allocate one separately. Second it uses the block layer bio chaining mechanism to chain additional bios off this first one if needed instead of manually accounting for multiple bio completions in the ioend structure. Together this removes a memory allocation per ioend and greatly simplifies the ioend setup and I/O completion path. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_aops.h')
-rw-r--r--fs/xfs/xfs_aops.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/xfs/xfs_aops.h b/fs/xfs/xfs_aops.h
index 61a3dc3dbdf8..814aab790713 100644
--- a/fs/xfs/xfs_aops.h
+++ b/fs/xfs/xfs_aops.h
@@ -18,7 +18,7 @@
#ifndef __XFS_AOPS_H__
#define __XFS_AOPS_H__
-extern mempool_t *xfs_ioend_pool;
+extern struct bio_set *xfs_ioend_bioset;
/*
* Types of I/O for bmap clustering and I/O completion tracking.
@@ -37,24 +37,19 @@ enum {
{ XFS_IO_OVERWRITE, "overwrite" }
/*
- * xfs_ioend struct manages large extent writes for XFS.
- * It can manage several multi-page bio's at once.
+ * Structure for buffered I/O completions.
*/
-typedef struct xfs_ioend {
+struct xfs_ioend {
struct list_head io_list; /* next ioend in chain */
unsigned int io_type; /* delalloc / unwritten */
- int io_error; /* I/O error code */
- atomic_t io_remaining; /* hold count */
struct inode *io_inode; /* file being written to */
size_t io_size; /* size of the extent */
xfs_off_t io_offset; /* offset in the file */
struct work_struct io_work; /* xfsdatad work queue */
struct xfs_trans *io_append_trans;/* xact. for size update */
struct bio *io_bio; /* bio being built */
- struct bio *io_bio_done; /* bios completed */
- struct bio *io_bio_done_tail; /* bios completed */
- spinlock_t io_lock; /* for bio completion list */
-} xfs_ioend_t;
+ struct bio io_inline_bio; /* MUST BE LAST! */
+};
extern const struct address_space_operations xfs_address_space_operations;