jbd: Split updating of journal superblock and marking journal empty

There are three case of updating journal superblock. In the first case, we want
to mark journal as empty (setting s_sequence to 0), in the second case we want
to update log tail, in the third case we want to update s_errno. Split these
cases into separate functions. It makes the code slightly more straightforward
and later patches will make the distinction even more important.

Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
Jan Kara
2012-04-07 12:33:03 +02:00
parent f72cf5e223
commit 9754e39c7b
5 changed files with 104 additions and 78 deletions
+4 -8
View File
@@ -169,24 +169,20 @@ TRACE_EVENT(jbd_cleanup_journal_tail,
__entry->block_nr, __entry->freed)
);
TRACE_EVENT(jbd_update_superblock_end,
TP_PROTO(journal_t *journal, int wait),
TRACE_EVENT(journal_write_superblock,
TP_PROTO(journal_t *journal),
TP_ARGS(journal, wait),
TP_ARGS(journal),
TP_STRUCT__entry(
__field( dev_t, dev )
__field( int, wait )
),
TP_fast_assign(
__entry->dev = journal->j_fs_dev->bd_dev;
__entry->wait = wait;
),
TP_printk("dev %d,%d wait %d",
MAJOR(__entry->dev), MINOR(__entry->dev),
__entry->wait)
TP_printk("dev %d,%d", MAJOR(__entry->dev), MINOR(__entry->dev))
);
#endif /* _TRACE_JBD_H */