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:
23
src/include/storage/checksum.h
Normal file
23
src/include/storage/checksum.h
Normal 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 */
|
Reference in New Issue
Block a user