mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Selectable block allocators
ZFS historically has had several space allocators that were dynamically selectable. While these have been retained in OpenZFS, only a single allocator has been statically compiled in. This patch compiles all allocators for OpenZFS and provides a module parameter to allow for manual selection between them. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ameer Hamza <ahamza@ixsystems.com> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Edmund Nadolski <edmund.nadolski@ixsystems.com> Closes #15218
This commit is contained in:
@@ -503,6 +503,24 @@ SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_idistance,
|
||||
|
||||
/* metaslab.c */
|
||||
|
||||
int
|
||||
param_set_active_allocator(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
char buf[16];
|
||||
int rc;
|
||||
|
||||
if (req->newptr == NULL)
|
||||
strlcpy(buf, zfs_active_allocator, sizeof (buf));
|
||||
|
||||
rc = sysctl_handle_string(oidp, buf, sizeof (buf), req);
|
||||
if (rc || req->newptr == NULL)
|
||||
return (rc);
|
||||
if (strcmp(buf, zfs_active_allocator) == 0)
|
||||
return (0);
|
||||
|
||||
return (param_set_active_allocator_common(buf));
|
||||
}
|
||||
|
||||
/*
|
||||
* In pools where the log space map feature is not enabled we touch
|
||||
* multiple metaslabs (and their respective space maps) with each
|
||||
|
||||
Reference in New Issue
Block a user