~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/innobase/include/fsp0types.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

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/fsp0types.h
 
21
File space management types
 
22
 
 
23
Created May 26, 2009 Vasil Dimov
 
24
*******************************************************/
 
25
 
 
26
#ifndef fsp0types_h
 
27
#define fsp0types_h
 
28
 
 
29
#include "univ.i"
 
30
 
 
31
#include "fil0fil.h" /* for FIL_PAGE_DATA */
 
32
 
 
33
/** @name Flags for inserting records in order
 
34
If records are inserted in order, there are the following
 
35
flags to tell this (their type is made byte for the compiler
 
36
to warn if direction and hint parameters are switched in
 
37
fseg_alloc_free_page) */
 
38
/* @{ */
 
39
#define FSP_UP          ((byte)111)     /*!< alphabetically upwards */
 
40
#define FSP_DOWN        ((byte)112)     /*!< alphabetically downwards */
 
41
#define FSP_NO_DIR      ((byte)113)     /*!< no order */
 
42
/* @} */
 
43
 
 
44
/** File space extent size (one megabyte) in pages */
 
45
#define FSP_EXTENT_SIZE         (1 << (20 - UNIV_PAGE_SIZE_SHIFT))
 
46
 
 
47
/** On a page of any file segment, data may be put starting from this
 
48
offset */
 
49
#define FSEG_PAGE_DATA          FIL_PAGE_DATA
 
50
 
 
51
/** @name File segment header
 
52
The file segment header points to the inode describing the file segment. */
 
53
/* @{ */
 
54
/** Data type for file segment header */
 
55
typedef byte    fseg_header_t;
 
56
 
 
57
#define FSEG_HDR_SPACE          0       /*!< space id of the inode */
 
58
#define FSEG_HDR_PAGE_NO        4       /*!< page number of the inode */
 
59
#define FSEG_HDR_OFFSET         8       /*!< byte offset of the inode */
 
60
 
 
61
#define FSEG_HEADER_SIZE        10      /*!< Length of the file system
 
62
                                        header, in bytes */
 
63
/* @} */
 
64
 
 
65
/** Flags for fsp_reserve_free_extents @{ */
 
66
#define FSP_NORMAL      1000000
 
67
#define FSP_UNDO        2000000
 
68
#define FSP_CLEANING    3000000
 
69
/* @} */
 
70
 
 
71
/* Number of pages described in a single descriptor page: currently each page
 
72
description takes less than 1 byte; a descriptor page is repeated every
 
73
this many file pages */
 
74
/* #define XDES_DESCRIBED_PER_PAGE              UNIV_PAGE_SIZE */
 
75
/* This has been replaced with either UNIV_PAGE_SIZE or page_zip->size. */
 
76
 
 
77
/** @name The space low address page map
 
78
The pages at FSP_XDES_OFFSET and FSP_IBUF_BITMAP_OFFSET are repeated
 
79
every XDES_DESCRIBED_PER_PAGE pages in every tablespace. */
 
80
/* @{ */
 
81
/*--------------------------------------*/
 
82
#define FSP_XDES_OFFSET                 0       /* !< extent descriptor */
 
83
#define FSP_IBUF_BITMAP_OFFSET          1       /* !< insert buffer bitmap */
 
84
                                /* The ibuf bitmap pages are the ones whose
 
85
                                page number is the number above plus a
 
86
                                multiple of XDES_DESCRIBED_PER_PAGE */
 
87
 
 
88
#define FSP_FIRST_INODE_PAGE_NO         2       /*!< in every tablespace */
 
89
                                /* The following pages exist
 
90
                                in the system tablespace (space 0). */
 
91
#define FSP_IBUF_HEADER_PAGE_NO         3       /*!< insert buffer
 
92
                                                header page, in
 
93
                                                tablespace 0 */
 
94
#define FSP_IBUF_TREE_ROOT_PAGE_NO      4       /*!< insert buffer
 
95
                                                B-tree root page in
 
96
                                                tablespace 0 */
 
97
                                /* The ibuf tree root page number in
 
98
                                tablespace 0; its fseg inode is on the page
 
99
                                number FSP_FIRST_INODE_PAGE_NO */
 
100
#define FSP_TRX_SYS_PAGE_NO             5       /*!< transaction
 
101
                                                system header, in
 
102
                                                tablespace 0 */
 
103
#define FSP_FIRST_RSEG_PAGE_NO          6       /*!< first rollback segment
 
104
                                                page, in tablespace 0 */
 
105
#define FSP_DICT_HDR_PAGE_NO            7       /*!< data dictionary header
 
106
                                                page, in tablespace 0 */
 
107
/*--------------------------------------*/
 
108
/* @} */
 
109
 
 
110
#endif /* fsp0types_h */