[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [lvm-devel] [PATCH 01/22] Add dm_list_splice() for list join.



Zdenek Kabelac <zkabelac redhat com> writes:
> --- a/libdm/datastruct/list.c
> +++ b/libdm/datastruct/list.c
> @@ -144,3 +144,15 @@ unsigned int dm_list_size(const struct dm_list *head)
>  
>  	return s;
>  }
> +
> +void dm_list_splice(struct dm_list *list, struct dm_list *head)
> +{
> +	struct dm_list *first = list->n;
> +	struct dm_list *last = list->p;
> +	struct dm_list *at = head->n;
> +
> +	first->p = head;
> +	head->n = first;
> +	last->n = at;
> +	at->p = last;
> +}

> --- a/libdm/libdevmapper.h
> +++ b/libdm/libdevmapper.h
> @@ -715,6 +715,11 @@ void dm_list_del(struct dm_list *elem);
>  void dm_list_move(struct dm_list *head, struct dm_list *elem);
>  
>  /*
> + * Join 'list' to 'head'.
> + */
> +void dm_list_splice(struct dm_list *list, struct dm_list *head);
> +
> +/*
>   * Is the list empty?
>   */
>  int dm_list_empty(const struct dm_list *head);

Ack. Please check in.

Yours,
   Petr.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]