Re: PATCH 2.5.2.9: ext2 unbork fs.h (part 1/7)

Jeff Garzik
2002-01-07T21:59:12Z

Arnaldo Carvalho de Melo wrote:
>
> Em Mon, Jan 07, 2002 at 04:32:40PM -0500, Jeff Garzik escreveu:
> > I am very much interested in a better solution... I could not figure
> > out how to get a private pointer from a struct inode*, without using a
> > nasty OFFSET_OF macro or a pointer to self as I implemented.
>
> Why nasty, don't you like the list_head macros? 8) BTW, thats how Linus
> suggested it to be done in private conversation. Look at list_entry.

Yep, sorry Linus :) I just much prefer inserting the back-ref at object
creation time to pointer arithmetic... that way there is no type
information lost, and it gives the compiler a better opportunity to see
the relationship between the two structs.

Jeff

--
Jeff Garzik | Alternate titles for LOTR:
Building 1024 | Fast Times at Uruk-Hai
MandrakeSoft | The Took, the Elf, His Daughter and Her Lover
| Samwise Gamgee: International Hobbit of Mystery