CFS_INIT_LIST_HEAD(&cache->fci_lru);
cache->fci_cache_count = 0;
- cfs_spin_lock_init(&cache->fci_lock);
+ spin_lock_init(&cache->fci_lock);
strncpy(cache->fci_name, name,
sizeof(cache->fci_name));
*/
void fld_cache_flush(struct fld_cache *cache)
{
- ENTRY;
+ ENTRY;
- cfs_spin_lock(&cache->fci_lock);
- cache->fci_cache_size = 0;
- fld_cache_shrink(cache);
- cfs_spin_unlock(&cache->fci_lock);
+ spin_lock(&cache->fci_lock);
+ cache->fci_cache_size = 0;
+ fld_cache_shrink(cache);
+ spin_unlock(&cache->fci_lock);
- EXIT;
+ EXIT;
}
/**
* So we don't need to search new entry before starting insertion loop.
*/
- cfs_spin_lock(&cache->fci_lock);
+ spin_lock(&cache->fci_lock);
fld_cache_shrink(cache);
head = &cache->fci_entries_head;
/* Add new entry to cache and lru list. */
fld_cache_entry_add(cache, f_new, prev);
out:
- cfs_spin_unlock(&cache->fci_lock);
- EXIT;
+ spin_unlock(&cache->fci_lock);
+ EXIT;
}
/**
* lookup \a seq sequence for range in fld cache.
*/
int fld_cache_lookup(struct fld_cache *cache,
- const seqno_t seq, struct lu_seq_range *range)
+ const seqno_t seq, struct lu_seq_range *range)
{
- struct fld_cache_entry *flde;
- cfs_list_t *head;
- ENTRY;
-
+ struct fld_cache_entry *flde;
+ cfs_list_t *head;
+ ENTRY;
- cfs_spin_lock(&cache->fci_lock);
+ spin_lock(&cache->fci_lock);
head = &cache->fci_entries_head;
cache->fci_stat.fst_count++;
/* update position of this entry in lru list. */
cfs_list_move(&flde->fce_lru, &cache->fci_lru);
cache->fci_stat.fst_cache++;
- cfs_spin_unlock(&cache->fci_lock);
- RETURN(0);
- }
- }
- cfs_spin_unlock(&cache->fci_lock);
- RETURN(-ENOENT);
+ spin_unlock(&cache->fci_lock);
+ RETURN(0);
+ }
+ }
+ spin_unlock(&cache->fci_lock);
+ RETURN(-ENOENT);
}