Re: delete from hlist ???

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

 



Because the field "pprev" holds the address of the "next" field in the previous node.
And *pprev = next; just like the prev->next = next; connect the two nodes in forward direction.
Hope it's helpful for you.
 


 
On Thu, Apr 8, 2010 at 1:58 PM, Onkar Mahajan <kern.devel@xxxxxxxxx> wrote:
I am not able to understand how the marked like skips the node n :

static inline void __hlist_del(struct hlist_node *n)
{
    struct hlist_node *next = n->next;
    struct hlist_node **pprev = n->pprev;
    *pprev = next; <--------------------------------------------------- ????
    if (next)
        next->pprev = pprev;
}

in this case

static inline void __list_del(struct list_head * prev, struct list_head * next)
{
    next->prev = prev;
    prev->next = next;
}

It is clear ...


Please help.

Regards,
Onkar




--
Yours sincerely
ZhangMeng

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux