Zach Brown f0a7c4f294 scoutfs: make trans item count const rhs
The item count estimate functions didn't obviously differentiate between
adding to a count and resetting it.  Most callers initialized the count
struct to 0 on the stack, incremented their estimate once, and passed it
in.  The problem is that those same functions that increment once in
callers are also used in other estimates to build counts based on
multiple operations.

This tripped up the data truncate path.  It looped and kept incrementing
its count while truncating a file with lots of extents until the count
got so large that it didn't fit in a segment by itself and blocked
forever.

This cleans up the item count code so that it's much harder to get
wrong.  We differentiate between the SIC_*() high level count estimates
that are meant to be passed in to _hold_trans(), and the internal
__count_*() functions which are used to add up the item counts that make
up an aggregate operation.

With this fix the only way to use the count in extent truncation is to
correctly reset it for the item count for each transacation.

Signed-off-by: Zach Brown <zab@versity.com>
2017-09-12 10:41:55 -07:00
Description
No description provided
8 MiB
Languages
C 87%
Shell 9.3%
Roff 2.5%
TeX 0.8%
Makefile 0.4%