Whamcloud - gitweb
LU-9678 osd-zfs: register arc_prune_func() after site init
[fs/lustre-release.git] / lustre / osd-zfs / osd_handler.c
index 4954e2a..bcb8705 100644 (file)
@@ -47,7 +47,7 @@
 #include <obd_class.h>
 #include <lustre_disk.h>
 #include <lustre_fid.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
 #include <md_object.h>
 
 #include "osd_internal.h"
@@ -96,6 +96,8 @@ static void arc_prune_func(int64_t bytes, void *private)
        struct lu_env      env;
        int rc;
 
+       LASSERT(site->ls_obj_hash);
+
        rc = lu_env_init(&env, LCT_SHRINKER);
        if (rc) {
                CERROR("%s: can't initialize shrinker env: rc = %d\n",
@@ -1051,10 +1053,6 @@ static int osd_mount(const struct lu_env *env,
        o->od_xattr_in_sa = B_TRUE;
        o->od_max_blksz = osd_spa_maxblocksize(o->od_os->os_spa);
 
-       rc = osd_objset_register_callbacks(o);
-       if (rc)
-               GOTO(err, rc);
-
        rc = __osd_obj2dnode(o->od_os, o->od_rootid, &rootdn);
        if (rc)
                GOTO(err, rc);
@@ -1085,6 +1083,10 @@ static int osd_mount(const struct lu_env *env,
        if (rc)
                GOTO(err, rc);
 
+       rc = osd_objset_register_callbacks(o);
+       if (rc)
+               GOTO(err, rc);
+
        rc = osd_procfs_init(o, o->od_svname);
        if (rc)
                GOTO(err, rc);