-/* lop_setup method for filter/osc */
-// XXX how to set exports
-int llog_obd_origin_setup(const struct lu_env *env, struct obd_device *obd,
- struct obd_llog_group *olg, int index,
- struct obd_device *disk_obd, int count,
- struct llog_logid *logid, const char *name)
-{
- struct llog_ctxt *ctxt;
- struct llog_handle *handle;
- struct lvfs_run_ctxt saved;
- int rc;
- ENTRY;
-
- if (count == 0)
- RETURN(0);
-
- LASSERT(count == 1);
-
- LASSERT(olg != NULL);
- ctxt = llog_group_get_ctxt(olg, index);
- if (!ctxt)
- RETURN(-ENODEV);
-
- if (logid && logid->lgl_oid) {
- rc = llog_open(env, ctxt, &handle, logid, NULL,
- LLOG_OPEN_EXISTS);
- } else {
- rc = llog_open_create(env, ctxt, &handle, NULL, (char *)name);
- if (!rc && logid)
- *logid = handle->lgh_id;
- }
- if (rc)
- GOTO(out, rc);
-
- ctxt->loc_handle = handle;
- push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
- rc = llog_init_handle(env, handle, LLOG_F_IS_CAT, NULL);
- pop_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
- if (rc)
- GOTO(out, rc);
-
- rc = llog_process(env, handle, (llog_cb_t)cat_cancel_cb, NULL, NULL);
- if (rc)
- CERROR("llog_process() with cat_cancel_cb failed: %d\n", rc);
- GOTO(out, rc);
-out:
- llog_ctxt_put(ctxt);
- return rc;
-}
-EXPORT_SYMBOL(llog_obd_origin_setup);
-
-int llog_obd_origin_cleanup(const struct lu_env *env, struct llog_ctxt *ctxt)
-{
- ENTRY;
-
- if (!ctxt)
- RETURN(0);
-
- if (ctxt->loc_handle)
- llog_cat_close(env, ctxt->loc_handle);
- RETURN(0);
-}
-EXPORT_SYMBOL(llog_obd_origin_cleanup);
-