+/**
+ * Wrapper for send_callback_request() which passes a lopsub parse result.
+ *
+ * \param f The callback function.
+ * \param cmd Needed for (de-)serialization.
+ * \param lpr Must match cmd.
+ * \param private_result_data Passed to send_callback_request().
+ *
+ * This function serializes the parse result given by the lpr pointer into a
+ * buffer. The buffer is sent as the query to the afs process with the callback
+ * mechanism.
+ *
+ * \return The return value of the underlying call to send_callback_request().
+ */
+int send_lls_callback_request(afs_callback *f,
+ const struct lls_command * const cmd,
+ struct lls_parse_result *lpr, void *private_result_data)
+{
+ struct osl_object query;
+ char *buf = NULL;
+ int ret = lls_serialize_parse_result(lpr, cmd, &buf, &query.size);
+
+ assert(ret >= 0);
+ query.data = buf;
+ ret = send_callback_request(f, &query, afs_cb_result_handler,
+ private_result_data);
+ free(buf);
+ return ret;
+}
+