Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/boot/zfs/zfssubr.c
Show All 20 Lines | |||||
/* | /* | ||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved. | * Copyright 2007 Sun Microsystems, Inc. All rights reserved. | ||||
* Use is subject to license terms. | * Use is subject to license terms. | ||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <lz4.h> | |||||
static uint64_t zfs_crc64_table[256]; | static uint64_t zfs_crc64_table[256]; | ||||
#define ECKSUM 666 | #define ECKSUM 666 | ||||
#define ASSERT3S(x, y, z) ((void)0) | #define ASSERT3S(x, y, z) ((void)0) | ||||
#define ASSERT3U(x, y, z) ((void)0) | #define ASSERT3U(x, y, z) ((void)0) | ||||
#define ASSERT3P(x, y, z) ((void)0) | #define ASSERT3P(x, y, z) ((void)0) | ||||
#define ASSERT0(x) ((void)0) | #define ASSERT0(x) ((void)0) | ||||
▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | typedef struct zio_compress_info { | ||||
zio_compress_func_t *ci_compress; /* compression function */ | zio_compress_func_t *ci_compress; /* compression function */ | ||||
zio_decompress_func_t *ci_decompress; /* decompression function */ | zio_decompress_func_t *ci_decompress; /* decompression function */ | ||||
int ci_level; /* level parameter */ | int ci_level; /* level parameter */ | ||||
const char *ci_name; /* algorithm name */ | const char *ci_name; /* algorithm name */ | ||||
} zio_compress_info_t; | } zio_compress_info_t; | ||||
#include "lzjb.c" | #include "lzjb.c" | ||||
#include "zle.c" | #include "zle.c" | ||||
#include "lz4.c" | |||||
delphij: Note that the boot/ copy of lz4 was stripped down and #included to give the compiler to liberty… | |||||
Done Inline ActionsWe do use function-sections and data sections with build and let ld to strip away the unused sections, the bios version is losing the compression bits this way. The UEFI version does not get clean - there we do build shared library, and I havent figured out exact steps how to reduce things like lz4_compress. I think we would need to get those symbols demoted to local via mapfile, then ld can strip them off. tsoome: We do use function-sections and data sections with build and let ld to strip away the unused… | |||||
/* | /* | ||||
* Compression vectors. | * Compression vectors. | ||||
*/ | */ | ||||
static zio_compress_info_t zio_compress_table[ZIO_COMPRESS_FUNCTIONS] = { | static zio_compress_info_t zio_compress_table[ZIO_COMPRESS_FUNCTIONS] = { | ||||
{NULL, NULL, 0, "inherit"}, | {NULL, NULL, 0, "inherit"}, | ||||
{NULL, NULL, 0, "on"}, | {NULL, NULL, 0, "on"}, | ||||
{NULL, NULL, 0, "uncompressed"}, | {NULL, NULL, 0, "uncompressed"}, | ||||
▲ Show 20 Lines • Show All 1,615 Lines • Show Last 20 Lines |
Note that the boot/ copy of lz4 was stripped down and #included to give the compiler to liberty to optimize away unused code. This practice is probably no longer relevant today (lz4 footprint is small anyways), but I'd suggest comparing the size before and after this change.