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

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

?? async_io.c

?? 代理服務(wù)器 squid-2.6.STABLE16
?? C
字號(hào):
/* * $Id: async_io.c,v 1.22 2006/10/08 07:43:31 serassio Exp $ * * DEBUG: section 32    Asynchronous Disk I/O * AUTHOR: Pete Bentley <pete@demon.net> * AUTHOR: Stewart Forster <slf@connect.com.au> * * SQUID Web Proxy Cache          http://www.squid-cache.org/ * ---------------------------------------------------------- * *  Squid is the result of efforts by numerous individuals from *  the Internet community; see the CONTRIBUTORS file for full *  details.   Many organizations have provided support for Squid's *  development; see the SPONSORS file for full details.  Squid is *  Copyrighted (C) 2001 by the Regents of the University of *  California; see the COPYRIGHT file for full details.  Squid *  incorporates software developed and/or copyrighted by other *  sources; see the CREDITS file for full details. * *  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. *   *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. *   *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * */#include "squid.h"#include "async_io.h"#define _AIO_OPEN	0#define _AIO_READ	1#define _AIO_WRITE	2#define _AIO_CLOSE	3#define _AIO_UNLINK	4#define _AIO_TRUNCATE	4#define _AIO_OPENDIR	5#define _AIO_STAT	6typedef struct squidaio_ctrl_t {    struct squidaio_ctrl_t *next;    int fd;    int operation;    AIOCB *done_handler;    void *done_handler_data;    squidaio_result_t result;    int len;    char *bufp;    FREE *free_func;    dlink_node node;} squidaio_ctrl_t;static struct {    int open;    int close;    int cancel;    int write;    int read;    int stat;    int unlink;    int check_callback;} squidaio_counts;typedef struct squidaio_unlinkq_t {    char *path;    struct squidaio_unlinkq_t *next;} squidaio_unlinkq_t;static dlink_list used_list;static int initialised = 0;static int usage_count = 0;static OBJH aioStats;static MemPool *squidaio_ctrl_pool;voidaioInit(void){    usage_count++;    if (initialised)	return;    squidaio_ctrl_pool = memPoolCreate("aio_ctrl", sizeof(squidaio_ctrl_t));    cachemgrRegister("squidaio_counts", "Async IO Function Counters",	aioStats, 0, 1);    initialised = 1;}voidaioDone(void){    if (--usage_count > 0)	return;    squidaio_shutdown();    memPoolDestroy(squidaio_ctrl_pool);    initialised = 0;}voidaioOpen(const char *path, int oflag, mode_t mode, AIOCB * callback, void *callback_data){    squidaio_ctrl_t *ctrlp;    assert(initialised);    squidaio_counts.open++;    ctrlp = memPoolAlloc(squidaio_ctrl_pool);    ctrlp->fd = -2;    ctrlp->done_handler = callback;    ctrlp->done_handler_data = callback_data;    ctrlp->operation = _AIO_OPEN;    cbdataLock(callback_data);    ctrlp->result.data = ctrlp;    squidaio_open(path, oflag, mode, &ctrlp->result);    dlinkAdd(ctrlp, &ctrlp->node, &used_list);    return;}voidaioClose(int fd){    squidaio_ctrl_t *ctrlp;    assert(initialised);    squidaio_counts.close++;    aioCancel(fd);    ctrlp = memPoolAlloc(squidaio_ctrl_pool);    ctrlp->fd = fd;    ctrlp->done_handler = NULL;    ctrlp->done_handler_data = NULL;    ctrlp->operation = _AIO_CLOSE;    ctrlp->result.data = ctrlp;    squidaio_close(fd, &ctrlp->result);    dlinkAdd(ctrlp, &ctrlp->node, &used_list);    return;}voidaioCancel(int fd){    squidaio_ctrl_t *ctrlp;    AIOCB *done_handler;    void *their_data;    dlink_node *m, *next;    assert(initialised);    squidaio_counts.cancel++;    for (m = used_list.head; m; m = next) {	next = m->next;	ctrlp = m->data;	if (ctrlp->fd != fd)	    continue;	squidaio_cancel(&ctrlp->result);	if ((done_handler = ctrlp->done_handler)) {	    their_data = ctrlp->done_handler_data;	    ctrlp->done_handler = NULL;	    ctrlp->done_handler_data = NULL;	    debug(32, 0) ("this be aioCancel. Danger ahead!\n");	    if (cbdataValid(their_data))		done_handler(fd, their_data, NULL, -2, -2);	    cbdataUnlock(their_data);	    /* free data if requested to aioWrite() */	    if (ctrlp->free_func)		ctrlp->free_func(ctrlp->bufp);	    /* free temporary read buffer */	    if (ctrlp->operation == _AIO_READ)		squidaio_xfree(ctrlp->bufp, ctrlp->len);	}	dlinkDelete(m, &used_list);	memPoolFree(squidaio_ctrl_pool, ctrlp);    }}voidaioWrite(int fd, off_t offset, char *bufp, int len, AIOCB * callback, void *callback_data, FREE * free_func){    squidaio_ctrl_t *ctrlp;    int seekmode;    assert(initialised);    squidaio_counts.write++;    ctrlp = memPoolAlloc(squidaio_ctrl_pool);    ctrlp->fd = fd;    ctrlp->done_handler = callback;    ctrlp->done_handler_data = callback_data;    ctrlp->operation = _AIO_WRITE;    ctrlp->bufp = bufp;    ctrlp->free_func = free_func;    if (offset >= 0)	seekmode = SEEK_SET;    else {	seekmode = SEEK_END;	offset = 0;    }    cbdataLock(callback_data);    ctrlp->result.data = ctrlp;    squidaio_write(fd, bufp, len, offset, seekmode, &ctrlp->result);    dlinkAdd(ctrlp, &ctrlp->node, &used_list);}				/* aioWrite */voidaioRead(int fd, off_t offset, int len, AIOCB * callback, void *callback_data){    squidaio_ctrl_t *ctrlp;    int seekmode;    assert(initialised);    squidaio_counts.read++;    ctrlp = memPoolAlloc(squidaio_ctrl_pool);    ctrlp->fd = fd;    ctrlp->done_handler = callback;    ctrlp->done_handler_data = callback_data;    ctrlp->operation = _AIO_READ;    ctrlp->len = len;    ctrlp->bufp = squidaio_xmalloc(len);    if (offset >= 0)	seekmode = SEEK_SET;    else {	seekmode = SEEK_CUR;	offset = 0;    }    cbdataLock(callback_data);    ctrlp->result.data = ctrlp;    squidaio_read(fd, ctrlp->bufp, len, offset, seekmode, &ctrlp->result);    dlinkAdd(ctrlp, &ctrlp->node, &used_list);    return;}				/* aioRead */voidaioStat(char *path, struct stat *sb, AIOCB * callback, void *callback_data){    squidaio_ctrl_t *ctrlp;    assert(initialised);    squidaio_counts.stat++;    ctrlp = memPoolAlloc(squidaio_ctrl_pool);    ctrlp->fd = -2;    ctrlp->done_handler = callback;    ctrlp->done_handler_data = callback_data;    ctrlp->operation = _AIO_STAT;    cbdataLock(callback_data);    ctrlp->result.data = ctrlp;    squidaio_stat(path, sb, &ctrlp->result);    dlinkAdd(ctrlp, &ctrlp->node, &used_list);    return;}				/* aioStat */voidaioUnlink(const char *path, AIOCB * callback, void *callback_data){    squidaio_ctrl_t *ctrlp;    assert(initialised);    squidaio_counts.unlink++;    ctrlp = memPoolAlloc(squidaio_ctrl_pool);    ctrlp->fd = -2;    ctrlp->done_handler = callback;    ctrlp->done_handler_data = callback_data;    ctrlp->operation = _AIO_UNLINK;    cbdataLock(callback_data);    ctrlp->result.data = ctrlp;    squidaio_unlink(path, &ctrlp->result);    dlinkAdd(ctrlp, &ctrlp->node, &used_list);}				/* aioUnlink */#if USE_TRUNCATEvoidaioTruncate(const char *path, off_t length, AIOCB * callback, void *callback_data){    squidaio_ctrl_t *ctrlp;    assert(initialised);    squidaio_counts.unlink++;    ctrlp = memPoolAlloc(squidaio_ctrl_pool);    ctrlp->fd = -2;    ctrlp->done_handler = callback;    ctrlp->done_handler_data = callback_data;    ctrlp->operation = _AIO_TRUNCATE;    cbdataLock(callback_data);    ctrlp->result.data = ctrlp;    squidaio_truncate(path, length, &ctrlp->result);    dlinkAdd(ctrlp, &ctrlp->node, &used_list);}				/* aioTruncate */#endifintaioCheckCallbacks(SwapDir * SD){    squidaio_result_t *resultp;    squidaio_ctrl_t *ctrlp;    AIOCB *done_handler;    void *their_data;    int retval = 0;    assert(initialised);    squidaio_counts.check_callback++;    for (;;) {	if ((resultp = squidaio_poll_done()) == NULL)	    break;	ctrlp = (squidaio_ctrl_t *) resultp->data;	if (ctrlp == NULL)	    continue;		/* XXX Should not happen */	dlinkDelete(&ctrlp->node, &used_list);	if ((done_handler = ctrlp->done_handler)) {	    their_data = ctrlp->done_handler_data;	    ctrlp->done_handler = NULL;	    ctrlp->done_handler_data = NULL;	    if (cbdataValid(their_data)) {		retval = 1;	/* Return that we've actually done some work */		done_handler(ctrlp->fd, their_data, ctrlp->bufp,		    ctrlp->result.aio_return, ctrlp->result.aio_errno);	    } else {		if (ctrlp->operation == _AIO_OPEN) {		    /* The open operation was aborted.. */		    int fd = ctrlp->result.aio_return;		    if (fd >= 0)			aioClose(fd);		}	    }	    cbdataUnlock(their_data);	}	/* free data if requested to aioWrite() */	if (ctrlp->free_func)	    ctrlp->free_func(ctrlp->bufp);	/* free temporary read buffer */	if (ctrlp->operation == _AIO_READ)	    squidaio_xfree(ctrlp->bufp, ctrlp->len);	memPoolFree(squidaio_ctrl_pool, ctrlp);    }    return retval;}voidaioStats(StoreEntry * sentry){    storeAppendPrintf(sentry, "ASYNC IO Counters:\n");    storeAppendPrintf(sentry, "Operation\t# Requests\n");    storeAppendPrintf(sentry, "open\t%d\n", squidaio_counts.open);    storeAppendPrintf(sentry, "close\t%d\n", squidaio_counts.close);    storeAppendPrintf(sentry, "cancel\t%d\n", squidaio_counts.cancel);    storeAppendPrintf(sentry, "write\t%d\n", squidaio_counts.write);    storeAppendPrintf(sentry, "read\t%d\n", squidaio_counts.read);    storeAppendPrintf(sentry, "stat\t%d\n", squidaio_counts.stat);    storeAppendPrintf(sentry, "unlink\t%d\n", squidaio_counts.unlink);    storeAppendPrintf(sentry, "check_callback\t%d\n", squidaio_counts.check_callback);    storeAppendPrintf(sentry, "queue\t%d\n", squidaio_get_queue_len());    squidaio_stats(sentry);}/* Flush all pending I/O */voidaioSync(SwapDir * SD){    if (!initialised)	return;			/* nothing to do then */    /* Flush all pending operations */    debug(32, 1) ("aioSync: flushing pending I/O operations\n");    do {	aioCheckCallbacks(SD);    } while (squidaio_sync());    debug(32, 1) ("aioSync: done\n");}intaioQueueSize(void){    return memPoolInUseCount(squidaio_ctrl_pool);}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩另类视频免费观看| 一区二区欧美视频| 亚洲日本在线看| 久久av资源网| 日本高清不卡视频| 久久久久久久久久久黄色| 视频一区二区欧美| 一本大道久久a久久综合婷婷| 欧美精品一区男女天堂| 亚洲一级不卡视频| 99精品视频在线免费观看| 日韩一区二区电影| 午夜影院久久久| 色噜噜狠狠一区二区三区果冻| 精品999久久久| 美日韩一级片在线观看| 在线视频中文字幕一区二区| 国产精品日日摸夜夜摸av| 精品在线免费观看| 欧美一级欧美一级在线播放| 亚洲国产毛片aaaaa无费看| 91麻豆精品在线观看| 国产精品乱码一区二三区小蝌蚪| 国产精品自拍网站| 日韩亚洲欧美一区二区三区| 视频在线观看一区| 欧美日韩你懂得| 亚洲一区二区偷拍精品| 色婷婷狠狠综合| 亚洲精品日韩综合观看成人91| 成人性色生活片免费看爆迷你毛片| 精品久久久久久久久久久久久久久久久 | 肉丝袜脚交视频一区二区| 99视频一区二区| 国产精品美女一区二区在线观看| 国产高清在线观看免费不卡| 国产免费观看久久| eeuss鲁片一区二区三区| 国产精品免费人成网站| 99re这里只有精品视频首页| 国产一区二区精品久久| 欧美成人综合网站| 国产精品资源站在线| 国产精品毛片久久久久久久| 91麻豆免费视频| 亚洲一区二区欧美| 日韩一区二区在线观看视频 | 亚洲欧美日韩久久| 91激情在线视频| 五月天视频一区| 日韩精品专区在线| 国产成人午夜精品影院观看视频| 中文字幕一区在线| 精品视频一区二区三区免费| 欧美a级理论片| 国产精品污www在线观看| 99久久精品国产麻豆演员表| 亚洲v精品v日韩v欧美v专区| 亚洲精品一区二区三区在线观看| 成人av电影在线播放| 亚洲国产精品麻豆| 久久久久久久网| 欧美日韩一区三区四区| 国产自产高清不卡| 亚洲裸体xxx| 日韩免费福利电影在线观看| 成人av电影在线网| 琪琪久久久久日韩精品| 国产日韩精品一区二区浪潮av | 午夜天堂影视香蕉久久| 欧美va日韩va| 欧美午夜影院一区| 国产精品一卡二卡| 午夜久久久久久| 亚洲国产精品成人综合| 51精品久久久久久久蜜臀| 国产91丝袜在线播放| 天天色天天爱天天射综合| 国产精品无人区| 欧美第一区第二区| 欧美在线播放高清精品| 国产91精品久久久久久久网曝门| 天天综合色天天| 一区二区三区在线观看视频| 国产亚洲欧美中文| 日韩一级欧美一级| 在线观看网站黄不卡| 成人综合日日夜夜| 韩国精品主播一区二区在线观看| 亚洲va欧美va国产va天堂影院| 国产精品久久精品日日| 久久久久国色av免费看影院| 91精品欧美久久久久久动漫| 欧美写真视频网站| 日本高清不卡视频| 99久久免费精品高清特色大片| 国产真实乱偷精品视频免| 国产999精品久久| 加勒比av一区二区| 日韩一区精品视频| 亚洲不卡在线观看| 伊人婷婷欧美激情| 亚洲精品视频在线观看网站| 亚洲欧洲精品成人久久奇米网 | 日韩一区二区影院| 欧美日韩一区二区三区四区五区| 一本色道久久综合狠狠躁的推荐 | 国产成人亚洲精品狼色在线| 免费的国产精品| 日韩高清在线不卡| 五月婷婷久久丁香| 美日韩黄色大片| 蜜臀av一区二区在线观看 | 91精品国产欧美一区二区成人| 精品视频一区二区不卡| 欧美怡红院视频| 色婷婷综合五月| 欧美无人高清视频在线观看| 欧美日韩一区二区三区不卡| 欧美精品tushy高清| 777午夜精品视频在线播放| 91精品婷婷国产综合久久竹菊| 91麻豆精品国产自产在线观看一区 | 91麻豆免费观看| 欧美午夜宅男影院| 欧美日韩精品电影| 日韩三级免费观看| 欧美精品一区视频| 国产精品久久久久久亚洲伦| 亚洲美女屁股眼交3| 亚洲国产sm捆绑调教视频| 日本中文在线一区| 韩国av一区二区三区在线观看| 国产一区欧美一区| 成人18精品视频| 欧美日韩国产三级| 欧美精品一区二区三区高清aⅴ| 久久久www免费人成精品| 国产精品乱人伦| 日韩影院在线观看| 国产成人精品网址| 91精彩视频在线观看| 欧美一级国产精品| 亚洲欧美综合色| 日本欧美一区二区三区| 国产精华液一区二区三区| 色综合久久中文综合久久97| 欧美一区二区国产| 中文一区二区完整视频在线观看 | 欧美四级电影在线观看| 日韩写真欧美这视频| 国产精品免费观看视频| 亚洲精品视频免费观看| 精品影院一区二区久久久| 99视频在线精品| 精品久久久久久久人人人人传媒| 亚洲精品亚洲人成人网| 久久超碰97中文字幕| 色国产综合视频| 精品国产乱码久久久久久久久 | 欧美猛男超大videosgay| 欧美一级片免费看| 亚洲黄色尤物视频| 韩国一区二区三区| 欧美精品tushy高清| 亚洲天堂免费在线观看视频| 韩国一区二区在线观看| 欧美精品v日韩精品v韩国精品v| 国产精品美女久久久久高潮| 蜜桃av一区二区在线观看| 色悠悠久久综合| 国产清纯美女被跳蛋高潮一区二区久久w| 亚洲线精品一区二区三区| av中文字幕一区| 久久久电影一区二区三区| 麻豆免费看一区二区三区| 欧美三级视频在线播放| 日韩理论电影院| eeuss影院一区二区三区| 国产亚洲欧美日韩日本| 久久丁香综合五月国产三级网站| 在线国产亚洲欧美| 亚洲精品水蜜桃| 色美美综合视频| 一区二区三区在线观看网站| 95精品视频在线| 中文字幕亚洲成人| 成人精品免费视频| 欧美激情一二三区| 国产99精品视频| 国产精品乱子久久久久| 国产69精品一区二区亚洲孕妇| 精品福利二区三区| 狠狠色2019综合网| 久久久电影一区二区三区| 国产一区二区三区观看| 久久久久久亚洲综合| 国产美女精品人人做人人爽| 久久综合久久综合亚洲| 国产一区二区视频在线播放|