24
24
#define FSP_DOWN ((byte)112) /* alphabetically downwards */
25
25
#define FSP_NO_DIR ((byte)113) /* no order */
27
/* File space extent size (one megabyte) in pages */
28
#define FSP_EXTENT_SIZE (1 << (20 - UNIV_PAGE_SIZE_SHIFT))
27
/* File space extent size in pages */
28
#define FSP_EXTENT_SIZE 64
30
30
/* On a page of any file segment, data may be put starting from this offset: */
31
31
#define FSEG_PAGE_DATA FIL_PAGE_DATA
42
42
/**************************************************************************
43
43
Initializes the file space system. */
48
48
/**************************************************************************
49
Gets the current free limit of the system tablespace. The free limit
50
means the place of the first page which has never been put to the the
51
free list for allocation. The space above that address is initialized
52
to zero. Sets also the global variable log_fsp_current_free_limit. */
55
fsp_header_get_free_limit(void);
49
Gets the current free limit of a tablespace. The free limit means the
50
place of the first page which has never been put to the the free list
51
for allocation. The space above that address is initialized to zero.
52
Sets also the global variable log_fsp_current_free_limit. */
55
fsp_header_get_free_limit(
56
/*======================*/
57
/* out: free limit in megabytes */
58
ulint space); /* in: space id, must be 0 */
59
/**************************************************************************
60
Gets the size of the tablespace from the tablespace header. If we do not
61
have an auto-extending data file, this should be equal to the size of the
62
data files. If there is an auto-extending data file, this can be smaller. */
65
fsp_header_get_tablespace_size(
56
66
/*===========================*/
57
/* out: free limit in megabytes */
58
/**************************************************************************
59
Gets the size of the system tablespace from the tablespace header. If
60
we do not have an auto-extending data file, this should be equal to
61
the size of the data files. If there is an auto-extending data file,
62
this can be smaller. */
65
fsp_header_get_tablespace_size(void);
66
/*================================*/
67
67
/* out: size in pages */
68
ulint space); /* in: space id, must be 0 */
68
69
/**************************************************************************
69
70
Reads the file space size stored in the header page. */
75
76
page_t* page); /* in: header page (page 0 in the tablespace) */
76
77
/**************************************************************************
77
78
Reads the space id from the first page of a tablespace. */
80
81
fsp_header_get_space_id(
81
82
/*====================*/
82
/* out: space id, ULINT UNDEFINED if error */
83
const page_t* page); /* in: first page of a tablespace */
84
/**************************************************************************
85
Reads the space flags from the first page of a tablespace. */
91
const page_t* page); /* in: first page of a tablespace */
92
/**************************************************************************
93
Reads the compressed page size from the first page of a tablespace. */
96
fsp_header_get_zip_size(
97
/*====================*/
98
/* out: compressed page size in bytes,
99
or 0 if uncompressed */
100
const page_t* page); /* in: first page of a tablespace */
101
/**************************************************************************
102
Writes the space id and compressed page size to a tablespace header.
103
This function is used past the buffer pool when we in fil0fil.c create
104
a new single-table tablespace. */
83
/* out: space id, ULINT UNDEFINED if error */
84
page_t* page); /* in: first page of a tablespace */
85
/**************************************************************************
86
Writes the space id to a tablespace header. This function is used past the
87
buffer pool when we in fil0fil.c create a new single-table tablespace. */
107
fsp_header_init_fields(
108
/*===================*/
109
page_t* page, /* in/out: first page in the space */
110
ulint space_id, /* in: space id */
111
ulint flags); /* in: tablespace flags (FSP_SPACE_FLAGS):
112
0, or table->flags if newer than COMPACT */
90
fsp_header_write_space_id(
91
/*======================*/
92
page_t* page, /* in: first page in the space */
93
ulint space_id); /* in: space id */
113
94
/**************************************************************************
114
95
Initializes the space header of a new created space and creates also the
115
96
insert buffer tree root if space == 0. */
120
ulint space, /* in: space id */
121
ulint size, /* in: current size in blocks */
122
mtr_t* mtr); /* in: mini-transaction handle */
101
ulint space, /* in: space id */
102
ulint size, /* in: current size in blocks */
103
mtr_t* mtr); /* in: mini-transaction handle */
123
104
/**************************************************************************
124
105
Increases the space size field of a space. */
127
108
fsp_header_inc_size(
128
109
/*================*/
131
112
mtr_t* mtr); /* in: mini-transaction handle */
132
113
/**************************************************************************
133
114
Creates a new segment. */
138
/* out: the block where the segment header is placed,
119
/* out: the page where the segment header is placed,
139
120
x-latched, NULL if could not create segment
140
121
because of lack of space */
141
122
ulint space, /* in: space id */
148
129
mtr_t* mtr); /* in: mtr */
149
130
/**************************************************************************
150
131
Creates a new segment. */
153
134
fseg_create_general(
154
135
/*================*/
155
/* out: the block where the segment header is placed,
136
/* out: the page where the segment header is placed,
156
137
x-latched, NULL if could not create segment
157
138
because of lack of space */
158
139
ulint space, /* in: space id */
282
263
/***********************************************************************
283
264
Frees a segment. The freeing is performed in several mini-transactions,
284
265
so that there is no danger of bufferfixing too many buffer pages. */
289
270
ulint space, /* in: space id */
290
ulint zip_size,/* in: compressed page size in bytes
291
or 0 for uncompressed pages */
292
271
ulint page_no,/* in: page number where the segment header is
294
273
ulint offset);/* in: byte offset of the segment header on that
329
308
/* out: TRUE if a descriptor page */
330
ulint zip_size,/* in: compressed page size in bytes;
331
0 for uncompressed pages */
332
309
ulint page_no);/* in: page number */
333
310
/***************************************************************
334
311
Parses a redo log record of a file page init. */
337
314
fsp_parse_init_file_page(
338
315
/*=====================*/
339
/* out: end of log record or NULL */
340
byte* ptr, /* in: buffer */
341
byte* end_ptr, /* in: buffer end */
342
buf_block_t* block); /* in: block or NULL */
316
/* out: end of log record or NULL */
317
byte* ptr, /* in: buffer */
318
byte* end_ptr,/* in: buffer end */
319
page_t* page); /* in: page or NULL */
343
320
/***********************************************************************
344
321
Validates the file space system and its segments. */
350
327
ulint space); /* in: space id */
351
328
/***********************************************************************
352
329
Prints info of a file space. */
357
334
ulint space); /* in: space id */
358
335
/***********************************************************************
359
336
Validates a segment. */
364
341
/* out: TRUE if ok */
365
342
fseg_header_t* header, /* in: segment header */
366
343
mtr_t* mtr2); /* in: mtr */
367
#ifdef UNIV_BTR_PRINT
368
344
/***********************************************************************
369
345
Writes info of a segment. */
374
350
fseg_header_t* header, /* in: segment header */
375
351
mtr_t* mtr); /* in: mtr */
376
#endif /* UNIV_BTR_PRINT */
378
353
/* Flags for fsp_reserve_free_extents */
379
354
#define FSP_NORMAL 1000000
383
358
/* Number of pages described in a single descriptor page: currently each page
384
359
description takes less than 1 byte; a descriptor page is repeated every
385
360
this many file pages */
386
/* #define XDES_DESCRIBED_PER_PAGE UNIV_PAGE_SIZE */
387
/* This has been replaced with either UNIV_PAGE_SIZE or page_zip->size. */
361
#define XDES_DESCRIBED_PER_PAGE UNIV_PAGE_SIZE
389
363
/* The space low address page map */
390
364
/*--------------------------------------*/