uint32_t dvr_extra_time_post;
uint32_t dvr_update_window;
int dvr_running;
- uint32_t dvr_cleanup_threshold_low;
- uint32_t dvr_cleanup_threshold_high;
+ uint32_t dvr_cleanup_threshold_free;
+ uint32_t dvr_cleanup_threshold_used;
muxer_config_t dvr_muxcnf;
cfg->dvr_warm_time = 30;
cfg->dvr_update_window = 24 * 3600;
cfg->dvr_pathname = strdup("$t$n.$x");
- cfg->dvr_cleanup_threshold_low = 200;
- cfg->dvr_cleanup_threshold_high = 2000;
+ cfg->dvr_cleanup_threshold_free = 200;
+ cfg->dvr_cleanup_threshold_used = 2000;
/* Muxer config */
cfg->dvr_muxcnf.m_cache = MC_CACHE_DONTKEEP;
lock_assert(&global_lock);
dvr_config_storage_check(cfg);
- if (cfg->dvr_cleanup_threshold_low < 50)
- cfg->dvr_cleanup_threshold_low = 50; // as checking is only periodically, lower is not save
- if (cfg->dvr_cleanup_threshold_high < cfg->dvr_cleanup_threshold_high)
- cfg->dvr_cleanup_threshold_high = cfg->dvr_cleanup_threshold_low + 50;
+ if (cfg->dvr_cleanup_threshold_free < 50)
+ cfg->dvr_cleanup_threshold_free = 50; // as checking is only periodically, lower is not save
+ if (cfg->dvr_cleanup_threshold_used < cfg->dvr_cleanup_threshold_used)
+ cfg->dvr_cleanup_threshold_used = cfg->dvr_cleanup_threshold_free + 50;
if (cfg->dvr_removal_days != DVR_RET_FOREVER &&
cfg->dvr_removal_days > cfg->dvr_retention_days)
cfg->dvr_retention_days = DVR_RET_ONREMOVE;
},
{
.type = PT_U32,
- .id = "storage-cleanup-low",
+ .id = "storage-mfree",
.name = N_("Maintain free storage space (MiB)"),
- .off = offsetof(dvr_config_t, dvr_cleanup_threshold_low),
+ .off = offsetof(dvr_config_t, dvr_cleanup_threshold_free),
.def.i = 200,
.group = 2,
},
{
.type = PT_U32,
- .id = "storage-cleanup-high",
+ .id = "storage-mused",
.name = N_("Maintain used storage space (MiB)"),
- .off = offsetof(dvr_config_t, dvr_cleanup_threshold_high),
+ .off = offsetof(dvr_config_t, dvr_cleanup_threshold_used),
.def.i = 2000,
.group = 2,
},
filesystemId = diskdata.f_fsid;
availBytes = diskdata.f_bsize * (int64_t)diskdata.f_bavail;
- requiredBytes = MIB(cfg->dvr_cleanup_threshold_low);
+ requiredBytes = MIB(cfg->dvr_cleanup_threshold_free);
diskBytes = diskdata.f_bsize * (int64_t)diskdata.f_blocks;
usedBytes = diskBytes - availBytes;
- maximalBytes = MIB(cfg->dvr_cleanup_threshold_high);
+ maximalBytes = MIB(cfg->dvr_cleanup_threshold_used);
configName = cfg != dvr_config_find_by_name(NULL) ? cfg->dvr_config_name : "Default profile";
/* When deleting a file from the disk, the system needs some time to actually do this */
{
availBytes = diskdata.f_bsize * (int64_t)diskdata.f_bavail;
usedBytes = (diskdata.f_bsize * (int64_t)diskdata.f_blocks) - availBytes;
- requiredBytes = MIB(cfg->dvr_cleanup_threshold_low);
- maximalBytes = MIB(cfg->dvr_cleanup_threshold_high);
+ requiredBytes = MIB(cfg->dvr_cleanup_threshold_free);
+ maximalBytes = MIB(cfg->dvr_cleanup_threshold_used);
if (availBytes < requiredBytes || maximalBytes > usedBytes) {
LIST_FOREACH(de, &dvrentries, de_global_link) {