~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-02-14 23:59:22 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120214235922-cux5uek1e5l0hje9
Tags: 5.5.20-0ubuntu1
* New upstream release.
* d/mysql-server-5.5.mysql.upstart: Fix stop on to make sure mysql is
  fully stopped before shutdown commences. (LP: #688541) Also simplify
  start on as it is redundant.
* d/control: Depend on upstart version which has apparmor profile load
  script to prevent failure on upgrade from lucid to precise.
  (LP: #907465)
* d/apparmor-profile: need to allow /run since that is the true path
  of /var/run files. (LP: #917542)
* d/control: mysql-server-5.5 has files in it that used to be owned
  by libmysqlclient-dev, so it must break/replace it. (LP: #912487)
* d/rules, d/control: 5.5.20 Fixes segfault on tests with gcc 4.6,
  change compiler back to system default.
* d/rules: Turn off embedded libedit/readline.(Closes: #659566)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
4
4
 
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.
12
12
 
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
16
16
 
17
17
*****************************************************************************/
18
18
 
34
34
#include "page0types.h"
35
35
#include "fsp0types.h"
36
36
 
 
37
/* @defgroup fsp_flags InnoDB Tablespace Flag Constants @{ */
 
38
 
 
39
/** Number of flag bits used to indicate the tablespace page size */
 
40
#define FSP_FLAGS_WIDTH_PAGE_SSIZE      4
 
41
/** Zero relative shift position of the PAGE_SSIZE field */
 
42
#define FSP_FLAGS_POS_PAGE_SSIZE        6
 
43
/** Bit mask of the PAGE_SSIZE field */
 
44
#define FSP_FLAGS_MASK_PAGE_SSIZE                               \
 
45
                ((~(~0 << FSP_FLAGS_WIDTH_PAGE_SSIZE))          \
 
46
                << FSP_FLAGS_POS_PAGE_SSIZE)
 
47
/** Return the value of the PAGE_SSIZE field */
 
48
#define FSP_FLAGS_GET_PAGE_SSIZE(flags)                         \
 
49
                ((flags & FSP_FLAGS_MASK_PAGE_SSIZE)            \
 
50
                >> FSP_FLAGS_POS_PAGE_SSIZE)
 
51
 
 
52
/* @} */
 
53
 
 
54
/* @defgroup Tablespace Header Constants (moved from fsp0fsp.c) @{ */
 
55
 
 
56
/** Offset of the space header within a file page */
 
57
#define FSP_HEADER_OFFSET       FIL_PAGE_DATA
 
58
 
 
59
/* The data structures in files are defined just as byte strings in C */
 
60
typedef byte    fsp_header_t;
 
61
typedef byte    xdes_t;
 
62
 
 
63
/*                      SPACE HEADER
 
64
                        ============
 
65
 
 
66
File space header data structure: this data structure is contained in the
 
67
first page of a space. The space for this header is reserved in every extent
 
68
descriptor page, but used only in the first. */
 
69
 
 
70
/*-------------------------------------*/
 
71
#define FSP_SPACE_ID            0       /* space id */
 
72
#define FSP_NOT_USED            4       /* this field contained a value up to
 
73
                                        which we know that the modifications
 
74
                                        in the database have been flushed to
 
75
                                        the file space; not used now */
 
76
#define FSP_SIZE                8       /* Current size of the space in
 
77
                                        pages */
 
78
#define FSP_FREE_LIMIT          12      /* Minimum page number for which the
 
79
                                        free list has not been initialized:
 
80
                                        the pages >= this limit are, by
 
81
                                        definition, free; note that in a
 
82
                                        single-table tablespace where size
 
83
                                        < 64 pages, this number is 64, i.e.,
 
84
                                        we have initialized the space
 
85
                                        about the first extent, but have not
 
86
                                        physically allocted those pages to the
 
87
                                        file */
 
88
#define FSP_SPACE_FLAGS         16      /* fsp_space_t.flags, similar to
 
89
                                        dict_table_t::flags */
 
90
#define FSP_FRAG_N_USED         20      /* number of used pages in the
 
91
                                        FSP_FREE_FRAG list */
 
92
#define FSP_FREE                24      /* list of free extents */
 
93
#define FSP_FREE_FRAG           (24 + FLST_BASE_NODE_SIZE)
 
94
                                        /* list of partially free extents not
 
95
                                        belonging to any segment */
 
96
#define FSP_FULL_FRAG           (24 + 2 * FLST_BASE_NODE_SIZE)
 
97
                                        /* list of full extents not belonging
 
98
                                        to any segment */
 
99
#define FSP_SEG_ID              (24 + 3 * FLST_BASE_NODE_SIZE)
 
100
                                        /* 8 bytes which give the first unused
 
101
                                        segment id */
 
102
#define FSP_SEG_INODES_FULL     (32 + 3 * FLST_BASE_NODE_SIZE)
 
103
                                        /* list of pages containing segment
 
104
                                        headers, where all the segment inode
 
105
                                        slots are reserved */
 
106
#define FSP_SEG_INODES_FREE     (32 + 4 * FLST_BASE_NODE_SIZE)
 
107
                                        /* list of pages containing segment
 
108
                                        headers, where not all the segment
 
109
                                        header slots are reserved */
 
110
/*-------------------------------------*/
 
111
/* File space header size */
 
112
#define FSP_HEADER_SIZE         (32 + 5 * FLST_BASE_NODE_SIZE)
 
113
 
 
114
#define FSP_FREE_ADD            4       /* this many free extents are added
 
115
                                        to the free list from above
 
116
                                        FSP_FREE_LIMIT at a time */
 
117
/* @} */
 
118
 
 
119
/* @} */
 
120
 
37
121
/**********************************************************************//**
38
122
Initializes the file space system. */
39
123
UNIV_INTERN
352
436
        mtr_t*          mtr);   /*!< in: mtr */
353
437
#endif /* UNIV_BTR_PRINT */
354
438
 
 
439
/********************************************************************//**
 
440
Extract the page size from tablespace flags.
 
441
This feature, storing the page_ssize into the tablespace flags, is added
 
442
to InnoDB 5.6.4.  This is here only to protect against a crash if a newer
 
443
database is opened with this code branch.
 
444
@return page size of the tablespace in bytes */
 
445
UNIV_INLINE
 
446
ulint
 
447
fsp_flags_get_page_size(
 
448
/*====================*/
 
449
        ulint   flags); /*!< in: tablespace flags */
 
450
 
355
451
#ifndef UNIV_NONINL
356
452
#include "fsp0fsp.ic"
357
453
#endif