Re: [PATCH 04/15] btrfs: combine device update operations during transaction commit

Johannes Thumshirn
2019-02-04T13:25:29Z

On 30/01/2019 15:50, Nikolay Borisov wrote:
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 888d72dda794..25dab68070dc 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -4498,6 +4498,15 @@ void btrfs_cleanup_one_transaction(struct btrfs_transaction *cur_trans,
> ASSERT(list_empty(&cur_trans->dirty_bgs));
> ASSERT(list_empty(&cur_trans->io_bgs));
>
> + while (!list_empty(&cur_trans->dev_update_list)) {
> + struct btrfs_device *dev;
> +
> + dev = list_first_entry(&cur_trans->dev_update_list,
> + struct btrfs_device,
> + post_commit_list);
> + list_del_init(&dev->post_commit_list);
> + }
> +

Why not?

list_for_each_entry_safe(dev, next, &cur_trans->dev_update_list,
post_commit_list)
list_del_init(&dev->post_commit_list);

--
Johannes Thumshirn SUSE Labs Filesystems
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850