Whamcloud - gitweb
LU-4944 osd: support for zfs-0.6.3 64/10064/6
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Wed, 23 Apr 2014 10:47:41 +0000 (14:47 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 5 May 2014 17:49:49 +0000 (17:49 +0000)
dsl_sync_task_nowait() replaces dsl_sync_task_do_nowait() and we have
to support the both versions: 0.6.2 and 0.6.3

Change-Id: I4e2e91eae40358e2cd68ab26107e51037c8fb09c
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-on: http://review.whamcloud.com/10064
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
config/lustre-build-zfs.m4
lustre/osd-zfs/osd_quota.c

index 8991759..548753e 100644 (file)
@@ -381,6 +381,15 @@ your distribution.
                        AC_DEFINE(HAVE_DSL_POOL_CONFIG, 1,
                                [Have dsl_pool_config_enter/exit in ZFS])
                ])
                        AC_DEFINE(HAVE_DSL_POOL_CONFIG, 1,
                                [Have dsl_pool_config_enter/exit in ZFS])
                ])
+               LB_CHECK_COMPILE([if zfs defines dsl_sync_task_do_nowait],
+               dsl_sync_task_do_nowait, [
+                       #include <sys/dsl_synctask.h>
+               ],[
+                       dsl_sync_task_do_nowait(NULL, NULL, NULL, NULL, NULL, 0, NULL);
+               ],[
+                       AC_DEFINE(HAVE_DSL_SYNC_TASK_DO_NOWAIT, 1,
+                               [Have dsl_sync_task_do_nowait in ZFS])
+               ])
        ])
 
        AM_CONDITIONAL(ZFS_ENABLED, [test "x$enable_zfs" = xyes])
        ])
 
        AM_CONDITIONAL(ZFS_ENABLED, [test "x$enable_zfs" = xyes])
index a27505b..69f1d5d 100644 (file)
@@ -392,7 +392,11 @@ static int osd_zfs_commit_item(cfs_hash_t *hs, cfs_hash_bd_t *bd,
  * we go over all the changes cached in per-txg structure
  * and apply them to actual ZAPs
  */
  * we go over all the changes cached in per-txg structure
  * and apply them to actual ZAPs
  */
+#ifdef HAVE_DSL_SYNC_TASK_DO_NOWAIT
 static void osd_zfs_acct_update(void *arg, void *arg2, dmu_tx_t *tx)
 static void osd_zfs_acct_update(void *arg, void *arg2, dmu_tx_t *tx)
+#else
+static void osd_zfs_acct_update(void *arg, dmu_tx_t *tx)
+#endif
 {
        struct osd_zfs_acct_txg *zat = arg;
        struct osd_device       *osd = zat->zat_osd;
 {
        struct osd_zfs_acct_txg *zat = arg;
        struct osd_device       *osd = zat->zat_osd;
@@ -417,11 +421,10 @@ static void osd_zfs_acct_update(void *arg, void *arg2, dmu_tx_t *tx)
        OBD_FREE_PTR(zat);
 }
 
        OBD_FREE_PTR(zat);
 }
 
-static int osd_zfs_acct_check(void *arg1, void *arg2, dmu_tx_t *tx)
-{
-       /* check function isn't used currently */
-       return 0;
-}
+#ifdef HAVE_DSL_SYNC_TASK_DO_NOWAIT
+#define dsl_sync_task_nowait(pool, func, arg, blocks, tx) \
+       dsl_sync_task_do_nowait(pool, NULL, func, arg, NULL, blocks, tx)
+#endif
 
 /*
  * if any change to the object accounting is going to happen,
 
 /*
  * if any change to the object accounting is going to happen,
@@ -476,10 +479,9 @@ int osd_zfs_acct_trans_start(const struct lu_env *env, struct osd_thandle *oh)
                spa_t *spa = dmu_objset_spa(osd->od_objset.os);
                LASSERT(ac->zat_osd == NULL);
                ac->zat_osd = osd;
                spa_t *spa = dmu_objset_spa(osd->od_objset.os);
                LASSERT(ac->zat_osd == NULL);
                ac->zat_osd = osd;
-               dsl_sync_task_do_nowait(spa_get_dsl(spa),
-                                       osd_zfs_acct_check,
+               dsl_sync_task_nowait(spa_get_dsl(spa),
                                        osd_zfs_acct_update,
                                        osd_zfs_acct_update,
-                                       ac, NULL, 128, oh->ot_tx);
+                                       ac, 128, oh->ot_tx);
 
                /* no to be freed now */
                ac = NULL;
 
                /* no to be freed now */
                ac = NULL;