HomeFreeBSD

makefs/zfs: Allow the autotrim pool property to be set

Description

makefs/zfs: Allow the autotrim pool property to be set

Add an "autotrim" option taking "on" or "off". The value is stored in
the pool properties object alongside "bootfs", so the imported pool
starts trimming freed space automatically without a separate
"zpool set" step. When the option is omitted nothing is written and
the pool keeps the default ("off"), exactly as before.

A string option is used rather than makefs's boolean option type since
the latter ignores its value, which would make "autotrim=off" enable
the feature.

Define the spa_autotrim_t enumeration in the boot zfsimpl.h, copied
from OpenZFS's sys/spa.h, so that makefs can refer to SPA_AUTOTRIM_OFF
and SPA_AUTOTRIM_ON by name. The loader does not use it.

Document the option in makefs(8) and add a regression test.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D60420

Details

Provenance
rcmAuthored on Wed, Oct 7, 2:57 PM
Reviewer
markj
Differential Revision
D60420: makefs/zfs: Allow the autotrim pool property to be set
Parents
rGfa6fe034a73c: inotify.2: Add some entries to the BUGS section
Branches
Unknown
Tags
Unknown