diff options
| author | gkostka <kostka.grzegorz@gmail.com> | 2017-01-19 01:04:49 +0100 |
|---|---|---|
| committer | gkostka <kostka.grzegorz@gmail.com> | 2017-01-19 01:04:49 +0100 |
| commit | ca673ab65bf77f2c71283583286992ffcddc52e6 (patch) | |
| tree | 55b4b14e1941eadb3c62b161287a2376a59a0fb7 /src | |
| parent | c1185991fa175c25b4ba47160784e64bc5deb4ce (diff) | |
ext4_journal: improve jbd_journal_alloc_block performance
Purge only one journal transaction if we are run out of journal
device space.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ext4_journal.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ext4_journal.c b/src/ext4_journal.c index 98e3573..e683e10 100644 --- a/src/ext4_journal.c +++ b/src/ext4_journal.c @@ -1459,10 +1459,12 @@ static uint32_t jbd_journal_alloc_block(struct jbd_journal *journal, trans->alloc_blocks++; wrap(&journal->jbd_fs->sb, journal->last); - /* If there is no space left, flush all journalled - * blocks to disk first.*/ - if (journal->last == journal->start) - jbd_journal_purge_cp_trans(journal, true, false); + /* If there is no space left, flush just one journalled + * transaction.*/ + if (journal->last == journal->start) { + jbd_journal_purge_cp_trans(journal, true, true); + ext4_assert(journal->last != journal->start); + } return start_block; } |
