summaryrefslogtreecommitdiff
path: root/isam
diff options
context:
space:
mode:
Diffstat (limited to 'isam')
-rw-r--r--isam/_locking.c4
-rw-r--r--isam/_page.c8
-rw-r--r--isam/close.c2
-rw-r--r--isam/extra.c2
-rw-r--r--isam/isamchk.c14
-rw-r--r--isam/isamdef.h1
-rw-r--r--isam/isamlog.c8
-rw-r--r--isam/panic.c2
-rw-r--r--isam/test2.c4
-rw-r--r--isam/test3.c3
10 files changed, 24 insertions, 24 deletions
diff --git a/isam/_locking.c b/isam/_locking.c
index 0ffb46a81f8..e19804549e5 100644
--- a/isam/_locking.c
+++ b/isam/_locking.c
@@ -50,7 +50,7 @@ int nisam_lock_database(N_INFO *info, int lock_type)
else
count= --share->w_locks;
if (info->lock_type == F_WRLCK && !share->w_locks &&
- flush_key_blocks(*dflt_keycache,share->kfile,FLUSH_KEEP))
+ flush_key_blocks(dflt_key_cache,share->kfile,FLUSH_KEEP))
error=my_errno;
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
if (end_io_cache(&info->rec_cache))
@@ -329,7 +329,7 @@ int _nisam_test_if_changed(register N_INFO *info)
share->state.uniq != info->last_uniq)
{ /* Keyfile has changed */
if (share->state.process != share->this_process)
- VOID(flush_key_blocks(*dflt_keycache,share->kfile,FLUSH_RELEASE));
+ VOID(flush_key_blocks(dflt_key_cache,share->kfile,FLUSH_RELEASE));
share->last_process=share->state.process;
info->last_loop= share->state.loop;
info->last_uniq= share->state.uniq;
diff --git a/isam/_page.c b/isam/_page.c
index 60f1dfb0ce6..e31115e624f 100644
--- a/isam/_page.c
+++ b/isam/_page.c
@@ -27,7 +27,7 @@ uchar *_nisam_fetch_keypage(register N_INFO *info, N_KEYDEF *keyinfo,
my_off_t page, uchar *buff, int return_buffer)
{
uchar *tmp;
- tmp=(uchar*) key_cache_read(*dflt_keycache,
+ tmp=(uchar*) key_cache_read(dflt_key_cache,
info->s->kfile,page,DFLT_INIT_HITS,(byte*) buff,
(uint) keyinfo->base.block_length,
(uint) keyinfo->base.block_length,
@@ -84,7 +84,7 @@ int _nisam_write_keypage(register N_INFO *info, register N_KEYDEF *keyinfo,
length=keyinfo->base.block_length;
}
#endif
- return (key_cache_write(*dflt_keycache,
+ return (key_cache_write(dflt_key_cache,
info->s->kfile,page,DFLT_INIT_HITS,
(byte*) buff,length,
(uint) keyinfo->base.block_length,
@@ -102,7 +102,7 @@ int _nisam_dispose(register N_INFO *info, N_KEYDEF *keyinfo, my_off_t pos)
old_link=info->s->state.key_del[keynr];
info->s->state.key_del[keynr]=(ulong) pos;
- DBUG_RETURN(key_cache_write(*dflt_keycache,
+ DBUG_RETURN(key_cache_write(dflt_key_cache,
info->s->kfile,pos,DFLT_INIT_HITS,
(byte*) &old_link,
sizeof(long),
@@ -131,7 +131,7 @@ ulong _nisam_new(register N_INFO *info, N_KEYDEF *keyinfo)
}
else
{
- if (!key_cache_read(*dflt_keycache,
+ if (!key_cache_read(dflt_key_cache,
info->s->kfile,pos,DFLT_INIT_HITS,
(byte*) &info->s->state.key_del[keynr],
(uint) sizeof(long),
diff --git a/isam/close.c b/isam/close.c
index 37b35e450ae..37425653a5d 100644
--- a/isam/close.c
+++ b/isam/close.c
@@ -57,7 +57,7 @@ int nisam_close(register N_INFO *info)
if (flag)
{
if (share->kfile >= 0 &&
- flush_key_blocks(*dflt_keycache,share->kfile,FLUSH_RELEASE))
+ flush_key_blocks(dflt_key_cache,share->kfile,FLUSH_RELEASE))
error=my_errno;
if (share->kfile >= 0 && my_close(share->kfile,MYF(0)))
error = my_errno;
diff --git a/isam/extra.c b/isam/extra.c
index 3bf1dd012ed..421404311c8 100644
--- a/isam/extra.c
+++ b/isam/extra.c
@@ -215,7 +215,7 @@ int nisam_extra(N_INFO *info, enum ha_extra_function function)
info->s->last_version= 0L; /* Impossible version */
#ifdef __WIN__
/* Close the isam and data files as Win32 can't drop an open table */
- if (flush_key_blocks(info->s->kfile,FLUSH_RELEASE))
+ if (flush_key_blocks(dflt_key_cache, info->s->kfile, FLUSH_RELEASE))
error=my_errno;
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
{
diff --git a/isam/isamchk.c b/isam/isamchk.c
index e59da07e85b..0c0df603da0 100644
--- a/isam/isamchk.c
+++ b/isam/isamchk.c
@@ -516,8 +516,8 @@ static int nisamchk(my_string filename)
if (!rep_quick)
{
if (testflag & T_EXTEND)
- VOID(init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,
- use_buffers,&dflt_key_cache_var));
+ VOID(init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,
+ use_buffers,0,0));
VOID(init_io_cache(&read_cache,datafile,(uint) read_buffer_length,
READ_CACHE,share->pack.header_length,1,
MYF(MY_WME)));
@@ -1460,8 +1460,7 @@ my_string name;
printf("Data records: %lu\n",(ulong) share->state.records);
}
- VOID(init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,use_buffers,
- &dflt_key_cache_var));
+ VOID(init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,use_buffers,0,0));
if (init_io_cache(&read_cache,info->dfile,(uint) read_buffer_length,
READ_CACHE,share->pack.header_length,1,MYF(MY_WME)))
goto err;
@@ -1889,12 +1888,12 @@ static void lock_memory(void)
static int flush_blocks(file)
File file;
{
- if (flush_key_blocks(dflt_keycache,file,FLUSH_RELEASE))
+ if (flush_key_blocks(dflt_key_cache,file,FLUSH_RELEASE))
{
print_error("%d when trying to write bufferts",my_errno);
return(1);
}
- end_key_cache(dflt_keycache,1);
+ end_key_cache(dflt_key_cache,1);
return 0;
} /* flush_blocks */
@@ -1938,8 +1937,7 @@ int write_info;
if (share->state.key_root[sort_key] == NI_POS_ERROR)
DBUG_RETURN(0); /* Nothing to do */
- init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,use_buffers,
- &dflt_key_cache_var);
+ init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,use_buffers, 0, 0);
if (init_io_cache(&info->rec_cache,-1,(uint) write_buffer_length,
WRITE_CACHE,share->pack.header_length,1,
MYF(MY_WME | MY_WAIT_IF_FULL)))
diff --git a/isam/isamdef.h b/isam/isamdef.h
index 54656b6842e..7d89730fe32 100644
--- a/isam/isamdef.h
+++ b/isam/isamdef.h
@@ -24,6 +24,7 @@
#else
#include <my_no_pthread.h>
#endif
+#include <keycache.h>
#ifdef my_write
#undef my_write /* We want test if disk full */
diff --git a/isam/isamlog.c b/isam/isamlog.c
index d8ea9d4ed80..75a35ef9704 100644
--- a/isam/isamlog.c
+++ b/isam/isamlog.c
@@ -329,8 +329,8 @@ static int examine_log(my_string file_name, char **table_names)
bzero((gptr) com_count,sizeof(com_count));
init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare,1,
(tree_element_free) file_info_free, NULL);
- VOID(init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE,
- &dflt_key_cache_var));
+ VOID(init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE,
+ 0,0));
files_open=0; access_time=0;
while (access_time++ != number_of_commands &&
!my_b_read(&cache,(byte*) head,9))
@@ -622,7 +622,7 @@ static int examine_log(my_string file_name, char **table_names)
goto end;
}
}
- end_key_cache(dflt_keycache,1);
+ end_key_cache(dflt_key_cache,1);
delete_tree(&tree);
VOID(end_io_cache(&cache));
VOID(my_close(file,MYF(0)));
@@ -642,7 +642,7 @@ static int examine_log(my_string file_name, char **table_names)
llstr(isamlog_filepos,llbuff)));
fflush(stderr);
end:
- end_key_cache(dflt_keycache,1);
+ end_key_cache(dflt_key_cache,1);
delete_tree(&tree);
VOID(end_io_cache(&cache));
VOID(my_close(file,MYF(0)));
diff --git a/isam/panic.c b/isam/panic.c
index de765f50e62..7af979a5104 100644
--- a/isam/panic.c
+++ b/isam/panic.c
@@ -48,7 +48,7 @@ int nisam_panic(enum ha_panic_function flag)
if (info->s->base.options & HA_OPTION_READ_ONLY_DATA)
break;
#endif
- if (flush_key_blocks(*dflt_keycache,info->s->kfile,FLUSH_RELEASE))
+ if (flush_key_blocks(dflt_key_cache,info->s->kfile,FLUSH_RELEASE))
error=my_errno;
if (info->opt_flag & WRITE_CACHE_USED)
if (flush_io_cache(&info->rec_cache))
diff --git a/isam/test2.c b/isam/test2.c
index 67b411d1bbf..14a40f39865 100644
--- a/isam/test2.c
+++ b/isam/test2.c
@@ -156,7 +156,7 @@ int main(int argc, char *argv[])
goto err;
printf("- Writing key:s\n");
if (key_cacheing)
- init_key_cache(dflt_keycache,512,IO_SIZE*16,0); /* Use a small cache */
+ init_key_cache(dflt_key_cache,512,IO_SIZE*16,0,0); /* Use a small cache */
if (locking)
nisam_lock_database(file,F_WRLCK);
if (write_cacheing)
@@ -674,7 +674,7 @@ end:
puts("Locking used");
if (use_blob)
puts("blobs used");
- end_key_cache(&dflt_keycache,1);
+ end_key_cache(dflt_key_cache,1);
if (blob_buffer)
my_free(blob_buffer,MYF(0));
my_end(MY_CHECK_ERROR | MY_GIVE_INFO);
diff --git a/isam/test3.c b/isam/test3.c
index 1b867ba0348..9195fcbf1b6 100644
--- a/isam/test3.c
+++ b/isam/test3.c
@@ -20,6 +20,7 @@
#include "nisam.h"
#include <sys/types.h>
+#include <keycache.h>
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif
@@ -173,7 +174,7 @@ void start_test(int id)
exit(1);
}
if (key_cacheing && rnd(2) == 0)
- init_key_cache(dflt_keycache,512,65536L,0);
+ init_key_cache(dflt_key_cache,512,65536L,0,0);
printf("Process %d, pid: %d\n",id,(int) getpid()); fflush(stdout);
for (error=i=0 ; i < tests && !error; i++)