Re: [PATCH 9/9] xfs_mdrestore: fix missed progress reporting

Christoph Hellwig
2023-11-23T06:44:34Z

> + if (mdrestore.show_progress) {
> + int64_t mb_now = bytes_read >> 20;
> +
> + if (mb_now != mb_read) {
> + print_progress("%lld MB read", mb_now);
> + mb_read = mb_now;
> + }
> + }

> if (mdrestore.show_progress) {
> + int64_t mb_now = bytes_read >> 20;
>
> if (mb_now != mb_read) {
> + print_progress("%lld mb read", mb_now);
> mb_read = mb_now;
> }
> }

Not sure if it's worth the effort, but to my pattern matching eyes
this screams for a little helper.

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>