openzfs / spl

A shim layer which adds the core interfaces required for OpenZFS.
https://zfsonlinux.org/
GNU General Public License v2.0
281 stars 180 forks source link

Add KSTAT_FLAG_NO_HEADERS for kstats #705

Closed tonyhutter closed 6 years ago

tonyhutter commented 6 years ago

The normal kstat output includes two metadata headers before the actual value:

    $ cat /proc/spl/kstat/zfs/foo
    31 0 0x01 1 0 1336141223666 1816471471871
    raw value
    foo

With this patch, you can omit those headers by setting KSTAT_FLAG_NO_HEADERS:

    $ cat /proc/spl/kstat/zfs/foo
    foo

This will be used by an upcoming ZFS patch that I'm working on.

tonyhutter commented 6 years ago

Now that SPL is merged, I folded these changes into https://github.com/zfsonlinux/zfs/pull/7563