The filehandlecache defined here protects all operations on the cache with a mutex.
Definition in file filehandlecache.h.
#include "lib/error.h"
#include "lib/mrucache.h"
#include "lib/mutex.h"
#include "backend/filehandle.h"


Go to the source code of this file.
Classes | |
| struct | lumiera_filehandlecache_struct |
Typedefs | |
|
typedef struct lumiera_filehandlecache_struct | lumiera_filehandlecache |
| typedef lumiera_filehandlecache * | LumieraFilehandlecache |
Functions | |
| void | lumiera_filehandlecache_checkin (LumieraFilehandle handle) |
| Put a filehandle into the cache Filehandles which are checked in are subject of cache aging and might get destroyed and reused. | |
| LumieraFilehandle | lumiera_filehandlecache_checkout (LumieraFilehandle handle) |
| Remove a filehandle from cache aging Filehandles which are subject of cache aging must be checked out before they can be used. | |
| void | lumiera_filehandlecache_delete (void) |
| Delete the filehandle cache. | |
| LumieraFilehandle | lumiera_filehandlecache_handle_acquire (LumieraFiledescriptor desc) |
| Get a fresh filehandle. | |
| void | lumiera_filehandlecache_new (int max_entries) |
| Initializes the filehandle cache. | |
| void lumiera_filehandlecache_new | ( | int | max_entries | ) |
Initializes the filehandle cache.
| max_entries | number how much filehandles shall be managed The number of elements the cache can hold is static and should be determined by sysconf (_SC_OPEN_MAX) minus some (big) safety margin. |
Definition at line 39 of file filehandlecache.c.
References lumiera_mutex_init().

| void lumiera_filehandlecache_delete | ( | void | ) |
Delete the filehandle cache.
No filehandles in the cache must be locked, this would be a fatal error. The handles are closed automatically.
Definition at line 53 of file filehandlecache.c.
References lumiera_free(), and lumiera_mutex_destroy().

| LumieraFilehandle lumiera_filehandlecache_handle_acquire | ( | LumieraFiledescriptor | desc | ) |
Get a fresh filehandle.
| self | pointer to the cache |
Definition at line 67 of file filehandlecache.c.
References LUMIERA_ERROR_SET_ALERT, lumiera_mrucache_pop(), and LUMIERA_MUTEX_SECTION.

| LumieraFilehandle lumiera_filehandlecache_checkout | ( | LumieraFilehandle | handle | ) |
Remove a filehandle from cache aging Filehandles which are subject of cache aging must be checked out before they can be used.
| self | the filehandlecache | |
| handle | the filehandle to be checked out |
Definition at line 102 of file filehandlecache.c.
References lumiera_filehandle_struct::cachenode, lumiera_mrucache_checkout(), LUMIERA_MUTEX_SECTION, and lumiera_filehandle_struct::use_cnt.

| void lumiera_filehandlecache_checkin | ( | LumieraFilehandle | handle | ) |
Put a filehandle into the cache Filehandles which are checked in are subject of cache aging and might get destroyed and reused.
| self | the filehandlecache | |
| handle | the filehandle to be checked in |
Definition at line 123 of file filehandlecache.c.
References lumiera_filehandle_struct::cachenode, lumiera_mrucache_checkin(), LUMIERA_MUTEX_SECTION, and lumiera_filehandle_struct::use_cnt.

1.5.6