[dm-devel] unnecessary "memset(n, 0, block_size); " in dm_btree_empty ?

shenghui shhuiw at foxmail.com
Sat Nov 10 11:49:50 UTC 2018


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




More information about the dm-devel mailing list