summaryrefslogtreecommitdiff
path: root/storage/maria/ma_locking.c
diff options
context:
space:
mode:
authorunknown <bell@desktop.sanja.is.com.ua>2007-04-16 13:19:43 +0300
committerunknown <bell@desktop.sanja.is.com.ua>2007-04-16 13:19:43 +0300
commite10fe77b0ac9a43ad795555c65391318ff7cc968 (patch)
treee2ed09433088190ae567be9a0e523defae042456 /storage/maria/ma_locking.c
parent1bf0ed775431a5142e846e23330228468dcf140b (diff)
parent39d64a1d2565b09307d11b2a665f3f2c6bc8106e (diff)
downloadmariadb-git-e10fe77b0ac9a43ad795555c65391318ff7cc968.tar.gz
Merge desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria.bak
into desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-test include/maria.h: Auto merged mysys/Makefile.am: Auto merged mysys/mf_keycaches.c: Auto merged sql/handler.h: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/set_var.h: Auto merged storage/maria/Makefile.am: Auto merged storage/maria/ha_maria.cc: Auto merged storage/maria/ma_bitmap.c: Auto merged storage/maria/ma_check.c: Auto merged storage/maria/ma_close.c: Auto merged storage/maria/ma_dynrec.c: Auto merged storage/maria/ma_extra.c: Auto merged storage/maria/ma_info.c: Auto merged storage/maria/ma_keycache.c: Auto merged storage/maria/ma_locking.c: Auto merged storage/maria/ma_loghandler.c: Auto merged storage/maria/ma_open.c: Auto merged storage/maria/ma_packrec.c: Auto merged storage/maria/ma_page.c: Auto merged storage/maria/ma_pagecache.c: Auto merged storage/maria/ma_panic.c: Auto merged storage/maria/ma_preload.c: Auto merged storage/maria/ma_static.c: Auto merged storage/maria/ma_test1.c: Auto merged storage/maria/ma_test2.c: Auto merged storage/maria/ma_test3.c: Auto merged storage/maria/ma_write.c: Auto merged storage/maria/maria_chk.c: Auto merged storage/maria/maria_def.h: Auto merged storage/maria/maria_ftdump.c: Auto merged storage/maria/maria_pack.c: Auto merged sql/handler.cc: merge storage/maria/ma_blockrec.c: merge storage/maria/ma_delete_all.c: merge
Diffstat (limited to 'storage/maria/ma_locking.c')
-rw-r--r--storage/maria/ma_locking.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/storage/maria/ma_locking.c b/storage/maria/ma_locking.c
index f280af130ac..6865c653d7e 100644
--- a/storage/maria/ma_locking.c
+++ b/storage/maria/ma_locking.c
@@ -49,7 +49,7 @@ int maria_lock_database(MARIA_HA *info, int lock_type)
error=0;
pthread_mutex_lock(&share->intern_lock);
- if (share->kfile >= 0) /* May only be false on windows */
+ if (share->kfile.file >= 0) /* May only be false on windows */
{
switch (lock_type) {
case F_UNLCK:
@@ -61,9 +61,9 @@ int maria_lock_database(MARIA_HA *info, int lock_type)
--share->tot_locks;
if (info->lock_type == F_WRLCK && !share->w_locks)
{
- if (!share->delay_key_write && flush_key_blocks(share->key_cache,
- share->kfile,
- FLUSH_KEEP))
+ if (!share->delay_key_write &&
+ flush_pagecache_blocks(share->pagecache, &share->kfile,
+ FLUSH_KEEP))
{
error= my_errno;
maria_print_error(info->s, HA_ERR_CRASHED);
@@ -71,7 +71,7 @@ int maria_lock_database(MARIA_HA *info, int lock_type)
maria_mark_crashed(info);
}
if (share->data_file_type == BLOCK_RECORD &&
- flush_key_blocks(share->key_cache, info->dfile, FLUSH_KEEP))
+ flush_pagecache_blocks(share->pagecache, &info->dfile, FLUSH_KEEP))
{
error= my_errno;
maria_print_error(info->s, HA_ERR_CRASHED);
@@ -110,7 +110,7 @@ int maria_lock_database(MARIA_HA *info, int lock_type)
share->state.process= share->last_process=share->this_process;
share->state.unique= info->last_unique= info->this_unique;
share->state.update_count= info->last_loop= ++info->this_loop;
- if (_ma_state_info_write(share->kfile, &share->state, 1))
+ if (_ma_state_info_write(share->kfile.file, &share->state, 1))
error=my_errno;
share->changed=0;
if (maria_flush)
@@ -146,7 +146,7 @@ int maria_lock_database(MARIA_HA *info, int lock_type)
}
if (!share->r_locks && !share->w_locks)
{
- if (_ma_state_info_read_dsk(share->kfile, &share->state, 1))
+ if (_ma_state_info_read_dsk(share->kfile.file, &share->state, 1))
{
error=my_errno;
break;
@@ -174,7 +174,7 @@ int maria_lock_database(MARIA_HA *info, int lock_type)
{
if (!share->r_locks)
{
- if (_ma_state_info_read_dsk(share->kfile, &share->state, 1))
+ if (_ma_state_info_read_dsk(share->kfile.file, &share->state, 1))
{
error=my_errno;
break;
@@ -202,7 +202,7 @@ int maria_lock_database(MARIA_HA *info, int lock_type)
a crash on windows if the table is renamed and
later on referenced by the merge table.
*/
- if( info->owned_by_merge && (info->s)->kfile < 0 )
+ if( info->owned_by_merge && (info->s)->kfile.file < 0 )
{
error = HA_ERR_NO_SUCH_TABLE;
}
@@ -356,7 +356,7 @@ int _ma_readinfo(register MARIA_HA *info, int lock_type, int check_keybuffer)
MARIA_SHARE *share=info->s;
if (!share->tot_locks)
{
- if (_ma_state_info_read_dsk(share->kfile, &share->state, 1))
+ if (_ma_state_info_read_dsk(share->kfile.file, &share->state, 1))
{
int error=my_errno ? my_errno : -1;
my_errno=error;
@@ -398,13 +398,13 @@ int _ma_writeinfo(register MARIA_HA *info, uint operation)
share->state.process= share->last_process= share->this_process;
share->state.unique= info->last_unique= info->this_unique;
share->state.update_count= info->last_loop= ++info->this_loop;
- if ((error= _ma_state_info_write(share->kfile, &share->state, 1)))
+ if ((error= _ma_state_info_write(share->kfile.file, &share->state, 1)))
olderror=my_errno;
#ifdef __WIN__
if (maria_flush)
{
- _commit(share->kfile);
- _commit(info->dfile);
+ _commit(share->kfile.file);
+ _commit(info->dfile.file);
}
#endif
my_errno=olderror;
@@ -428,7 +428,8 @@ int _ma_test_if_changed(register MARIA_HA *info)
{ /* Keyfile has changed */
DBUG_PRINT("info",("index file changed"));
if (share->state.process != share->this_process)
- VOID(flush_key_blocks(share->key_cache, share->kfile, FLUSH_RELEASE));
+ VOID(flush_pagecache_blocks(share->pagecache, &share->kfile,
+ FLUSH_RELEASE));
share->last_process=share->state.process;
info->last_unique= share->state.unique;
info->last_loop= share->state.update_count;
@@ -480,7 +481,7 @@ int _ma_mark_file_changed(MARIA_HA *info)
{
mi_int2store(buff,share->state.open_count);
buff[2]=1; /* Mark that it's changed */
- DBUG_RETURN(my_pwrite(share->kfile,buff,sizeof(buff),
+ DBUG_RETURN(my_pwrite(share->kfile.file, buff, sizeof(buff),
sizeof(share->state.header),
MYF(MY_NABP)));
}
@@ -509,9 +510,9 @@ int _ma_decrement_open_count(MARIA_HA *info)
{
share->state.open_count--;
mi_int2store(buff,share->state.open_count);
- write_error=my_pwrite(share->kfile,buff,sizeof(buff),
- sizeof(share->state.header),
- MYF(MY_NABP));
+ write_error= my_pwrite(share->kfile.file, buff, sizeof(buff),
+ sizeof(share->state.header),
+ MYF(MY_NABP));
}
if (!lock_error)
lock_error=maria_lock_database(info,old_lock);