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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
5d54fd61
Commit
5d54fd61
authored
Jan 21, 2022
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: Replace ut_crc32c(x,y) with my_crc32c(0,x,y)
parent
685d958e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
61 deletions
+20
-61
extra/innochecksum.cc
extra/innochecksum.cc
+2
-3
storage/innobase/buf/buf0buf.cc
storage/innobase/buf/buf0buf.cc
+5
-4
storage/innobase/buf/buf0checksum.cc
storage/innobase/buf/buf0checksum.cc
+7
-8
storage/innobase/include/ut0crc32.h
storage/innobase/include/ut0crc32.h
+0
-37
storage/innobase/page/page0zip.cc
storage/innobase/page/page0zip.cc
+6
-7
storage/innobase/srv/srv0srv.cc
storage/innobase/srv/srv0srv.cc
+0
-1
storage/innobase/srv/srv0start.cc
storage/innobase/srv/srv0start.cc
+0
-1
No files found.
extra/innochecksum.cc
View file @
5d54fd61
/*
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2014, 202
1
, MariaDB Corporation.
Copyright (c) 2014, 202
2
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -48,7 +48,6 @@ The parts not included are excluded by #ifndef UNIV_INNOCHECKSUM. */
#include "buf0buf.h"
/* buf_page_is_corrupted */
#include "page0zip.h"
/* page_zip_*() */
#include "trx0undo.h"
/* TRX_* */
#include "ut0crc32.h"
/* ut_crc32_init() */
#include "fil0crypt.h"
/* fil_space_verify_crypt_checksum */
#include <string.h>
...
...
@@ -629,7 +628,7 @@ static bool update_checksum(byte* page, uint32_t flags)
}
else
if
(
use_full_crc32
)
{
ulint
payload
=
buf_page_full_crc32_size
(
page
,
NULL
,
NULL
)
-
FIL_PAGE_FCRC32_CHECKSUM
;
checksum
=
ut_crc32
(
page
,
payload
);
checksum
=
my_crc32c
(
0
,
page
,
payload
);
byte
*
c
=
page
+
payload
;
if
(
mach_read_from_4
(
c
)
==
checksum
)
return
false
;
mach_write_to_4
(
c
,
checksum
);
...
...
storage/innobase/buf/buf0buf.cc
View file @
5d54fd61
...
...
@@ -36,10 +36,11 @@ Created 11/5/1995 Heikki Tuuri
#include "mach0data.h"
#include "buf0buf.h"
#include "buf0checksum.h"
#include "ut0crc32.h"
#include <string.h>
#ifndef UNIV_INNOCHECKSUM
#ifdef UNIV_INNOCHECKSUM
#include "my_sys.h"
#else
#include "my_cpu.h"
#include "mem0mem.h"
#include "btr0btr.h"
...
...
@@ -608,8 +609,8 @@ bool buf_page_is_corrupted(bool check_lsn, const byte *read_buf,
}
});
if
(
crc32
!=
ut_crc32
(
read_buf
,
size
-
FIL_PAGE_FCRC32_CHECKSUM
))
{
if
(
crc32
!=
my_crc32c
(
0
,
read_buf
,
size
-
FIL_PAGE_FCRC32_CHECKSUM
))
{
return
true
;
}
static_assert
(
FIL_PAGE_FCRC32_KEY_VERSION
==
0
,
"alignment"
);
...
...
storage/innobase/buf/buf0checksum.cc
View file @
5d54fd61
/*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 202
1
, MariaDB Corporation.
Copyright (c) 2017, 202
2
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -26,7 +26,6 @@ Created Aug 11, 2011 Vasil Dimov
#include "buf0checksum.h"
#include "fil0fil.h"
#include "ut0crc32.h"
#include "ut0rnd.h"
#ifndef UNIV_INNOCHECKSUM
...
...
@@ -46,12 +45,12 @@ uint32_t buf_calc_page_crc32(const byte* page)
should be combined with the CRC-32 function, not with
exclusive OR. We stick to the current algorithm in order to
remain compatible with old data files. */
return
ut_crc32
(
page
+
FIL_PAGE_OFFSET
,
FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
-
FIL_PAGE_OFFSET
)
^
ut_crc32
(
page
+
FIL_PAGE_DATA
,
srv_page_size
-
(
FIL_PAGE_DATA
+
FIL_PAGE_END_LSN_OLD_CHKSUM
));
return
my_crc32c
(
0
,
page
+
FIL_PAGE_OFFSET
,
FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
-
FIL_PAGE_OFFSET
)
^
my_crc32c
(
0
,
page
+
FIL_PAGE_DATA
,
srv_page_size
-
(
FIL_PAGE_DATA
+
FIL_PAGE_END_LSN_OLD_CHKSUM
));
}
#ifndef UNIV_INNOCHECKSUM
...
...
storage/innobase/include/ut0crc32.h
deleted
100644 → 0
View file @
685d958e
/*****************************************************************************
Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
*****************************************************************************/
/**************************************************//**
@file include/ut0crc32.h
CRC32 implementation
Created Aug 10, 2011 Vasil Dimov
*******************************************************/
#ifndef ut0crc32_h
#define ut0crc32_h
#include "univ.i"
#include <my_sys.h>
static
inline
uint32_t
ut_crc32
(
const
byte
*
s
,
size_t
size
)
{
return
my_crc32c
(
0
,
s
,
size
);
}
#endif
/* ut0crc32_h */
storage/innobase/page/page0zip.cc
View file @
5d54fd61
...
...
@@ -2,7 +2,7 @@
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2014, 202
1
, MariaDB Corporation.
Copyright (c) 2014, 202
2
, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -29,7 +29,6 @@ Created June 2005 by Marko Makela
#include "fsp0types.h"
#include "page0page.h"
#include "buf0checksum.h"
#include "ut0crc32.h"
#include "zlib.h"
#include "span.h"
...
...
@@ -4605,11 +4604,11 @@ uint32_t page_zip_calc_checksum(const void *data, size_t size, bool use_adler)
ut_ad
(
size
>
FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
);
if
(
!
use_adler
)
{
return
ut_crc32
(
s
+
FIL_PAGE_OFFSET
,
FIL_PAGE_LSN
-
FIL_PAGE_OFFSET
)
^
ut_crc32
(
s
+
FIL_PAGE_TYPE
,
2
)
^
ut_crc32
(
s
+
FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
,
size
-
FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
);
return
my_crc32c
(
0
,
s
+
FIL_PAGE_OFFSET
,
FIL_PAGE_LSN
-
FIL_PAGE_OFFSET
)
^
my_crc32c
(
0
,
s
+
FIL_PAGE_TYPE
,
2
)
^
my_crc32c
(
0
,
s
+
FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
,
size
-
FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
);
}
else
{
adler
=
adler32
(
0L
,
s
+
FIL_PAGE_OFFSET
,
FIL_PAGE_LSN
-
FIL_PAGE_OFFSET
);
...
...
storage/innobase/srv/srv0srv.cc
View file @
5d54fd61
...
...
@@ -61,7 +61,6 @@ Created 10/8/1995 Heikki Tuuri
#include "srv0start.h"
#include "trx0i_s.h"
#include "trx0purge.h"
#include "ut0crc32.h"
#include "btr0defragment.h"
#include "ut0mem.h"
#include "fil0fil.h"
...
...
storage/innobase/srv/srv0start.cc
View file @
5d54fd61
...
...
@@ -97,7 +97,6 @@ Created 2/16/1996 Heikki Tuuri
#include "row0mysql.h"
#include "btr0pcur.h"
#include "zlib.h"
#include "ut0crc32.h"
#include "log.h"
/** We are prepared for a situation that we have this many threads waiting for
...
...
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