~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to storage/innodb_plugin/include/buf0types.h

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 
 
3
Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
 
4
 
 
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.
 
8
 
 
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.
 
12
 
 
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
 
16
 
 
17
*****************************************************************************/
 
18
 
 
19
/**************************************************//**
 
20
@file include/buf0types.h
 
21
The database buffer pool global types for the directory
 
22
 
 
23
Created 11/17/1995 Heikki Tuuri
 
24
*******************************************************/
 
25
 
 
26
#ifndef buf0types_h
 
27
#define buf0types_h
 
28
 
 
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;
 
39
 
 
40
/** A buffer frame. @see page_t */
 
41
typedef byte    buf_frame_t;
 
42
 
 
43
/** Flags for flush types */
 
44
enum buf_flush {
 
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
 
48
                                        of dirty blocks */
 
49
        BUF_FLUSH_N_TYPES               /*!< index of last element + 1  */
 
50
};
 
51
 
 
52
/** Flags for io_fix types */
 
53
enum buf_io_fix {
 
54
        BUF_IO_NONE = 0,                /**< no pending I/O */
 
55
        BUF_IO_READ,                    /**< read pending */
 
56
        BUF_IO_WRITE                    /**< write pending */
 
57
};
 
58
 
 
59
/** Parameters of binary buddy system for compressed pages (buf0buddy.h) */
 
60
/* @{ */
 
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
 
67
#endif
 
68
#define BUF_BUDDY_LOW           (1 << BUF_BUDDY_LOW_SHIFT)
 
69
                                        /*!< minimum block size in the binary
 
70
                                        buddy system; must be at least
 
71
                                        sizeof(buf_page_t) */
 
72
#define BUF_BUDDY_SIZES         (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
 
73
                                        /*!< number of buddy sizes */
 
74
 
 
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)
 
79
/* @} */
 
80
 
 
81
#endif
 
82