#include <obd_class.h>
#include <lustre_log.h>
#include <lustre_net.h>
-#include <libcfs/list.h>
#include <lustre_fsfilt.h>
#if defined(__KERNEL__) && defined(LUSTRE_LOG_SERVER)
disk_obd = ctxt->loc_exp->exp_obd;
push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
- rc = llog_create(ctxt, &loghandle, logid, name);
+ rc = llog_create(req->rq_svc_thread->t_env, ctxt, &loghandle, logid,
+ name);
if (rc)
GOTO(out_pop, rc);
body = req_capsule_server_get(&req->rq_pill, &RMF_LLOGD_BODY);
body->lgd_logid = loghandle->lgh_id;
- GOTO(out_close, rc);
+ EXIT;
out_close:
- rc2 = llog_close(loghandle);
+ rc2 = llog_close(req->rq_svc_thread->t_env, loghandle);
if (!rc)
rc = rc2;
out_pop:
disk_obd = ctxt->loc_exp->exp_obd;
push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
- rc = llog_create(ctxt, &loghandle, logid, NULL);
+ rc = llog_create(req->rq_svc_thread->t_env, ctxt, &loghandle, logid,
+ NULL);
if (rc)
GOTO(out_pop, rc);
body = req_capsule_server_get(&req->rq_pill, &RMF_LLOGD_BODY);
body->lgd_logid = loghandle->lgh_id;
- rc = llog_init_handle(loghandle, LLOG_F_IS_PLAIN, NULL);
+ rc = llog_init_handle(req->rq_svc_thread->t_env, loghandle,
+ LLOG_F_IS_PLAIN, NULL);
if (rc)
GOTO(out_close, rc);
- rc = llog_destroy(loghandle);
+ rc = llog_destroy(req->rq_svc_thread->t_env, loghandle);
if (rc)
GOTO(out_close, rc);
llog_free_handle(loghandle);
- GOTO(out_close, rc);
+ EXIT;
out_close:
if (rc)
- llog_close(loghandle);
+ llog_close(req->rq_svc_thread->t_env, loghandle);
out_pop:
pop_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
llog_ctxt_put(ctxt);
disk_obd = ctxt->loc_exp->exp_obd;
push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
- rc = llog_create(ctxt, &loghandle, &body->lgd_logid, NULL);
+ rc = llog_create(req->rq_svc_thread->t_env, ctxt, &loghandle,
+ &body->lgd_logid, NULL);
if (rc)
GOTO(out_pop, rc);
flags = body->lgd_llh_flags;
- rc = llog_init_handle(loghandle, flags, NULL);
+ rc = llog_init_handle(req->rq_svc_thread->t_env, loghandle, flags,
+ NULL);
if (rc)
GOTO(out_close, rc);
memset(buf, 0, LLOG_CHUNK_SIZE);
- rc = llog_next_block(loghandle, &body->lgd_saved_index,
- body->lgd_index,
- &body->lgd_cur_offset, buf, LLOG_CHUNK_SIZE);
+ rc = llog_next_block(req->rq_svc_thread->t_env, loghandle,
+ &body->lgd_saved_index, body->lgd_index,
+ &body->lgd_cur_offset, buf, LLOG_CHUNK_SIZE);
if (rc)
GOTO(out_close, rc);
ptr = req_capsule_server_get(&req->rq_pill, &RMF_EADATA);
memcpy(ptr, buf, LLOG_CHUNK_SIZE);
- GOTO(out_close, rc);
+ EXIT;
out_close:
- rc2 = llog_close(loghandle);
+ rc2 = llog_close(req->rq_svc_thread->t_env, loghandle);
if (!rc)
rc = rc2;
out_pop:
disk_obd = ctxt->loc_exp->exp_obd;
push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
- rc = llog_create(ctxt, &loghandle, &body->lgd_logid, NULL);
+ rc = llog_create(req->rq_svc_thread->t_env, ctxt, &loghandle,
+ &body->lgd_logid, NULL);
if (rc)
GOTO(out_pop, rc);
flags = body->lgd_llh_flags;
- rc = llog_init_handle(loghandle, flags, NULL);
+ rc = llog_init_handle(req->rq_svc_thread->t_env, loghandle, flags,
+ NULL);
if (rc)
GOTO(out_close, rc);
memset(buf, 0, LLOG_CHUNK_SIZE);
- rc = llog_prev_block(loghandle, body->lgd_index,
- buf, LLOG_CHUNK_SIZE);
+ rc = llog_prev_block(req->rq_svc_thread->t_env, loghandle,
+ body->lgd_index, buf, LLOG_CHUNK_SIZE);
if (rc)
GOTO(out_close, rc);
ptr = req_capsule_server_get(&req->rq_pill, &RMF_EADATA);
memcpy(ptr, buf, LLOG_CHUNK_SIZE);
- GOTO(out_close, rc);
+ EXIT;
out_close:
- rc2 = llog_close(loghandle);
+ rc2 = llog_close(req->rq_svc_thread->t_env, loghandle);
if (!rc)
rc = rc2;
disk_obd = ctxt->loc_exp->exp_obd;
push_ctxt(&saved, &disk_obd->obd_lvfs_ctxt, NULL);
- rc = llog_create(ctxt, &loghandle, &body->lgd_logid, NULL);
+ rc = llog_create(req->rq_svc_thread->t_env, ctxt, &loghandle,
+ &body->lgd_logid, NULL);
if (rc)
GOTO(out_pop, rc);
* llog_init_handle() reads the llog header
*/
flags = body->lgd_llh_flags;
- rc = llog_init_handle(loghandle, flags, NULL);
+ rc = llog_init_handle(req->rq_svc_thread->t_env, loghandle, flags,
+ NULL);
if (rc)
GOTO(out_close, rc);
hdr = req_capsule_server_get(&req->rq_pill, &RMF_LLOG_LOG_HDR);
*hdr = *loghandle->lgh_hdr;
- GOTO(out_close, rc);
+ EXIT;
out_close:
- rc2 = llog_close(loghandle);
+ rc2 = llog_close(req->rq_svc_thread->t_env, loghandle);
if (!rc)
rc = rc2;
out_pop:
GOTO(pop_ctxt, rc = PTR_ERR(handle));
}
- rc = llog_cat_cancel_records(cathandle, 1, logcookies);
+ rc = llog_cat_cancel_records(req->rq_svc_thread->t_env,
+ cathandle, 1, logcookies);
/*
* Do not raise -ENOENT errors for resent rpcs. This rec already