Re: [f2fs-dev] [PATCH 2/3] f2fs: factor out discard_cmd usage from general rb_tree use

From: Eric Biggers
Date: Fri Mar 10 2023 - 17:24:29 EST


On Fri, Mar 10, 2023 at 01:04:53PM -0800, Jaegeuk Kim wrote:
> +static bool f2fs_check_discard_tree(struct f2fs_sb_info *sbi)
> +{
> +#ifdef CONFIG_F2FS_CHECK_FS
> + struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info;
> + struct rb_node *cur = rb_first_cached(&dcc->root), *next;
> + struct discard_cmd *cur_dc, *next_dc;
> +
> + if (!cur)
> + return true;
> +
> + while (cur) {

The !cur check is redundant here.

- Eric