scoutfs: add counters for radix enospc

Add counters for the various sources of ENOSPC from the radix block
allocator.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2020-04-22 14:56:06 -07:00
committed by Zach Brown
parent 9ad86d4d29
commit e3b1f2e2b0
2 changed files with 6 additions and 0 deletions

View File

@@ -85,6 +85,9 @@
EXPAND_COUNTER(quorum_write_block) \
EXPAND_COUNTER(quorum_write_block_error) \
EXPAND_COUNTER(quorum_fenced) \
EXPAND_COUNTER(radix_enospc_data) \
EXPAND_COUNTER(radix_enospc_paths) \
EXPAND_COUNTER(radix_enospc_synth) \
EXPAND_COUNTER(trans_commit_data_alloc_low) \
EXPAND_COUNTER(trans_commit_fsync) \
EXPAND_COUNTER(trans_commit_full) \

View File

@@ -834,6 +834,7 @@ static int get_path(struct super_block *sb, struct scoutfs_radix_root *root,
synth = chg->next_synth++;
/* careful not to go too high or wrap */
if (synth == U64_MAX || synth < RADIX_SYNTH_BLKNO) {
scoutfs_inc_counter(sb, radix_enospc_synth);
ret = -ENOSPC;
goto out;
}
@@ -992,6 +993,7 @@ static int get_all_paths(struct super_block *sb,
/* we're not modifying as we go, check for wrapping */
if (next_meta >= start_meta && meta_wrapped) {
scoutfs_inc_counter(sb, radix_enospc_paths);
ret = -ENOSPC;
break;
}
@@ -1276,6 +1278,7 @@ find_next:
root->next_find_bit = 0;
goto find_next;
}
scoutfs_inc_counter(sb, radix_enospc_data);
ret = -ENOSPC;
}
goto out;