rethinkdb/rethinkdb — pull request #2262 by Aleaxander (2014-04-16 10:14:46+00:00)
Title: btree: metainfo: avoid unnecessary write

We might come to 2 cases when we set superblock metainfo:
- key is already exist
- key is not exist

For the first case, we might simply read all metainfo out into a buffer,
and modify to update new value, and then write the modified buffer back.

However, for the second case, there is no need to write whole buffer
back; instead, we can just append new at tail to avoid
unnecessary write.

Signed-off-by: Liu Aleaxander