X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=config%2Flustre-build-zfs.m4;h=80dfcfffe88574ec6540aabf7dbd333689d4b1d0;hp=6debc601f0f87eb261a18ceb6c4efa21380f62ff;hb=fe2300b2fb91cc321412a6e53335848741ea30cd;hpb=8d1639b5cf1edbc885876956dcd6189173c00955 diff --git a/config/lustre-build-zfs.m4 b/config/lustre-build-zfs.m4 index 6debc60..80dfcff 100644 --- a/config/lustre-build-zfs.m4 +++ b/config/lustre-build-zfs.m4 @@ -15,8 +15,8 @@ dnl # dnl # * /var/lib/dkms/zfs/${VERSION}/source dnl # * /usr/src/zfs-${VERSION}/${LINUXRELEASE} dnl # * /usr/src/zfs-${VERSION} -dnl # * ../spl/ -dnl # * $LINUX +dnl # * ../zfs/ +dnl # * $LINUX/zfs dnl # dnl # --with-zfs-devel=path dnl # - User provided directory where zfs development headers @@ -46,7 +46,7 @@ dnl # * /var/lib/dkms/spl/${VERSION}/source dnl # * /usr/src/spl-${VERSION}/${LINUXRELEASE} dnl # * /usr/src/spl-${VERSION} dnl # * ../spl/ -dnl # * $LINUX +dnl # * $LINUX/spl dnl # dnl # --with-spl=path - Enable spl support and use the spl headers in the dnl # provided path. No autodetection is performed. @@ -76,7 +76,7 @@ AC_DEFUN([LB_SPL], [ splsrc1="/usr/src/spl-${splver}/${LINUXRELEASE}" splsrc2="/usr/src/spl-${splver}" splsrc3="../spl/" - splsrc4="$LINUX" + splsrc4="$LINUX/spl" AC_MSG_CHECKING([spl source directory]) AS_IF([test -z "${splsrc}"], [ @@ -111,7 +111,7 @@ AC_DEFUN([LB_SPL], [ dnl # AC_MSG_CHECKING([spl build directory]) AS_IF([test -z "$splobj"], [ - last_spl_obj_dir=$(ls -d ${splsrc}/[[0-9]]*/ | tail -n 1 | sed 's|/$||') + last_spl_obj_dir=$(ls -d ${splsrc}/[[0-9]]*/ 2> /dev/null | tail -n 1 | sed 's|/$||') AS_IF([test "${splsrc}" = "${spldkms}/source"], [ AS_IF([test -e "${spldkms}/${LINUXRELEASE}/${target_cpu}/spl_config.h"], [ splobj=${spldkms}/${LINUXRELEASE}/${target_cpu} @@ -194,7 +194,7 @@ AC_DEFUN([LB_ZFS], [ zfssrc1="/usr/src/zfs-${zfsver}/${LINUXRELEASE}" zfssrc2="/usr/src/zfs-${zfsver}" zfssrc3="../zfs/" - zfssrc4="$LINUX" + zfssrc4="$LINUX/zfs" AC_MSG_CHECKING([zfs source directory]) AS_IF([test -z "${zfssrc}"], [ @@ -229,7 +229,7 @@ AC_DEFUN([LB_ZFS], [ dnl # AC_MSG_CHECKING([zfs build directory]) AS_IF([test -z "$zfsobj"], [ - last_zfs_obj_dir=$(ls -d ${zfssrc}/[[0-9]]*/ | tail -n 1 | sed 's|/$||') + last_zfs_obj_dir=$(ls -d ${zfssrc}/[[0-9]]*/ 2> /dev/null | tail -n 1 | sed 's|/$||') AS_IF([test "${zfssrc}" = "${zfsdkms}/source"], [ AS_IF([test -e "${zfsdkms}/${LINUXRELEASE}/${target_cpu}/zfs_config.h"], [ zfsobj=${zfsdkms}/${LINUXRELEASE}/${target_cpu} @@ -336,9 +336,11 @@ AC_DEFUN([LB_ZFS_USER], [ AC_MSG_RESULT([$zfsinc]) ZFS_LIBZFS_INCLUDE=${zfsinc} - ZFS_LIBZFS_LDFLAGS="-lzfs -lnvpair ${zfslib}" + ZFS_LIBZFS_LDFLAGS=${zfslib} + ZFS_LIBZFS_LIBS="-lzfs -lnvpair" AC_SUBST(ZFS_LIBZFS_INCLUDE) AC_SUBST(ZFS_LIBZFS_LDFLAGS) + AC_SUBST(ZFS_LIBZFS_LIBS) ]) AC_DEFUN([LB_CONFIG_ZFS], [ @@ -346,21 +348,26 @@ AC_DEFUN([LB_CONFIG_ZFS], [ [AS_HELP_STRING([--with-zfs=PATH], [Path to zfs source])], [ AS_IF([test x$withval = xno], [ + enable_spl=no enable_zfs=no require_zfs=no ], [test x$withval = xyes], [ + enable_spl=yes enable_zfs=yes require_zfs=yes ], [ + enable_spl=yes enable_zfs=yes require_zfs=yes zfssrc="$withval" ]) ], [ AS_IF([test x$enable_server != xno], [ + enable_spl=yes require_zfs=no enable_zfs=yes ], [ + enable_spl=no require_zfs=no enable_zfs=no ]) @@ -371,13 +378,35 @@ AC_DEFUN([LB_CONFIG_ZFS], [ AS_IF([test x$enable_zfs = xyes], [ AS_IF([test x$enable_modules = xyes], [ - LB_SPL LB_ZFS ]) LB_ZFS_DEVEL LB_ZFS_USER dnl # + dnl # Define zfs source code version + dnl # + ZFS_MAJOR=$(echo $zfsver | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\1/']) + ZFS_MINOR=$(echo $zfsver | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\2/']) + ZFS_PATCH=$(echo $zfsver | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\3/']) + ZFS_FIX=$(echo $zfsver | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\5/']) + AS_IF([test -z "$ZFS_FIX"], [ZFS_FIX="0"]) + + AC_DEFINE_UNQUOTED([ZFS_MAJOR], [$ZFS_MAJOR], [zfs major version]) + AC_DEFINE_UNQUOTED([ZFS_MINOR], [$ZFS_MINOR], [zfs minor version]) + AC_DEFINE_UNQUOTED([ZFS_PATCH], [$ZFS_PATCH], [zfs patch version]) + AC_DEFINE_UNQUOTED([ZFS_FIX], [$ZFS_FIX], [zfs fix version]) + + 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], [ + LB_SPL + ],[ + enable_spl=no + ]) + + dnl # dnl # enable_zfs will be set to no in LB_SPL or LB_ZFS if dnl # one of more of the build requirements is not met. dnl # @@ -406,21 +435,6 @@ your distribution. ]) ]) - dnl # - dnl # Define zfs source code version - dnl # - AS_IF([test x$enable_zfs = xyes], [ - ZFS_MAJOR=$(echo $zfsver | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\1/']) - ZFS_MINOR=$(echo $zfsver | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\2/']) - ZFS_PATCH=$(echo $zfsver | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\3/']) - ZFS_FIX=$(echo $zfsver | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\5/']) - AS_IF([test -z "$ZFS_FIX"], [ZFS_FIX="0"]) - - AC_DEFINE_UNQUOTED([ZFS_MAJOR], [$ZFS_MAJOR], [zfs major version]) - AC_DEFINE_UNQUOTED([ZFS_MINOR], [$ZFS_MINOR], [zfs minor version]) - AC_DEFINE_UNQUOTED([ZFS_PATCH], [$ZFS_PATCH], [zfs patch version]) - AC_DEFINE_UNQUOTED([ZFS_FIX], [$ZFS_FIX], [zfs fix version]) - ]) AS_IF([test "x$enable_zfs" = xyes], [ LB_CHECK_COMPILE([if zfs defines dsl_pool_config_enter/exit], @@ -522,15 +536,28 @@ your distribution. dnl # dnl # ZFS 0.7.0 feature: SPA_FEATURE_USEROBJ_ACCOUNTING dnl # - LB_CHECK_COMPILE([if zfs has native dnode accounting supported], - dmu_objset_id_quota_upgrade, [ + LB_CHECK_COMPILE([if ZFS has native dnode accounting supported], + dmu_objset_userobjused_enabled, [ #include ],[ - dmu_objset_id_quota_upgrade(NULL); + dmu_objset_userobjused_enabled(NULL); ],[ AC_DEFINE(HAVE_DMU_USEROBJ_ACCOUNTING, 1, [Have native dnode accounting in ZFS]) ]) + dnl # + dnl # ZFS 0.7.0 feature: MULTIHOST + dnl # + LB_CHECK_COMPILE([if ZFS has multihost protection], + spa_multihost, [ + #include + ],[ + spa_multihost(NULL); + ],[ + AC_DEFINE(HAVE_ZFS_MULTIHOST, 1, + [Have multihost protection in ZFS]) + ]) + dnl # dnl # ZFS 0.7.x adds new method zap_lookup_by_dnode dnl # LB_CHECK_COMPILE([if ZFS has 'zap_lookup_by_dnode'], @@ -629,6 +656,44 @@ your distribution. [Have dmu_read_by_dnode() in ZFS]) ]) dnl # + dnl # ZFS 0.7.2 adds new method dmu_tx_mark_netfree + dnl # + LB_CHECK_COMPILE([if ZFS has 'dmu_tx_mark_netfree'], + dmu_tx_mark_netfree, [ + #include + ],[ + dmu_tx_t *tx = NULL; + dmu_tx_mark_netfree(tx); + ],[ + AC_DEFINE(HAVE_DMU_TX_MARK_NETFREE, 1, + [Have dmu_tx_mark_netfree]) + ]) + dnl # + dnl # ZFS 0.7.10 changes timestruc_t to inode_timespec_t + dnl # + LB_CHECK_COMPILE([if SPL has 'inode_timespec_t'], + zfs_have_inode_timespec, [ + #include + ],[ + inode_timespec_t now; + gethrestime(&now); + ],[ + AC_DEFINE(HAVE_ZFS_INODE_TIMESPEC, 1, + [Have inode_timespec_t]) + ]) + dnl # ZFS 0.7.12/0.8.x uses zfs_refcount_add() instead of + dnl # refcount_add(). + dnl # + LB_CHECK_COMPILE([if ZFS has 'zfs_refcount_add'], + zfs_refcount_add, [ + #include + ],[ + zfs_refcount_add((zfs_refcount_t *) NULL, NULL); + ],[ + AC_DEFINE(HAVE_ZFS_REFCOUNT_ADD, 1, + [Have zfs_refcount_add]) + ]) + dnl # dnl # ZFS 0.8.x changes dmu_objset_own for encryption dnl # LB_CHECK_COMPILE([if ZFS has 'dmu_objset_own' with 6 args], @@ -637,7 +702,7 @@ your distribution. ],[ objset_t *os = NULL; dmu_objset_type_t type = DMU_OST_ANY; - dmu_objset_own(NULL, type, B_FALSE, B_FALSE, FTAG, &os); + dmu_objset_own(NULL, type, B_FALSE, B_TRUE, FTAG, &os); ],[ AC_DEFINE(HAVE_DMU_OBJSET_OWN_6ARG, 1, [Have dmu_objset_own() with 6 args]) @@ -650,24 +715,11 @@ your distribution. #include ],[ objset_t *os = NULL; - dmu_objset_disown(os, B_FALSE, FTAG); + dmu_objset_disown(os, B_TRUE, FTAG); ],[ AC_DEFINE(HAVE_DMU_OBJSET_DISOWN_3ARG, 1, [Have dmu_objset_disown() with 3 args]) ]) - dnl # - dnl # ZFS 0.7.2 adds new method dmu_tx_mark_netfree - dnl # - LB_CHECK_COMPILE([if ZFS has 'dmu_tx_mark_netfree'], - dmu_tx_mark_netfree, [ - #include - ],[ - dmu_tx_t *tx = NULL; - dmu_tx_mark_netfree(tx); - ],[ - AC_DEFINE(HAVE_DMU_TX_MARK_NETFREE, 1, - [Have dmu_tx_mark_netfree]) - ]) ]) AS_IF([test "x$enable_zfs" = xyes], [ @@ -676,4 +728,5 @@ your distribution. AC_SUBST(ENABLE_ZFS, no) ]) AM_CONDITIONAL(ZFS_ENABLED, [test "x$enable_zfs" = xyes]) + AM_CONDITIONAL(SPL_ENABLED, [test "x$enable_spl" = xyes]) ])