亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ip_vs_lblcr.c

?? 優(yōu)龍2410linux2.6.8內(nèi)核源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * IPVS:        Locality-Based Least-Connection with Replication scheduler * * Version:     $Id: ip_vs_lblcr.c,v 1.11 2002/09/15 08:14:08 wensong Exp $ * * Authors:     Wensong Zhang <wensong@gnuchina.org> * *              This program is free software; you can redistribute it and/or *              modify it under the terms of the GNU General Public License *              as published by the Free Software Foundation; either version *              2 of the License, or (at your option) any later version. * * Changes: *     Julian Anastasov        :    Added the missing (dest->weight>0) *                                  condition in the ip_vs_dest_set_max. * *//* * The lblc/r algorithm is as follows (pseudo code): * *       if serverSet[dest_ip] is null then *               n, serverSet[dest_ip] <- {weighted least-conn node}; *       else *               n <- {least-conn (alive) node in serverSet[dest_ip]}; *               if (n is null) OR *                  (n.conns>n.weight AND *                   there is a node m with m.conns<m.weight/2) then *                   n <- {weighted least-conn node}; *                   add n to serverSet[dest_ip]; *               if |serverSet[dest_ip]| > 1 AND *                   now - serverSet[dest_ip].lastMod > T then *                   m <- {most conn node in serverSet[dest_ip]}; *                   remove m from serverSet[dest_ip]; *       if serverSet[dest_ip] changed then *               serverSet[dest_ip].lastMod <- now; * *       return n; * */#include <linux/module.h>#include <linux/kernel.h>/* for sysctl */#include <linux/fs.h>#include <linux/sysctl.h>/* for proc_net_create/proc_net_remove */#include <linux/proc_fs.h>#include <net/ip_vs.h>/* *    It is for garbage collection of stale IPVS lblcr entries, *    when the table is full. */#define CHECK_EXPIRE_INTERVAL   (60*HZ)#define ENTRY_TIMEOUT           (6*60*HZ)/* *    It is for full expiration check. *    When there is no partial expiration check (garbage collection) *    in a half hour, do a full expiration check to collect stale *    entries that haven't been touched for a day. */#define COUNT_FOR_FULL_EXPIRATION   30static int sysctl_ip_vs_lblcr_expiration = 24*60*60*HZ;/* *     for IPVS lblcr entry hash table */#ifndef CONFIG_IP_VS_LBLCR_TAB_BITS#define CONFIG_IP_VS_LBLCR_TAB_BITS      10#endif#define IP_VS_LBLCR_TAB_BITS     CONFIG_IP_VS_LBLCR_TAB_BITS#define IP_VS_LBLCR_TAB_SIZE     (1 << IP_VS_LBLCR_TAB_BITS)#define IP_VS_LBLCR_TAB_MASK     (IP_VS_LBLCR_TAB_SIZE - 1)/* *      IPVS destination set structure and operations */struct ip_vs_dest_list {	struct ip_vs_dest_list  *next;          /* list link */	struct ip_vs_dest       *dest;          /* destination server */};struct ip_vs_dest_set {	atomic_t                size;           /* set size */	unsigned long           lastmod;        /* last modified time */	struct ip_vs_dest_list  *list;          /* destination list */	rwlock_t	        lock;           /* lock for this list */};static struct ip_vs_dest_list *ip_vs_dest_set_insert(struct ip_vs_dest_set *set, struct ip_vs_dest *dest){	struct ip_vs_dest_list *e;	for (e=set->list; e!=NULL; e=e->next) {		if (e->dest == dest)			/* already existed */			return NULL;	}	e = kmalloc(sizeof(struct ip_vs_dest_list), GFP_ATOMIC);	if (e == NULL) {		IP_VS_ERR("ip_vs_dest_set_insert(): no memory\n");		return NULL;	}	atomic_inc(&dest->refcnt);	e->dest = dest;	/* link it to the list */	write_lock(&set->lock);	e->next = set->list;	set->list = e;	atomic_inc(&set->size);	write_unlock(&set->lock);	set->lastmod = jiffies;	return e;}static voidip_vs_dest_set_erase(struct ip_vs_dest_set *set, struct ip_vs_dest *dest){	struct ip_vs_dest_list *e, **ep;	write_lock(&set->lock);	for (ep=&set->list, e=*ep; e!=NULL; e=*ep) {		if (e->dest == dest) {			/* HIT */			*ep = e->next;			atomic_dec(&set->size);			set->lastmod = jiffies;			atomic_dec(&e->dest->refcnt);			kfree(e);			break;		}		ep = &e->next;	}	write_unlock(&set->lock);}static void ip_vs_dest_set_eraseall(struct ip_vs_dest_set *set){	struct ip_vs_dest_list *e, **ep;	write_lock(&set->lock);	for (ep=&set->list, e=*ep; e!=NULL; e=*ep) {		*ep = e->next;		/*		 * We don't kfree dest because it is refered either		 * by its service or by the trash dest list.		 */		atomic_dec(&e->dest->refcnt);		kfree(e);	}	write_unlock(&set->lock);}/* get weighted least-connection node in the destination set */static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set){	register struct ip_vs_dest_list *e;	struct ip_vs_dest *dest, *least;	int loh, doh;	if (set == NULL)		return NULL;	read_lock(&set->lock);	/* select the first destination server, whose weight > 0 */	for (e=set->list; e!=NULL; e=e->next) {		least = e->dest;		if (least->flags & IP_VS_DEST_F_OVERLOAD)			continue;		if ((atomic_read(&least->weight) > 0)		    && (least->flags & IP_VS_DEST_F_AVAILABLE)) {			loh = atomic_read(&least->activeconns) * 50				+ atomic_read(&least->inactconns);			goto nextstage;		}	}	read_unlock(&set->lock);	return NULL;	/* find the destination with the weighted least load */  nextstage:	for (e=e->next; e!=NULL; e=e->next) {		dest = e->dest;		if (dest->flags & IP_VS_DEST_F_OVERLOAD)			continue;		doh = atomic_read(&dest->activeconns) * 50			+ atomic_read(&dest->inactconns);		if ((loh * atomic_read(&dest->weight) >		     doh * atomic_read(&least->weight))		    && (dest->flags & IP_VS_DEST_F_AVAILABLE)) {			least = dest;			loh = doh;		}	}	read_unlock(&set->lock);	IP_VS_DBG(6, "ip_vs_dest_set_min: server %d.%d.%d.%d:%d "		  "activeconns %d refcnt %d weight %d overhead %d\n",		  NIPQUAD(least->addr), ntohs(least->port),		  atomic_read(&least->activeconns),		  atomic_read(&least->refcnt),		  atomic_read(&least->weight), loh);	return least;}/* get weighted most-connection node in the destination set */static inline struct ip_vs_dest *ip_vs_dest_set_max(struct ip_vs_dest_set *set){	register struct ip_vs_dest_list *e;	struct ip_vs_dest *dest, *most;	int moh, doh;	if (set == NULL)		return NULL;	read_lock(&set->lock);	/* select the first destination server, whose weight > 0 */	for (e=set->list; e!=NULL; e=e->next) {		most = e->dest;		if (atomic_read(&most->weight) > 0) {			moh = atomic_read(&most->activeconns) * 50				+ atomic_read(&most->inactconns);			goto nextstage;		}	}	read_unlock(&set->lock);	return NULL;	/* find the destination with the weighted most load */  nextstage:	for (e=e->next; e!=NULL; e=e->next) {		dest = e->dest;		doh = atomic_read(&dest->activeconns) * 50			+ atomic_read(&dest->inactconns);		/* moh/mw < doh/dw ==> moh*dw < doh*mw, where mw,dw>0 */		if ((moh * atomic_read(&dest->weight) <		     doh * atomic_read(&most->weight))		    && (atomic_read(&dest->weight) > 0)) {			most = dest;			moh = doh;		}	}	read_unlock(&set->lock);	IP_VS_DBG(6, "ip_vs_dest_set_max: server %d.%d.%d.%d:%d "		  "activeconns %d refcnt %d weight %d overhead %d\n",		  NIPQUAD(most->addr), ntohs(most->port),		  atomic_read(&most->activeconns),		  atomic_read(&most->refcnt),		  atomic_read(&most->weight), moh);	return most;}/* *      IPVS lblcr entry represents an association between destination *      IP address and its destination server set */struct ip_vs_lblcr_entry {	struct list_head        list;	__u32                   addr;           /* destination IP address */	struct ip_vs_dest_set   set;            /* destination server set */	unsigned long           lastuse;        /* last used time */};/* *      IPVS lblcr hash table */struct ip_vs_lblcr_table {	rwlock_t	        lock;           /* lock for this table */	struct list_head        bucket[IP_VS_LBLCR_TAB_SIZE];  /* hash bucket */	atomic_t                entries;        /* number of entries */	int                     max_size;       /* maximum size of entries */	struct timer_list       periodic_timer; /* collect stale entries */	int                     rover;          /* rover for expire check */	int                     counter;        /* counter for no expire */};/* *      IPVS LBLCR sysctl table */static ctl_table vs_vars_table[] = {	{		.ctl_name	= NET_IPV4_VS_LBLCR_EXPIRE,		.procname	= "lblcr_expiration",		.data		= &sysctl_ip_vs_lblcr_expiration,		.maxlen		= sizeof(int),		.mode		= 0644, 		.proc_handler	= &proc_dointvec_jiffies,	},	{ .ctl_name = 0 }};static ctl_table vs_table[] = {	{		.ctl_name	= NET_IPV4_VS,		.procname	= "vs",		.mode		= 0555,		.child		= vs_vars_table	},	{ .ctl_name = 0 }};static ctl_table ipv4_table[] = {	{		.ctl_name	= NET_IPV4,		.procname	= "ipv4", 		.mode		= 0555,		.child		= vs_table	},	{ .ctl_name = 0 }};static ctl_table lblcr_root_table[] = {	{		.ctl_name	= CTL_NET,		.procname	= "net", 		.mode		= 0555, 		.child		= ipv4_table	},	{ .ctl_name = 0 }};static struct ctl_table_header * sysctl_header;/* *      new/free a ip_vs_lblcr_entry, which is a mapping of a destination *      IP address to a server. */static inline struct ip_vs_lblcr_entry *ip_vs_lblcr_new(__u32 daddr){	struct ip_vs_lblcr_entry *en;	en = kmalloc(sizeof(struct ip_vs_lblcr_entry), GFP_ATOMIC);	if (en == NULL) {		IP_VS_ERR("ip_vs_lblcr_new(): no memory\n");		return NULL;	}	INIT_LIST_HEAD(&en->list);	en->addr = daddr;	/* initilize its dest set */	atomic_set(&(en->set.size), 0);	en->set.list = NULL;	en->set.lock = RW_LOCK_UNLOCKED;	return en;}static inline void ip_vs_lblcr_free(struct ip_vs_lblcr_entry *en){	list_del(&en->list);	ip_vs_dest_set_eraseall(&en->set);	kfree(en);}/* *	Returns hash value for IPVS LBLCR entry */static inline unsigned ip_vs_lblcr_hashkey(__u32 addr){	return (ntohl(addr)*2654435761UL) & IP_VS_LBLCR_TAB_MASK;}/* *	Hash an entry in the ip_vs_lblcr_table. *	returns bool success. */static intip_vs_lblcr_hash(struct ip_vs_lblcr_table *tbl, struct ip_vs_lblcr_entry *en){	unsigned hash;	if (!list_empty(&en->list)) {		IP_VS_ERR("ip_vs_lblcr_hash(): request for already hashed, "			  "called from %p\n", __builtin_return_address(0));		return 0;	}	/*	 *	Hash by destination IP address	 */	hash = ip_vs_lblcr_hashkey(en->addr);	write_lock(&tbl->lock);	list_add(&en->list, &tbl->bucket[hash]);	atomic_inc(&tbl->entries);	write_unlock(&tbl->lock);	return 1;}#if 0000/* *	Unhash ip_vs_lblcr_entry from ip_vs_lblcr_table. *	returns bool success. */static int ip_vs_lblcr_unhash(struct ip_vs_lblcr_table *tbl,			     struct ip_vs_lblcr_entry *en){	if (list_empty(&en->list)) {		IP_VS_ERR("ip_vs_lblcr_unhash(): request for not hashed entry, "			  "called from %p\n", __builtin_return_address(0));		return 0;	}	/*	 * Remove it from the table	 */	write_lock(&tbl->lock);	list_del(&en->list);	INIT_LIST_HEAD(&en->list);	write_unlock(&tbl->lock);	return 1;}#endif/* *  Get ip_vs_lblcr_entry associated with supplied parameters.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久一区二区三区捆绑**| 91国偷自产一区二区开放时间 | 久久精品无码一区二区三区| 久久国产精品99久久久久久老狼| 日韩欧美一级片| 国产又黄又大久久| 中文字幕乱码日本亚洲一区二区| 99精品视频在线免费观看| 亚洲免费在线观看视频| 欧美伦理视频网站| 久久99热狠狠色一区二区| 国产日韩高清在线| 在线观看精品一区| 热久久久久久久| 国产精品丝袜91| 欧美精品丝袜久久久中文字幕| 韩国女主播一区二区三区| 久久精品日产第一区二区三区高清版 | 久久99精品久久久久久动态图| 久久久99久久精品欧美| 91在线精品一区二区| 午夜精品123| 国产亲近乱来精品视频| 日本韩国一区二区三区| 男人的天堂久久精品| 国产欧美一区在线| 欧美日韩午夜精品| 成人免费毛片片v| 香蕉av福利精品导航| 久久色视频免费观看| 在线观看亚洲a| 国产乱妇无码大片在线观看| 亚洲黄色录像片| 久久久国产一区二区三区四区小说 | 日韩免费在线观看| 99久久久久久99| 黄色资源网久久资源365| 亚洲欧美偷拍另类a∨色屁股| 欧美大片在线观看一区二区| 91蝌蚪porny九色| 国产做a爰片久久毛片| 一区二区久久久久久| 国产日韩欧美精品在线| 欧美一区二区三区免费视频| 99精品国产99久久久久久白柏| 青青草91视频| 一区二区欧美在线观看| 欧美国产在线观看| 制服.丝袜.亚洲.中文.综合| av网站免费线看精品| 精品一区二区三区免费毛片爱| 亚洲综合成人在线视频| 国产精品美女一区二区| 久久综合色天天久久综合图片| 欧美久久一二区| 91官网在线免费观看| 成人黄色大片在线观看| 久久国内精品视频| 日韩国产在线一| 一区二区高清免费观看影视大全| 中文av一区二区| 久久久久国色av免费看影院| 欧美成人激情免费网| 91精品国产综合久久精品| 欧美视频一区二区三区| 日本乱人伦一区| 一本久久综合亚洲鲁鲁五月天| 国产69精品久久久久毛片| 狠狠v欧美v日韩v亚洲ⅴ| 蜜桃精品视频在线观看| 日韩激情在线观看| 日韩av在线播放中文字幕| 婷婷一区二区三区| 视频在线观看一区| 日韩专区一卡二卡| 婷婷丁香久久五月婷婷| 亚洲成人精品在线观看| 亚洲成人一区二区| 日本亚洲天堂网| 人人爽香蕉精品| 久久97超碰色| 成人一区二区三区在线观看| 成人免费视频免费观看| jlzzjlzz国产精品久久| 91在线看国产| 欧美日韩一区二区三区四区五区| 欧美影院午夜播放| 欧美日韩国产高清一区二区 | 一本久道久久综合中文字幕 | 香港成人在线视频| 三级久久三级久久久| 久久激情综合网| 成人av一区二区三区| 91网站视频在线观看| 欧亚洲嫩模精品一区三区| 91精品国产色综合久久不卡电影| 欧美一区二区三区四区五区 | 制服丝袜av成人在线看| 久久综合九色综合97婷婷女人 | 国产午夜亚洲精品午夜鲁丝片| 国产精品无人区| 亚洲一区二区三区自拍| 日韩福利电影在线观看| 国产精品一区二区久久不卡 | 最近日韩中文字幕| 亚洲丰满少妇videoshd| 激情文学综合丁香| 91在线视频观看| 日韩一级片在线播放| 欧美高清在线一区| 亚洲午夜av在线| 国产专区综合网| 日本精品一区二区三区高清 | 色综合天天综合在线视频| 欧美日本国产一区| 日本一区二区三区四区在线视频| 伊人一区二区三区| 精久久久久久久久久久| 日本久久一区二区三区| 亚洲精品一区二区三区精华液 | 精品国产一区二区三区久久影院| 中文字幕在线免费不卡| 日韩电影在线观看一区| 懂色av一区二区在线播放| 欧美卡1卡2卡| 欧美经典一区二区| 美女网站色91| 91麻豆高清视频| 久久在线观看免费| 午夜影院在线观看欧美| av电影天堂一区二区在线观看| 欧美一区二区在线观看| 亚洲免费电影在线| 国产精品一线二线三线精华| 欧美疯狂性受xxxxx喷水图片| 自拍偷自拍亚洲精品播放| 国产在线精品一区二区| 欧美群妇大交群的观看方式| 中文字幕在线不卡| 国产精品亚洲一区二区三区在线| 在线不卡一区二区| 亚洲免费在线观看| 成人av资源站| 国产目拍亚洲精品99久久精品| 捆绑紧缚一区二区三区视频| 欧美性猛片xxxx免费看久爱| 一区视频在线播放| 国产一区激情在线| 精品国产乱子伦一区| 青青草国产精品97视觉盛宴| 欧美吻胸吃奶大尺度电影| 国产精品二三区| 成人少妇影院yyyy| 欧美成人精品1314www| 国产自产v一区二区三区c| 在线不卡欧美精品一区二区三区| 一区二区三区在线观看国产| 成人精品视频一区| 亚洲国产经典视频| 成人手机在线视频| 欧美韩日一区二区三区四区| 国产成人午夜视频| 久久久不卡网国产精品一区| 国产精品自拍三区| 久久久www免费人成精品| 国产精品亚洲一区二区三区在线| 久久综合99re88久久爱| 国产一区日韩二区欧美三区| xnxx国产精品| 国产一级精品在线| 久久久综合九色合综国产精品| 国产麻豆精品一区二区| 久久久777精品电影网影网| 国产精品99久久久久久似苏梦涵| 国产拍揄自揄精品视频麻豆| 99久久99久久精品免费看蜜桃| 日韩理论电影院| 欧美色区777第一页| 日韩电影在线免费| 久久久综合网站| 91碰在线视频| 亚洲成人av一区二区三区| 911精品国产一区二区在线| 秋霞影院一区二区| 国产欧美日韩卡一| 色噜噜狠狠成人网p站| 亚洲第一久久影院| 精品三级在线观看| 成人黄色免费短视频| 亚洲第一福利视频在线| 欧美精品一区视频| 91视频一区二区| 日韩电影网1区2区| 国产欧美一区二区三区在线老狼| 99re在线精品| 日韩av中文字幕一区二区三区| 久久蜜桃av一区二区天堂| 99久久精品免费精品国产| 天堂一区二区在线| 国产精品久久久久久久久久免费看|