Re: [PATCH 1/2] list: introduce a new cutting helper

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

 



On 6/12/24 08:51, Keith Busch wrote:
> From: Keith Busch <kbusch@xxxxxxxxxx>
>
> Provide a helper to remove elements from a list to the end, and place
> those elements in a new list.
>
> Signed-off-by: Keith Busch <kbusch@xxxxxxxxxx>
> ---

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@xxxxxxxxxx>

-ck

I did quick run before the review if anybody cares :-

           head     entry                      list

node [3 | | 2]    [1 | | 3]     [2 | | 1]    [X | | X]
addr 1             2            3            4

+    list->next = entry;
+    list->prev = head->prev;
node                                         [3 | | 2] 
addr                                         4

+ head->prev = entry->prev;
node  [1 | | 2]
addr  1
+ entry->prev->next = head; node [1 | | 1]
addr 1

+ entry->prev = list; node               [4 | | 3]
addr                2

+    list->prev->next = list;
node                          [2 | | 4] addr                          3

reordering with list at front with head  :-
      head
node [1 | | 1]
addr
      list
node [3 | | 2] [4 | | 3] [2 | | 4]
addr  4         2         3






[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux