1
1
/*****************************************************************************
3
Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
3
Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
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., 59 Temple
15
Place, Suite 330, Boston, MA 02111-1307 USA
14
this program; if not, write to the Free Software Foundation, Inc.,
15
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
17
17
*****************************************************************************/
50
50
#include "dict0mem.h"
53
#define FSP_HEADER_OFFSET FIL_PAGE_DATA /* Offset of the space header
56
/* The data structures in files are defined just as byte strings in C */
57
typedef byte fsp_header_t;
63
File space header data structure: this data structure is contained in the
64
first page of a space. The space for this header is reserved in every extent
65
descriptor page, but used only in the first. */
67
/*-------------------------------------*/
68
#define FSP_SPACE_ID 0 /* space id */
69
#define FSP_NOT_USED 4 /* this field contained a value up to
70
which we know that the modifications
71
in the database have been flushed to
72
the file space; not used now */
73
#define FSP_SIZE 8 /* Current size of the space in
75
#define FSP_FREE_LIMIT 12 /* Minimum page number for which the
76
free list has not been initialized:
77
the pages >= this limit are, by
78
definition, free; note that in a
79
single-table tablespace where size
80
< 64 pages, this number is 64, i.e.,
81
we have initialized the space
82
about the first extent, but have not
83
physically allocted those pages to the
85
#define FSP_SPACE_FLAGS 16 /* table->flags & ~DICT_TF_COMPACT */
86
#define FSP_FRAG_N_USED 20 /* number of used pages in the
88
#define FSP_FREE 24 /* list of free extents */
89
#define FSP_FREE_FRAG (24 + FLST_BASE_NODE_SIZE)
90
/* list of partially free extents not
91
belonging to any segment */
92
#define FSP_FULL_FRAG (24 + 2 * FLST_BASE_NODE_SIZE)
93
/* list of full extents not belonging
95
#define FSP_SEG_ID (24 + 3 * FLST_BASE_NODE_SIZE)
96
/* 8 bytes which give the first unused
98
#define FSP_SEG_INODES_FULL (32 + 3 * FLST_BASE_NODE_SIZE)
99
/* list of pages containing segment
100
headers, where all the segment inode
101
slots are reserved */
102
#define FSP_SEG_INODES_FREE (32 + 4 * FLST_BASE_NODE_SIZE)
103
/* list of pages containing segment
104
headers, where not all the segment
105
header slots are reserved */
106
/*-------------------------------------*/
107
/* File space header size */
108
#define FSP_HEADER_SIZE (32 + 5 * FLST_BASE_NODE_SIZE)
110
#define FSP_FREE_ADD 4 /* this many free extents are added
111
to the free list from above
112
FSP_FREE_LIMIT at a time */
114
53
/* FILE SEGMENT INODE
115
54
==================