X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=config%2Flustre-build-zfs.m4;h=acacf34e1f9b9573b0b07459b8dfb4061d2daa46;hb=622e4c6e04baa4f9d19cc33f4636679014fc1d2f;hp=f632df1ab07ca65e355fe13b8dcc6d65f28945e0;hpb=87cc32adc11b3db914dd63e3766614a02e2f988f;p=fs%2Flustre-release.git diff --git a/config/lustre-build-zfs.m4 b/config/lustre-build-zfs.m4 index f632df1..acacf34 100644 --- a/config/lustre-build-zfs.m4 +++ b/config/lustre-build-zfs.m4 @@ -169,14 +169,17 @@ AC_DEFUN([LB_SPL], [ AC_MSG_RESULT([$splsym]) ]) - SPL=${splsrc} - SPL_OBJ=${splobj} - SPL_VERSION=${splver} - - AC_SUBST(SPL) - AC_SUBST(SPL_OBJ) - AC_SUBST(SPL_VERSION) - AC_SUBST(EXTRA_SYMBOLS) + AS_IF([test x$enable_zfs = xyes], [ + SPL=${splsrc} + SPL_OBJ=${splobj} + SPL_VERSION=${splver} + + AC_SUBST(SPL) + AC_SUBST(SPL_OBJ) + AC_SUBST(SPL_VERSION) + AC_SUBST(EXTRA_SYMBOLS) + ]) + ]) AC_DEFUN([LB_ZFS], [ @@ -287,14 +290,17 @@ AC_DEFUN([LB_ZFS], [ AC_MSG_RESULT([$zfssym]) ]) - ZFS=${zfssrc} - ZFS_OBJ=${zfsobj} - ZFS_VERSION=${zfsver} + AS_IF([test x$enable_zfs = xyes], [ + ZFS=${zfssrc} + ZFS_OBJ=${zfsobj} + ZFS_VERSION=${zfsver} + + AC_SUBST(ZFS) + AC_SUBST(ZFS_OBJ) + AC_SUBST(ZFS_VERSION) + AC_SUBST(EXTRA_SYMBOLS) + ]) - AC_SUBST(ZFS) - AC_SUBST(ZFS_OBJ) - AC_SUBST(ZFS_VERSION) - AC_SUBST(EXTRA_SYMBOLS) ]) AC_DEFUN([LB_ZFS_DEVEL], [ @@ -400,7 +406,8 @@ AC_DEFUN([LB_CONFIG_ZFS], [ dnl # dnl # SPL is only needed if ZFS is prior to 0.8.0 dnl # - AS_IF([test x$enable_modules = xyes && test $ZFS_MAJOR -eq 0 && test $ZFS_MINOR -lt 8], [ + AS_IF([test x$enable_modules = xyes && test -n "$ZFS_MAJOR" && + test $ZFS_MAJOR -eq 0 && test $ZFS_MINOR -lt 8], [ LB_SPL ],[ enable_spl=no @@ -691,11 +698,14 @@ your distribution. [Have inode_timespec_t]) ]) dnl # ZFS 0.7.12/0.8.x uses zfs_refcount_add() instead of - dnl # refcount_add(). + dnl # refcount_add(). ZFS 2.0 renamed sys/refcount.h to + dnl # sys/zfs_refcount.h, rather the add another check to + dnl # determine the correct header name include it + dnl # indirectly through sys/dnode.h. dnl # LB_CHECK_COMPILE([if ZFS has 'zfs_refcount_add'], zfs_refcount_add, [ - #include + #include ],[ zfs_refcount_add((zfs_refcount_t *) NULL, NULL); ],[ @@ -729,6 +739,34 @@ your distribution. AC_DEFINE(HAVE_DMU_OBJSET_DISOWN_3ARG, 1, [Have dmu_objset_disown() with 3 args]) ]) + dnl # + dnl # ZFS exports dmu_offet_next + dnl # + AC_CACHE_CHECK([if ZFS exports 'dmu_offset_next'], + [lb_cv_dmu_offset_next], [ + lb_cv_dmu_offset_next="no" + AS_IF([grep -q -E "EXPORT_SYMBOL.*\(dmu_offset_next\)" "$zfssrc/module/zfs/dmu.c" 2>/dev/null], + [lb_cv_dmu_offset_next="yes"]) + ]) + AS_IF([test "x$lb_cv_dmu_offset_next" = "xyes"], [ + AC_DEFINE(HAVE_DMU_OFFSET_NEXT, 1, + [Have dmu_offset_next() exported]) + ]) + dnl # + dnl # ZFS 2.0 replaced .db_last_dirty / .dr_next with a list_t + dnl # and list_node_t named .db_dirty_records / .dr_dbuf_node. + dnl # + LB_CHECK_COMPILE([if ZFS has 'db_dirty_records' list_t], + db_dirty_records, [ + #include + ],[ + dmu_buf_impl_t db; + dbuf_dirty_record_t *dr; + dr = list_head(&db.db_dirty_records); + ],[ + AC_DEFINE(HAVE_DB_DIRTY_RECORDS_LIST, 1, + [Have db_dirty_records list_t]) + ]) ]) AS_IF([test "x$enable_zfs" = xyes], [