mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
include: move SPA_MINBLOCKSHIFT and zio_encrypt to sys/fs/zfs.h
These are used by userspace, so should live in a public header Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12116
This commit is contained in:
parent
f00f469052
commit
e618e4a4ff
@ -1613,6 +1613,47 @@ typedef enum {
|
||||
#define ZFS_EV_HIST_DSID "history_dsid"
|
||||
#define ZFS_EV_RESILVER_TYPE "resilver_type"
|
||||
|
||||
|
||||
/*
|
||||
* We currently support block sizes from 512 bytes to 16MB.
|
||||
* The benefits of larger blocks, and thus larger IO, need to be weighed
|
||||
* against the cost of COWing a giant block to modify one byte, and the
|
||||
* large latency of reading or writing a large block.
|
||||
*
|
||||
* Note that although blocks up to 16MB are supported, the recordsize
|
||||
* property can not be set larger than zfs_max_recordsize (default 1MB).
|
||||
* See the comment near zfs_max_recordsize in dsl_dataset.c for details.
|
||||
*
|
||||
* Note that although the LSIZE field of the blkptr_t can store sizes up
|
||||
* to 32MB, the dnode's dn_datablkszsec can only store sizes up to
|
||||
* 32MB - 512 bytes. Therefore, we limit SPA_MAXBLOCKSIZE to 16MB.
|
||||
*/
|
||||
#define SPA_MINBLOCKSHIFT 9
|
||||
#define SPA_OLD_MAXBLOCKSHIFT 17
|
||||
#define SPA_MAXBLOCKSHIFT 24
|
||||
#define SPA_MINBLOCKSIZE (1ULL << SPA_MINBLOCKSHIFT)
|
||||
#define SPA_OLD_MAXBLOCKSIZE (1ULL << SPA_OLD_MAXBLOCKSHIFT)
|
||||
#define SPA_MAXBLOCKSIZE (1ULL << SPA_MAXBLOCKSHIFT)
|
||||
|
||||
|
||||
/* supported encryption algorithms */
|
||||
enum zio_encrypt {
|
||||
ZIO_CRYPT_INHERIT = 0,
|
||||
ZIO_CRYPT_ON,
|
||||
ZIO_CRYPT_OFF,
|
||||
ZIO_CRYPT_AES_128_CCM,
|
||||
ZIO_CRYPT_AES_192_CCM,
|
||||
ZIO_CRYPT_AES_256_CCM,
|
||||
ZIO_CRYPT_AES_128_GCM,
|
||||
ZIO_CRYPT_AES_192_GCM,
|
||||
ZIO_CRYPT_AES_256_GCM,
|
||||
ZIO_CRYPT_FUNCTIONS
|
||||
};
|
||||
|
||||
#define ZIO_CRYPT_ON_VALUE ZIO_CRYPT_AES_256_GCM
|
||||
#define ZIO_CRYPT_DEFAULT ZIO_CRYPT_OFF
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -72,27 +72,6 @@ struct dsl_pool;
|
||||
struct dsl_dataset;
|
||||
struct dsl_crypto_params;
|
||||
|
||||
/*
|
||||
* We currently support block sizes from 512 bytes to 16MB.
|
||||
* The benefits of larger blocks, and thus larger IO, need to be weighed
|
||||
* against the cost of COWing a giant block to modify one byte, and the
|
||||
* large latency of reading or writing a large block.
|
||||
*
|
||||
* Note that although blocks up to 16MB are supported, the recordsize
|
||||
* property can not be set larger than zfs_max_recordsize (default 1MB).
|
||||
* See the comment near zfs_max_recordsize in dsl_dataset.c for details.
|
||||
*
|
||||
* Note that although the LSIZE field of the blkptr_t can store sizes up
|
||||
* to 32MB, the dnode's dn_datablkszsec can only store sizes up to
|
||||
* 32MB - 512 bytes. Therefore, we limit SPA_MAXBLOCKSIZE to 16MB.
|
||||
*/
|
||||
#define SPA_MINBLOCKSHIFT 9
|
||||
#define SPA_OLD_MAXBLOCKSHIFT 17
|
||||
#define SPA_MAXBLOCKSHIFT 24
|
||||
#define SPA_MINBLOCKSIZE (1ULL << SPA_MINBLOCKSHIFT)
|
||||
#define SPA_OLD_MAXBLOCKSIZE (1ULL << SPA_OLD_MAXBLOCKSHIFT)
|
||||
#define SPA_MAXBLOCKSIZE (1ULL << SPA_MAXBLOCKSHIFT)
|
||||
|
||||
/*
|
||||
* Alignment Shift (ashift) is an immutable, internal top-level vdev property
|
||||
* which can only be set at vdev creation time. Physical writes are always done
|
||||
|
@ -108,23 +108,6 @@ enum zio_checksum {
|
||||
|
||||
#define ZIO_DEDUPCHECKSUM ZIO_CHECKSUM_SHA256
|
||||
|
||||
/* supported encryption algorithms */
|
||||
enum zio_encrypt {
|
||||
ZIO_CRYPT_INHERIT = 0,
|
||||
ZIO_CRYPT_ON,
|
||||
ZIO_CRYPT_OFF,
|
||||
ZIO_CRYPT_AES_128_CCM,
|
||||
ZIO_CRYPT_AES_192_CCM,
|
||||
ZIO_CRYPT_AES_256_CCM,
|
||||
ZIO_CRYPT_AES_128_GCM,
|
||||
ZIO_CRYPT_AES_192_GCM,
|
||||
ZIO_CRYPT_AES_256_GCM,
|
||||
ZIO_CRYPT_FUNCTIONS
|
||||
};
|
||||
|
||||
#define ZIO_CRYPT_ON_VALUE ZIO_CRYPT_AES_256_GCM
|
||||
#define ZIO_CRYPT_DEFAULT ZIO_CRYPT_OFF
|
||||
|
||||
/* macros defining encryption lengths */
|
||||
#define ZIO_OBJSET_MAC_LEN 32
|
||||
#define ZIO_DATA_IV_LEN 12
|
||||
|
Loading…
Reference in New Issue
Block a user