diff options
Diffstat (limited to 'lib/util.h')
-rw-r--r-- | lib/util.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -30,4 +30,10 @@ static inline uint64_t fuse_higher_32_bits(uint64_t nr) #define FUSE_VAR_UNUSED(var) (__attribute__((unused)) var) #endif +#define container_of(ptr, type, member) \ + ({ \ + unsigned long __mptr = (unsigned long)(ptr); \ + ((type *)(__mptr - offsetof(type, member))); \ + }) + #endif |