head 1.16; access; symbols netbsd-10-0-RELEASE:1.16 netbsd-10-0-RC6:1.16 netbsd-10-0-RC5:1.16 netbsd-10-0-RC4:1.16 netbsd-10-0-RC3:1.16 netbsd-10-0-RC2:1.16 netbsd-10-0-RC1:1.16 netbsd-10:1.16.0.24 netbsd-10-base:1.16 netbsd-9-3-RELEASE:1.16 cjep_sun2x-base1:1.16 cjep_sun2x:1.16.0.22 cjep_sun2x-base:1.16 cjep_staticlib_x-base1:1.16 netbsd-9-2-RELEASE:1.16 cjep_staticlib_x:1.16.0.20 cjep_staticlib_x-base:1.16 netbsd-9-1-RELEASE:1.16 phil-wifi-20200421:1.16 phil-wifi-20200411:1.16 is-mlppp:1.16.0.18 is-mlppp-base:1.16 phil-wifi-20200406:1.16 netbsd-8-2-RELEASE:1.16 netbsd-9-0-RELEASE:1.16 netbsd-9-0-RC2:1.16 netbsd-9-0-RC1:1.16 phil-wifi-20191119:1.16 netbsd-9:1.16.0.16 netbsd-9-base:1.16 phil-wifi-20190609:1.16 netbsd-8-1-RELEASE:1.16 netbsd-8-1-RC1:1.16 pgoyette-compat-merge-20190127:1.16 pgoyette-compat-20190127:1.16 pgoyette-compat-20190118:1.16 pgoyette-compat-1226:1.16 pgoyette-compat-1126:1.16 pgoyette-compat-1020:1.16 pgoyette-compat-0930:1.16 pgoyette-compat-0906:1.16 netbsd-7-2-RELEASE:1.14 pgoyette-compat-0728:1.16 netbsd-8-0-RELEASE:1.16 phil-wifi:1.16.0.14 phil-wifi-base:1.16 pgoyette-compat-0625:1.16 netbsd-8-0-RC2:1.16 pgoyette-compat-0521:1.16 pgoyette-compat-0502:1.16 pgoyette-compat-0422:1.16 netbsd-8-0-RC1:1.16 pgoyette-compat-0415:1.16 pgoyette-compat-0407:1.16 pgoyette-compat-0330:1.16 pgoyette-compat-0322:1.16 pgoyette-compat-0315:1.16 netbsd-7-1-2-RELEASE:1.14 pgoyette-compat:1.16.0.12 pgoyette-compat-base:1.16 netbsd-7-1-1-RELEASE:1.14 matt-nb8-mediatek:1.16.0.10 matt-nb8-mediatek-base:1.16 perseant-stdc-iso10646:1.16.0.8 perseant-stdc-iso10646-base:1.16 netbsd-8:1.16.0.6 netbsd-8-base:1.16 prg-localcount2-base3:1.16 prg-localcount2-base2:1.16 prg-localcount2-base1:1.16 prg-localcount2:1.16.0.4 prg-localcount2-base:1.16 pgoyette-localcount-20170426:1.16 bouyer-socketcan-base1:1.16 pgoyette-localcount-20170320:1.16 netbsd-7-1:1.14.0.12 netbsd-7-1-RELEASE:1.14 netbsd-7-1-RC2:1.14 netbsd-7-nhusb-base-20170116:1.14 bouyer-socketcan:1.16.0.2 bouyer-socketcan-base:1.16 pgoyette-localcount-20170107:1.16 netbsd-7-1-RC1:1.14 pgoyette-localcount-20161104:1.16 netbsd-7-0-2-RELEASE:1.14 localcount-20160914:1.14 netbsd-7-nhusb:1.14.0.10 netbsd-7-nhusb-base:1.14 pgoyette-localcount-20160806:1.14 pgoyette-localcount-20160726:1.14 pgoyette-localcount:1.14.0.8 pgoyette-localcount-base:1.14 netbsd-7-0-1-RELEASE:1.14 netbsd-7-0:1.14.0.6 netbsd-7-0-RELEASE:1.14 netbsd-7-0-RC3:1.14 netbsd-7-0-RC2:1.14 netbsd-7-0-RC1:1.14 netbsd-5-2-3-RELEASE:1.13 netbsd-5-1-5-RELEASE:1.13 netbsd-6-0-6-RELEASE:1.13 netbsd-6-1-5-RELEASE:1.13 netbsd-7:1.14.0.4 netbsd-7-base:1.14 yamt-pagecache-base9:1.14 yamt-pagecache-tag8:1.13 netbsd-6-1-4-RELEASE:1.13 netbsd-6-0-5-RELEASE:1.13 tls-earlyentropy:1.14.0.2 tls-earlyentropy-base:1.14 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.14 riastradh-drm2-base3:1.14 netbsd-6-1-3-RELEASE:1.13 netbsd-6-0-4-RELEASE:1.13 netbsd-5-2-2-RELEASE:1.13 netbsd-5-1-4-RELEASE:1.13 netbsd-6-1-2-RELEASE:1.13 netbsd-6-0-3-RELEASE:1.13 netbsd-5-2-1-RELEASE:1.13 netbsd-5-1-3-RELEASE:1.13 netbsd-6-1-1-RELEASE:1.13 riastradh-drm2-base2:1.13 riastradh-drm2-base1:1.13 riastradh-drm2:1.13.0.34 riastradh-drm2-base:1.13 netbsd-6-1:1.13.0.38 netbsd-6-0-2-RELEASE:1.13 netbsd-6-1-RELEASE:1.13 netbsd-6-1-RC4:1.13 netbsd-6-1-RC3:1.13 agc-symver:1.13.0.36 agc-symver-base:1.13 netbsd-6-1-RC2:1.13 netbsd-6-1-RC1:1.13 yamt-pagecache-base8:1.13 netbsd-5-2:1.13.0.32 netbsd-6-0-1-RELEASE:1.13 yamt-pagecache-base7:1.13 netbsd-5-2-RELEASE:1.13 netbsd-5-2-RC1:1.13 matt-nb6-plus-nbase:1.13 yamt-pagecache-base6:1.13 netbsd-6-0:1.13.0.30 netbsd-6-0-RELEASE:1.13 netbsd-6-0-RC2:1.13 tls-maxphys:1.13.0.28 tls-maxphys-base:1.14 matt-nb6-plus:1.13.0.26 matt-nb6-plus-base:1.13 netbsd-6-0-RC1:1.13 yamt-pagecache-base5:1.13 yamt-pagecache-base4:1.13 netbsd-6:1.13.0.24 netbsd-6-base:1.13 netbsd-5-1-2-RELEASE:1.13 netbsd-5-1-1-RELEASE:1.13 yamt-pagecache-base3:1.13 yamt-pagecache-base2:1.13 yamt-pagecache:1.13.0.2 yamt-pagecache-base:1.13 cherry-xenmp:1.13.0.22 cherry-xenmp-base:1.13 uebayasi-xip-base7:1.13 bouyer-quota2-nbase:1.13 bouyer-quota2:1.13.0.20 bouyer-quota2-base:1.13 matt-mips64-premerge-20101231:1.13 matt-nb5-mips64-premerge-20101231:1.13 matt-nb5-pq3:1.13.0.18 matt-nb5-pq3-base:1.13 netbsd-5-1:1.13.0.16 uebayasi-xip-base6:1.13 uebayasi-xip-base5:1.13 netbsd-5-1-RELEASE:1.13 uebayasi-xip-base4:1.13 uebayasi-xip-base3:1.13 netbsd-5-1-RC4:1.13 matt-nb5-mips64-k15:1.13 uebayasi-xip-base2:1.13 netbsd-5-1-RC3:1.13 netbsd-5-1-RC2:1.13 uebayasi-xip-base1:1.13 netbsd-5-1-RC1:1.13 uebayasi-xip:1.13.0.14 uebayasi-xip-base:1.13 netbsd-5-0-2-RELEASE:1.13 matt-nb5-mips64-premerge-20091211:1.13 matt-premerge-20091211:1.13 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.13 matt-nb4-mips64-k7-u2a-k9b:1.13 matt-nb5-mips64-u1-k1-k5:1.13 matt-nb5-mips64:1.13.0.12 netbsd-5-0-1-RELEASE:1.13 jym-xensuspend-nbase:1.13 netbsd-5-0:1.13.0.10 netbsd-5-0-RELEASE:1.13 netbsd-5-0-RC4:1.13 netbsd-5-0-RC3:1.13 netbsd-5-0-RC2:1.13 jym-xensuspend:1.13.0.8 jym-xensuspend-base:1.13 netbsd-5-0-RC1:1.13 christos-time_t-nbase:1.13 christos-time_t:1.13.0.6 christos-time_t-base:1.13 netbsd-5:1.13.0.4 netbsd-5-base:1.13 matt-mips64-base2:1.13 matt-mips64:1.12.0.24 netbsd-4-0-1-RELEASE:1.12 wrstuden-revivesa-base-3:1.13 wrstuden-revivesa-base-2:1.13 wrstuden-fixsa-newbase:1.12 wrstuden-revivesa-base-1:1.12 simonb-wapbl-nbase:1.12 yamt-pf42-base4:1.12 simonb-wapbl:1.12.0.22 simonb-wapbl-base:1.12 yamt-pf42-base3:1.12 hpcarm-cleanup-nbase:1.12 yamt-pf42-baseX:1.12 yamt-pf42-base2:1.12 wrstuden-revivesa:1.12.0.20 wrstuden-revivesa-base:1.12 yamt-pf42:1.12.0.18 yamt-pf42-base:1.12 keiichi-mipv6:1.12.0.16 keiichi-mipv6-base:1.12 matt-armv6-nbase:1.12 matt-armv6-prevmlocking:1.12 wrstuden-fixsa-base-1:1.12 netbsd-4-0:1.12.0.14 netbsd-4-0-RELEASE:1.12 cube-autoconf:1.12.0.12 cube-autoconf-base:1.12 netbsd-4-0-RC5:1.12 netbsd-4-0-RC4:1.12 netbsd-4-0-RC3:1.12 netbsd-4-0-RC2:1.12 netbsd-4-0-RC1:1.12 matt-armv6:1.12.0.10 matt-armv6-base:1.12 matt-mips64-base:1.12 hpcarm-cleanup:1.12.0.8 hpcarm-cleanup-base:1.12 netbsd-3-1-1-RELEASE:1.11 netbsd-3-0-3-RELEASE:1.11 wrstuden-fixsa:1.12.0.6 wrstuden-fixsa-base:1.12 abandoned-netbsd-4-base:1.12 abandoned-netbsd-4:1.12.0.2 netbsd-3-1:1.11.0.6 netbsd-3-1-RELEASE:1.11 netbsd-3-0-2-RELEASE:1.11 netbsd-3-1-RC4:1.11 netbsd-3-1-RC3:1.11 netbsd-3-1-RC2:1.11 netbsd-3-1-RC1:1.11 netbsd-4:1.12.0.4 netbsd-4-base:1.12 netbsd-3-0-1-RELEASE:1.11 netbsd-3-0:1.11.0.4 netbsd-3-0-RELEASE:1.11 netbsd-3-0-RC6:1.11 netbsd-3-0-RC5:1.11 netbsd-3-0-RC4:1.11 netbsd-3-0-RC3:1.11 netbsd-3-0-RC2:1.11 netbsd-3-0-RC1:1.11 netbsd-2-0-3-RELEASE:1.10 netbsd-2-1:1.10.0.6 netbsd-2-1-RELEASE:1.10 netbsd-2-1-RC6:1.10 netbsd-2-1-RC5:1.10 netbsd-2-1-RC4:1.10 netbsd-2-1-RC3:1.10 netbsd-2-1-RC2:1.10 netbsd-2-1-RC1:1.10 netbsd-2-0-2-RELEASE:1.10 netbsd-3:1.11.0.2 netbsd-3-base:1.11 netbsd-2-0-1-RELEASE:1.10 netbsd-2:1.10.0.4 netbsd-2-base:1.10 netbsd-2-0-RELEASE:1.10 netbsd-2-0-RC5:1.10 netbsd-2-0-RC4:1.10 netbsd-2-0-RC3:1.10 netbsd-2-0-RC2:1.10 netbsd-2-0-RC1:1.10 netbsd-2-0:1.10.0.2 netbsd-2-0-base:1.10 netbsd-1-6-PATCH002-RELEASE:1.9 netbsd-1-6-PATCH002:1.9 netbsd-1-6-PATCH002-RC4:1.9 netbsd-1-6-PATCH002-RC3:1.9 netbsd-1-6-PATCH002-RC2:1.9 netbsd-1-6-PATCH002-RC1:1.9 netbsd-1-6-PATCH001:1.9 netbsd-1-6-PATCH001-RELEASE:1.9 netbsd-1-6-PATCH001-RC3:1.9 netbsd-1-6-PATCH001-RC2:1.9 netbsd-1-6-PATCH001-RC1:1.9 nathanw_sa_before_merge:1.9 nathanw_sa_end:1.9 fvdl_fs64_base:1.9 nathanw_sa_base:1.9 netbsd-1-6-RELEASE:1.9 netbsd-1-6-RC3:1.9 netbsd-1-6-RC2:1.9 netbsd-1-6-RC1:1.9 netbsd-1-6:1.9.0.4 netbsd-1-6-base:1.9 netbsd-1-5-PATCH003:1.8 netbsd-1-5-PATCH002:1.8 netbsd-1-5-PATCH001:1.8 nathanw_sa:1.9.0.2 netbsd-1-5-RELEASE:1.8 netbsd-1-5-BETA2:1.8 netbsd-1-5-BETA:1.8 netbsd-1-4-PATCH003:1.8 netbsd-1-5-ALPHA2:1.8 netbsd-1-5:1.8.0.10 netbsd-1-5-base:1.8 minoura-xpg4dl:1.8.0.8 minoura-xpg4dl-base:1.8 netbsd-1-4-PATCH002:1.8 wrstuden-devbsize-19991221:1.8 wrstuden-devbsize:1.8.0.6 wrstuden-devbsize-base:1.8 comdex-fall-1999:1.8.0.4 comdex-fall-1999-base:1.8 netbsd-1-4-PATCH001:1.8 netbsd-1-4-RELEASE:1.8 netbsd-1-4:1.8.0.2 netbsd-1-4-base:1.8 netbsd-1-3-PATCH003:1.7 netbsd-1-3-PATCH003-CANDIDATE2:1.7 netbsd-1-3-PATCH003-CANDIDATE1:1.7 netbsd-1-3-PATCH003-CANDIDATE0:1.7 netbsd-1-3-PATCH002:1.7 netbsd-1-3-PATCH001:1.7 lite-2:1.1.1.3 netbsd-1-3-RELEASE:1.7 netbsd-1-3-BETA:1.7 netbsd-1-3:1.7.0.6 netbsd-1-3-base:1.7 netbsd-1-2-PATCH001:1.7 nsswitch:1.7.0.2 netbsd-1-2-RELEASE:1.7 netbsd-1-2-BETA:1.7 netbsd-1-2-base:1.7 netbsd-1-2:1.7.0.4 db-1-85:1.1.1.2 netbsd-1-1-PATCH001:1.6 netbsd-1-1-RELEASE:1.6 netbsd-1-1:1.6.0.2 netbsd-1-1-base:1.6 netbsd-1-0-PATCH06:1.5 netbsd-1-0-PATCH05:1.5 netbsd-1-0-PATCH04:1.5 netbsd-1-0-PATCH03:1.5 netbsd-1-0-PATCH02:1.5 netbsd-1-0-PATCH1:1.5 netbsd-1-0-PATCH0:1.5 netbsd-1-0-RELEASE:1.5 netbsd-1-0:1.5.0.2 CSRG-94-08-17:1.1.1.1 CSRG:1.1.1 netbsd-1-0-base:1.4 netbsd-0-9-RELEASE:1.3 netbsd-0-9-BETA:1.3 netbsd-0-9-ALPHA2:1.3 netbsd-0-9-ALPHA:1.3 netbsd-0-9:1.3.0.2 netbsd-0-9-base:1.3; locks; strict; comment @ * @; 1.16 date 2016.09.24.21.18.09; author christos; state Exp; branches; next 1.15; commitid McahjFnJci7ErAnz; 1.15 date 2016.09.24.20.11.43; author christos; state Exp; branches; next 1.14; commitid 6wvPOZfjplNO4Anz; 1.14 date 2013.11.22.16.25.01; author christos; state Exp; branches 1.14.8.1; next 1.13; commitid g7zJrMKUOzkG9iex; 1.13 date 2008.08.26.21.18.38; author joerg; state Exp; branches 1.13.2.1 1.13.6.1 1.13.28.1; next 1.12; 1.12 date 2005.12.26.19.01.47; author perry; state Exp; branches 1.12.20.1; next 1.11; 1.11 date 2005.02.03.04.39.32; author perry; state Exp; branches; next 1.10; 1.10 date 2003.08.07.09.44.10; author agc; state Exp; branches; next 1.9; 1.9 date 2000.07.07.10.43.54; author ad; state Exp; branches; next 1.8; 1.8 date 98.02.10.00.29.57; author perry; state Exp; branches; next 1.7; 1.7 date 96.05.03.21.13.41; author cgd; state Exp; branches; next 1.6; 1.6 date 94.10.26.00.56.07; author cgd; state Exp; branches; next 1.5; 1.5 date 94.08.17.22.58.59; author cgd; state Exp; branches 1.5.2.1; next 1.4; 1.4 date 93.08.01.18.44.47; author mycroft; state Exp; branches; next 1.3; 1.3 date 93.06.14.23.51.30; author cgd; state Exp; branches; next 1.2; 1.2 date 93.05.27.19.54.32; author cgd; state Exp; branches; next 1.1; 1.1 date 93.04.18.21.48.38; author proven; state Exp; branches 1.1.1.1; next ; 1.14.8.1 date 2016.11.04.14.48.51; author pgoyette; state Exp; branches; next ; commitid 2m1JRwYmpwPkOOsz; 1.13.2.1 date 2014.05.22.11.36.35; author yamt; state Exp; branches; next ; commitid OndjEcbQZzO4KwBx; 1.13.6.1 date 2008.08.26.21.18.38; author joerg; state dead; branches; next 1.13.6.2; 1.13.6.2 date 2008.08.26.21.18.39; author joerg; state Exp; branches; next ; 1.13.28.1 date 2014.08.20.00.02.05; author tls; state Exp; branches; next ; commitid jTnpym9Qu0o4R1Nx; 1.12.20.1 date 2008.09.18.04.39.55; author wrstuden; state Exp; branches; next ; 1.5.2.1 date 94.08.17.22.58.59; author cgd; state dead; branches; next 1.5.2.2; 1.5.2.2 date 94.08.17.22.59.00; author cgd; state Exp; branches; next ; 1.1.1.1 date 94.08.17.22.52.42; author cgd; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 96.05.03.21.06.04; author cgd; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 98.02.02.07.23.17; author perry; state Exp; branches; next ; desc @@ 1.16 log @remove mpool_getf @ text @/* $NetBSD: mpool.h,v 1.15 2016/09/24 20:11:43 christos Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @@(#)mpool.h 8.2 (Berkeley) 7/14/94 */ #ifndef _MPOOL_H_ #define _MPOOL_H_ #include #include /* * The memory pool scheme is a simple one. Each in-memory page is referenced * by a bucket which is threaded in up to two of three ways. All active pages * are threaded on a hash chain (hashed by page number) and an lru chain. * Inactive pages are threaded on a free chain. Each reference to a memory * pool is handed an opaque MPOOL cookie which stores all of this information. */ #define HASHSIZE 128 #define HASHKEY(pgno) ((pgno - 1) % HASHSIZE) /* The BKT structures are the elements of the queues. */ typedef struct _bkt { TAILQ_ENTRY(_bkt) hq; /* hash queue */ TAILQ_ENTRY(_bkt) q; /* lru queue */ void *page; /* page */ pgno_t pgno; /* page number */ #define MPOOL_DIRTY 0x01 /* page needs to be written */ #define MPOOL_PINNED 0x02 /* page is pinned into memory */ #define MPOOL_INUSE 0x04 /* page address is valid */ uint8_t flags; /* flags */ } BKT; typedef struct MPOOL { TAILQ_HEAD(_lqh, _bkt) lqh; /* lru queue head */ /* hash queue array */ TAILQ_HEAD(_hqh, _bkt) hqh[HASHSIZE]; pgno_t curcache; /* current number of cached pages */ pgno_t maxcache; /* max number of cached pages */ pgno_t npages; /* number of pages in the file */ unsigned long pagesize; /* file page size */ int fd; /* file descriptor */ /* page in conversion routine */ void (*pgin)(void *, pgno_t, void *); /* page out conversion routine */ void (*pgout)(void *, pgno_t, void *); void *pgcookie; /* cookie for page in/out routines */ #ifdef STATISTICS unsigned long cachehit; unsigned long cachemiss; unsigned long pagealloc; unsigned long pageflush; unsigned long pageget; unsigned long pagenew; unsigned long pageput; unsigned long pageread; unsigned long pagewrite; #endif } MPOOL; /* flags for get/put */ #define MPOOL_IGNOREPIN 0x01 /* Ignore if the page is pinned. */ /* flags for newf */ #define MPOOL_PAGE_REQUEST 0x01 /* Allocate a new page with a specific page number. */ #define MPOOL_PAGE_NEXT 0x02 /* Allocate a new page with the next page number. */ __BEGIN_DECLS MPOOL *mpool_open(void *, int, pgno_t, pgno_t); void mpool_filter(MPOOL *, void (*)(void *, pgno_t, void *), void (*)(void *, pgno_t, void *), void *); void *mpool_new(MPOOL *, pgno_t *); void *mpool_newf(MPOOL *, pgno_t *, unsigned int); int mpool_delete(MPOOL *, void *); void *mpool_get(MPOOL *, pgno_t, unsigned int); int mpool_put(MPOOL *, void *, unsigned int); int mpool_sync(MPOOL *); int mpool_close(MPOOL *); #ifdef STATISTICS void mpool_stat(MPOOL *); #endif __END_DECLS #endif /* _MPOOL_H_ */ @ 1.15 log @sync with mit/kerberos db @ text @d1 1 a1 1 /* $NetBSD: mpool.h,v 1.14 2013/11/22 16:25:01 christos Exp $ */ d105 1 a105 2 void *mpool_get(MPOOL *, pgno_t); void *mpool_getf(MPOOL *, pgno_t, unsigned int); @ 1.14 log @use a TAILQ instead of a CIRCLEQ, from FreeBSD @ text @d1 1 a1 1 /* $NetBSD: mpool.h,v 1.13 2008/08/26 21:18:38 joerg Exp $ */ d59 1 d90 8 d103 4 a106 1 void *mpool_get(MPOOL *, pgno_t, unsigned int); @ 1.14.8.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: mpool.h,v 1.16 2016/09/24 21:18:09 christos Exp $ */ a58 1 #define MPOOL_INUSE 0x04 /* page address is valid */ a88 8 /* flags for get/put */ #define MPOOL_IGNOREPIN 0x01 /* Ignore if the page is pinned. */ /* flags for newf */ #define MPOOL_PAGE_REQUEST 0x01 /* Allocate a new page with a specific page number. */ #define MPOOL_PAGE_NEXT 0x02 /* Allocate a new page with the next page number. */ a93 2 void *mpool_newf(MPOOL *, pgno_t *, unsigned int); int mpool_delete(MPOOL *, void *); @ 1.13 log @Convert db from UCB types to POSIX types. Prefer uint8_t for u_char as it is mostly about the wire format. Patched libc.so is bit-identical. OK matt@@ @ text @d1 1 a1 1 /* $NetBSD: mpool.h,v 1.12 2005/12/26 19:01:47 perry Exp $ */ d52 2 a53 2 CIRCLEQ_ENTRY(_bkt) hq; /* hash queue */ CIRCLEQ_ENTRY(_bkt) q; /* lru queue */ d63 1 a63 1 CIRCLEQ_HEAD(_lqh, _bkt) lqh; /* lru queue head */ d65 1 a65 1 CIRCLEQ_HEAD(_hqh, _bkt) hqh[HASHSIZE]; @ 1.13.28.1 log @Rebase to HEAD as of a few days ago. @ text @d1 1 a1 1 /* $NetBSD$ */ d52 2 a53 2 TAILQ_ENTRY(_bkt) hq; /* hash queue */ TAILQ_ENTRY(_bkt) q; /* lru queue */ d63 1 a63 1 TAILQ_HEAD(_lqh, _bkt) lqh; /* lru queue head */ d65 1 a65 1 TAILQ_HEAD(_hqh, _bkt) hqh[HASHSIZE]; @ 1.13.2.1 log @sync with head. for a reference, the tree before this commit was tagged as yamt-pagecache-tag8. this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments") @ text @d1 1 a1 1 /* $NetBSD: mpool.h,v 1.13 2008/08/26 21:18:38 joerg Exp $ */ d52 2 a53 2 TAILQ_ENTRY(_bkt) hq; /* hash queue */ TAILQ_ENTRY(_bkt) q; /* lru queue */ d63 1 a63 1 TAILQ_HEAD(_lqh, _bkt) lqh; /* lru queue head */ d65 1 a65 1 TAILQ_HEAD(_hqh, _bkt) hqh[HASHSIZE]; @ 1.13.6.1 log @file mpool.h was added on branch christos-time_t on 2008-08-26 21:18:39 +0000 @ text @d1 103 @ 1.13.6.2 log @Convert db from UCB types to POSIX types. Prefer uint8_t for u_char as it is mostly about the wire format. Patched libc.so is bit-identical. OK matt@@ @ text @a0 103 /* $NetBSD: mpool.h,v 1.13 2008/08/26 21:18:38 joerg Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @@(#)mpool.h 8.2 (Berkeley) 7/14/94 */ #ifndef _MPOOL_H_ #define _MPOOL_H_ #include #include /* * The memory pool scheme is a simple one. Each in-memory page is referenced * by a bucket which is threaded in up to two of three ways. All active pages * are threaded on a hash chain (hashed by page number) and an lru chain. * Inactive pages are threaded on a free chain. Each reference to a memory * pool is handed an opaque MPOOL cookie which stores all of this information. */ #define HASHSIZE 128 #define HASHKEY(pgno) ((pgno - 1) % HASHSIZE) /* The BKT structures are the elements of the queues. */ typedef struct _bkt { CIRCLEQ_ENTRY(_bkt) hq; /* hash queue */ CIRCLEQ_ENTRY(_bkt) q; /* lru queue */ void *page; /* page */ pgno_t pgno; /* page number */ #define MPOOL_DIRTY 0x01 /* page needs to be written */ #define MPOOL_PINNED 0x02 /* page is pinned into memory */ uint8_t flags; /* flags */ } BKT; typedef struct MPOOL { CIRCLEQ_HEAD(_lqh, _bkt) lqh; /* lru queue head */ /* hash queue array */ CIRCLEQ_HEAD(_hqh, _bkt) hqh[HASHSIZE]; pgno_t curcache; /* current number of cached pages */ pgno_t maxcache; /* max number of cached pages */ pgno_t npages; /* number of pages in the file */ unsigned long pagesize; /* file page size */ int fd; /* file descriptor */ /* page in conversion routine */ void (*pgin)(void *, pgno_t, void *); /* page out conversion routine */ void (*pgout)(void *, pgno_t, void *); void *pgcookie; /* cookie for page in/out routines */ #ifdef STATISTICS unsigned long cachehit; unsigned long cachemiss; unsigned long pagealloc; unsigned long pageflush; unsigned long pageget; unsigned long pagenew; unsigned long pageput; unsigned long pageread; unsigned long pagewrite; #endif } MPOOL; __BEGIN_DECLS MPOOL *mpool_open(void *, int, pgno_t, pgno_t); void mpool_filter(MPOOL *, void (*)(void *, pgno_t, void *), void (*)(void *, pgno_t, void *), void *); void *mpool_new(MPOOL *, pgno_t *); void *mpool_get(MPOOL *, pgno_t, unsigned int); int mpool_put(MPOOL *, void *, unsigned int); int mpool_sync(MPOOL *); int mpool_close(MPOOL *); #ifdef STATISTICS void mpool_stat(MPOOL *); #endif __END_DECLS #endif /* _MPOOL_H_ */ @ 1.12 log @u_intN_t -> uintN_t @ text @d1 1 a1 1 /* $NetBSD: mpool.h,v 1.11 2005/02/03 04:39:32 perry Exp $ */ d69 1 a69 1 u_long pagesize; /* file page size */ d77 9 a85 9 u_long cachehit; u_long cachemiss; u_long pagealloc; u_long pageflush; u_long pageget; u_long pagenew; u_long pageput; u_long pageread; u_long pagewrite; d94 2 a95 2 void *mpool_get(MPOOL *, pgno_t, u_int); int mpool_put(MPOOL *, void *, u_int); @ 1.12.20.1 log @Sync with wrstuden-revivesa-base-2. @ text @d1 1 a1 1 /* $NetBSD: mpool.h,v 1.12 2005/12/26 19:01:47 perry Exp $ */ d69 1 a69 1 unsigned long pagesize; /* file page size */ d77 9 a85 9 unsigned long cachehit; unsigned long cachemiss; unsigned long pagealloc; unsigned long pageflush; unsigned long pageget; unsigned long pagenew; unsigned long pageput; unsigned long pageread; unsigned long pagewrite; d94 2 a95 2 void *mpool_get(MPOOL *, pgno_t, unsigned int); int mpool_put(MPOOL *, void *, unsigned int); @ 1.11 log @de-__P -- the hack is long since useless. Discussed with christos, matt, kleink, others. Approved by christos. @ text @d1 1 a1 1 /* $NetBSD: mpool.h,v 1.10 2003/08/07 09:44:10 agc Exp $ */ d59 1 a59 1 u_int8_t flags; /* flags */ @ 1.10 log @Move UCB-licensed code from 4-clause to 3-clause licence. Patches provided by Joel Baker in PR 22270, verified by myself. @ text @d1 1 a1 1 /* $NetBSD: mpool.h,v 1.9 2000/07/07 10:43:54 ad Exp $ */ d72 1 a72 1 void (*pgin) __P((void *, pgno_t, void *)); d74 1 a74 1 void (*pgout) __P((void *, pgno_t, void *)); d90 8 a97 8 MPOOL *mpool_open __P((void *, int, pgno_t, pgno_t)); void mpool_filter __P((MPOOL *, void (*)(void *, pgno_t, void *), void (*)(void *, pgno_t, void *), void *)); void *mpool_new __P((MPOOL *, pgno_t *)); void *mpool_get __P((MPOOL *, pgno_t, u_int)); int mpool_put __P((MPOOL *, void *, u_int)); int mpool_sync __P((MPOOL *)); int mpool_close __P((MPOOL *)); d99 1 a99 1 void mpool_stat __P((MPOOL *)); @ 1.9 log @Pull in , since we're using __BEGIN_DECLS/__END_DECLS. @ text @d1 1 a1 1 /* $NetBSD: mpool.h,v 1.8 1998/02/10 00:29:57 perry Exp $ */ d15 1 a15 5 * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors @ 1.8 log @add/cleanup multiple inclusion protection. @ text @d1 1 a1 1 /* $NetBSD: mpool.h,v 1.7 1996/05/03 21:13:41 cgd Exp $ */ d41 1 @ 1.7 log @merge DB 1.85 import @ text @d1 1 a1 1 /* $NetBSD: mpool.h,v 1.6 1994/10/26 00:56:07 cgd Exp $ */ d38 3 d105 2 @ 1.6 log @new RCS ID format. @ text @d1 1 a1 1 /* $NetBSD$ */ d4 1 a4 1 * Copyright (c) 1991, 1993 d35 1 a35 1 * @@(#)mpool.h 8.1 (Berkeley) 6/2/93 d38 2 d41 5 a45 6 * The memory pool scheme is a simple one. Each in memory page is referenced * by a bucket which is threaded in three ways. All active pages are threaded * on a hash chain (hashed by the page number) and an lru chain. Inactive * pages are threaded on a free chain. Each reference to a memory pool is * handed an MPOOL which is the opaque cookie passed to all of the memory * routines. d50 6 a55 8 /* The BKT structures are the elements of the lists. */ typedef struct BKT { struct BKT *hnext; /* next hash bucket */ struct BKT *hprev; /* previous hash bucket */ struct BKT *cnext; /* next free/lru bucket */ struct BKT *cprev; /* previous free/lru bucket */ void *page; /* page */ pgno_t pgno; /* page number */ d59 1 a59 1 unsigned long flags; /* flags */ a61 8 /* The BKTHDR structures are the heads of the lists. */ typedef struct BKTHDR { struct BKT *hnext; /* next hash bucket */ struct BKT *hprev; /* previous hash bucket */ struct BKT *cnext; /* next free/lru bucket */ struct BKT *cprev; /* previous free/lru bucket */ } BKTHDR; d63 9 a71 9 BKTHDR free; /* The free list. */ BKTHDR lru; /* The LRU list. */ BKTHDR hashtable[HASHSIZE]; /* Hashed list by page number. */ pgno_t curcache; /* Current number of cached pages. */ pgno_t maxcache; /* Max number of cached pages. */ pgno_t npages; /* Number of pages in the file. */ u_long pagesize; /* File page size. */ int fd; /* File descriptor. */ /* Page in conversion routine. */ d73 1 a73 1 /* Page out conversion routine. */ d75 1 a75 1 void *pgcookie; /* Cookie for page in/out routines. */ d77 9 a85 9 unsigned long cachehit; unsigned long cachemiss; unsigned long pagealloc; unsigned long pageflush; unsigned long pageget; unsigned long pagenew; unsigned long pageput; unsigned long pageread; unsigned long pagewrite; a88 27 #ifdef __MPOOLINTERFACE_PRIVATE /* Macros to insert/delete into/from hash chain. */ #define rmhash(bp) { \ (bp)->hprev->hnext = (bp)->hnext; \ (bp)->hnext->hprev = (bp)->hprev; \ } #define inshash(bp, pg) { \ hp = &mp->hashtable[HASHKEY(pg)]; \ (bp)->hnext = hp->hnext; \ (bp)->hprev = (struct BKT *)hp; \ hp->hnext->hprev = (bp); \ hp->hnext = (bp); \ } /* Macros to insert/delete into/from lru and free chains. */ #define rmchain(bp) { \ (bp)->cprev->cnext = (bp)->cnext; \ (bp)->cnext->cprev = (bp)->cprev; \ } #define inschain(bp, dp) { \ (bp)->cnext = (dp)->cnext; \ (bp)->cprev = (struct BKT *)(dp); \ (dp)->cnext->cprev = (bp); \ (dp)->cnext = (bp); \ } #endif d90 1 a90 1 MPOOL *mpool_open __P((DBT *, int, pgno_t, pgno_t)); @ 1.5 log @clean up import @ text @d1 2 @ 1.5.2.1 log @file mpool.h was added on branch netbsd-1-0 on 1994-08-17 22:59:00 +0000 @ text @d1 135 @ 1.5.2.2 log @clean up import @ text @a0 135 /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @@(#)mpool.h 8.1 (Berkeley) 6/2/93 */ /* * The memory pool scheme is a simple one. Each in memory page is referenced * by a bucket which is threaded in three ways. All active pages are threaded * on a hash chain (hashed by the page number) and an lru chain. Inactive * pages are threaded on a free chain. Each reference to a memory pool is * handed an MPOOL which is the opaque cookie passed to all of the memory * routines. */ #define HASHSIZE 128 #define HASHKEY(pgno) ((pgno - 1) % HASHSIZE) /* The BKT structures are the elements of the lists. */ typedef struct BKT { struct BKT *hnext; /* next hash bucket */ struct BKT *hprev; /* previous hash bucket */ struct BKT *cnext; /* next free/lru bucket */ struct BKT *cprev; /* previous free/lru bucket */ void *page; /* page */ pgno_t pgno; /* page number */ #define MPOOL_DIRTY 0x01 /* page needs to be written */ #define MPOOL_PINNED 0x02 /* page is pinned into memory */ unsigned long flags; /* flags */ } BKT; /* The BKTHDR structures are the heads of the lists. */ typedef struct BKTHDR { struct BKT *hnext; /* next hash bucket */ struct BKT *hprev; /* previous hash bucket */ struct BKT *cnext; /* next free/lru bucket */ struct BKT *cprev; /* previous free/lru bucket */ } BKTHDR; typedef struct MPOOL { BKTHDR free; /* The free list. */ BKTHDR lru; /* The LRU list. */ BKTHDR hashtable[HASHSIZE]; /* Hashed list by page number. */ pgno_t curcache; /* Current number of cached pages. */ pgno_t maxcache; /* Max number of cached pages. */ pgno_t npages; /* Number of pages in the file. */ u_long pagesize; /* File page size. */ int fd; /* File descriptor. */ /* Page in conversion routine. */ void (*pgin) __P((void *, pgno_t, void *)); /* Page out conversion routine. */ void (*pgout) __P((void *, pgno_t, void *)); void *pgcookie; /* Cookie for page in/out routines. */ #ifdef STATISTICS unsigned long cachehit; unsigned long cachemiss; unsigned long pagealloc; unsigned long pageflush; unsigned long pageget; unsigned long pagenew; unsigned long pageput; unsigned long pageread; unsigned long pagewrite; #endif } MPOOL; #ifdef __MPOOLINTERFACE_PRIVATE /* Macros to insert/delete into/from hash chain. */ #define rmhash(bp) { \ (bp)->hprev->hnext = (bp)->hnext; \ (bp)->hnext->hprev = (bp)->hprev; \ } #define inshash(bp, pg) { \ hp = &mp->hashtable[HASHKEY(pg)]; \ (bp)->hnext = hp->hnext; \ (bp)->hprev = (struct BKT *)hp; \ hp->hnext->hprev = (bp); \ hp->hnext = (bp); \ } /* Macros to insert/delete into/from lru and free chains. */ #define rmchain(bp) { \ (bp)->cprev->cnext = (bp)->cnext; \ (bp)->cnext->cprev = (bp)->cprev; \ } #define inschain(bp, dp) { \ (bp)->cnext = (dp)->cnext; \ (bp)->cprev = (struct BKT *)(dp); \ (dp)->cnext->cprev = (bp); \ (dp)->cnext = (bp); \ } #endif __BEGIN_DECLS MPOOL *mpool_open __P((DBT *, int, pgno_t, pgno_t)); void mpool_filter __P((MPOOL *, void (*)(void *, pgno_t, void *), void (*)(void *, pgno_t, void *), void *)); void *mpool_new __P((MPOOL *, pgno_t *)); void *mpool_get __P((MPOOL *, pgno_t, u_int)); int mpool_put __P((MPOOL *, void *, u_int)); int mpool_sync __P((MPOOL *)); int mpool_close __P((MPOOL *)); #ifdef STATISTICS void mpool_stat __P((MPOOL *)); #endif __END_DECLS @ 1.4 log @Add RCS identifiers. @ text @d33 1 a33 2 * from: @@(#)mpool.h 8.1 (Berkeley) 6/2/93 * $Id: $ @ 1.3 log @update db code to v1.6 from vangogh, and put it in "db" rather than "DB" @ text @d33 2 a34 1 * @@(#)mpool.h 8.1 (Berkeley) 6/2/93 @ 1.2 log @new vangogh db (v1.5) @ text @d2 2 a3 2 * Copyright (c) 1991 The Regents of the University of California. * All rights reserved. d33 1 a33 1 * @@(#)mpool.h 5.3 (Berkeley) 5/20/93 @ 1.1 log @Updated header files for libdb. @ text @d33 1 a33 1 * @@(#)mpool.h 5.2 (Berkeley) 2/14/93 d76 1 a76 1 indx_t pagesize; /* File page size. */ @ 1.1.1.1 log @update to 1.79 @ text @d2 2 a3 2 * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. d33 1 a33 1 * @@(#)mpool.h 8.1 (Berkeley) 6/2/93 d76 1 a76 1 u_long pagesize; /* File page size. */ @ 1.1.1.2 log @Import of Berkeley DB version 1.85 @ text @d2 1 a2 1 * Copyright (c) 1991, 1993, 1994 d33 1 a33 1 * @@(#)mpool.h 8.2 (Berkeley) 7/14/94 a35 2 #include d37 6 a42 5 * The memory pool scheme is a simple one. Each in-memory page is referenced * by a bucket which is threaded in up to two of three ways. All active pages * are threaded on a hash chain (hashed by page number) and an lru chain. * Inactive pages are threaded on a free chain. Each reference to a memory * pool is handed an opaque MPOOL cookie which stores all of this information. d47 8 a54 6 /* The BKT structures are the elements of the queues. */ typedef struct _bkt { CIRCLEQ_ENTRY(_bkt) hq; /* hash queue */ CIRCLEQ_ENTRY(_bkt) q; /* lru queue */ void *page; /* page */ pgno_t pgno; /* page number */ d58 1 a58 1 u_int8_t flags; /* flags */ d61 8 d70 9 a78 9 CIRCLEQ_HEAD(_lqh, _bkt) lqh; /* lru queue head */ /* hash queue array */ CIRCLEQ_HEAD(_hqh, _bkt) hqh[HASHSIZE]; pgno_t curcache; /* current number of cached pages */ pgno_t maxcache; /* max number of cached pages */ pgno_t npages; /* number of pages in the file */ u_long pagesize; /* file page size */ int fd; /* file descriptor */ /* page in conversion routine */ d80 1 a80 1 /* page out conversion routine */ d82 1 a82 1 void *pgcookie; /* cookie for page in/out routines */ d84 9 a92 9 u_long cachehit; u_long cachemiss; u_long pagealloc; u_long pageflush; u_long pageget; u_long pagenew; u_long pageput; u_long pageread; u_long pagewrite; d96 27 d124 1 a124 1 MPOOL *mpool_open __P((void *, int, pgno_t, pgno_t)); @ 1.1.1.3 log @import lite-2 @ text @d2 1 a2 1 * Copyright (c) 1991, 1993 d33 1 a33 1 * @@(#)mpool.h 8.1 (Berkeley) 6/2/93 d36 2 d39 5 a43 6 * The memory pool scheme is a simple one. Each in memory page is referenced * by a bucket which is threaded in three ways. All active pages are threaded * on a hash chain (hashed by the page number) and an lru chain. Inactive * pages are threaded on a free chain. Each reference to a memory pool is * handed an MPOOL which is the opaque cookie passed to all of the memory * routines. d48 6 a53 8 /* The BKT structures are the elements of the lists. */ typedef struct BKT { struct BKT *hnext; /* next hash bucket */ struct BKT *hprev; /* previous hash bucket */ struct BKT *cnext; /* next free/lru bucket */ struct BKT *cprev; /* previous free/lru bucket */ void *page; /* page */ pgno_t pgno; /* page number */ d57 1 a57 1 unsigned long flags; /* flags */ a59 8 /* The BKTHDR structures are the heads of the lists. */ typedef struct BKTHDR { struct BKT *hnext; /* next hash bucket */ struct BKT *hprev; /* previous hash bucket */ struct BKT *cnext; /* next free/lru bucket */ struct BKT *cprev; /* previous free/lru bucket */ } BKTHDR; d61 9 a69 9 BKTHDR free; /* The free list. */ BKTHDR lru; /* The LRU list. */ BKTHDR hashtable[HASHSIZE]; /* Hashed list by page number. */ pgno_t curcache; /* Current number of cached pages. */ pgno_t maxcache; /* Max number of cached pages. */ pgno_t npages; /* Number of pages in the file. */ u_long pagesize; /* File page size. */ int fd; /* File descriptor. */ /* Page in conversion routine. */ d71 1 a71 1 /* Page out conversion routine. */ d73 1 a73 1 void *pgcookie; /* Cookie for page in/out routines. */ d75 9 a83 9 unsigned long cachehit; unsigned long cachemiss; unsigned long pagealloc; unsigned long pageflush; unsigned long pageget; unsigned long pagenew; unsigned long pageput; unsigned long pageread; unsigned long pagewrite; a86 27 #ifdef __MPOOLINTERFACE_PRIVATE /* Macros to insert/delete into/from hash chain. */ #define rmhash(bp) { \ (bp)->hprev->hnext = (bp)->hnext; \ (bp)->hnext->hprev = (bp)->hprev; \ } #define inshash(bp, pg) { \ hp = &mp->hashtable[HASHKEY(pg)]; \ (bp)->hnext = hp->hnext; \ (bp)->hprev = (struct BKT *)hp; \ hp->hnext->hprev = (bp); \ hp->hnext = (bp); \ } /* Macros to insert/delete into/from lru and free chains. */ #define rmchain(bp) { \ (bp)->cprev->cnext = (bp)->cnext; \ (bp)->cnext->cprev = (bp)->cprev; \ } #define inschain(bp, dp) { \ (bp)->cnext = (dp)->cnext; \ (bp)->cprev = (struct BKT *)(dp); \ (dp)->cnext->cprev = (bp); \ (dp)->cnext = (bp); \ } #endif d88 1 a88 1 MPOOL *mpool_open __P((DBT *, int, pgno_t, pgno_t)); @