[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240104121150.cxrykpptpgnwkqge@quack3>
Date: Thu, 4 Jan 2024 13:11:50 +0100
From: Jan Kara <jack@...e.cz>
To: Yu Kuai <yukuai1@...weicloud.com>
Cc: axboe@...nel.dk, roger.pau@...rix.com, colyli@...e.de,
kent.overstreet@...il.com, joern@...ybastard.org,
miquel.raynal@...tlin.com, richard@....at, vigneshr@...com,
sth@...ux.ibm.com, hoeppner@...ux.ibm.com, hca@...ux.ibm.com,
gor@...ux.ibm.com, agordeev@...ux.ibm.com, jejb@...ux.ibm.com,
martin.petersen@...cle.com, clm@...com, josef@...icpanda.com,
dsterba@...e.com, viro@...iv.linux.org.uk, brauner@...nel.org,
nico@...xnic.net, xiang@...nel.org, chao@...nel.org, tytso@....edu,
adilger.kernel@...ger.ca, jack@...e.com, konishi.ryusuke@...il.com,
willy@...radead.org, akpm@...ux-foundation.org, hare@...e.de,
p.raghav@...sung.com, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, xen-devel@...ts.xenproject.org,
linux-bcache@...r.kernel.org, linux-mtd@...ts.infradead.org,
linux-s390@...r.kernel.org, linux-scsi@...r.kernel.org,
linux-bcachefs@...r.kernel.org, linux-btrfs@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-erofs@...ts.ozlabs.org,
linux-ext4@...r.kernel.org, linux-nilfs@...r.kernel.org,
yukuai3@...wei.com, yi.zhang@...wei.com, yangerkun@...wei.com
Subject: Re: [PATCH RFC v3 for-6.8/block 13/17] jbd2: use bdev apis
On Thu 21-12-23 16:58:46, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@...wei.com>
>
> Avoid to access bd_inode directly, prepare to remove bd_inode from
> block_device.
>
> Signed-off-by: Yu Kuai <yukuai3@...wei.com>
Looks good to me. Feel free to add:
Reviewed-by: Jan Kara <jack@...e.cz>
But note there are changes pending to this code for the coming merge window
so you'll have to rebase...
Honza
> ---
> fs/jbd2/journal.c | 3 +--
> fs/jbd2/recovery.c | 6 ++----
> 2 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
> index ed53188472f9..f1b5ffeaf02a 100644
> --- a/fs/jbd2/journal.c
> +++ b/fs/jbd2/journal.c
> @@ -2003,8 +2003,7 @@ static int __jbd2_journal_erase(journal_t *journal, unsigned int flags)
> byte_count = (block_stop - block_start + 1) *
> journal->j_blocksize;
>
> - truncate_inode_pages_range(journal->j_dev->bd_inode->i_mapping,
> - byte_start, byte_stop);
> + truncate_bdev_range(journal->j_dev, 0, byte_start, byte_stop);
>
> if (flags & JBD2_JOURNAL_FLUSH_DISCARD) {
> err = blkdev_issue_discard(journal->j_dev,
> diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
> index 01f744cb97a4..6b6a2c4585fa 100644
> --- a/fs/jbd2/recovery.c
> +++ b/fs/jbd2/recovery.c
> @@ -290,7 +290,6 @@ int jbd2_journal_recover(journal_t *journal)
>
> struct recovery_info info;
> errseq_t wb_err;
> - struct address_space *mapping;
>
> memset(&info, 0, sizeof(info));
> sb = journal->j_superblock;
> @@ -309,8 +308,7 @@ int jbd2_journal_recover(journal_t *journal)
> }
>
> wb_err = 0;
> - mapping = journal->j_fs_dev->bd_inode->i_mapping;
> - errseq_check_and_advance(&mapping->wb_err, &wb_err);
> + bdev_wb_err_check_and_advance(journal->j_fs_dev, &wb_err);
> err = do_one_pass(journal, &info, PASS_SCAN);
> if (!err)
> err = do_one_pass(journal, &info, PASS_REVOKE);
> @@ -334,7 +332,7 @@ int jbd2_journal_recover(journal_t *journal)
> err2 = sync_blockdev(journal->j_fs_dev);
> if (!err)
> err = err2;
> - err2 = errseq_check_and_advance(&mapping->wb_err, &wb_err);
> + err2 = bdev_wb_err_check_and_advance(journal->j_fs_dev, &wb_err);
> if (!err)
> err = err2;
> /* Make sure all replayed data is on permanent storage */
> --
> 2.39.2
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists