@@ -19,7 +19,7 @@ CRITICAL_SECTION fscache_cs;
19
19
struct fscache {
20
20
volatile long enabled ;
21
21
struct hashmap map ;
22
- struct mem_pool * mem_pool ;
22
+ struct mem_pool mem_pool ;
23
23
unsigned int lstat_requests ;
24
24
unsigned int opendir_requests ;
25
25
unsigned int fscache_requests ;
@@ -132,7 +132,7 @@ static struct fsentry *fsentry_alloc(struct fscache *cache, struct fsentry *list
132
132
{
133
133
/* overallocate fsentry and copy the name to the end */
134
134
struct fsentry * fse =
135
- mem_pool_alloc (cache -> mem_pool , sizeof (* fse ) + len + 1 );
135
+ mem_pool_alloc (& cache -> mem_pool , sizeof (* fse ) + len + 1 );
136
136
/* init the rest of the structure */
137
137
fsentry_init (fse , list , name , len );
138
138
fse -> next = NULL ;
@@ -355,8 +355,7 @@ static void fscache_add(struct fscache *cache, struct fsentry *fse)
355
355
*/
356
356
static void fscache_clear (struct fscache * cache )
357
357
{
358
- mem_pool_discard (cache -> mem_pool , 0 );
359
- cache -> mem_pool = NULL ;
358
+ mem_pool_discard (& cache -> mem_pool , 0 );
360
359
mem_pool_init (& cache -> mem_pool , 0 );
361
360
hashmap_free (& cache -> map );
362
361
hashmap_init (& cache -> map , (hashmap_cmp_fn )fsentry_cmp , NULL , 0 );
@@ -534,7 +533,7 @@ void fscache_disable(void)
534
533
"total requests/misses %u/%u\n" ,
535
534
cache -> lstat_requests , cache -> opendir_requests ,
536
535
cache -> fscache_requests , cache -> fscache_misses );
537
- mem_pool_discard (cache -> mem_pool , 0 );
536
+ mem_pool_discard (& cache -> mem_pool , 0 );
538
537
hashmap_free (& cache -> map );
539
538
free (cache );
540
539
}
@@ -766,7 +765,7 @@ void fscache_merge(struct fscache *dest)
766
765
while ((e = hashmap_iter_next (& iter )))
767
766
hashmap_add (& dest -> map , e );
768
767
769
- mem_pool_combine (dest -> mem_pool , cache -> mem_pool );
768
+ mem_pool_combine (& dest -> mem_pool , & cache -> mem_pool );
770
769
771
770
dest -> lstat_requests += cache -> lstat_requests ;
772
771
dest -> opendir_requests += cache -> opendir_requests ;
0 commit comments