diff options
author | Jan Kara <jack@suse.cz> | 2008-07-11 19:27:31 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-07-11 19:27:31 -0400 |
commit | 678aaf481496b01473b778685eca231d6784098b (patch) | |
tree | 298fa039e4910a0ead3cdfb814af167f378391bc /fs/ext4/super.c | |
parent | c851ed540173736e60d48b53b91a16ea5c903896 (diff) |
ext4: Use new framework for data=ordered mode in JBD2
This patch makes ext4 use inode-based implementation of data=ordered mode
in JBD2. It allows us to unify some data=ordered and data=writeback paths
(especially writepage since we don't have to start a transaction anymore)
and remove some buffer walking.
Updated fix from Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
to fix file system hang due to corrupt jinode values.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 1b330cd71ca8..629d0fa27e3a 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -573,6 +573,7 @@ static struct inode *ext4_alloc_inode(struct super_block *sb) | |||
573 | memset(&ei->i_cached_extent, 0, sizeof(struct ext4_ext_cache)); | 573 | memset(&ei->i_cached_extent, 0, sizeof(struct ext4_ext_cache)); |
574 | INIT_LIST_HEAD(&ei->i_prealloc_list); | 574 | INIT_LIST_HEAD(&ei->i_prealloc_list); |
575 | spin_lock_init(&ei->i_prealloc_lock); | 575 | spin_lock_init(&ei->i_prealloc_lock); |
576 | jbd2_journal_init_jbd_inode(&ei->jinode, &ei->vfs_inode); | ||
576 | return &ei->vfs_inode; | 577 | return &ei->vfs_inode; |
577 | } | 578 | } |
578 | 579 | ||
@@ -637,6 +638,8 @@ static void ext4_clear_inode(struct inode *inode) | |||
637 | EXT4_I(inode)->i_block_alloc_info = NULL; | 638 | EXT4_I(inode)->i_block_alloc_info = NULL; |
638 | if (unlikely(rsv)) | 639 | if (unlikely(rsv)) |
639 | kfree(rsv); | 640 | kfree(rsv); |
641 | jbd2_journal_release_jbd_inode(EXT4_SB(inode->i_sb)->s_journal, | ||
642 | &EXT4_I(inode)->jinode); | ||
640 | } | 643 | } |
641 | 644 | ||
642 | static inline void ext4_show_quota_options(struct seq_file *seq, struct super_block *sb) | 645 | static inline void ext4_show_quota_options(struct seq_file *seq, struct super_block *sb) |
@@ -3378,7 +3381,7 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type, | |||
3378 | err = ext4_journal_dirty_metadata(handle, bh); | 3381 | err = ext4_journal_dirty_metadata(handle, bh); |
3379 | else { | 3382 | else { |
3380 | /* Always do at least ordered writes for quotas */ | 3383 | /* Always do at least ordered writes for quotas */ |
3381 | err = ext4_journal_dirty_data(handle, bh); | 3384 | err = ext4_jbd2_file_inode(handle, inode); |
3382 | mark_buffer_dirty(bh); | 3385 | mark_buffer_dirty(bh); |
3383 | } | 3386 | } |
3384 | brelse(bh); | 3387 | brelse(bh); |