📄 store_null.c
字号:
/* * $Id: store_null.c,v 1.7 2006/06/08 13:39:52 hno Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels * * 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"#if HAVE_STATVFS#if HAVE_SYS_STATVFS_H#include <sys/statvfs.h>#endif#endifstatic int null_initialised = 0;static void storeNullDirInit(SwapDir * sd);static void storeNullDirStats(SwapDir * SD, StoreEntry * sentry);static STCHECKOBJ storeNullDirCheckObj;static STFSRECONFIGURE storeNullDirReconfigure;static STLOGCLEANSTART storeNullDirWriteCleanStart;static STLOGCLEANDONE storeNullDirWriteCleanDone;static EVH storeNullDirRebuildComplete;/* The only externally visible interface */STSETUP storeFsSetup_null;static voidstoreNullDirReconfigure(SwapDir * sd, int index, char *path){ (void) 0;}static voidstoreNullDirDone(void){ null_initialised = 0;}static voidstoreNullDirStats(SwapDir * SD, StoreEntry * sentry){ (void) 0;}static voidstoreNullDirInit(SwapDir * sd){ store_dirs_rebuilding++; eventAdd("storeNullDirRebuildComplete", storeNullDirRebuildComplete, NULL, 0.0, 1);}/* * Only "free" the filesystem specific stuff here */static voidstoreNullDirFree(SwapDir * s){}static voidstoreNullDirRebuildComplete(void *unused){ struct _store_rebuild_data counts; memset(&counts, '\0', sizeof(counts)); store_dirs_rebuilding--; storeRebuildComplete(&counts);}static intstoreNullDirCheckObj(SwapDir * SD, const StoreEntry * e){ return 0;}/* * We should never, in theory, see an open/create, but just in case.. */static intstoreNullDirCheckLoadAv(SwapDir * SD, store_op_t op){ return -1;}static intstoreNullDirWriteCleanStart(SwapDir * unused){ return 0;}static voidstoreNullDirWriteCleanDone(SwapDir * unused){ (void) 0;}static voidstoreNullDirParse(SwapDir * sd, int index, char *path){ sd->index = index; sd->path = xstrdup(path); sd->statfs = storeNullDirStats; sd->init = storeNullDirInit; sd->freefs = storeNullDirFree; sd->checkobj = storeNullDirCheckObj; sd->checkload = storeNullDirCheckLoadAv; sd->log.clean.start = storeNullDirWriteCleanStart; sd->log.clean.done = storeNullDirWriteCleanDone; parse_cachedir_options(sd, NULL, 0);}/* Setup and register the store module */voidstoreFsSetup_null(storefs_entry_t * storefs){ assert(!null_initialised); storefs->parsefunc = storeNullDirParse; storefs->reconfigurefunc = storeNullDirReconfigure; storefs->donefunc = storeNullDirDone; null_initialised = 1;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -