From 79ab299bfb20b7fc1982ca90d77d8b908b824fea Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 4 Jan 2012 14:31:41 +0100 Subject: conntrackd: simplify cache_get_extra function This patch simplifies cache_get_extra which now takes only one parameter that is the cache_object. With it, the extra area can be calculated. Signed-off-by: Pablo Neira Ayuso --- src/cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cache.c') diff --git a/src/cache.c b/src/cache.c index efdab0e..f515ba0 100644 --- a/src/cache.c +++ b/src/cache.c @@ -308,9 +308,9 @@ struct cache_object *cache_data_get_object(struct cache *c, void *data) return (struct cache_object *)((char*)data - c->extra_offset); } -void *cache_get_extra(struct cache *c, void *data) +void *cache_get_extra(struct cache_object *obj) { - return (char*)data + c->extra_offset; + return (char*)obj + obj->cache->extra_offset; } void cache_stats(const struct cache *c, int fd) -- cgit v1.2.3