diff options
author | Jan Kara <jack@suse.cz> | 2016-04-24 00:56:07 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-04-24 00:56:07 -0400 |
commit | 41617e1a8dec9fe082ba5dec26bacb154eb55482 (patch) | |
tree | cad9847e725526c8af355f116ec5cf317dc2d24c /fs/ext4/ext4_jbd2.h | |
parent | 3957ef53a5033bd519b19cf375061be1929bdb5f (diff) | |
download | linux-41617e1a8dec9fe082ba5dec26bacb154eb55482.tar.bz2 |
jbd2: add support for avoiding data writes during transaction commits
Currently when filesystem needs to make sure data is on permanent
storage before committing a transaction it adds inode to transaction's
inode list. During transaction commit, jbd2 writes back all dirty
buffers that have allocated underlying blocks and waits for the IO to
finish. However when doing writeback for delayed allocated data, we
allocate blocks and immediately submit the data. Thus asking jbd2 to
write dirty pages just unnecessarily adds more work to jbd2 possibly
writing back other redirtied blocks.
Add support to jbd2 to allow filesystem to ask jbd2 to only wait for
outstanding data writes before committing a transaction and thus avoid
unnecessary writes.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4_jbd2.h')
-rw-r--r-- | fs/ext4/ext4_jbd2.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h index 5f5846211095..f1c940b38b30 100644 --- a/fs/ext4/ext4_jbd2.h +++ b/fs/ext4/ext4_jbd2.h @@ -362,7 +362,8 @@ static inline int ext4_journal_force_commit(journal_t *journal) static inline int ext4_jbd2_file_inode(handle_t *handle, struct inode *inode) { if (ext4_handle_valid(handle)) - return jbd2_journal_file_inode(handle, EXT4_I(inode)->jinode); + return jbd2_journal_inode_add_write(handle, + EXT4_I(inode)->jinode); return 0; } |