diff options
author | Jan Kara <jack@suse.cz> | 2013-06-04 14:23:41 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-06-04 14:23:41 -0400 |
commit | b0857d309faefaf5443752458e8af1a4b22b3e92 (patch) | |
tree | b6b18b3d41831a205a5f90609abb567fd756e07c /fs/ext4/ext4.h | |
parent | 2e8fa54e3b48e4ce8c4e9ca4674ffbc973f58be5 (diff) | |
download | lwn-b0857d309faefaf5443752458e8af1a4b22b3e92.tar.gz lwn-b0857d309faefaf5443752458e8af1a4b22b3e92.zip |
ext4: defer clearing of PageWriteback after extent conversion
Currently PageWriteback bit gets cleared from put_io_page() called
from ext4_end_bio(). This is somewhat inconvenient as extent tree is
not fully updated at that time (unwritten extents are not marked as
written) so we cannot read the data back yet. This design was
dictated by lock ordering as we cannot start a transaction while
PageWriteback bit is set (we could easily deadlock with
ext4_da_writepages()). But now that we use transaction reservation
for extent conversion, locking issues are solved and we can move
PageWriteback bit clearing after extent conversion is done. As a
result we can remove wait for unwritten extent conversion from
ext4_sync_file() because it already implicitely happens through
wait_on_page_writeback().
We implement deferring of PageWriteback clearing by queueing completed
bios to appropriate io_end and processing all the pages when io_end is
going to be freed instead of at the moment ext4_io_end() is called.
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index b69a733b5b42..74db579bb482 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -180,8 +180,7 @@ struct ext4_map_blocks { * Flags for ext4_io_end->flags */ #define EXT4_IO_END_UNWRITTEN 0x0001 -#define EXT4_IO_END_ERROR 0x0002 -#define EXT4_IO_END_DIRECT 0x0004 +#define EXT4_IO_END_DIRECT 0x0002 /* * For converting uninitialized extents on a work queue. 'handle' is used for @@ -192,6 +191,8 @@ typedef struct ext4_io_end { handle_t *handle; /* handle reserved for extent * conversion */ struct inode *inode; /* file being written to */ + struct bio *bio; /* Linked list of completed + * bios covering the extent */ unsigned int flag; /* unwritten or not */ loff_t offset; /* offset in the file */ ssize_t size; /* size of the extent */ |