1
/*****************************************************************************
3
Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
5
This program is free software; you can redistribute it and/or modify it under
6
the terms of the GNU General Public License as published by the Free Software
7
Foundation; version 2 of the License.
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15
Place, Suite 330, Boston, MA 02111-1307 USA
17
*****************************************************************************/
19
/**************************************************//**
20
@file include/buf0types.h
21
The database buffer pool global types for the directory
23
Created 11/17/1995 Heikki Tuuri
24
*******************************************************/
29
/** Buffer page (uncompressed or compressed) */
30
typedef struct buf_page_struct buf_page_t;
31
/** Buffer block for which an uncompressed page exists */
32
typedef struct buf_block_struct buf_block_t;
33
/** Buffer pool chunk comprising buf_block_t */
34
typedef struct buf_chunk_struct buf_chunk_t;
35
/** Buffer pool comprising buf_chunk_t */
36
typedef struct buf_pool_struct buf_pool_t;
37
/** Buffer pool statistics struct */
38
typedef struct buf_pool_stat_struct buf_pool_stat_t;
40
/** A buffer frame. @see page_t */
41
typedef byte buf_frame_t;
43
/** Flags for flush types */
45
BUF_FLUSH_LRU = 0, /*!< flush via the LRU list */
46
BUF_FLUSH_SINGLE_PAGE, /*!< flush a single page */
47
BUF_FLUSH_LIST, /*!< flush via the flush list
49
BUF_FLUSH_N_TYPES /*!< index of last element + 1 */
52
/** Flags for io_fix types */
54
BUF_IO_NONE = 0, /**< no pending I/O */
55
BUF_IO_READ, /**< read pending */
56
BUF_IO_WRITE /**< write pending */
59
/** Parameters of binary buddy system for compressed pages (buf0buddy.h) */
61
#if UNIV_WORD_SIZE <= 4 /* 32-bit system */
62
/** Base-2 logarithm of the smallest buddy block size */
63
# define BUF_BUDDY_LOW_SHIFT 6
64
#else /* 64-bit system */
65
/** Base-2 logarithm of the smallest buddy block size */
66
# define BUF_BUDDY_LOW_SHIFT 7
68
#define BUF_BUDDY_LOW (1 << BUF_BUDDY_LOW_SHIFT)
69
/*!< minimum block size in the binary
70
buddy system; must be at least
72
#define BUF_BUDDY_SIZES (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
73
/*!< number of buddy sizes */
75
/** twice the maximum block size of the buddy system;
76
the underlying memory is aligned by this amount:
77
this must be equal to UNIV_PAGE_SIZE */
78
#define BUF_BUDDY_HIGH (BUF_BUDDY_LOW << BUF_BUDDY_SIZES)