1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Introduce new page checksum algorithm and module.

Isolate checksum calculation to its own module, so that bufpage
knows little if anything about the details of the calculation.

This implementation is a modified FNV-1a hash checksum, details
of which are given in the new checksum.c header comments.

Basic implementation only, so we fix the output value.

Later related commits will add version numbers to pg_control,
compiler optimization flags and memory barriers.

Ants Aasma, reviewed by Jeff Davis and Simon Riggs
This commit is contained in:
Simon Riggs
2013-04-29 09:05:27 +01:00
parent f8db76e875
commit 43e7a66849
4 changed files with 204 additions and 23 deletions

View File

@@ -0,0 +1,23 @@
/*-------------------------------------------------------------------------
*
* checksum.h
* Checksum implementation for data pages.
*
*
* Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/checksum.h
*
*-------------------------------------------------------------------------
*/
#ifndef CHECKSUM_H
#define CHECKSUM_H
/*
* Fowler-Noll-Vo 1a block checksum algorithm. The data argument should be
* aligned on a 4-byte boundary.
*/
extern uint32 checksum_block(char *data, uint32 size);
#endif /* CHECKSUM_H */