revoked accidental renaming om dir cache entries.

This commit is contained in:
nvt-se 2008-11-04 23:12:44 +00:00
parent e6a7089942
commit 6ca91f1271

View File

@ -132,7 +132,7 @@ struct log_param {
((file_page) * COFFEE_PAGE_SIZE + \ ((file_page) * COFFEE_PAGE_SIZE + \
sizeof(struct file_header) + (file_offset)) sizeof(struct file_header) + (file_offset))
static struct dir_cache dir_cache[COFFEE_DIR_CACHE_RECORDS]; static struct dir_cache dir_cache[COFFEE_DIR_CACHE_ENTRIES];
static struct file_desc coffee_fd_set[COFFEE_FD_SET_SIZE]; static struct file_desc coffee_fd_set[COFFEE_FD_SET_SIZE];
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
@ -232,7 +232,7 @@ dir_cache_add(char c, coffee_offset_t page)
{ {
int i; int i;
for(i = 0; i < COFFEE_DIR_CACHE_RECORDS; i++) { for(i = 0; i < COFFEE_DIR_CACHE_ENTRIES; i++) {
if(dir_cache[i].filename_start == '\0') { if(dir_cache[i].filename_start == '\0') {
dir_cache[i].filename_start = c; dir_cache[i].filename_start = c;
dir_cache[i].page = page; dir_cache[i].page = page;
@ -246,7 +246,7 @@ dir_cache_del(coffee_offset_t page)
{ {
int i; int i;
for(i = 0; i < COFFEE_DIR_CACHE_RECORDS; i++) { for(i = 0; i < COFFEE_DIR_CACHE_ENTRIES; i++) {
if(dir_cache[i].page == page) { if(dir_cache[i].page == page) {
dir_cache[i].filename_start = '\0'; dir_cache[i].filename_start = '\0';
} }
@ -259,7 +259,7 @@ dir_cache_find(const char *name)
int i; int i;
struct file_header hdr; struct file_header hdr;
for(i = 0; i < COFFEE_DIR_CACHE_RECORDS; i++) { for(i = 0; i < COFFEE_DIR_CACHE_ENTRIES; i++) {
if(*name == dir_cache[i].filename_start) { if(*name == dir_cache[i].filename_start) {
read_header(&hdr, dir_cache[i].page); read_header(&hdr, dir_cache[i].page);
if(!COFFEE_PAGE_ACTIVE(hdr)) { if(!COFFEE_PAGE_ACTIVE(hdr)) {