+/**
+ * Update local FLDB copy from master server.
+ *
+ * This callback is called when LWP is connected to the server.
+ * It retrieves its FLDB entries from MDT0, and it only happens
+ * when upgrading the existing file system to 2.6.
+ *
+ * \param[in] data OFD device
+ *
+ * \retval 0 on successful FLDB update
+ * \retval negative value in case if failure
+ */
+static int ofd_register_lwp_callback(void *data)
+{
+ struct lu_env *env;
+ struct ofd_device *ofd = data;
+ struct lu_server_fld *fld = ofd->ofd_seq_site.ss_server_fld;
+ int rc;
+
+ ENTRY;
+
+ if (!likely(fld->lsf_new))
+ RETURN(0);
+
+ OBD_ALLOC_PTR(env);
+ if (env == NULL)
+ RETURN(-ENOMEM);
+
+ rc = lu_env_init(env, LCT_DT_THREAD);
+ if (rc < 0)
+ GOTO(out, rc);
+
+ rc = fld_update_from_controller(env, fld);
+ if (rc < 0) {
+ CERROR("%s: cannot update controller: rc = %d\n",
+ ofd_name(ofd), rc);
+ GOTO(out, rc);
+ }
+ EXIT;
+out:
+ lu_env_fini(env);
+ OBD_FREE_PTR(env);
+ return rc;
+}
+
+/**
+ * Get LWP exports from LWP connection for local FLDB server and SEQ client.
+ *
+ * This function is part of setup process and initialize FLDB server and SEQ
+ * client, so they may work with remote servers.
+ *
+ * \param[in] ofd OFD device
+ *
+ * \retval 0 on successful export get
+ * \retval negative value on error
+ */