[tsdb&kvdb] improve the control function.

This commit is contained in:
armink
2020-06-28 00:20:18 +08:00
parent 145991e6eb
commit 074bdee64f
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -1531,6 +1531,8 @@ void fdb_kvdb_control(fdb_kvdb_t db, int cmd, void *arg)
switch (cmd) {
case FDB_KVDB_CTRL_SET_SEC_SIZE:
/* the sector size change MUST before database initialization */
FDB_ASSERT(db->parent.init_ok == false);
db->parent.sec_size = *(uint32_t *)arg;
break;
case FDB_KVDB_CTRL_GET_SEC_SIZE:
+2
View File
@@ -675,6 +675,8 @@ void fdb_tsdb_control(fdb_tsdb_t db, int cmd, void *arg)
*(bool *)arg = db->rollover;
break;
case FDB_TSDB_CTRL_SET_SEC_SIZE:
/* the sector size change MUST before database initialization */
FDB_ASSERT(db->parent.init_ok == false);
db->parent.sec_size = *(uint32_t *)arg;
break;
case FDB_TSDB_CTRL_GET_SEC_SIZE: