OSDN Git Service

fs/jbd2: Fix the documentation of the jbd2_write_superblock() callers
authorBart Van Assche <bvanassche@acm.org>
Thu, 14 Jul 2022 18:07:22 +0000 (11:07 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 14 Jul 2022 18:14:32 +0000 (12:14 -0600)
Commit 2a222ca992c3 ("fs: have submit_bh users pass in op and flags
separately") renamed the jbd2_write_superblock() 'write_op' argument into
'write_flags'. Propagate this change to the jbd2_write_superblock()
callers. Additionally, change the type of 'write_flags' into blk_opf_t.

Cc: Mike Christie <michael.christie@oracle.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20220714180729.1065367-57-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/jbd2/journal.c
include/linux/jbd2.h
include/trace/events/jbd2.h

index 07e6aaf..2a1b9da 100644 (file)
@@ -1604,7 +1604,7 @@ static int journal_reset(journal_t *journal)
  * This function expects that the caller will have locked the journal
  * buffer head, and will return with it unlocked
  */
-static int jbd2_write_superblock(journal_t *journal, int write_flags)
+static int jbd2_write_superblock(journal_t *journal, blk_opf_t write_flags)
 {
        struct buffer_head *bh = journal->j_sb_buffer;
        journal_superblock_t *sb = journal->j_superblock;
@@ -1661,13 +1661,14 @@ static int jbd2_write_superblock(journal_t *journal, int write_flags)
  * @journal: The journal to update.
  * @tail_tid: TID of the new transaction at the tail of the log
  * @tail_block: The first block of the transaction at the tail of the log
- * @write_op: With which operation should we write the journal sb
+ * @write_flags: Flags for the journal sb write operation
  *
  * Update a journal's superblock information about log tail and write it to
  * disk, waiting for the IO to complete.
  */
 int jbd2_journal_update_sb_log_tail(journal_t *journal, tid_t tail_tid,
-                                    unsigned long tail_block, int write_op)
+                                   unsigned long tail_block,
+                                   blk_opf_t write_flags)
 {
        journal_superblock_t *sb = journal->j_superblock;
        int ret;
@@ -1687,7 +1688,7 @@ int jbd2_journal_update_sb_log_tail(journal_t *journal, tid_t tail_tid,
        sb->s_sequence = cpu_to_be32(tail_tid);
        sb->s_start    = cpu_to_be32(tail_block);
 
-       ret = jbd2_write_superblock(journal, write_op);
+       ret = jbd2_write_superblock(journal, write_flags);
        if (ret)
                goto out;
 
@@ -1704,12 +1705,12 @@ out:
 /**
  * jbd2_mark_journal_empty() - Mark on disk journal as empty.
  * @journal: The journal to update.
- * @write_op: With which operation should we write the journal sb
+ * @write_flags: Flags for the journal sb write operation
  *
  * Update a journal's dynamic superblock fields to show that journal is empty.
  * Write updated superblock to disk waiting for IO to complete.
  */
-static void jbd2_mark_journal_empty(journal_t *journal, int write_op)
+static void jbd2_mark_journal_empty(journal_t *journal, blk_opf_t write_flags)
 {
        journal_superblock_t *sb = journal->j_superblock;
        bool had_fast_commit = false;
@@ -1735,7 +1736,7 @@ static void jbd2_mark_journal_empty(journal_t *journal, int write_op)
                had_fast_commit = true;
        }
 
-       jbd2_write_superblock(journal, write_op);
+       jbd2_write_superblock(journal, write_flags);
 
        if (had_fast_commit)
                jbd2_set_feature_fast_commit(journal);
index e79d6e0..dc17241 100644 (file)
@@ -1557,7 +1557,7 @@ extern int           jbd2_journal_wipe       (journal_t *, int);
 extern int        jbd2_journal_skip_recovery   (journal_t *);
 extern void       jbd2_journal_update_sb_errno(journal_t *);
 extern int        jbd2_journal_update_sb_log_tail      (journal_t *, tid_t,
-                               unsigned long, int);
+                               unsigned long, blk_opf_t);
 extern void       jbd2_journal_abort      (journal_t *, int);
 extern int        jbd2_journal_errno      (journal_t *);
 extern void       jbd2_journal_ack_err    (journal_t *);
index a4dfe00..99f783c 100644 (file)
@@ -355,22 +355,22 @@ TRACE_EVENT(jbd2_update_log_tail,
 
 TRACE_EVENT(jbd2_write_superblock,
 
-       TP_PROTO(journal_t *journal, int write_op),
+       TP_PROTO(journal_t *journal, blk_opf_t write_flags),
 
-       TP_ARGS(journal, write_op),
+       TP_ARGS(journal, write_flags),
 
        TP_STRUCT__entry(
                __field(        dev_t,  dev                     )
-               __field(          int,  write_op                )
+               __field(    blk_opf_t,  write_flags             )
        ),
 
        TP_fast_assign(
                __entry->dev            = journal->j_fs_dev->bd_dev;
-               __entry->write_op       = write_op;
+               __entry->write_flags    = write_flags;
        ),
 
-       TP_printk("dev %d,%d write_op %x", MAJOR(__entry->dev),
-                 MINOR(__entry->dev), __entry->write_op)
+       TP_printk("dev %d,%d write_flags %x", MAJOR(__entry->dev),
+                 MINOR(__entry->dev), (__force u32)__entry->write_flags)
 );
 
 TRACE_EVENT(jbd2_lock_buffer_stall,