diff options
author | unknown <bell@pwbook.sanja.is.com.ua> | 2007-04-04 23:37:09 +0300 |
---|---|---|
committer | unknown <bell@pwbook.sanja.is.com.ua> | 2007-04-04 23:37:09 +0300 |
commit | 39d64a1d2565b09307d11b2a665f3f2c6bc8106e (patch) | |
tree | f06eaccb6a5b46b3894e7939c81911d30e765fd5 /storage/maria/ma_preload.c | |
parent | a3f9083bb4649530b210423e21589803c075bb9e (diff) | |
download | mariadb-git-39d64a1d2565b09307d11b2a665f3f2c6bc8106e.tar.gz |
Pagecache integration for review.
storage/maria/unittest/ma_pagecache_single.c:
Rename: storage/maria/unittest/mf_pagecache_single.c -> storage/maria/unittest/ma_pagecache_single.c
include/maria.h:
Pagecache integration.
include/myisamchk.h:
Pagecache integration.
include/pagecache.h:
removed WRITE_NOW mode
Pagecache parameters management.
mysys/Makefile.am:
Safe hash procedures moved to the separate file.
Pagecache moved to maria engine directory.
mysys/mf_keycaches.c:
Safe hash procedures moved to the separate file.
sql/handler.cc:
Pageccahe integration.
sql/handler.h:
Pagecache integration.
sql/mysql_priv.h:
pagecache integration
sql/mysqld.cc:
pagecache integration
sql/set_var.cc:
Pagecache integration.
sql/set_var.h:
Pagecache integration.
storage/maria/Makefile.am:
Pagecache integration and moving to maria engine directory.
storage/maria/ha_maria.cc:
File changed on PAGECCAHE_FILE.
storage/maria/ma_bitmap.c:
Pagecache integration.
storage/maria/ma_blockrec.c:
Pagecache integration.
storage/maria/ma_check.c:
File changed on PAGECCAHE_FILE.
Pagecache integration.
storage/maria/ma_close.c:
File changed on PAGECCAHE_FILE.
storage/maria/ma_delete_all.c:
File changed on PAGECCAHE_FILE.
storage/maria/ma_dynrec.c:
File changed on PAGECCAHE_FILE.
storage/maria/ma_extra.c:
File changed on PAGECCAHE_FILE.
storage/maria/ma_info.c:
File changed on PAGECCAHE_FILE.
storage/maria/ma_keycache.c:
Pagecache integration.
storage/maria/ma_locking.c:
File changed on PAGECCAHE_FILE.
storage/maria/ma_loghandler.c:
Assert added.
storage/maria/ma_loghandler.h:
extern specifier added.
storage/maria/ma_open.c:
Pagecache integration.
File changed on PAGECCAHE_FILE.
storage/maria/ma_packrec.c:
File changed on PAGECCAHE_FILE.
storage/maria/ma_page.c:
Pagecache integration.
storage/maria/ma_pagecache.c:
Pagecache renamed and moved to the maria directory.
BLOCK_* defines renamed to avoid conflict with BLOCK_ERROR defined in maria_def.h
storage/maria/ma_panic.c:
File changed on PAGECCAHE_FILE.
storage/maria/ma_preload.c:
Pagecache integration.
File changed on PAGECCAHE_FILE.
storage/maria/ma_static.c:
Pagecache integration.
storage/maria/ma_test1.c:
Pagecache integration.
storage/maria/ma_test2.c:
Pagecache integration.
storage/maria/ma_test3.c:
Pagecache integration.
storage/maria/ma_write.c:
File changed on PAGECCAHE_FILE.
storage/maria/maria_chk.c:
Pagecache integration.
File changed on PAGECCAHE_FILE.
storage/maria/maria_def.h:
Pagecache integration.
File changed on PAGECCAHE_FILE.
storage/maria/maria_ftdump.c:
Pagecache integration.
storage/maria/maria_pack.c:
File changed on PAGECCAHE_FILE.
storage/maria/unittest/Makefile.am:
Pagecache moved to the maria directory.
storage/maria/unittest/ma_pagecache_consist.c:
fixed using uninitialized variable
storage/maria/ma_pagecaches.c:
New BitKeeper file ``storage/maria/ma_pagecaches.c''
mysys/my_safehash.h:
New BitKeeper file ``mysys/my_safehash.h''
Diffstat (limited to 'storage/maria/ma_preload.c')
-rw-r--r-- | storage/maria/ma_preload.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/storage/maria/ma_preload.c b/storage/maria/ma_preload.c index f387f2b7de3..5dcfcb35129 100644 --- a/storage/maria/ma_preload.c +++ b/storage/maria/ma_preload.c @@ -69,7 +69,7 @@ int maria_preload(MARIA_HA *info, ulonglong key_map, my_bool ignore_leaves) if (!(buff= (uchar *) my_malloc(length, MYF(MY_WME)))) DBUG_RETURN(my_errno= HA_ERR_OUT_OF_MEM); - if (flush_key_blocks(share->key_cache,share->kfile, FLUSH_RELEASE)) + if (flush_pagecache_blocks(share->pagecache, &share->kfile, FLUSH_RELEASE)) goto err; do @@ -77,7 +77,8 @@ int maria_preload(MARIA_HA *info, ulonglong key_map, my_bool ignore_leaves) /* Read the next block of index file into the preload buffer */ if ((my_off_t) length > (key_file_length-pos)) length= (ulong) (key_file_length-pos); - if (my_pread(share->kfile, (byte*) buff, length, pos, MYF(MY_FAE|MY_FNABP))) + if (my_pread(share->kfile.file, (byte*) buff, length, pos, + MYF(MY_FAE|MY_FNABP))) goto err; if (ignore_leaves) @@ -87,9 +88,15 @@ int maria_preload(MARIA_HA *info, ulonglong key_map, my_bool ignore_leaves) { if (_ma_test_if_nod(buff)) { - if (key_cache_insert(share->key_cache, - share->kfile, pos, DFLT_INIT_HITS, - (byte*) buff, block_length)) + DBUG_ASSERT(share->pagecache->block_size == block_length); + if (pagecache_write(share->pagecache, + &share->kfile, pos / block_length, + DFLT_INIT_HITS, + (byte*) buff, + PAGECACHE_PLAIN_PAGE, + PAGECACHE_LOCK_LEFT_UNLOCKED, + PAGECACHE_PIN_LEFT_PINNED, + PAGECACHE_WRITE_DONE, 0)) goto err; } pos+= block_length; @@ -99,9 +106,14 @@ int maria_preload(MARIA_HA *info, ulonglong key_map, my_bool ignore_leaves) } else { - if (key_cache_insert(share->key_cache, - share->kfile, pos, DFLT_INIT_HITS, - (byte*) buff, length)) + if (pagecache_write(share->pagecache, + &share->kfile, pos / block_length, + DFLT_INIT_HITS, + (byte*) buff, + PAGECACHE_PLAIN_PAGE, + PAGECACHE_LOCK_LEFT_UNLOCKED, + PAGECACHE_PIN_LEFT_PINNED, + PAGECACHE_WRITE_DONE, 0)) goto err; pos+= length; } |