Drizzled Public API Documentation

fsp0fsp.h
Go to the documentation of this file.
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., 51 Franklin
15 St, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 *****************************************************************************/
18 
19 /**************************************************/
26 #pragma once
27 #ifndef fsp0fsp_h
28 #define fsp0fsp_h
29 
30 #include "univ.i"
31 
32 #include "mtr0mtr.h"
33 #include "fut0lst.h"
34 #include "ut0byte.h"
35 #include "page0types.h"
36 #include "fsp0types.h"
37 
38 /**********************************************************************/
40 UNIV_INTERN
41 void
42 fsp_init(void);
43 /*==========*/
44 /**********************************************************************/
50 UNIV_INTERN
51 ulint
52 fsp_header_get_free_limit(void);
53 /*===========================*/
54 /**********************************************************************/
60 UNIV_INTERN
61 ulint
62 fsp_header_get_tablespace_size(void);
63 /*================================*/
64 /**********************************************************************/
67 UNIV_INTERN
68 ulint
69 fsp_get_size_low(
70 /*=============*/
71  page_t* page);
72 /**********************************************************************/
75 UNIV_INTERN
76 ulint
77 fsp_header_get_space_id(
78 /*====================*/
79  const page_t* page);
80 /**********************************************************************/
83 UNIV_INTERN
84 ulint
85 fsp_header_get_flags(
86 /*=================*/
87  const page_t* page);
88 /**********************************************************************/
91 UNIV_INTERN
92 ulint
93 fsp_header_get_zip_size(
94 /*====================*/
95  const page_t* page);
96 /**********************************************************************/
100 UNIV_INTERN
101 void
102 fsp_header_init_fields(
103 /*===================*/
104  page_t* page,
105  ulint space_id,
106  ulint flags);
108 /**********************************************************************/
111 UNIV_INTERN
112 void
113 fsp_header_init(
114 /*============*/
115  ulint space,
116  ulint size,
117  mtr_t* mtr);
118 /**********************************************************************/
120 UNIV_INTERN
121 void
122 fsp_header_inc_size(
123 /*================*/
124  ulint space,
125  ulint size_inc,
126  mtr_t* mtr);
127 /**********************************************************************/
131 UNIV_INTERN
133 fseg_create(
134 /*========*/
135  ulint space,
136  ulint page,
140  ulint byte_offset,
142  mtr_t* mtr);
143 /**********************************************************************/
147 UNIV_INTERN
149 fseg_create_general(
150 /*================*/
151  ulint space,
152  ulint page,
156  ulint byte_offset,
158  ibool has_done_reservation,
164  mtr_t* mtr);
165 /**********************************************************************/
169 UNIV_INTERN
170 ulint
171 fseg_n_reserved_pages(
172 /*==================*/
173  fseg_header_t* header,
174  ulint* used,
175  mtr_t* mtr);
176 /**********************************************************************/
181 UNIV_INTERN
182 ulint
183 fseg_alloc_free_page(
184 /*=================*/
185  fseg_header_t* seg_header,
186  ulint hint,
187  byte direction,
192  mtr_t* mtr);
193 /**********************************************************************/
198 UNIV_INTERN
199 ulint
200 fseg_alloc_free_page_general(
201 /*=========================*/
202  fseg_header_t* seg_header,
203  ulint hint,
204  byte direction,
209  ibool has_done_reservation,
214  mtr_t* mtr);
215 /**********************************************************************/
241 UNIV_INTERN
242 ibool
243 fsp_reserve_free_extents(
244 /*=====================*/
245  ulint* n_reserved,
248  ulint space,
249  ulint n_ext,
250  ulint alloc_type,
251  mtr_t* mtr);
252 /**********************************************************************/
258 UNIV_INTERN
259 ullint
260 fsp_get_available_space_in_free_extents(
261 /*====================================*/
262  ulint space);
263 /**********************************************************************/
265 UNIV_INTERN
266 void
267 fseg_free_page(
268 /*===========*/
269  fseg_header_t* seg_header,
270  ulint space,
271  ulint page,
272  mtr_t* mtr);
273 /**********************************************************************/
279 UNIV_INTERN
280 ibool
281 fseg_free_step(
282 /*===========*/
283  fseg_header_t* header,
287  mtr_t* mtr);
288 /**********************************************************************/
292 UNIV_INTERN
293 ibool
294 fseg_free_step_not_header(
295 /*======================*/
296  fseg_header_t* header,
298  mtr_t* mtr);
299 /***********************************************************************/
302 UNIV_INLINE
303 ibool
305 /*===========*/
306  ulint zip_size,
308  ulint page_no);
309 /***********************************************************/
312 UNIV_INTERN
313 byte*
314 fsp_parse_init_file_page(
315 /*=====================*/
316  byte* ptr,
317  byte* end_ptr,
318  buf_block_t* block);
319 /*******************************************************************/
322 UNIV_INTERN
323 ibool
324 fsp_validate(
325 /*=========*/
326  ulint space);
327 /*******************************************************************/
329 UNIV_INTERN
330 void
331 fsp_print(
332 /*======*/
333  ulint space);
334 #ifdef UNIV_DEBUG
335 /*******************************************************************/
338 UNIV_INTERN
339 ibool
340 fseg_validate(
341 /*==========*/
342  fseg_header_t* header,
343  mtr_t* mtr);
344 #endif /* UNIV_DEBUG */
345 #ifdef UNIV_BTR_PRINT
346 /*******************************************************************/
348 UNIV_INTERN
349 void
350 fseg_print(
351 /*=======*/
352  fseg_header_t* header,
353  mtr_t* mtr);
354 #endif /* UNIV_BTR_PRINT */
355 
356 #ifndef UNIV_NONINL
357 #include "fsp0fsp.ic"
358 #endif
359 
360 #endif