From: Matthew Dillon Date: Sun, 24 Oct 2010 18:01:41 +0000 (-0700) Subject: hammer utility - Add force support to cleanup X-Git-Tag: v2.9.1~89 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/bdc54107c5a7268f3a700335389bf494df136bf7 hammer utility - Add force support to cleanup * Allow hammer -f cleanup to override the normal timestamp checking and force the cleanup to run. --- diff --git a/nrelease/root/etc/sysctl.conf b/nrelease/root/etc/sysctl.conf new file mode 100644 index 0000000000..6f03107f4b --- /dev/null +++ b/nrelease/root/etc/sysctl.conf @@ -0,0 +1,6 @@ +# To help get kernels up and running on new installs we poll +# all interrupt functions at a slow rate in addition to attempting +# to route interrupts. This line is usually removed once you've +# got a working build. +# +kern.emergency_intr_enable=1 diff --git a/sbin/hammer/cmd_cleanup.c b/sbin/hammer/cmd_cleanup.c index 8075324d95..83426842ef 100644 --- a/sbin/hammer/cmd_cleanup.c +++ b/sbin/hammer/cmd_cleanup.c @@ -724,6 +724,8 @@ dividing_slash(const char *path) * Periods in minutes, hours, or days are assumed to have been crossed * if the local time crosses a minute, hour, or day boundary regardless * of how close the last operation actually was. + * + * If ForceOpt is set always return true. */ static int check_period(const char *snapshots_path, const char *cmd, int arg1, @@ -739,6 +741,12 @@ check_period(const char *snapshots_path, const char *cmd, int arg1, time(savep); localtime_r(savep, &tp1); + /* + * Force run if -F + */ + if (ForceOpt) + return(1); + /* * Retrieve the start time of the last successful operation. */