fmpool(3) fmpool(3)
NAME
fmpool_open, fmpool_filter, fmpool_new, fmpool_get, fmpool_put, fmpool_sync, fmpool_close, fmpool_set_lastpagesize, fmpool_get_lastpa- gesize, fmpool_get_pagesize, fmpool_get_maxcache, fmpool_get_npages - Shared Memory File Buffer Pool
SYNOPSIS
#include <fmpool.h> MPOOL *fmpool_open(void); void fmpool_filter(void); void *fmpool_new(void); void *fmpool_get(void); int fmpool_put(void); int fmpool_sync(void); int fmpool_close(void); int fmpool_set_lastpagesize(void); pageno_t fmpool_get_lastpagesize(void); pageno_t fmpool_get_pagesize(void); pageno_t fmpool_get_maxcache(void); pageno_t fmpool_get_npages(void);
DESCRIPTION
fmpool_open Initialize a memory pool. We try to find the length of the file using either the stat() calls or seeking to the end of the file and getting the offset. We take special note of the size of the lastpage when the file size is not even multiple of page sizes. fmpool_filter Initialize input/output filters for user page processing. fmpool_new Get a new page of memory. This is where we get new pages for the file. This will only return a full page of memory. If the last page is an odd size the user must keep track of this as only lastpagesize bytes will be written out. As a result if the user fills the last page and lastpagesize does not equal pagesize the user will lose data. If 'flags' = 0, increase number of pages by 1 and return pgnoaddr = npages If 'flags' = MPOOL_EXTEND, set page to *pgnoaddr and npages = *pgnoaddr. All returned pages are pinned. fmpool_get Get a page specified by 'pgno'. If the page is not cached then we need to create a new page. All returned pages are pinned. fmpool_put Return a page to the buffer pool. Unpin it and mark it appropriately i.e. MPOOL_DIRTY. fmpool_sync Sync the pool to disk. Does NOT Free the buffer pool. fmpool_close Close the buffer pool. Frees the buffer pool. Does not sync the buffer pool. fmpool_set_lastpagesize Set the pagesize of the last page in the file. fmpool_get_lastpagesize Finds the size of the last page in the file. fmpool_get_pagesize Finds current pagesize used for file. fmpool_get_maxcache Finds current number of pages cached for file. fmpool_get_npages Finds current number of pages in file.
RETURNS
fmpool_open A memory pool cookie if successful else NULL. fmpool_filter Nothing. fmpool_new Returns the new page if successfull and NULL otherwise. fmpool_get The specifed page if successful and NULL otherwise. fmpool_put RET_SUCCESS if succesful and RET_ERROR otherwise. fmpool_sync RET_SUCCESS if succesful and RET_ERROR otherwise. fmpool_close RET_SUCCESS if succesful and RET_ERROR otherwise. fmpool_set_lastpagesize Returns RET_SUCCESS if successful and RET_ERROR otherwise. fmpool_get_lastpagesize Returns the pagesize of the last page in the file. fmpool_get_pagesize Returns pagesize for file. fmpool_get_maxcache Returns current number of pages cached. fmpool_get_npages Returns current number of pages in file.
NAME
fmpool_open Fmpool_open -- Open a memory pool on the given file. fmpool_filter Fmpool_filter -- Initialize input/output filters. fmpool_new Fmpool_new -- get a new page of memory. fmpool_get Fmpool_get - get a specified page by page number. fmpool_put Fmpool_put -- put a page back into the memory buffer pool. fmpool_sync Fmpool_sync -- sync the memory buffer pool. fmpool_close Fmpool_close - close the memory buffer pool. fmpool_set_lastpagesize Fmpool_set_lastpagesize - set the pagesize of the last page in the file. fmpool_get_lastpagesize Fmpool_get_lastpagsize - returns pagesize of last page in file. fmpool_get_pagesize Fmpool_get_pagsize - returns pagesize for file. fmpool_get_maxcache Fmpool_get_maxcache - returns current number of pages cached. fmpool_get_npages Fmpool_get_npages - returns current number of pages in file.
NOTE
fmpool_open We don't have much use for the page in/out filters as we rely on the interfaces above us to fill the page and we allow the user to arbitrar- ily change the pagesize from one invocation to another. This deviates from the original Berkely implemntation. The key string byte for sharing buffers is not implemented. fmpool_filter The filters must now handle the case where the page is the last page which may not be a full 'pagesize' so the filters must check for this. We don't use these yet.
CONTACT
George Velamparampil <georgev@ncsa.uiuc.edu> NCSA Software Development Group HDF Group 152 Computing Applications Bldg. 605 E. Springfield Ave. Champaign, IL 61820 c2man fmpool.h 2 February 1996 fmpool(3)
hdf 4.2r4 - Generated Fri Feb 6 07:42:43 CST 2009