[lustre-devel] [PATCH 02/22] Revert "staging: lustre: o2iblnd: Use list_for_each_entry_safe in kiblnd_destroy_fmr_pool_list"

James Simmons jsimmons at infradead.org
Wed Aug 1 19:53:31 PDT 2018


> This reverts commit 0d33ec5f95fe068d7e96b6e7ed9216de93f6b5b0.
> 
> These loops really want to remove everything, and using a
>   while(!list_empty())
> loop makes this more obvious.
>

Reviewed-by: James Simmons <jsimmons at infradead.org>
 
> Signed-off-by: NeilBrown <neilb at suse.com>
> ---
>  .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c    |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
> index 05835cc0f0a5..124870ada28b 100644
> --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
> +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
> @@ -1306,9 +1306,10 @@ static void kiblnd_destroy_fmr_pool(struct kib_fmr_pool *fpo)
>  
>  static void kiblnd_destroy_fmr_pool_list(struct list_head *head)
>  {
> -	struct kib_fmr_pool *fpo, *tmp;
> +	struct kib_fmr_pool *fpo;
>  
> -	list_for_each_entry_safe(fpo, tmp, head, fpo_list) {
> +	while (!list_empty(head)) {
> +		fpo = list_entry(head->next, struct kib_fmr_pool, fpo_list);
>  		list_del(&fpo->fpo_list);
>  		kiblnd_destroy_fmr_pool(fpo);
>  	}
> 
> 
> 


More information about the lustre-devel mailing list