Re: [GIT PULL] iomap: new code for 5.4
From: Linus Torvalds
Date: Thu Sep 19 2019 - 13:41:56 EST
On Thu, Sep 19, 2019 at 10:07 AM Christoph Hellwig <hch@xxxxxx> wrote:
>
> I personally surived with it, but really hated writing the open coded
> list_for_each_entry + list_del or while list_first_entry_or_null +
> âist_del when I could have a nice primitive for it. I finally decided
> to just add that helper..
You realize that the list helper is even mis-named?
Generally a "pop()" should pop the last entry, not the first one. Or
course, which one is last and which one is first is entirely up to you
since you can add at the tail or the beginning. So even the name is
ambiguous.
So I really think the whole thing was badly implemented (and yes, part
of that was the whole implementation thing).
Doing list_del() by hand also means that you can actually decide if
you want list_del_init() or not. So it's
But again - keep that helper if you want it. Just don't put a badly
implemented and badly named "helper" it in a global header file that
_everybody_ has to look at.
Linus