vfs_subr: maintain sorted tailq
Pctries are based on unsigned index values. Type daddr_t is
signed. Using daddr_t as an index type for a pctrie works, except that
the pctrie considers negative values greater than nonnegative
ones. Building a sorted tailq of bufs, based on pctrie results, sorts
negative daddr_ts larger than nonnegative ones, and makes code that
depends on the tailq being actually sorted broken.
Write wrappers for the functions that do pctrie operations that depend
on index ordering that fix the order problem, and use them in place of
direct pctrie operations.
PR: 282134
Reported by: pho
Reviewed by: kib, markj
Tested by: pho
Fixes: 2c8caa4b3925aa7335 vfs_subr: optimize inval_buf_range
Differential Revision: https://reviews.freebsd.org/D47200