Whamcloud - gitweb
LU-11024 osd-zfs: properly detect ZFS dnode accounting
[fs/lustre-release.git] / config / lustre-build-zfs.m4
index 04e9bc0..0bcdf20 100644 (file)
@@ -323,7 +323,7 @@ AC_DEFUN([LB_ZFS_USER], [
        AS_IF([test -z "${zfsinc}"], [
                AS_IF([test -e "${zfssrc}/include/libzfs.h" && test -e "${zfssrc}/lib/libspl/include"], [
                        zfsinc="-I $zfssrc/lib/libspl/include -I $zfssrc/include"
-                       zfslib="-L$zfssrc/lib/libzfs/.libs/"
+                       zfslib="-L$zfssrc/lib/libzfs/.libs/ -L$zfssrc/lib/libnvpair/.libs"
                ], [test -d /usr/include/libzfs && test -d /usr/include/libspl], [
                        zfsinc="-I/usr/include/libspl -I /usr/include/libzfs"
                        zfslib=""
@@ -336,7 +336,7 @@ AC_DEFUN([LB_ZFS_USER], [
        AC_MSG_RESULT([$zfsinc])
 
        ZFS_LIBZFS_INCLUDE=${zfsinc}
-       ZFS_LIBZFS_LDFLAGS="-lzfs ${zfslib}"
+       ZFS_LIBZFS_LDFLAGS="-lzfs -lnvpair ${zfslib}"
        AC_SUBST(ZFS_LIBZFS_INCLUDE)
        AC_SUBST(ZFS_LIBZFS_LDFLAGS)
 ])
@@ -522,11 +522,11 @@ 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_userobjspace_upgrade, [
+               LB_CHECK_COMPILE([if ZFS has native dnode accounting supported],
+               dmu_objset_userobjused_enabled, [
                        #include <sys/dmu_objset.h>
                ],[
-                       dmu_objset_userobjspace_upgrade(NULL);
+                       dmu_objset_userobjused_enabled(NULL);
                ],[
                        AC_DEFINE(HAVE_DMU_USEROBJ_ACCOUNTING, 1,
                                [Have native dnode accounting in ZFS])
@@ -628,6 +628,46 @@ your distribution.
                        AC_DEFINE(HAVE_DMU_READ_BY_DNODE, 1,
                                [Have dmu_read_by_dnode() in ZFS])
                ])
+               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],
+               dmu_objset_own, [
+                       #include <sys/dmu_objset.h>
+               ],[
+                       objset_t *os = NULL;
+                       dmu_objset_type_t type = DMU_OST_ANY;
+                       dmu_objset_own(NULL, type, B_FALSE, B_FALSE, FTAG, &os);
+               ],[
+                       AC_DEFINE(HAVE_DMU_OBJSET_OWN_6ARG, 1,
+                               [Have dmu_objset_own() with 6 args])
+               ])
+               dnl #
+               dnl # ZFS 0.8.x changes dmu_objset_disown for encryption
+               dnl #
+               LB_CHECK_COMPILE([if ZFS has 'dmu_objset_disown' with 3 args],
+               dmu_objset_disown, [
+                       #include <sys/dmu_objset.h>
+               ],[
+                       objset_t *os = NULL;
+                       dmu_objset_disown(os, B_FALSE, 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 <sys/dmu.h>
+               ],[
+                       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], [