Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
9be9363c
Commit
9be9363c
authored
Mar 05, 2008
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: fsp_header_get_free_limit(), fsp_header_get_tablespace_size():
Remove the redundant parameter "space".
parent
79bbbc98
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
44 deletions
+32
-44
fsp/fsp0fsp.c
fsp/fsp0fsp.c
+17
-28
include/fsp0fsp.h
include/fsp0fsp.h
+12
-13
srv/srv0start.c
srv/srv0start.c
+3
-3
No files found.
fsp/fsp0fsp.c
View file @
9be9363c
...
@@ -1048,37 +1048,29 @@ fsp_header_inc_size(
...
@@ -1048,37 +1048,29 @@ fsp_header_inc_size(
}
}
/**************************************************************************
/**************************************************************************
Gets the current free limit of
a tablespace. The free limit means the
Gets the current free limit of
the system tablespace. The free limit
place of the first page which has never been put to the the free list
means the place of the first page which has never been put to the the
f
or allocation. The space above that address is initialized to zero.
f
ree list for allocation. The space above that address is initialized
Sets also the global variable log_fsp_current_free_limit. */
to zero.
Sets also the global variable log_fsp_current_free_limit. */
UNIV_INTERN
UNIV_INTERN
ulint
ulint
fsp_header_get_free_limit
(
fsp_header_get_free_limit
(
void
)
/*======================*/
/*======================
=====
*/
/* out: free limit in megabytes */
/* out: free limit in megabytes */
ulint
space
)
/* in: space id, must be 0 */
{
{
fsp_header_t
*
header
;
fsp_header_t
*
header
;
ulint
limit
;
ulint
limit
;
ulint
zip_size
;
mtr_t
mtr
;
mtr_t
mtr
;
ut_a
(
space
==
0
);
/* We have only one log_fsp_current_... variable */
mtr_start
(
&
mtr
);
mtr_start
(
&
mtr
);
mtr_x_lock
(
fil_space_get_latch
(
space
,
&
zip_size
),
&
mtr
);
mtr_x_lock
(
fil_space_get_latch
(
0
,
NULL
),
&
mtr
);
header
=
fsp_get_space_header
(
space
,
zip_size
,
&
mtr
);
header
=
fsp_get_space_header
(
0
,
0
,
&
mtr
);
limit
=
mtr_read_ulint
(
header
+
FSP_FREE_LIMIT
,
MLOG_4BYTES
,
&
mtr
);
limit
=
mtr_read_ulint
(
header
+
FSP_FREE_LIMIT
,
MLOG_4BYTES
,
&
mtr
);
if
(
!
zip_size
)
{
limit
/=
((
1024
*
1024
)
/
UNIV_PAGE_SIZE
);
limit
/=
((
1024
*
1024
)
/
UNIV_PAGE_SIZE
);
}
else
{
limit
/=
((
1024
*
1024
)
/
zip_size
);
}
log_fsp_current_free_limit_set_and_checkpoint
(
limit
);
log_fsp_current_free_limit_set_and_checkpoint
(
limit
);
...
@@ -1088,28 +1080,25 @@ fsp_header_get_free_limit(
...
@@ -1088,28 +1080,25 @@ fsp_header_get_free_limit(
}
}
/**************************************************************************
/**************************************************************************
Gets the size of the tablespace from the tablespace header. If we do not
Gets the size of the system tablespace from the tablespace header. If
have an auto-extending data file, this should be equal to the size of the
we do not have an auto-extending data file, this should be equal to
data files. If there is an auto-extending data file, this can be smaller. */
the size of the data files. If there is an auto-extending data file,
this can be smaller. */
UNIV_INTERN
UNIV_INTERN
ulint
ulint
fsp_header_get_tablespace_size
(
fsp_header_get_tablespace_size
(
void
)
/*===========================*/
/*===========================
=====
*/
/* out: size in pages */
/* out: size in pages */
ulint
space
)
/* in: space id, must be 0 */
{
{
fsp_header_t
*
header
;
fsp_header_t
*
header
;
ulint
size
;
ulint
size
;
ulint
zip_size
;
mtr_t
mtr
;
mtr_t
mtr
;
ut_a
(
space
==
0
);
/* We have only one log_fsp_current_... variable */
mtr_start
(
&
mtr
);
mtr_start
(
&
mtr
);
mtr_x_lock
(
fil_space_get_latch
(
space
,
&
zip_size
),
&
mtr
);
mtr_x_lock
(
fil_space_get_latch
(
0
,
NULL
),
&
mtr
);
header
=
fsp_get_space_header
(
space
,
zip_size
,
&
mtr
);
header
=
fsp_get_space_header
(
0
,
0
,
&
mtr
);
size
=
mtr_read_ulint
(
header
+
FSP_SIZE
,
MLOG_4BYTES
,
&
mtr
);
size
=
mtr_read_ulint
(
header
+
FSP_SIZE
,
MLOG_4BYTES
,
&
mtr
);
...
...
include/fsp0fsp.h
View file @
9be9363c
...
@@ -46,26 +46,25 @@ void
...
@@ -46,26 +46,25 @@ void
fsp_init
(
void
);
fsp_init
(
void
);
/*==========*/
/*==========*/
/**************************************************************************
/**************************************************************************
Gets the current free limit of
a tablespace. The free limit means the
Gets the current free limit of
the system tablespace. The free limit
place of the first page which has never been put to the the free list
means the place of the first page which has never been put to the the
f
or allocation. The space above that address is initialized to zero.
f
ree list for allocation. The space above that address is initialized
Sets also the global variable log_fsp_current_free_limit. */
to zero.
Sets also the global variable log_fsp_current_free_limit. */
UNIV_INTERN
UNIV_INTERN
ulint
ulint
fsp_header_get_free_limit
(
fsp_header_get_free_limit
(
void
);
/*======================*/
/*======================
=====
*/
/* out: free limit in megabytes */
/* out: free limit in megabytes */
ulint
space
);
/* in: space id, must be 0 */
/**************************************************************************
/**************************************************************************
Gets the size of the tablespace from the tablespace header. If we do not
Gets the size of the system tablespace from the tablespace header. If
have an auto-extending data file, this should be equal to the size of the
we do not have an auto-extending data file, this should be equal to
data files. If there is an auto-extending data file, this can be smaller. */
the size of the data files. If there is an auto-extending data file,
this can be smaller. */
UNIV_INTERN
UNIV_INTERN
ulint
ulint
fsp_header_get_tablespace_size
(
fsp_header_get_tablespace_size
(
void
);
/*===========================*/
/*===========================
=====
*/
/* out: size in pages */
/* out: size in pages */
ulint
space
);
/* in: space id, must be 0 */
/**************************************************************************
/**************************************************************************
Reads the file space size stored in the header page. */
Reads the file space size stored in the header page. */
UNIV_INTERN
UNIV_INTERN
...
...
srv/srv0start.c
View file @
9be9363c
...
@@ -1436,7 +1436,7 @@ innobase_start_or_create_for_mysql(void)
...
@@ -1436,7 +1436,7 @@ innobase_start_or_create_for_mysql(void)
/* Initialize the fsp free limit global variable in the log
/* Initialize the fsp free limit global variable in the log
system */
system */
fsp_header_get_free_limit
(
0
);
fsp_header_get_free_limit
();
recv_recovery_from_archive_finish
();
recv_recovery_from_archive_finish
();
#endif
/* UNIV_LOG_ARCHIVE */
#endif
/* UNIV_LOG_ARCHIVE */
...
@@ -1491,7 +1491,7 @@ innobase_start_or_create_for_mysql(void)
...
@@ -1491,7 +1491,7 @@ innobase_start_or_create_for_mysql(void)
/* Initialize the fsp free limit global variable in the log
/* Initialize the fsp free limit global variable in the log
system */
system */
fsp_header_get_free_limit
(
0
);
fsp_header_get_free_limit
();
/* recv_recovery_from_checkpoint_finish needs trx lists which
/* recv_recovery_from_checkpoint_finish needs trx lists which
are initialized in trx_sys_init_at_db_start(). */
are initialized in trx_sys_init_at_db_start(). */
...
@@ -1576,7 +1576,7 @@ innobase_start_or_create_for_mysql(void)
...
@@ -1576,7 +1576,7 @@ innobase_start_or_create_for_mysql(void)
sum_of_data_file_sizes
+=
srv_data_file_sizes
[
i
];
sum_of_data_file_sizes
+=
srv_data_file_sizes
[
i
];
}
}
tablespace_size_in_header
=
fsp_header_get_tablespace_size
(
0
);
tablespace_size_in_header
=
fsp_header_get_tablespace_size
();
if
(
!
srv_auto_extend_last_data_file
if
(
!
srv_auto_extend_last_data_file
&&
sum_of_data_file_sizes
!=
tablespace_size_in_header
)
{
&&
sum_of_data_file_sizes
!=
tablespace_size_in_header
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment