]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
A couple of small style cleanups
authorColm <colm@tuatha.org>
Thu, 3 Jun 2021 15:13:42 +0000 (16:13 +0100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 9 Jun 2021 20:05:34 +0000 (13:05 -0700)
commitdb9048741ba4ccad874218ef8b36b27192aada0b
tree35681df092ccdaf317bdc05077a31420601d083b
parentb1b1faf0f1e2abd74b4c79314a709f7168341ba4
A couple of small style cleanups

In `zpool_load_compat()`:

  * initialize `l_features[]` with a loop rather than a static
    initializer.

  * don't redefine system constants; use private names instead

Rationale here:

When an array is initialized using a static {foo}, only the specified
members are initialized to the provided values, the rest are
initialized to zero. While B_FALSE is of course zero, it feels
unsafe to rely on this being true forever, so I'm inclined to sacrifice
a few microseconds of runtime here and initialize using a loop.

When looking for the correct combination of system constants to use
(in open() and mmap()), I prefer to use private constants rather than
redefining system ones; due to the small chance that the system
ones might be referenced later in the file. So rather than defining
O_PATH and MAP_POPULATE, I use distinct constant names.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Signed-off-by: Colm Buckley <colm@tuatha.org>
Closes #12156
lib/libzfs/libzfs_pool.c