diff options
author | Dmitry Monakhov <dmonakhov@openvz.org> | 2012-09-28 23:21:09 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-09-28 23:21:09 -0400 |
commit | f45ee3a1ea438af96e4fd2c0b16d195e67ef235f (patch) | |
tree | a773005b8473dc3e4a25fc91fae8c564084e3af7 /fs | |
parent | ba39ebb61401cfe0ccd58dd0cd4da88465528c0a (diff) |
ext4: ext4_inode_info diet
Generic inode has unused i_private pointer which may be used as cur_aio_dio
storage.
TODO: If cur_aio_dio will be passed as an argument to get_block_t this allow
to have concurent AIO_DIO requests.
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/ext4.h | 12 | ||||
-rw-r--r-- | fs/ext4/extents.c | 4 | ||||
-rw-r--r-- | fs/ext4/inode.c | 6 | ||||
-rw-r--r-- | fs/ext4/super.c | 1 |
4 files changed, 15 insertions, 8 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 8b6902c4d7be..3e8e185e5e22 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -912,8 +912,6 @@ struct ext4_inode_info { | |||
912 | struct list_head i_completed_io_list; | 912 | struct list_head i_completed_io_list; |
913 | spinlock_t i_completed_io_lock; | 913 | spinlock_t i_completed_io_lock; |
914 | atomic_t i_ioend_count; /* Number of outstanding io_end structs */ | 914 | atomic_t i_ioend_count; /* Number of outstanding io_end structs */ |
915 | /* current io_end structure for async DIO write*/ | ||
916 | ext4_io_end_t *cur_aio_dio; | ||
917 | atomic_t i_aiodio_unwritten; /* Nr. of inflight conversions pending */ | 915 | atomic_t i_aiodio_unwritten; /* Nr. of inflight conversions pending */ |
918 | 916 | ||
919 | spinlock_t i_block_reservation_lock; | 917 | spinlock_t i_block_reservation_lock; |
@@ -1338,6 +1336,16 @@ static inline void ext4_set_io_unwritten_flag(struct inode *inode, | |||
1338 | } | 1336 | } |
1339 | } | 1337 | } |
1340 | 1338 | ||
1339 | static inline ext4_io_end_t *ext4_inode_aio(struct inode *inode) | ||
1340 | { | ||
1341 | return inode->i_private; | ||
1342 | } | ||
1343 | |||
1344 | static inline void ext4_inode_aio_set(struct inode *inode, ext4_io_end_t *io) | ||
1345 | { | ||
1346 | inode->i_private = io; | ||
1347 | } | ||
1348 | |||
1341 | /* | 1349 | /* |
1342 | * Inode dynamic state flags | 1350 | * Inode dynamic state flags |
1343 | */ | 1351 | */ |
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 8f08c7b77179..a1f56c3e773b 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -3618,7 +3618,7 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode, | |||
3618 | { | 3618 | { |
3619 | int ret = 0; | 3619 | int ret = 0; |
3620 | int err = 0; | 3620 | int err = 0; |
3621 | ext4_io_end_t *io = EXT4_I(inode)->cur_aio_dio; | 3621 | ext4_io_end_t *io = ext4_inode_aio(inode); |
3622 | 3622 | ||
3623 | ext_debug("ext4_ext_handle_uninitialized_extents: inode %lu, logical " | 3623 | ext_debug("ext4_ext_handle_uninitialized_extents: inode %lu, logical " |
3624 | "block %llu, max_blocks %u, flags %x, allocated %u\n", | 3624 | "block %llu, max_blocks %u, flags %x, allocated %u\n", |
@@ -3876,7 +3876,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, | |||
3876 | unsigned int allocated = 0, offset = 0; | 3876 | unsigned int allocated = 0, offset = 0; |
3877 | unsigned int allocated_clusters = 0; | 3877 | unsigned int allocated_clusters = 0; |
3878 | struct ext4_allocation_request ar; | 3878 | struct ext4_allocation_request ar; |
3879 | ext4_io_end_t *io = EXT4_I(inode)->cur_aio_dio; | 3879 | ext4_io_end_t *io = ext4_inode_aio(inode); |
3880 | ext4_lblk_t cluster_offset; | 3880 | ext4_lblk_t cluster_offset; |
3881 | 3881 | ||
3882 | ext_debug("blocks %u/%u requested for inode %lu\n", | 3882 | ext_debug("blocks %u/%u requested for inode %lu\n", |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 4df5e95801b4..a99588673566 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -3056,7 +3056,7 @@ static ssize_t ext4_ext_direct_IO(int rw, struct kiocb *iocb, | |||
3056 | * hook to the iocb. | 3056 | * hook to the iocb. |
3057 | */ | 3057 | */ |
3058 | iocb->private = NULL; | 3058 | iocb->private = NULL; |
3059 | EXT4_I(inode)->cur_aio_dio = NULL; | 3059 | ext4_inode_aio_set(inode, NULL); |
3060 | if (!is_sync_kiocb(iocb)) { | 3060 | if (!is_sync_kiocb(iocb)) { |
3061 | ext4_io_end_t *io_end = | 3061 | ext4_io_end_t *io_end = |
3062 | ext4_init_io_end(inode, GFP_NOFS); | 3062 | ext4_init_io_end(inode, GFP_NOFS); |
@@ -3073,7 +3073,7 @@ static ssize_t ext4_ext_direct_IO(int rw, struct kiocb *iocb, | |||
3073 | * is a unwritten extents needs to be converted | 3073 | * is a unwritten extents needs to be converted |
3074 | * when IO is completed. | 3074 | * when IO is completed. |
3075 | */ | 3075 | */ |
3076 | EXT4_I(inode)->cur_aio_dio = iocb->private; | 3076 | ext4_inode_aio_set(inode, io_end); |
3077 | } | 3077 | } |
3078 | 3078 | ||
3079 | if (overwrite) | 3079 | if (overwrite) |
@@ -3093,7 +3093,7 @@ static ssize_t ext4_ext_direct_IO(int rw, struct kiocb *iocb, | |||
3093 | NULL, | 3093 | NULL, |
3094 | DIO_LOCKING); | 3094 | DIO_LOCKING); |
3095 | if (iocb->private) | 3095 | if (iocb->private) |
3096 | EXT4_I(inode)->cur_aio_dio = NULL; | 3096 | ext4_inode_aio_set(inode, NULL); |
3097 | /* | 3097 | /* |
3098 | * The io_end structure takes a reference to the inode, | 3098 | * The io_end structure takes a reference to the inode, |
3099 | * that structure needs to be destroyed and the | 3099 | * that structure needs to be destroyed and the |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index ae456321c5bf..e05267ab1f81 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -965,7 +965,6 @@ static struct inode *ext4_alloc_inode(struct super_block *sb) | |||
965 | ei->jinode = NULL; | 965 | ei->jinode = NULL; |
966 | INIT_LIST_HEAD(&ei->i_completed_io_list); | 966 | INIT_LIST_HEAD(&ei->i_completed_io_list); |
967 | spin_lock_init(&ei->i_completed_io_lock); | 967 | spin_lock_init(&ei->i_completed_io_lock); |
968 | ei->cur_aio_dio = NULL; | ||
969 | ei->i_sync_tid = 0; | 968 | ei->i_sync_tid = 0; |
970 | ei->i_datasync_tid = 0; | 969 | ei->i_datasync_tid = 0; |
971 | atomic_set(&ei->i_ioend_count, 0); | 970 | atomic_set(&ei->i_ioend_count, 0); |