Whamcloud - gitweb
LU-10174 osd-zfs: Fix build against ZFS 0.6.5.x 70/33070/3
authorNathaniel Clark <nathaniel.l.clark@intel.com>
Tue, 31 Oct 2017 16:49:39 +0000 (12:49 -0400)
committerJohn L. Hammond <jhammond@whamcloud.com>
Tue, 11 Sep 2018 20:55:35 +0000 (20:55 +0000)
Ensure all values used in https://review.whamcloud.com/29242 are
actually used conditionally.  This allows us to build against
ZFS 0.6.5.7 again.

Lustre-change: https://review.whamcloud.com/29866
Lustre-commit: 0cfb879608e5036723337ac0f8f01336ecf6b7fd

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: Ide560e21f7b7fedc0c107b1943602e5af99b478c
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-on: https://review.whamcloud.com/33070
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Jenkins
Reviewed-by: Nathaniel Clark <nclark@whamcloud.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
lustre/osd-zfs/osd_handler.c

index 4490dfc..82f2e05 100644 (file)
@@ -793,13 +793,14 @@ static void osd_readonly_changed_cb(void *arg, uint64_t newval)
        osd->od_prop_rdonly = !!newval;
 }
 
+#ifdef HAVE_DMU_OBJECT_ALLOC_DNSIZE
 static void osd_dnodesize_changed_cb(void *arg, uint64_t newval)
 {
        struct osd_device *osd = arg;
 
        osd->od_dnsize = newval;
 }
-
+#endif
 /*
  * This function unregisters all registered callbacks.  It's harmless to
  * unregister callbacks that were never registered so it is used to safely
@@ -815,8 +816,10 @@ static void osd_objset_unregister_callbacks(struct osd_device *o)
                                   osd_recordsize_changed_cb, o);
        (void) dsl_prop_unregister(ds, zfs_prop_to_name(ZFS_PROP_READONLY),
                                   osd_readonly_changed_cb, o);
+#ifdef HAVE_DMU_OBJECT_ALLOC_DNSIZE
        (void) dsl_prop_unregister(ds, zfs_prop_to_name(ZFS_PROP_DNODESIZE),
-                                  osd_readonly_changed_cb, o);
+                                  osd_dnodesize_changed_cb, o);
+#endif
 
        if (o->arc_prune_cb != NULL) {
                arc_remove_prune_callback(o->arc_prune_cb);
@@ -853,10 +856,12 @@ static int osd_objset_register_callbacks(struct osd_device *o)
        if (rc)
                GOTO(err, rc);
 
+#ifdef HAVE_DMU_OBJECT_ALLOC_DNSIZE
        rc = -dsl_prop_register(ds, zfs_prop_to_name(ZFS_PROP_DNODESIZE),
                                osd_dnodesize_changed_cb, o);
        if (rc)
                GOTO(err, rc);
+#endif
 
        o->arc_prune_cb = arc_add_prune_callback(arc_prune_func, o);
 err: