Skip to contentSkip to conversation

unnecessary "memset(n, 0, block_size); " in dm_btree_empty ?

DISCUSSION shenghui 1 participant 1 message Nov 10, 2018 Device mapper

lore
Share & tools
lore

shenghui

author
#0 lore raw

Hi,

Sorry to trouble you.

I'm reading the code of persistent data, and noticed:

dm_btree_empty() -> new_block() -> dm_tm_new_block() to get a new block allocated. And the new block is zeroed with write lock held.

"memset(n, 0, block_size);" in dm_btree_empty() seems unnecessary. Right?

Thanks,
shenghui