~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

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