You should define your struct source_store
as:
struct source_store{
sector_t source;
sector_t cache;
struct rb_node node; // not a pointer to node
}
That is because rb_entry
is defined as
#define rb_entry(ptr, type, member) container_of(ptr, type, member)
And it is just some simple offset calculation
#define container_of(ptr, type, member) ({ /
const typeof( ((type *)0)->member ) *__mptr = (ptr); / <--error happens here
(type *)( (char *)__mptr - offsetof(type,member) );})
The type of __mptr
is struct rb_node**
and the type of your ptr
is struct rb_node*
. So there is a warning of incompatible pointer type.