mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 19:19:32 +03:00
Eliminate gratuitous bzeroing in dbuf_stats_hash_table_data
`dbuf_stats_hash_table_data` can take much longer than it needs to by repeatedly bzeroing its buffer when in fact the buffer only needs to be NULL terminated. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #10993
This commit is contained in:
parent
8a171ccd92
commit
1cb8202b1b
@ -134,7 +134,8 @@ dbuf_stats_hash_table_data(char *buf, size_t size, void *data)
|
|||||||
|
|
||||||
ASSERT3S(dsh->idx, >=, 0);
|
ASSERT3S(dsh->idx, >=, 0);
|
||||||
ASSERT3S(dsh->idx, <=, h->hash_table_mask);
|
ASSERT3S(dsh->idx, <=, h->hash_table_mask);
|
||||||
memset(buf, 0, size);
|
if (size)
|
||||||
|
buf[0] = 0;
|
||||||
|
|
||||||
mutex_enter(DBUF_HASH_MUTEX(h, dsh->idx));
|
mutex_enter(DBUF_HASH_MUTEX(h, dsh->idx));
|
||||||
for (db = h->hash_table[dsh->idx]; db != NULL; db = db->db_hash_next) {
|
for (db = h->hash_table[dsh->idx]; db != NULL; db = db->db_hash_next) {
|
||||||
|
Loading…
Reference in New Issue
Block a user