X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=config%2Flustre-build-zfs.m4;h=ded7085d157915bf7f631a4e58feca6a5c36d83b;hb=refs%2Fchanges%2F94%2F15294%2F28;hp=f2f72ec7672ac3c95a717e4f1d51bb56174d5694;hpb=6cba4c1958b8bc25e7c675fd7ec6bf2772c7c0f0;p=fs%2Flustre-release.git diff --git a/config/lustre-build-zfs.m4 b/config/lustre-build-zfs.m4 index f2f72ec..ded7085 100644 --- a/config/lustre-build-zfs.m4 +++ b/config/lustre-build-zfs.m4 @@ -12,7 +12,7 @@ dnl # --with-zfs=yes headers in one of the following places. Because zfs dnl # support was explicitly required if the headers cannot dnl # be located it is treated as a fatal error. dnl # -dnl # * /var/lib/dkms/zfs/${VERSION}/build +dnl # * /var/lib/dkms/zfs/${VERSION}/source dnl # * /usr/src/zfs-${VERSION}/${LINUXRELEASE} dnl # * /usr/src/zfs-${VERSION} dnl # * ../spl/ @@ -42,7 +42,7 @@ dnl # --with-spl=no dnl # dnl # --with-spl - Enable spl support and attempt to autodetect the spl dnl # --with-spl=yes headers in one of the following places in this order: -dnl # * /var/lib/dkms/spl/${VERSION}/build +dnl # * /var/lib/dkms/spl/${VERSION}/source dnl # * /usr/src/spl-${VERSION}/${LINUXRELEASE} dnl # * /usr/src/spl-${VERSION} dnl # * ../spl/ @@ -72,7 +72,7 @@ AC_DEFUN([LB_SPL], [ dnl # source directory. In order of preference: dnl # splver=$(ls -1 /usr/src/ | grep -m1 spl | cut -f2 -d'-') - splsrc0="/var/lib/dkms/spl/${splver}/build" + spldkms="/var/lib/dkms/spl/${splver}" splsrc1="/usr/src/spl-${splver}/${LINUXRELEASE}" splsrc2="/usr/src/spl-${splver}" splsrc3="../spl/" @@ -80,8 +80,8 @@ AC_DEFUN([LB_SPL], [ AC_MSG_CHECKING([spl source directory]) AS_IF([test -z "${splsrc}"], [ - AS_IF([test -e "${splsrc0}/spl.release.in"], [ - splsrc=${splsrc0} + AS_IF([test -e "${spldkms}/source/spl.release.in"], [ + splsrc=${spldkms}/source ], [test -e "${splsrc1}/spl.release.in"], [ splsrc=${splsrc1} ], [test -e "${splsrc2}/spl.release.in"], [ @@ -105,14 +105,25 @@ AC_DEFUN([LB_SPL], [ dnl # The existence of the spl_config.h is used to identify a valid dnl # spl object directory. In many cases the object and source dnl # directory are the same, however the objects may also reside - dnl # is a subdirectory named after the kernel version. + dnl # is a subdirectory named after the kernel version. When + dnl # weak modules are used, the kernel version may not be the + dnl # same as the LINUXRELEASE against which we are building lustre. dnl # AC_MSG_CHECKING([spl build directory]) AS_IF([test -z "$splobj"], [ - AS_IF([test -e "${splsrc}/${LINUXRELEASE}/spl_config.h"], [ + last_spl_obj_dir=$(ls -d ${splsrc}/[[0-9]]*/ | 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} + ], [ + splobj="[Not found]" + ]) + ],[test -e "${splsrc}/${LINUXRELEASE}/spl_config.h"], [ splobj="${splsrc}/${LINUXRELEASE}" ], [test -e "${splsrc}/spl_config.h"], [ splobj="${splsrc}" + ], [test -e "${last_spl_obj_dir}/spl_config.h"], [ + splobj="${last_spl_obj_dir}" ], [ splobj="[Not found]" ]) @@ -179,7 +190,7 @@ AC_DEFUN([LB_ZFS], [ dnl # source directory. In order of preference: dnl # zfsver=$(ls -1 /usr/src/ | grep -m1 zfs | cut -f2 -d'-') - zfssrc0="/var/lib/dkms/zfs/${zfsver}/build" + zfsdkms="/var/lib/dkms/zfs/${zfsver}" zfssrc1="/usr/src/zfs-${zfsver}/${LINUXRELEASE}" zfssrc2="/usr/src/zfs-${zfsver}" zfssrc3="../zfs/" @@ -187,8 +198,8 @@ AC_DEFUN([LB_ZFS], [ AC_MSG_CHECKING([zfs source directory]) AS_IF([test -z "${zfssrc}"], [ - AS_IF([test -e "${zfssrc0}/zfs.release.in"], [ - zfssrc=${zfssrc0} + AS_IF([test -e "${zfsdkms}/source/zfs.release.in"], [ + zfssrc=${zfsdkms}/source ], [test -e "${zfssrc1}/zfs.release.in"], [ zfssrc=${zfssrc1} ], [test -e "${zfssrc2}/zfs.release.in"], [ @@ -212,14 +223,25 @@ AC_DEFUN([LB_ZFS], [ dnl # The existence of the zfs_config.h is used to identify a valid dnl # zfs object directory. In many cases the object and source dnl # directory are the same, however the objects may also reside - dnl # is a subdirectory named after the kernel version. + dnl # is a subdirectory named after the kernel version. When + dnl # weak modules are used, the kernel version may not be the + dnl # same as the LINUXRELEASE against which we are building lustre. dnl # AC_MSG_CHECKING([zfs build directory]) AS_IF([test -z "$zfsobj"], [ - AS_IF([test -e "${zfssrc}/${LINUXRELEASE}/zfs_config.h"], [ + last_zfs_obj_dir=$(ls -d ${zfssrc}/[[0-9]]*/ | 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} + ], [ + zfsobj="[Not found]" + ]) + ], [test -e "${zfssrc}/${LINUXRELEASE}/zfs_config.h"], [ zfsobj="${zfssrc}/${LINUXRELEASE}" ], [test -e "${zfssrc}/zfs_config.h"], [ zfsobj="${zfssrc}" + ], [test -e "${last_zfs_obj_dir}/zfs_config.h"], [ + zfsobj="${last_zfs_obj_dir}" ], [ zfsobj="[Not found]" ]) @@ -428,6 +450,71 @@ your distribution. AC_DEFINE(HAVE_SPA_MAXBLOCKSIZE, 1, [Have spa_maxblocksize in ZFS]) ]) + + dnl # + dnl # ZFS 0.7.x adds support for large dnodes. This + dnl # allows Lustre to optionally specify the size of a + dnl # dnode which ZFS will then use to store metadata such + dnl # as xattrs. The default dnode size specified by the + dnl # 'dnodesize' dataset property will be used unless a + dnl # specific value is provided. + dnl # + LB_CHECK_COMPILE([if zfs defines dmu_object_alloc_dnsize], + dmu_object_alloc_dnsize, [ + #include + #include + ],[ + objset_t *os = NULL; + dmu_object_type_t objtype = DMU_OT_NONE; + int blocksize = 0; + dmu_object_type_t bonustype = DMU_OT_SA; + int dnodesize = DNODE_MIN_SIZE; + dmu_tx_t *tx = NULL; + uint64_t id; + + id = dmu_object_alloc_dnsize(os, objtype, blocksize, + bonustype, + DN_BONUS_SIZE(dnodesize), + dnodesize, tx); + ],[ + AC_DEFINE(HAVE_DMU_OBJECT_ALLOC_DNSIZE, 1, + [Have dmu_object_alloc_dnsize in ZFS]) + ]) + + dnl # + dnl # ZFS 0.7.x extended dmu_prefetch() to take an additional + dnl # 'level' and 'priority' argument. Use a level of 0 and a + dnl # priority of ZIO_PRIORITY_SYNC_READ to replicate the + dnl # behavior of the four argument version. + dnl # + LB_CHECK_COMPILE([if ZFS has 'dmu_prefetch' with 6 args], + dmu_prefetch, [ + #include + ],[ + objset_t *os = NULL; + uint64_t object = 0; + int64_t level = 0; + uint64_t offset = 0; + uint64_t len = 0; + enum zio_priority pri = ZIO_PRIORITY_SYNC_READ; + + dmu_prefetch(os, object, level, offset, len, pri); + ],[ + AC_DEFINE(HAVE_DMU_PREFETCH_6ARG, 1, + [Have 6 argument dmu_pretch in ZFS]) + ]) + dnl # + dnl # ZFS 0.7.0 feature: SPA_FEATURE_USEROBJ_ACCOUNTING + dnl # + LB_CHECK_COMPILE([if zfs has native dnode accounting supported], + dmu_objset_userobjspace_upgrade, [ + #include + ],[ + dmu_objset_userobjspace_upgrade(NULL); + ],[ + AC_DEFINE(HAVE_DMU_USEROBJ_ACCOUNTING, 1, + [Have native dnode accounting in ZFS]) + ]) ]) AM_CONDITIONAL(ZFS_ENABLED, [test "x$enable_zfs" = xyes])