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

« back to all changes in this revision

Viewing changes to storage/innobase/fsp/fsp0fsp.c

  • 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, 2010, 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
 
50
50
#include "dict0mem.h"
51
51
 
52
52
 
53
 
#define FSP_HEADER_OFFSET       FIL_PAGE_DATA   /* Offset of the space header
54
 
                                                within a file page */
55
 
 
56
 
/* The data structures in files are defined just as byte strings in C */
57
 
typedef byte    fsp_header_t;
58
 
typedef byte    xdes_t;
59
 
 
60
 
/*                      SPACE HEADER
61
 
                        ============
62
 
 
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. */
66
 
 
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
74
 
                                        pages */
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
84
 
                                        file */
85
 
#define FSP_SPACE_FLAGS         16      /* table->flags & ~DICT_TF_COMPACT */
86
 
#define FSP_FRAG_N_USED         20      /* number of used pages in the
87
 
                                        FSP_FREE_FRAG list */
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
94
 
                                        to any segment */
95
 
#define FSP_SEG_ID              (24 + 3 * FLST_BASE_NODE_SIZE)
96
 
                                        /* 8 bytes which give the first unused
97
 
                                        segment id */
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)
109
 
 
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 */
113
 
 
114
53
/*                      FILE SEGMENT INODE
115
54
                        ==================
116
55