1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

logfs: fix bugs in handling full filesystem conditions

This was caught by the logfs unit tests.
This commit is contained in:
Stacey Sheldon 2012-12-18 01:03:31 -05:00 committed by Alessio Morale
parent b211840104
commit 842b275e13

View File

@ -385,7 +385,7 @@ static int32_t logfs_raw_copy_bytes (uintptr_t src_addr, uint16_t src_size, uint
*/
static bool logfs_fs_is_full(void)
{
return (logfs.num_active_slots == (logfs.cfg->arena_size / logfs.cfg->slot_size));
return (logfs.num_active_slots == (logfs.cfg->arena_size / logfs.cfg->slot_size) - 1);
}
/*
@ -663,6 +663,8 @@ static int8_t logfs_delete_object (uint32_t obj_id, uint16_t obj_inst_id)
rc = -2;
goto out_exit;
}
/* Object has been successfully obsoleted and is no longer active */
logfs.num_active_slots--;
break;
case -1:
/* Search completed, object not found */