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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cache.h

?? linux-2.6.15.6
?? H
字號:
/* * include/linux/sunrpc/cache.h * * Generic code for various authentication-related caches * used by sunrpc clients and servers. * * Copyright (C) 2002 Neil Brown <neilb@cse.unsw.edu.au> * * Released under terms in GPL version 2.  See COPYING. * */#ifndef _LINUX_SUNRPC_CACHE_H_#define _LINUX_SUNRPC_CACHE_H_#include <linux/slab.h>#include <asm/atomic.h>#include <linux/proc_fs.h>/* * Each cache requires: *  - A 'struct cache_detail' which contains information specific to the cache *    for common code to use. *  - An item structure that must contain a "struct cache_head" *  - A lookup function defined using DefineCacheLookup *  - A 'put' function that can release a cache item. It will only *    be called after cache_put has succeed, so there are guarantee *    to be no references. *  - A function to calculate a hash of an item's key. * * as well as assorted code fragments (e.g. compare keys) and numbers * (e.g. hash size, goal_age, etc). * * Each cache must be registered so that it can be cleaned regularly. * When the cache is unregistered, it is flushed completely. * * Entries have a ref count and a 'hashed' flag which counts the existance * in the hash table. * We only expire entries when refcount is zero. * Existance in the cache is counted  the refcount. *//* Every cache item has a common header that is used * for expiring and refreshing entries. *  */struct cache_head {	struct cache_head * next;	time_t		expiry_time;	/* After time time, don't use the data */	time_t		last_refresh;   /* If CACHE_PENDING, this is when upcall 					 * was sent, else this is when update was received					 */	atomic_t 	refcnt;	unsigned long	flags;};#define	CACHE_VALID	0	/* Entry contains valid data */#define	CACHE_NEGATIVE	1	/* Negative entry - there is no match for the key */#define	CACHE_PENDING	2	/* An upcall has been sent but no reply received yet*/#define	CACHE_NEW_EXPIRY 120	/* keep new things pending confirmation for 120 seconds */struct cache_detail {	struct module *		owner;	int			hash_size;	struct cache_head **	hash_table;	rwlock_t		hash_lock;	atomic_t		inuse; /* active user-space update or lookup */	char			*name;	void			(*cache_put)(struct cache_head *,					     struct cache_detail*);	void			(*cache_request)(struct cache_detail *cd,						 struct cache_head *h,						 char **bpp, int *blen);	int			(*cache_parse)(struct cache_detail *,					       char *buf, int len);	int			(*cache_show)(struct seq_file *m,					      struct cache_detail *cd,					      struct cache_head *h);	/* fields below this comment are for internal use	 * and should not be touched by cache owners	 */	time_t			flush_time;		/* flush all cache items with last_refresh							 * earlier than this */	struct list_head	others;	time_t			nextcheck;	int			entries;	/* fields for communication over channel */	struct list_head	queue;	struct proc_dir_entry	*proc_ent;	struct proc_dir_entry   *flush_ent, *channel_ent, *content_ent;	atomic_t		readers;		/* how many time is /chennel open */	time_t			last_close;		/* if no readers, when did last close */	time_t			last_warn;		/* when we last warned about no readers */	void			(*warn_no_listener)(struct cache_detail *cd);};/* this must be embedded in any request structure that * identifies an object that will want a callback on * a cache fill */struct cache_req {	struct cache_deferred_req *(*defer)(struct cache_req *req);};/* this must be embedded in a deferred_request that is being * delayed awaiting cache-fill */struct cache_deferred_req {	struct list_head	hash;	/* on hash chain */	struct list_head	recent; /* on fifo */	struct cache_head	*item;  /* cache item we wait on */	time_t			recv_time;	void			*owner; /* we might need to discard all defered requests					 * owned by someone */	void			(*revisit)(struct cache_deferred_req *req,					   int too_many);};/* * just like a template in C++, this macro does cache lookup * for us. * The function is passed some sort of HANDLE from which a cache_detail * structure can be determined (via SETUP, DETAIL), a template * cache entry (type RTN*), and a "set" flag.  Using the HASHFN and the  * TEST, the function will try to find a matching cache entry in the cache. * If "set" == 0 : *    If an entry is found, it is returned *    If no entry is found, a new non-VALID entry is created. * If "set" == 1 and INPLACE == 0 : *    If no entry is found a new one is inserted with data from "template" *    If a non-CACHE_VALID entry is found, it is updated from template using UPDATE *    If a CACHE_VALID entry is found, a new entry is swapped in with data *       from "template" * If set == 1, and INPLACE == 1 : *    As above, except that if a CACHE_VALID entry is found, we UPDATE in place *       instead of swapping in a new entry. * * If the passed handle has the CACHE_NEGATIVE flag set, then UPDATE is not * run but insteead CACHE_NEGATIVE is set in any new item. *  In any case, the new entry is returned with a reference count. * *     * RTN is a struct type for a cache entry * MEMBER is the member of the cache which is cache_head, which must be first * FNAME is the name for the function	 * ARGS are arguments to function and must contain RTN *item, int set.  May *   also contain something to be usedby SETUP or DETAIL to find cache_detail. * SETUP  locates the cache detail and makes it available as... * DETAIL identifies the cache detail, possibly set up by SETUP * HASHFN returns a hash value of the cache entry "item" * TEST  tests if "tmp" matches "item" * INIT copies key information from "item" to "new" * UPDATE copies content information from "item" to "tmp" * INPLACE is true if updates can happen inplace rather than allocating a new structure * * WARNING: any substantial changes to this must be reflected in *   net/sunrpc/svcauth.c(auth_domain_lookup) *  which is a similar routine that is open-coded. */#define DefineCacheLookup(RTN,MEMBER,FNAME,ARGS,SETUP,DETAIL,HASHFN,TEST,INIT,UPDATE,INPLACE)	\RTN *FNAME ARGS										\{											\	RTN *tmp, *new=NULL;								\	struct cache_head **hp, **head;							\	SETUP;										\	head = &(DETAIL)->hash_table[HASHFN];						\ retry:											\	if (set||new) write_lock(&(DETAIL)->hash_lock);					\	else read_lock(&(DETAIL)->hash_lock);						\	for(hp=head; *hp != NULL; hp = &tmp->MEMBER.next) {				\		tmp = container_of(*hp, RTN, MEMBER);					\		if (TEST) { /* found a match */						\											\			if (set && !INPLACE && test_bit(CACHE_VALID, &tmp->MEMBER.flags) && !new) \				break;							\											\			if (new)							\				{INIT;}							\			if (set) {							\				if (!INPLACE && test_bit(CACHE_VALID, &tmp->MEMBER.flags))\				{ /* need to swap in new */				\					RTN *t2;					\											\					new->MEMBER.next = tmp->MEMBER.next;		\					*hp = &new->MEMBER;				\					tmp->MEMBER.next = NULL;			\					t2 = tmp; tmp = new; new = t2;			\				}							\				if (test_bit(CACHE_NEGATIVE,  &item->MEMBER.flags))	\					set_bit(CACHE_NEGATIVE, &tmp->MEMBER.flags);	\				else {							\					UPDATE;						\					clear_bit(CACHE_NEGATIVE, &tmp->MEMBER.flags);	\				}							\			}								\			cache_get(&tmp->MEMBER);					\			if (set||new) write_unlock(&(DETAIL)->hash_lock);		\			else read_unlock(&(DETAIL)->hash_lock);				\			if (set)							\				cache_fresh(DETAIL, &tmp->MEMBER, item->MEMBER.expiry_time); \			if (set && !INPLACE && new) cache_fresh(DETAIL, &new->MEMBER, 0);	\			if (new) (DETAIL)->cache_put(&new->MEMBER, DETAIL);		\			return tmp;							\		}									\	}										\	/* Didn't find anything */							\	if (new) {									\		INIT;									\		new->MEMBER.next = *head;						\		*head = &new->MEMBER;							\		(DETAIL)->entries ++;							\		cache_get(&new->MEMBER);						\		if (set) {								\			tmp = new;							\			if (test_bit(CACHE_NEGATIVE, &item->MEMBER.flags))		\				set_bit(CACHE_NEGATIVE, &tmp->MEMBER.flags);		\			else {UPDATE;}							\		}									\	}										\	if (set||new) write_unlock(&(DETAIL)->hash_lock);				\	else read_unlock(&(DETAIL)->hash_lock);						\	if (new && set)									\		cache_fresh(DETAIL, &new->MEMBER, item->MEMBER.expiry_time);		\	if (new)				       					\		return new;								\	new = kmalloc(sizeof(*new), GFP_KERNEL);					\	if (new) {									\		cache_init(&new->MEMBER);						\		goto retry;								\	}										\	return NULL;									\}#define DefineSimpleCacheLookup(STRUCT,INPLACE)	\	DefineCacheLookup(struct STRUCT, h, STRUCT##_lookup, (struct STRUCT *item, int set), /*no setup */,	\			  & STRUCT##_cache, STRUCT##_hash(item), STRUCT##_match(item, tmp),\			  STRUCT##_init(new, item), STRUCT##_update(tmp, item),INPLACE)#define cache_for_each(pos, detail, index, member) 						\	for (({read_lock(&(detail)->hash_lock); index = (detail)->hash_size;}) ;		\	     ({if (index==0)read_unlock(&(detail)->hash_lock); index--;});			\		)										\		for (pos = container_of((detail)->hash_table[index], typeof(*pos), member);	\		     &pos->member;								\		     pos = container_of(pos->member.next, typeof(*pos), member))	     extern void cache_clean_deferred(void *owner);static inline struct cache_head  *cache_get(struct cache_head *h){	atomic_inc(&h->refcnt);	return h;}static inline int cache_put(struct cache_head *h, struct cache_detail *cd){	if (atomic_read(&h->refcnt) <= 2 &&	    h->expiry_time < cd->nextcheck)		cd->nextcheck = h->expiry_time;	return atomic_dec_and_test(&h->refcnt);}extern void cache_init(struct cache_head *h);extern void cache_fresh(struct cache_detail *detail,			struct cache_head *head, time_t expiry);extern int cache_check(struct cache_detail *detail,		       struct cache_head *h, struct cache_req *rqstp);extern void cache_flush(void);extern void cache_purge(struct cache_detail *detail);#define NEVER (0x7FFFFFFF)extern void cache_register(struct cache_detail *cd);extern int cache_unregister(struct cache_detail *cd);extern void qword_add(char **bpp, int *lp, char *str);extern void qword_addhex(char **bpp, int *lp, char *buf, int blen);extern int qword_get(char **bpp, char *dest, int bufsize);static inline int get_int(char **bpp, int *anint){	char buf[50];	char *ep;	int rv;	int len = qword_get(bpp, buf, 50);	if (len < 0) return -EINVAL;	if (len ==0) return -ENOENT;	rv = simple_strtol(buf, &ep, 0);	if (*ep) return -EINVAL;	*anint = rv;	return 0;}static inline time_t get_expiry(char **bpp){	int rv;	if (get_int(bpp, &rv))		return 0;	if (rv < 0)		return 0;	return rv;}#endif /*  _LINUX_SUNRPC_CACHE_H_ */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美色电影| 国产精品亚洲第一区在线暖暖韩国| 国产盗摄精品一区二区三区在线| 欧美久久久影院| 午夜成人免费视频| 色呦呦日韩精品| 久久精品一区二区三区不卡牛牛| 蜜桃av一区二区| 欧美日韩色综合| 日本aⅴ亚洲精品中文乱码| 91精彩视频在线观看| 中文字幕一区二区三区不卡在线 | 视频一区二区中文字幕| 欧洲av在线精品| 亚洲精品亚洲人成人网在线播放| 国产一二精品视频| 国产精品色在线观看| 一本到三区不卡视频| 亚洲欧洲日产国码二区| 国产69精品久久久久777| 久久精品人人做| 91在线免费播放| 亚洲一线二线三线久久久| 欧美美女直播网站| 热久久免费视频| 国产亚洲综合性久久久影院| 99re66热这里只有精品3直播 | 欧美人狂配大交3d怪物一区| 成人黄色大片在线观看| 亚洲午夜电影网| 久久奇米777| 成人免费观看视频| 石原莉奈在线亚洲三区| 日韩伦理电影网| 久久久久国产精品麻豆| 在线视频一区二区三| 国产精品一区在线观看乱码| 日韩精品免费专区| 婷婷夜色潮精品综合在线| 樱花草国产18久久久久| 日本一区二区视频在线观看| 欧美色老头old∨ideo| 国产成人aaa| 久久精品国产精品亚洲精品| 亚洲综合色噜噜狠狠| 日本一区二区三区在线观看| 欧美一区二区三区啪啪| 欧美午夜精品一区二区蜜桃| 粉嫩蜜臀av国产精品网站| 精品在线亚洲视频| 久久99久久久欧美国产| 日本在线不卡视频| 日韩av在线发布| 亚洲另类春色国产| 精品欧美乱码久久久久久| 日韩欧美激情四射| 精品乱码亚洲一区二区不卡| 日韩一区二区精品葵司在线| 日韩午夜在线观看视频| 欧美大片一区二区| 2023国产一二三区日本精品2022| 欧美一级艳片视频免费观看| 欧洲精品在线观看| 欧美私人免费视频| 欧美精品在欧美一区二区少妇| 91欧美一区二区| 欧美精品三级在线观看| 这里只有精品99re| 国产精品日韩成人| 亚洲国产精品综合小说图片区| 蜜桃视频第一区免费观看| 不卡av在线网| 777奇米四色成人影色区| 国产午夜精品理论片a级大结局| 国产亚洲欧美日韩在线一区| 亚洲国产精华液网站w| 亚洲精品视频在线看| 奇米888四色在线精品| 不卡一区中文字幕| 欧美精品一区二区三区久久久| 欧美tk丨vk视频| 亚洲免费在线电影| 亚洲h精品动漫在线观看| 成人高清在线视频| 久久蜜桃av一区二区天堂| 一区二区三区高清不卡| 男男gaygay亚洲| 91免费版在线| 久久综合久久久久88| 亚洲午夜久久久久久久久电影网| 国内精品伊人久久久久影院对白| 91污片在线观看| 精品成人私密视频| 蜜桃一区二区三区四区| 日韩欧美一级特黄在线播放| 亚洲国产精品尤物yw在线观看| 色综合天天综合网天天看片| 中文字幕精品在线不卡| 99久久婷婷国产综合精品电影| 国产精品拍天天在线| 91麻豆高清视频| 亚洲图片激情小说| 欧美丰满少妇xxxbbb| 亚洲免费观看在线视频| caoporen国产精品视频| 亚洲图片你懂的| 99久久国产综合精品女不卡| 国产精品毛片无遮挡高清| 不卡视频一二三| 中文无字幕一区二区三区| 国产成人av资源| 有坂深雪av一区二区精品| 3atv一区二区三区| 风流少妇一区二区| 亚洲综合成人在线视频| 欧美三区在线观看| 亚洲精品videosex极品| 欧美日韩一区二区三区高清 | 国产偷国产偷精品高清尤物 | 国产精品亚洲午夜一区二区三区 | 在线观看视频欧美| 青青草精品视频| 日本一区二区三区国色天香| 91碰在线视频| 国产精品一二三四| 免费日韩伦理电影| 成人免费在线视频| 精品国产亚洲一区二区三区在线观看| 成人性生交大片免费看视频在线 | 日韩一级二级三级精品视频| 国产成人精品网址| 亚洲.国产.中文慕字在线| 中文字幕第一区第二区| 欧美日韩的一区二区| 99久久婷婷国产综合精品电影 | 欧美一级片在线| 成人动漫中文字幕| 日韩**一区毛片| 亚洲免费观看高清完整版在线观看熊| 欧美影院精品一区| 欧美影院午夜播放| 91国模大尺度私拍在线视频| 成人午夜激情在线| 成人美女视频在线观看18| 久久97超碰国产精品超碰| 五月天激情综合| 亚洲色图制服诱惑| 亚洲国产精品成人综合色在线婷婷| 欧美性大战久久| 欧美唯美清纯偷拍| 欧美日韩视频在线观看一区二区三区 | 7777精品伊人久久久大香线蕉最新版 | 精品一区二区久久久| 午夜视频一区二区三区| 亚洲午夜激情av| 日韩福利视频网| 蜜桃一区二区三区四区| 久久电影网电视剧免费观看| 免费人成精品欧美精品| 久久精品国产秦先生| 国产精品资源网| 日本精品视频一区二区| 欧美精品一二三区| 久久综合999| 中文字幕日韩精品一区 | 中文字幕欧美三区| 亚洲日本丝袜连裤袜办公室| 天天操天天综合网| 国产老妇另类xxxxx| 色婷婷狠狠综合| 日韩欧美成人激情| 日韩理论片网站| 久久国产精品99久久人人澡| 国产美女一区二区| 欧美亚洲国产一区在线观看网站 | 国产精品欧美久久久久无广告| 亚洲黄色av一区| 韩国女主播一区二区三区| 99精品欧美一区二区蜜桃免费 | 成人精品高清在线| 91精品国产综合久久久久久久久久| 国产欧美视频一区二区| 天天影视涩香欲综合网| 99热精品一区二区| 精品欧美一区二区在线观看| 亚洲精品中文在线观看| 国产综合色在线| 日韩欧美在线网站| 亚洲一区二区三区四区的| 成人午夜av电影| 国产午夜三级一区二区三| 麻豆一区二区在线| 4438x亚洲最大成人网| 六月丁香综合在线视频| 亚洲国产精品v| 制服丝袜激情欧洲亚洲| 成人福利电影精品一区二区在线观看| 亚洲女子a中天字幕| 91 com成人网| 99久久精品国产导航|