Lines Matching refs:md_dst

274 static void __metadata_dst_init(struct metadata_dst *md_dst,  in __metadata_dst_init()  argument
279 dst = &md_dst->dst; in __metadata_dst_init()
282 memset(dst + 1, 0, sizeof(*md_dst) + optslen - sizeof(*dst)); in __metadata_dst_init()
283 md_dst->type = type; in __metadata_dst_init()
289 struct metadata_dst *md_dst; in metadata_dst_alloc() local
291 md_dst = kmalloc(sizeof(*md_dst) + optslen, flags); in metadata_dst_alloc()
292 if (!md_dst) in metadata_dst_alloc()
295 __metadata_dst_init(md_dst, type, optslen); in metadata_dst_alloc()
297 return md_dst; in metadata_dst_alloc()
301 void metadata_dst_free(struct metadata_dst *md_dst) in metadata_dst_free() argument
304 if (md_dst->type == METADATA_IP_TUNNEL) in metadata_dst_free()
305 dst_cache_destroy(&md_dst->u.tun_info.dst_cache); in metadata_dst_free()
307 if (md_dst->type == METADATA_XFRM) in metadata_dst_free()
308 dst_release(md_dst->u.xfrm_info.dst_orig); in metadata_dst_free()
309 kfree(md_dst); in metadata_dst_free()
317 struct metadata_dst __percpu *md_dst; in metadata_dst_alloc_percpu() local
319 md_dst = __alloc_percpu_gfp(sizeof(struct metadata_dst) + optslen, in metadata_dst_alloc_percpu()
321 if (!md_dst) in metadata_dst_alloc_percpu()
325 __metadata_dst_init(per_cpu_ptr(md_dst, cpu), type, optslen); in metadata_dst_alloc_percpu()
327 return md_dst; in metadata_dst_alloc_percpu()
331 void metadata_dst_free_percpu(struct metadata_dst __percpu *md_dst) in metadata_dst_free_percpu() argument
336 struct metadata_dst *one_md_dst = per_cpu_ptr(md_dst, cpu); in metadata_dst_free_percpu()
345 free_percpu(md_dst); in metadata_dst_free_percpu()