diff options
author | Bobi Jam <bobijam@whamcloud.com> | 2012-02-20 17:53:02 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-02-20 17:53:02 -0500 |
commit | 18aadd47f88464928b5ce57791c2e8f9f2aaece0 (patch) | |
tree | bb4f32855484a6dd6081c33fae1564359a88af74 /fs/ext4/super.c | |
parent | 15291164b22a357cb211b618adfef4fa82fc0de3 (diff) | |
download | blackbird-op-linux-18aadd47f88464928b5ce57791c2e8f9f2aaece0.tar.gz blackbird-op-linux-18aadd47f88464928b5ce57791c2e8f9f2aaece0.zip |
ext4: expand commit callback and
The per-commit callback was used by mballoc code to manage free space
bitmaps after deleted blocks have been released. This patch expands
it to support multiple different callbacks, to allow other things to
be done after the commit has been completed.
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 502c61fd7392..3e697ec7feca 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -431,6 +431,22 @@ static int block_device_ejected(struct super_block *sb) return bdi->dev == NULL; } +static void ext4_journal_commit_callback(journal_t *journal, transaction_t *txn) +{ + struct super_block *sb = journal->j_private; + struct ext4_sb_info *sbi = EXT4_SB(sb); + int error = is_journal_aborted(journal); + struct ext4_journal_cb_entry *jce, *tmp; + + spin_lock(&sbi->s_md_lock); + list_for_each_entry_safe(jce, tmp, &txn->t_private_list, jce_list) { + list_del_init(&jce->jce_list); + spin_unlock(&sbi->s_md_lock); + jce->jce_func(sb, jce, error); + spin_lock(&sbi->s_md_lock); + } + spin_unlock(&sbi->s_md_lock); +} /* Deal with the reporting of failure conditions on a filesystem such as * inconsistencies detected or read IO failures. @@ -3694,6 +3710,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) } set_task_ioprio(sbi->s_journal->j_task, journal_ioprio); + sbi->s_journal->j_commit_callback = ext4_journal_commit_callback; + /* * The journal may have updated the bg summary counts, so we * need to update the global counters. |