summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <istruewing@chilla.local>2007-05-31 21:34:05 +0200
committerunknown <istruewing@chilla.local>2007-05-31 21:34:05 +0200
commitedd98ca5dbbbf9aea3451ae1da2c770576a04aec (patch)
tree9f6eeb619b18692c54b10a9106d7ed4dca14d034 /mysys
parenta9f967d44b18e54d5245055226d67706e66a9408 (diff)
parenta471267a242f4651724271c93c939d610ac5bdb3 (diff)
downloadmariadb-git-edd98ca5dbbbf9aea3451ae1da2c770576a04aec.tar.gz
Merge chilla.local:/home/mydev/mysql-5.0-axmrg
into chilla.local:/home/mydev/mysql-5.1-axmrg include/keycache.h: Auto merged mysql-test/r/key_cache.result: Auto merged sql/mysqld.cc: Auto merged mysys/mf_keycache.c: SCCS merged
Diffstat (limited to 'mysys')
-rw-r--r--mysys/mf_keycache.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 4c98882ac7e..44e03fdee63 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -234,7 +234,7 @@ static void test_key_cache(KEY_CACHE *keycache,
#endif
#define KEYCACHE_HASH(f, pos) \
-(((ulong) ((pos) >> keycache->key_cache_shift)+ \
+(((ulong) ((pos) / keycache->key_cache_block_size) + \
(ulong) (f)) & (keycache->hash_entries-1))
#define FILE_HASH(f) ((uint) (f) & (CHANGED_BLOCKS_HASH-1))
@@ -399,7 +399,6 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
keycache->key_cache_mem_size= use_mem;
keycache->key_cache_block_size= key_cache_block_size;
- keycache->key_cache_shift= my_bit_log2(key_cache_block_size);
DBUG_PRINT("info", ("key_cache_block_size: %u",
key_cache_block_size));
@@ -422,7 +421,7 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
ALIGN_SIZE(hash_links * sizeof(HASH_LINK)) +
ALIGN_SIZE(sizeof(HASH_LINK*) *
keycache->hash_entries))) +
- ((ulong) blocks << keycache->key_cache_shift) > use_mem)
+ ((ulong) blocks * keycache->key_cache_block_size) > use_mem)
blocks--;
/* Allocate memory for cache page buffers */
if ((keycache->block_mem=
@@ -2558,7 +2557,7 @@ uchar *key_cache_read(KEY_CACHE *keycache,
inc_counter_for_resize_op(keycache);
locked_and_incremented= TRUE;
/* Requested data may not always be aligned to cache blocks. */
- offset= (uint) (filepos & (keycache->key_cache_block_size-1));
+ offset= (uint) (filepos % keycache->key_cache_block_size);
/* Read data in key_cache_block_size increments */
do
{
@@ -2756,7 +2755,7 @@ int key_cache_insert(KEY_CACHE *keycache,
inc_counter_for_resize_op(keycache);
locked_and_incremented= TRUE;
/* Loaded data may not always be aligned to cache blocks. */
- offset= (uint) (filepos & (keycache->key_cache_block_size-1));
+ offset= (uint) (filepos % keycache->key_cache_block_size);
/* Load data in key_cache_block_size increments. */
do
{
@@ -3030,7 +3029,7 @@ int key_cache_write(KEY_CACHE *keycache,
inc_counter_for_resize_op(keycache);
locked_and_incremented= TRUE;
/* Requested data may not always be aligned to cache blocks. */
- offset= (uint) (filepos & (keycache->key_cache_block_size-1));
+ offset= (uint) (filepos % keycache->key_cache_block_size);
/* Write data in key_cache_block_size increments. */
do
{