diff options
author | Richard Yao <[email protected]> | 2023-01-20 14:10:15 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2023-01-20 11:10:15 -0800 |
commit | 856cefcd1c57da665e1690786a8be011ce7e4fa2 (patch) | |
tree | 190473827376b3d198f0559d06b771bf27000cbb /include | |
parent | ebabb93e6c6e1849173206874a1543d8161225ab (diff) |
Cleanup ->dd_space_towrite should be unsigned
This is only ever used with unsigned data, so the type itself should be
unsigned. Also, PVS Studio's 2016 FreeBSD kernel report correctly
identified the following assertion as always being true, so we can drop
it:
ASSERT3U(dd->dd_space_towrite[i & TXG_MASK], >=, 0);
The reason it was always true is because it would do casts to give us
unsigned comparisons. This could have been fixed by switching to
`ASSERT3S()`, but upon inspection, it turned out that this variable
never should have been allowed to be signed in the first place.
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Closes #14408
Diffstat (limited to 'include')
-rw-r--r-- | include/sys/dsl_dir.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/sys/dsl_dir.h b/include/sys/dsl_dir.h index 384f98e8f..f7c0d9acd 100644 --- a/include/sys/dsl_dir.h +++ b/include/sys/dsl_dir.h @@ -116,7 +116,7 @@ struct dsl_dir { /* gross estimate of space used by in-flight tx's */ uint64_t dd_tempreserved[TXG_SIZE]; /* amount of space we expect to write; == amount of dirty data */ - int64_t dd_space_towrite[TXG_SIZE]; + uint64_t dd_space_towrite[TXG_SIZE]; dsl_deadlist_t dd_livelist; bplist_t dd_pending_frees; |