~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/buf0rea.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-03-30 18:27:35 UTC
  • mto: (968.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 971.
  • Revision ID: osullivan.padraig@gmail.com-20090330182735-8tor89czwodcv77s
Removing the last of LIST from the MyISAM storage engine.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
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., 51 Franklin
15
 
St, Fifth Floor, Boston, MA 02110-1301 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
19
 
/**************************************************//**
20
 
@file include/buf0rea.h
 
19
/******************************************************
21
20
The database buffer read
22
21
 
23
22
Created 11/5/1995 Heikki Tuuri
29
28
#include "univ.i"
30
29
#include "buf0types.h"
31
30
 
32
 
/********************************************************************//**
 
31
/************************************************************************
33
32
High-level function which reads a page asynchronously from a file to the
34
33
buffer buf_pool if it is not already there. Sets the io_fix flag and sets
35
34
an exclusive lock on the buffer frame. The flag is cleared and the x-lock
36
 
released by the i/o-handler thread.
37
 
@return TRUE if page has been read in, FALSE in case of failure */
 
35
released by the i/o-handler thread. Does a random read-ahead if it seems
 
36
sensible. */
38
37
UNIV_INTERN
39
 
ibool
 
38
ulint
40
39
buf_read_page(
41
40
/*==========*/
42
 
        ulint   space,  /*!< in: space id */
43
 
        ulint   zip_size,/*!< in: compressed page size in bytes, or 0 */
44
 
        ulint   offset);/*!< in: page number */
45
 
/********************************************************************//**
 
41
                        /* out: number of page read requests issued: this can
 
42
                        be > 1 if read-ahead occurred */
 
43
        ulint   space,  /* in: space id */
 
44
        ulint   zip_size,/* in: compressed page size in bytes, or 0 */
 
45
        ulint   offset);/* in: page number */
 
46
/************************************************************************
46
47
Applies linear read-ahead if in the buf_pool the page is a border page of
47
48
a linear read-ahead area and all the pages in the area have been accessed.
48
49
Does not read any page if the read-ahead mechanism is not activated. Note
64
65
latches!
65
66
NOTE 3: the calling thread must want access to the page given: this rule is
66
67
set to prevent unintended read-aheads performed by ibuf routines, a situation
67
 
which could result in a deadlock if the OS does not support asynchronous io.
68
 
@return number of page read requests issued */
 
68
which could result in a deadlock if the OS does not support asynchronous io. */
69
69
UNIV_INTERN
70
70
ulint
71
71
buf_read_ahead_linear(
72
72
/*==================*/
73
 
        ulint   space,  /*!< in: space id */
74
 
        ulint   zip_size,/*!< in: compressed page size in bytes, or 0 */
75
 
        ulint   offset);/*!< in: page number of a page; NOTE: the current thread
 
73
                        /* out: number of page read requests issued */
 
74
        ulint   space,  /* in: space id */
 
75
        ulint   zip_size,/* in: compressed page size in bytes, or 0 */
 
76
        ulint   offset);/* in: page number of a page; NOTE: the current thread
76
77
                        must want access to this page (see NOTE 3 above) */
77
 
/********************************************************************//**
 
78
/************************************************************************
78
79
Issues read requests for pages which the ibuf module wants to read in, in
79
80
order to contract the insert buffer tree. Technically, this function is like
80
81
a read-ahead function. */
82
83
void
83
84
buf_read_ibuf_merge_pages(
84
85
/*======================*/
85
 
        ibool           sync,           /*!< in: TRUE if the caller
 
86
        ibool           sync,           /* in: TRUE if the caller
86
87
                                        wants this function to wait
87
88
                                        for the highest address page
88
89
                                        to get read in, before this
89
90
                                        function returns */
90
 
        const ulint*    space_ids,      /*!< in: array of space ids */
91
 
        const ib_int64_t* space_versions,/*!< in: the spaces must have
 
91
        const ulint*    space_ids,      /* in: array of space ids */
 
92
        const ib_int64_t* space_versions,/* in: the spaces must have
92
93
                                        this version number
93
94
                                        (timestamp), otherwise we
94
95
                                        discard the read; we use this
95
96
                                        to cancel reads if DISCARD +
96
97
                                        IMPORT may have changed the
97
98
                                        tablespace size */
98
 
        const ulint*    page_nos,       /*!< in: array of page numbers
 
99
        const ulint*    page_nos,       /* in: array of page numbers
99
100
                                        to read, with the highest page
100
101
                                        number the last in the
101
102
                                        array */
102
 
        ulint           n_stored);      /*!< in: number of elements
 
103
        ulint           n_stored);      /* in: number of elements
103
104
                                        in the arrays */
104
 
/********************************************************************//**
 
105
/************************************************************************
105
106
Issues read requests for pages which recovery wants to read in. */
106
107
UNIV_INTERN
107
108
void
108
109
buf_read_recv_pages(
109
110
/*================*/
110
 
        ibool           sync,           /*!< in: TRUE if the caller
 
111
        ibool           sync,           /* in: TRUE if the caller
111
112
                                        wants this function to wait
112
113
                                        for the highest address page
113
114
                                        to get read in, before this
114
115
                                        function returns */
115
 
        ulint           space,          /*!< in: space id */
116
 
        ulint           zip_size,       /*!< in: compressed page size in
 
116
        ulint           space,          /* in: space id */
 
117
        ulint           zip_size,       /* in: compressed page size in
117
118
                                        bytes, or 0 */
118
 
        const ulint*    page_nos,       /*!< in: array of page numbers
 
119
        const ulint*    page_nos,       /* in: array of page numbers
119
120
                                        to read, with the highest page
120
121
                                        number the last in the
121
122
                                        array */
122
 
        ulint           n_stored);      /*!< in: number of page numbers
 
123
        ulint           n_stored);      /* in: number of page numbers
123
124
                                        in the array */
124
125
 
125
 
/** The size in pages of the area which the read-ahead algorithms read if
 
126
/* The size in pages of the area which the read-ahead algorithms read if
126
127
invoked */
127
 
#define BUF_READ_AHEAD_AREA(b)                                  \
128
 
        ut_min(64, ut_2_power_up((b)->curr_size / 32))
129
 
 
130
 
/** @name Modes used in read-ahead @{ */
131
 
/** read only pages belonging to the insert buffer tree */
 
128
 
 
129
#define BUF_READ_AHEAD_AREA                                     \
 
130
        ut_min(64, ut_2_power_up(buf_pool->curr_size / 32))
 
131
 
 
132
/* Modes used in read-ahead */
132
133
#define BUF_READ_IBUF_PAGES_ONLY        131
133
 
/** read any page */
134
134
#define BUF_READ_ANY_PAGE               132
135
 
/* @} */
136
135
 
137
136
#endif