From daa05a473f696f794b87f8ab0420feb443670bb1 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Wed, 26 May 1999 12:24:21 +0000 Subject: [PATCH] added big store system chunk --- doc/Programming-Guide/prog-guide.sgml | 262 +++++++++++++++++++++++--- 1 file changed, 239 insertions(+), 23 deletions(-) diff --git a/doc/Programming-Guide/prog-guide.sgml b/doc/Programming-Guide/prog-guide.sgml index 226ceb165e..a144a28030 100644 --- a/doc/Programming-Guide/prog-guide.sgml +++ b/doc/Programming-Guide/prog-guide.sgml @@ -686,14 +686,13 @@ Squid consists of the following major components it. Currently, this structure looks like: struct _storeIOState { - int fd; sfileno swap_file_number; - mode_t mode; + mode_t mode; size_t st_size; /* do stat(2) after read open */ off_t offset; /* current offset pointer */ - STIOCB *callback; + STIOCB *callback; void *callback_data; - struct { + struct { STRCB *callback; void *callback_data; } read; @@ -702,22 +701,22 @@ Squid consists of the following major components } flags; union { struct { - struct { + int fd; + struct { unsigned int close_request:1; unsigned int reading:1; unsigned int writing:1; } flags; } ufs; } type; - }; + }; - External Functions -Object I/O + +

+ These functions all relate to per-object I/O tasks: opening, + closing, reading, writing, and unlinking objects on disk. + +

+ Note that the underlying storage system functions are + accessed through function pointers, kept in the + + struct _SwapDir { + .... + struct { + STOBJOPEN *open; + STOBJCLOSE *close; + STOBJREAD *read; + STOBJWRITE *write; + STOBJUNLINK *unlink; + } obj; + .... + }; + + +

+ Thus, a storage system must do something like this + when initializing its + SwapDir->obj.open = storeFooOpen; + SwapDir->obj.close = storeFooClose; + SwapDir->obj.read = storeFooRead; + SwapDir->obj.write = storeFooWrite; + SwapDir->obj.unlink = storeFooUnlink; + + + @@ -769,7 +808,7 @@ Squid consists of the following major components assume the open request will succeed, and may begin reading or writing immediately. - @@ -785,7 +824,7 @@ Squid consists of the following major components the @@ -806,7 +845,7 @@ Squid consists of the following major components

The caller is responsible for allocating and freeing @@ -828,7 +867,7 @@ Squid consists of the following major components calling module by calling the @@ -842,7 +881,10 @@ Squid consists of the following major components does not need to be opened first. The filesystem layer will remove the object if it exists on the disk. - + These functions can be found in @@ -854,7 +896,7 @@ Squid consists of the following major components Returns the current byte-offset of the cache object on disk. - @@ -881,7 +923,7 @@ Squid consists of the following major components Once the The @@ -898,14 +940,188 @@ Squid consists of the following major components called if the read operation is successful. If it fails, then the Todo... +Config file parsing + +

+ There are three functions relating to the Squid configuration + file: parsing, dumping, and freeing. + +

+ The parse function is called at startup, and during a reconfigure, + for a + The ``dump'' function is used to output a configuration + file from the in-memory configuration structure. It is + called with a + The free function is called during a reconfigure (and at + exit) to free up (or un-initialize) any memory or structures + associated with the configuration line. The Filesystem Startup, Initialization, and State Logging + +

+ These functions deal with initializing, state + logging, and related tasks for a squid storage system. + These functions can be found in + Each storage system must provide the functions + described in this section. Each function is + accessed through a function pointer stored in + the + struct _SwapDir { + ... + STINIT *init; + STNEWFS *newfs; + struct { + STLOGOPEN *open; + STLOGCLOSE *close; + STLOGWRITE *write; + struct { + STLOGCLEANOPEN *open; + STLOGCLEANWRITE *write; + void *state; + } clean; + } log; + .... + }; + + + + + void + STINIT(SwapDir *); + + +

+ The + + void + STNEWFS(SwapDir *); + + +

+ The + + void + STLOGOPEN(SwapDir *); + + +

+ The + The + + void + STLOGCLOSE(SwapDir *); + + +

+ The + + void + STLOGWRITE(const SwapDir *, const StoreEntry *, int op); + + +

+ The + + int + STLOGCLEANOPEN(SwapDir *); + + +

+ The + The + + void + STLOGCLEANWRITE(const StoreEntry *, SwapDir *); + + +

+ The - Note there is much work yet to be done in defining - this programming interface. All of the code for - rebuilding the disk store at startup is still very - UFS-specific. The configuration file and -- 2.47.2