AC_DEFINE(HAVE_ZFS_REFCOUNT_HEADER, 1,
[Have zfs_refcount.h])
])
+ dnl #
+ dnl # ZFS 2.2 nvpair now returns and expects constant args
+ dnl #
+ old_EXTRA_KCFLAGS=$EXTRA_KCFLAGS
+ EXTRA_KCFLAGS+=" -Werror"
+ LB_CHECK_COMPILE([if ZFS nvlist interfaces require const],
+ zfs_nvpair_const, [
+ #include <sys/nvpair.h>
+ ], [
+ nvpair_t *nvp = NULL;
+ nvlist_t *nvl = NULL;
+ const char *name = nvpair_name(nvp);
+ nvlist_lookup_string(nvl, name, &name);
+ nvlist_lookup_nvlist(nvl, name, &nvl);
+ ], [
+ AC_DEFINE(HAVE_ZFS_NVLIST_CONST_INTERFACES, 1,
+ [ZFS nvlist interfaces require const])
+ ])
+ EXTRA_KCFLAGS=$old_EXTRA_KCFLAGS
])
AS_IF([test "x$enable_zfs" = xyes], [
int zlpb_ldd_offset;
/* Function pointer responsible for reading in the @prop
* property from @zhp and storing it in @ldd_field */
+#ifdef HAVE_ZFS_NVLIST_CONST_INTERFACES
+ int (*zlpb_get_prop_fn)(zfs_handle_t *zhp, const char *prop,
+ void *ldd_field);
+#else
int (*zlpb_get_prop_fn)(zfs_handle_t *zhp, char *prop, void *ldd_field);
+#endif
/* Function pointer responsible for writing the value of @ldd_field
* into the @prop dataset property in @zhp */
int (*zlpb_set_prop_fn)(zfs_handle_t *zhp, char *prop, void *ldd_field);
};
/* Forward declarations needed to initialize the ldd prop bridge list */
+#ifdef HAVE_ZFS_NVLIST_CONST_INTERFACES
+static int zfs_get_prop_int(zfs_handle_t *, const char *, void *);
+static int zfs_get_prop_str(zfs_handle_t *, const char *, void *);
+#else
static int zfs_get_prop_int(zfs_handle_t *, char *, void *);
-static int zfs_set_prop_int(zfs_handle_t *, char *, void *);
static int zfs_get_prop_str(zfs_handle_t *, char *, void *);
+#endif
+static int zfs_set_prop_int(zfs_handle_t *, char *, void *);
static int zfs_set_prop_str(zfs_handle_t *, char *, void *);
/* Helper for initializing the entries in the special_ldd_prop_params list.
return zfs_remove_prop(zhp, nvl, propname);
}
+#ifdef HAVE_ZFS_NVLIST_CONST_INTERFACES
+static int zfs_is_special_ldd_prop_param(const char *name)
+#else
static int zfs_is_special_ldd_prop_param(char *name)
+#endif
{
int i;
return add_param(mop->mo_ldd.ldd_params, key, "");
}
+#ifdef HAVE_ZFS_NVLIST_CONST_INTERFACES
+static int zfs_get_prop_int(zfs_handle_t *zhp, const char *prop, void *val)
+{
+ const char *propstr;
+#else
static int zfs_get_prop_int(zfs_handle_t *zhp, char *prop, void *val)
{
- nvlist_t *propval;
char *propstr;
+#endif
+ nvlist_t *propval;
int ret;
ret = nvlist_lookup_nvlist(zfs_get_user_props(zhp), prop, &propval);
return ret;
}
+#ifdef HAVE_ZFS_NVLIST_CONST_INTERFACES
+static int zfs_get_prop_str(zfs_handle_t *zhp, const char *prop, void *val)
+{
+ const char *propstr;
+#else
static int zfs_get_prop_str(zfs_handle_t *zhp, char *prop, void *val)
{
- nvlist_t *propval;
char *propstr;
+#endif
+ nvlist_t *propval;
int ret;
ret = nvlist_lookup_nvlist(zfs_get_user_props(zhp), prop, &propval);