Commit f3ed5df3 authored by Ritesh Harjani (IBM)'s avatar Ritesh Harjani (IBM) Committed by Theodore Ts'o

jbd2: drop useless return value of submit_bh

submit_bh always returns 0. This patch cleans up 2 of it's caller
in jbd2 to drop submit_bh's useless return value.
Once all submit_bh callers are cleaned up, we can make it's return
type as void.
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarRitesh Harjani (IBM) <ritesh.list@gmail.com>
Link: https://lore.kernel.org/r/e069c0539be0aec61abcdc6f6141982ec85d489d.1660788334.git.ritesh.list@gmail.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 3b575495
...@@ -122,8 +122,8 @@ static int journal_submit_commit_record(journal_t *journal, ...@@ -122,8 +122,8 @@ static int journal_submit_commit_record(journal_t *journal,
{ {
struct commit_header *tmp; struct commit_header *tmp;
struct buffer_head *bh; struct buffer_head *bh;
int ret;
struct timespec64 now; struct timespec64 now;
blk_opf_t write_flags = REQ_OP_WRITE | REQ_SYNC;
*cbh = NULL; *cbh = NULL;
...@@ -155,13 +155,11 @@ static int journal_submit_commit_record(journal_t *journal, ...@@ -155,13 +155,11 @@ static int journal_submit_commit_record(journal_t *journal,
if (journal->j_flags & JBD2_BARRIER && if (journal->j_flags & JBD2_BARRIER &&
!jbd2_has_feature_async_commit(journal)) !jbd2_has_feature_async_commit(journal))
ret = submit_bh(REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH | write_flags |= REQ_PREFLUSH | REQ_FUA;
REQ_FUA, bh);
else
ret = submit_bh(REQ_OP_WRITE | REQ_SYNC, bh);
submit_bh(write_flags, bh);
*cbh = bh; *cbh = bh;
return ret; return 0;
} }
/* /*
......
...@@ -1606,7 +1606,7 @@ static int jbd2_write_superblock(journal_t *journal, blk_opf_t write_flags) ...@@ -1606,7 +1606,7 @@ static int jbd2_write_superblock(journal_t *journal, blk_opf_t write_flags)
{ {
struct buffer_head *bh = journal->j_sb_buffer; struct buffer_head *bh = journal->j_sb_buffer;
journal_superblock_t *sb = journal->j_superblock; journal_superblock_t *sb = journal->j_superblock;
int ret; int ret = 0;
/* Buffer got discarded which means block device got invalidated */ /* Buffer got discarded which means block device got invalidated */
if (!buffer_mapped(bh)) { if (!buffer_mapped(bh)) {
...@@ -1636,7 +1636,7 @@ static int jbd2_write_superblock(journal_t *journal, blk_opf_t write_flags) ...@@ -1636,7 +1636,7 @@ static int jbd2_write_superblock(journal_t *journal, blk_opf_t write_flags)
sb->s_checksum = jbd2_superblock_csum(journal, sb); sb->s_checksum = jbd2_superblock_csum(journal, sb);
get_bh(bh); get_bh(bh);
bh->b_end_io = end_buffer_write_sync; bh->b_end_io = end_buffer_write_sync;
ret = submit_bh(REQ_OP_WRITE | write_flags, bh); submit_bh(REQ_OP_WRITE | write_flags, bh);
wait_on_buffer(bh); wait_on_buffer(bh);
if (buffer_write_io_error(bh)) { if (buffer_write_io_error(bh)) {
clear_buffer_write_io_error(bh); clear_buffer_write_io_error(bh);
...@@ -1644,9 +1644,8 @@ static int jbd2_write_superblock(journal_t *journal, blk_opf_t write_flags) ...@@ -1644,9 +1644,8 @@ static int jbd2_write_superblock(journal_t *journal, blk_opf_t write_flags)
ret = -EIO; ret = -EIO;
} }
if (ret) { if (ret) {
printk(KERN_ERR "JBD2: Error %d detected when updating " printk(KERN_ERR "JBD2: I/O error when updating journal superblock for %s.\n",
"journal superblock for %s.\n", ret, journal->j_devname);
journal->j_devname);
if (!is_journal_aborted(journal)) if (!is_journal_aborted(journal))
jbd2_journal_abort(journal, ret); jbd2_journal_abort(journal, ret);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment