diff options
author | unknown <knielsen@knielsen-hq.org> | 2010-09-03 19:42:54 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2010-09-03 19:42:54 +0200 |
commit | c21a7a6bb2bed5f159dfba64e7a5220a5ee78cab (patch) | |
tree | aab22730a36718adb824289458f98b86006f5c32 /storage/xtradb/include/buf0buf.h | |
parent | 401c69e49babc293da30f833c18673f5f071eca3 (diff) | |
parent | 9ec2d5b6e510b9a3ad2fd54c37eb302c0121f9e3 (diff) | |
download | mariadb-git-c21a7a6bb2bed5f159dfba64e7a5220a5ee78cab.tar.gz |
Merge XtraDB from Percona server 5.1.49-12 into MariaDB.
Diffstat (limited to 'storage/xtradb/include/buf0buf.h')
-rw-r--r-- | storage/xtradb/include/buf0buf.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/storage/xtradb/include/buf0buf.h b/storage/xtradb/include/buf0buf.h index f93510be6d6..9484146d8a3 100644 --- a/storage/xtradb/include/buf0buf.h +++ b/storage/xtradb/include/buf0buf.h @@ -36,6 +36,7 @@ Created 11/5/1995 Heikki Tuuri #include "ut0rbt.h" #ifndef UNIV_HOTBACKUP #include "os0proc.h" +#include "srv0srv.h" /** @name Modes for buf_page_get_gen */ /* @{ */ @@ -1301,11 +1302,23 @@ struct buf_block_struct{ /**********************************************************************//** Compute the hash fold value for blocks in buf_pool->zip_hash. */ /* @{ */ -#define BUF_POOL_ZIP_FOLD_PTR(ptr) ((ulint) (ptr) / UNIV_PAGE_SIZE) +/* the fold should be relative when srv_buffer_pool_shm_key is enabled */ +#define BUF_POOL_ZIP_FOLD_PTR(ptr) (!srv_buffer_pool_shm_key\ + ?((ulint) (ptr) / UNIV_PAGE_SIZE)\ + :((ulint) ((void*)ptr - (void*)(buf_pool->chunks->blocks->frame)) / UNIV_PAGE_SIZE)) #define BUF_POOL_ZIP_FOLD(b) BUF_POOL_ZIP_FOLD_PTR((b)->frame) #define BUF_POOL_ZIP_FOLD_BPAGE(b) BUF_POOL_ZIP_FOLD((buf_block_t*) (b)) /* @} */ +/** A chunk of buffers. The buffer pool is allocated in chunks. */ +struct buf_chunk_struct{ + ulint mem_size; /*!< allocated size of the chunk */ + ulint size; /*!< size of frames[] and blocks[] */ + void* mem; /*!< pointer to the memory area which + was allocated for the frames */ + buf_block_t* blocks; /*!< array of buffer control blocks */ +}; + /** @brief The buffer pool statistics structure. */ struct buf_pool_stat_struct{ ulint n_page_gets; /*!< number of page gets performed; |