]> git.proxmox.com Git - mirror_zfs.git/commit
Bring consistency to ABD chunk count types.
authorAlexander Motin <mav@FreeBSD.org>
Sun, 6 Dec 2020 17:53:40 +0000 (12:53 -0500)
committerGitHub <noreply@github.com>
Sun, 6 Dec 2020 17:53:40 +0000 (09:53 -0800)
commit6366ef22404ef1bd0ba26364905e19f2ec7df2a4
tree179fbf277c2d7b7dff0a178cb1112166f4ca1395
parenteed2bfe06a60d42b0035edb4b86590eb7edd331d
Bring consistency to ABD chunk count types.

With both abd_size and abd_nents being uint_t it makes no sense for
abd_chunkcnt_for_bytes() to return size_t.  Random mix of different
types used to count chunks looks bad and makes compiler more difficult
to optimize the code.

In particular on FreeBSD this change allows compiler to completely
optimize out abd_verify_scatter() when built without debug, removing
pointless 64-bit division and even more pointless empty loop.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Closes #11279
module/os/freebsd/zfs/abd_os.c
module/os/linux/zfs/abd_os.c