summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKarel Zak2015-09-22 15:26:36 +0200
committerKarel Zak2015-09-24 09:26:42 +0200
commit7020de0be8b5fa0cdb6a8feee3f64f5384b18f06 (patch)
tree9dd9ef9c801e55c6b99cde0a3cbace73d6cbda8e /include
parentsfdisk: add --delete (diff)
downloadkernel-qcow2-util-linux-7020de0be8b5fa0cdb6a8feee3f64f5384b18f06.tar.gz
kernel-qcow2-util-linux-7020de0be8b5fa0cdb6a8feee3f64f5384b18f06.tar.xz
kernel-qcow2-util-linux-7020de0be8b5fa0cdb6a8feee3f64f5384b18f06.zip
lib/crc32: don't require to modify GPT header
This patch introduces smart crc32 function that is able to exclude specified. The advantage is that we does not have to modify GPT header (set the current in-header crc field to zero) when we count crc32. This allows to keep GPT header in read-only buffers and simplify code. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/crc32.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/crc32.h b/include/crc32.h
index 26169109e..ff2dd99d8 100644
--- a/include/crc32.h
+++ b/include/crc32.h
@@ -5,6 +5,8 @@
#include <stdint.h>
extern uint32_t crc32(uint32_t seed, const unsigned char *buf, size_t len);
+extern uint32_t crc32_exclude_offset(uint32_t seed, const unsigned char *buf, size_t len,
+ size_t exclude_off, size_t exclude_len);
#endif