static int ip_vs_sh_update_svc(struct ip_vs_service *svc) { struct ip_vs_sh_bucket *tbl = svc->sched_data; /* got to clean up hash buckets here */ ip_vs_sh_flush(tbl); /* assign the hash buckets with the updated service */ ip_vs_sh_assign(tbl, svc); return 0; }
static int ip_vs_sh_init_svc(struct ip_vs_service *svc) { struct ip_vs_sh_bucket *tbl; /* allocate the SH table for this service */ tbl = kmalloc(sizeof(struct ip_vs_sh_bucket)*IP_VS_SH_TAB_SIZE, GFP_ATOMIC); if (tbl == NULL) return -ENOMEM; svc->sched_data = tbl; IP_VS_DBG(6, "SH hash table (memory=%Zdbytes) allocated for " "current service\n", sizeof(struct ip_vs_sh_bucket)*IP_VS_SH_TAB_SIZE); /* assign the hash buckets with the updated service */ ip_vs_sh_assign(tbl, svc); return 0; }