diff options
Diffstat (limited to 'fs/jbd2/journal.c')
-rw-r--r-- | fs/jbd2/journal.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index c5ff177400ff..bda564f63864 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
@@ -821,6 +821,19 @@ void __jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block) | |||
821 | write_unlock(&journal->j_state_lock); | 821 | write_unlock(&journal->j_state_lock); |
822 | } | 822 | } |
823 | 823 | ||
824 | /* | ||
825 | * This is a variaon of __jbd2_update_log_tail which checks for validity of | ||
826 | * provided log tail and locks j_checkpoint_mutex. So it is safe against races | ||
827 | * with other threads updating log tail. | ||
828 | */ | ||
829 | void jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block) | ||
830 | { | ||
831 | mutex_lock(&journal->j_checkpoint_mutex); | ||
832 | if (tid_gt(tid, journal->j_tail_sequence)) | ||
833 | __jbd2_update_log_tail(journal, tid, block); | ||
834 | mutex_unlock(&journal->j_checkpoint_mutex); | ||
835 | } | ||
836 | |||
824 | struct jbd2_stats_proc_session { | 837 | struct jbd2_stats_proc_session { |
825 | journal_t *journal; | 838 | journal_t *journal; |
826 | struct transaction_stats_s *stats; | 839 | struct transaction_stats_s *stats; |