Commit 80020f5d authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[IPSEC]: Kill object argument from flow_cache_flush.

parent 6383fad8
...@@ -87,7 +87,7 @@ typedef void (*flow_resolve_t)(struct flowi *key, u16 family, u8 dir, ...@@ -87,7 +87,7 @@ typedef void (*flow_resolve_t)(struct flowi *key, u16 family, u8 dir,
extern void *flow_cache_lookup(struct flowi *key, u16 family, u8 dir, extern void *flow_cache_lookup(struct flowi *key, u16 family, u8 dir,
flow_resolve_t resolver); flow_resolve_t resolver);
extern void flow_cache_flush(void *object); extern void flow_cache_flush(void);
extern atomic_t flow_cache_genid; extern atomic_t flow_cache_genid;
#endif #endif
...@@ -54,7 +54,6 @@ static struct timer_list flow_hash_rnd_timer; ...@@ -54,7 +54,6 @@ static struct timer_list flow_hash_rnd_timer;
#define FLOW_HASH_RND_PERIOD (10 * 60 * HZ) #define FLOW_HASH_RND_PERIOD (10 * 60 * HZ)
struct flow_flush_info { struct flow_flush_info {
void *object;
atomic_t cpuleft; atomic_t cpuleft;
struct completion completion; struct completion completion;
}; };
...@@ -224,18 +223,20 @@ void *flow_cache_lookup(struct flowi *key, u16 family, u8 dir, ...@@ -224,18 +223,20 @@ void *flow_cache_lookup(struct flowi *key, u16 family, u8 dir,
static void flow_cache_flush_tasklet(unsigned long data) static void flow_cache_flush_tasklet(unsigned long data)
{ {
struct flow_flush_info *info = (void *)data; struct flow_flush_info *info = (void *)data;
void *object = info->object;
int i; int i;
int cpu; int cpu;
cpu = smp_processor_id(); cpu = smp_processor_id();
for (i = 0; i < flow_hash_size; i++) { for (i = 0; i < flow_hash_size; i++) {
struct flow_cache_entry *fle, **flp; struct flow_cache_entry *fle;
flp = &flow_table[(cpu << flow_hash_shift) + i]; fle = flow_table[(cpu << flow_hash_shift) + i];
for (; (fle = *flp) != NULL; flp = &fle->next) { for (; fle; fle = fle->next) {
if (fle->object != object) unsigned genid = atomic_read(&flow_cache_genid);
if (!fle->object || fle->genid == genid)
continue; continue;
fle->object = NULL; fle->object = NULL;
atomic_dec(fle->object_ref); atomic_dec(fle->object_ref);
} }
...@@ -257,11 +258,10 @@ static void flow_cache_flush_per_cpu(void *data) ...@@ -257,11 +258,10 @@ static void flow_cache_flush_per_cpu(void *data)
tasklet_schedule(tasklet); tasklet_schedule(tasklet);
} }
void flow_cache_flush(void *object) void flow_cache_flush(void)
{ {
struct flow_flush_info info; struct flow_flush_info info;
info.object = object;
atomic_set(&info.cpuleft, num_online_cpus()); atomic_set(&info.cpuleft, num_online_cpus());
init_completion(&info.completion); init_completion(&info.completion);
......
...@@ -224,7 +224,7 @@ static void xfrm_policy_gc_kill(struct xfrm_policy *policy) ...@@ -224,7 +224,7 @@ static void xfrm_policy_gc_kill(struct xfrm_policy *policy)
atomic_dec(&policy->refcnt); atomic_dec(&policy->refcnt);
if (atomic_read(&policy->refcnt) > 1) if (atomic_read(&policy->refcnt) > 1)
flow_cache_flush(policy); flow_cache_flush();
xfrm_pol_put(policy); xfrm_pol_put(policy);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment