diff options
author | pjd <pjd@FreeBSD.org> | 2011-03-06 23:09:33 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2011-03-06 23:09:33 +0000 |
commit | 337b50efa895f3694fae9eeac35a3abd16181e75 (patch) | |
tree | 89777d06274aeb1f7f06b2647305a98d160268c9 /sbin/hastd/hast.h | |
parent | 8697092f0ef00a8c8c15e4c26574e6fbfce848a2 (diff) | |
download | FreeBSD-src-337b50efa895f3694fae9eeac35a3abd16181e75.zip FreeBSD-src-337b50efa895f3694fae9eeac35a3abd16181e75.tar.gz |
Allow to compress on-the-wire data using two algorithms:
- HOLE - it simply turns all-zero blocks into few bytes header;
it is extremely fast, so it is turned on by default;
it is mostly intended to speed up initial synchronization
where we expect many zeros;
- LZF - very fast algorithm by Marc Alexander Lehmann, which shows
very decent compression ratio and has BSD license.
MFC after: 2 weeks
Diffstat (limited to 'sbin/hastd/hast.h')
-rw-r--r-- | sbin/hastd/hast.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sbin/hastd/hast.h b/sbin/hastd/hast.h index fe9cf0d..8c64395 100644 --- a/sbin/hastd/hast.h +++ b/sbin/hastd/hast.h @@ -117,6 +117,10 @@ struct hastd_config { #define HAST_REPLICATION_MEMSYNC 1 #define HAST_REPLICATION_ASYNC 2 +#define HAST_COMPRESSION_NONE 0 +#define HAST_COMPRESSION_HOLE 1 +#define HAST_COMPRESSION_LZF 2 + #define HAST_CHECKSUM_NONE 0 #define HAST_CHECKSUM_CRC32 1 #define HAST_CHECKSUM_SHA256 2 @@ -137,6 +141,8 @@ struct hast_resource { int hr_keepdirty; /* Path to a program to execute on various events. */ char hr_exec[PATH_MAX]; + /* Compression algorithm. */ + int hr_compression; /* Checksum algorithm. */ int hr_checksum; |