X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=dss.c;h=4396e6e5975c79d2806aa39625fea99d23a2ee90;hb=71a8073e6f18ccc21880a475af8d864279a960b8;hp=e2ee7dd66e511199c42821cbc32cf0a8ddf727ad;hpb=d4d72473957544283b6d426c3d4fa0b3f583da87;p=dss.git diff --git a/dss.c b/dss.c index e2ee7dd..4396e6e 100644 --- a/dss.c +++ b/dss.c @@ -1660,14 +1660,21 @@ static int com_prune(void) struct snapshot *victim; struct disk_space ds; char *why; + bool try_hard; lock_dss_or_die(); - ret = get_disk_space(".", &ds); - if (ret < 0) - return ret; - log_disk_space(&ds); + switch (OPT_UINT32_VAL(PRUNE, DISK_SPACE)) { + case FDS_LOW: try_hard = true; break; + case FDS_HIGH: try_hard = false; break; + default: + ret = get_disk_space(".", &ds); + if (ret < 0) + return ret; + log_disk_space(&ds); + try_hard = disk_space_low(&ds); + } dss_get_snapshot_list(&sl); - victim = find_removable_snapshot(&sl, disk_space_low(&ds), &why); + victim = find_removable_snapshot(&sl, try_hard, &why); if (!victim) { dss_msg("nothing to prune\n"); ret = 0;