FdHandle_t *fdLruTail;
int ih_Inited = 0;
-int ih_PkgDefaultsSet = 0;
/* Most of the servers use fopen/fdopen. Since the FILE structure
* only has eight bits for the file descriptor, the cache size
/* start-time configurable I/O limits */
ih_init_params vol_io_params;
-void ih_PkgDefaults(void)
+void
+ih_PkgDefaults(void)
{
- /* once */
+ static int ih_PkgDefaultsSet = 0;
+
+ IH_LOCK;
+ if (ih_PkgDefaultsSet) {
+ IH_UNLOCK;
+ return;
+ }
+
ih_PkgDefaultsSet = 1;
/* default to well-known values */
vol_io_params.fd_max_cachesize = FD_MAX_CACHESIZE;
vol_io_params.sync_behavior = IH_SYNC_ONCLOSE;
+ IH_UNLOCK;
}
int
void
ih_UseLargeCache(void)
{
- IH_LOCK;
+ ih_PkgDefaults();
- if (!ih_PkgDefaultsSet) {
- ih_PkgDefaults();
- }
+ IH_LOCK;
if (!ih_Inited) {
ih_Initialize();
int ihash = IH_HASH(dev, vid, ino);
IHandle_t *ihP;
- if (!ih_PkgDefaultsSet) {
- ih_PkgDefaults();
- }
+ ih_PkgDefaults();
IH_LOCK;
if (!ih_Inited) {