Skip to content

Commit

Permalink
libzfs_FQ.c: feat(lib): Add 'FQis_autosnap_minutely()' inclusion test
Browse files Browse the repository at this point in the history
  • Loading branch information
TerraTech committed Feb 16, 2021
1 parent 50f279d commit b51b574
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/libzfs/libzfs_FQ.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 *);
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit b51b574

Please sign in to comment.