diff --git a/lib/libzfs/libzfs_FQ.c b/lib/libzfs/libzfs_FQ.c index c41d48322024..eddd80fbef92 100644 --- a/lib/libzfs/libzfs_FQ.c +++ b/lib/libzfs/libzfs_FQ.c @@ -58,6 +58,10 @@ #define FQXATTR_NO_HOURLY (1 << 2) #define FQXATTR_NO_ZBHOLD (1 << 3) +// gated handling +#define ALLOW B_FALSE +#define EXCLUDE B_TRUE + typedef char *xattrs_t; typedef struct FQoverrides { @@ -73,6 +77,7 @@ static boolean_t FQget_xattrs(zfs_handle_t *, xattrs_t *); static boolean_t FQis_autosnap(const char *); static boolean_t FQis_autosnap_daily(const char *); static boolean_t FQis_autosnap_hourly(const char *); +static boolean_t FQis_autosnap_minutely(const char *); // a{...} static inline boolean_t FQxattrs_has_a(xattrs_t); static inline boolean_t FQxattrs_has_a_D(FQxattrs_t *); @@ -176,6 +181,15 @@ FQexclude_autosnap(libzfs_handle_t *hdl, const char *snapshot) { if (FQxattrs_has_A(xattrs.xattrs)) return (B_TRUE); +//FQdebug("minutely\n"); + if (FQis_autosnap_minutely(snapshot)) { +//FQdebug("%s :: %s\n", xattrs.xattrs, snapshot); + if (FQxattrs_has_m(xattrs.xattrs)) + return (ALLOW); + + return (EXCLUDE); + } + if (!FQxattrs_has_a(xattrs.xattrs)) return (B_FALSE);