osi->osi_unlink.lur_count = count;
break;
case MDS_SETATTR64_REC:
- rc = fid_ostid_pack(fid, &osi->osi_oi);
+ rc = fid_to_ostid(fid, &osi->osi_oi);
LASSERT(rc == 0);
osi->osi_hdr.lrh_len = sizeof(osi->osi_setattr);
osi->osi_hdr.lrh_type = MDS_SETATTR64_REC;
- osi->osi_setattr.lsr_oid = osi->osi_oi.oi_id;
- osi->osi_setattr.lsr_oseq = osi->osi_oi.oi_seq;
+ osi->osi_setattr.lsr_oi = osi->osi_oi;
LASSERT(attr);
osi->osi_setattr.lsr_uid = attr->la_uid;
osi->osi_setattr.lsr_gid = attr->la_gid;
NULL, th);
llog_ctxt_put(ctxt);
- CDEBUG(D_OTHER, "%s: new record %lu:%lu:%lu/%lu: %d\n",
- d->opd_obd->obd_name,
- (unsigned long) osi->osi_cookie.lgc_lgl.lgl_oid,
- (unsigned long) osi->osi_cookie.lgc_lgl.lgl_oseq,
+ CDEBUG(D_OTHER, "%s: new record "DOSTID":%lu/%lu: %d\n",
+ d->opd_obd->obd_name, POSTID(&osi->osi_cookie.lgc_lgl.lgl_oi),
(unsigned long) osi->osi_cookie.lgc_lgl.lgl_ogen,
(unsigned long) osi->osi_cookie.lgc_index, rc);
static void osp_sync_request_commit_cb(struct ptlrpc_request *req)
{
struct osp_device *d = req->rq_cb_data;
- struct obd_import *imp = req->rq_import;
CDEBUG(D_HA, "commit req %p, transno "LPU64"\n", req, req->rq_transno);
if (unlikely(req->rq_transno == 0))
return;
- if (unlikely(req->rq_transno > imp->imp_peer_committed_transno)) {
- /* this request was aborted by the shutdown procedure,
- * not committed by the peer. we should preserve llog
- * record */
- spin_lock(&d->opd_syn_lock);
- d->opd_syn_rpc_in_progress--;
- spin_unlock(&d->opd_syn_lock);
- cfs_waitq_signal(&d->opd_syn_waitq);
- return;
- }
+ /* do not do any opd_dyn_rpc_* accounting here
+ * it's done in osp_sync_interpret sooner or later */
- /* XXX: what if request isn't committed for very long? */
LASSERT(d);
LASSERT(req->rq_svc_thread == (void *) OSP_JOB_MAGIC);
LASSERT(cfs_list_empty(&req->rq_exp_list));
{
struct osp_device *d = req->rq_cb_data;
- /* XXX: error handling here */
if (req->rq_svc_thread != (void *) OSP_JOB_MAGIC)
DEBUG_REQ(D_ERROR, req, "bad magic %p\n", req->rq_svc_thread);
LASSERT(req->rq_svc_thread == (void *) OSP_JOB_MAGIC);
"transno "LPU64", rc %d, gen: req %d, imp %d\n",
req->rq_transno, rc, req->rq_import_generation,
imp->imp_generation);
- LASSERT(d->opd_syn_rpc_in_progress > 0);
if (req->rq_transno == 0) {
/* this is the last time we see the request
* if transno is not zero, then commit cb
* will be called at some point */
+ LASSERT(d->opd_syn_rpc_in_progress > 0);
spin_lock(&d->opd_syn_lock);
d->opd_syn_rpc_in_progress--;
spin_unlock(&d->opd_syn_lock);
body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
LASSERT(body);
- body->oa.o_id = rec->lsr_oid;
- body->oa.o_seq = rec->lsr_oseq;
+ body->oa.o_oi = rec->lsr_oi;
body->oa.o_uid = rec->lsr_uid;
body->oa.o_gid = rec->lsr_gid;
body->oa.o_valid = OBD_MD_FLGROUP | OBD_MD_FLID |
body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
LASSERT(body);
- body->oa.o_id = rec->lur_oid;
- body->oa.o_seq = rec->lur_oseq;
+ ostid_set_seq(&body->oa.o_oi, rec->lur_oseq);
+ ostid_set_id(&body->oa.o_oi, rec->lur_oid);
body->oa.o_misc = rec->lur_count;
body->oa.o_valid = OBD_MD_FLGROUP | OBD_MD_FLID;
if (rec->lur_count)
body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
if (body == NULL)
RETURN(-EFAULT);
- rc = fid_ostid_pack(&rec->lur_fid, &body->oa.o_oi);
+ rc = fid_to_ostid(&rec->lur_fid, &body->oa.o_oi);
if (rc < 0)
RETURN(rc);
body->oa.o_misc = rec->lur_count;
static int osp_sync_llog_init(const struct lu_env *env, struct osp_device *d)
{
struct osp_thread_info *osi = osp_env_info(env);
- struct llog_handle *lgh;
+ struct llog_handle *lgh = NULL;
struct obd_device *obd = d->opd_obd;
struct llog_ctxt *ctxt;
int rc;
RETURN(rc);
}
- CDEBUG(D_INFO, "%s: Init llog for %d - catid "LPX64"/"LPX64":%x\n",
- obd->obd_name, d->opd_index, osi->osi_cid.lci_logid.lgl_oid,
- osi->osi_cid.lci_logid.lgl_oseq,
+ CDEBUG(D_INFO, "%s: Init llog for %d - catid "DOSTID":%x\n",
+ obd->obd_name, d->opd_index,
+ POSTID(&osi->osi_cid.lci_logid.lgl_oi),
osi->osi_cid.lci_logid.lgl_ogen);
rc = llog_setup(env, obd, &obd->obd_olg, LLOG_MDS_OST_ORIG_CTXT, obd,
ctxt = llog_get_context(obd, LLOG_MDS_OST_ORIG_CTXT);
LASSERT(ctxt);
- if (likely(osi->osi_cid.lci_logid.lgl_oid != 0)) {
+ if (likely(ostid_id(&osi->osi_cid.lci_logid.lgl_oi) != 0)) {
rc = llog_open(env, ctxt, &lgh, &osi->osi_cid.lci_logid, NULL,
LLOG_OPEN_EXISTS);
/* re-create llog if it is missing */
if (rc == -ENOENT)
- osi->osi_cid.lci_logid.lgl_oid = 0;
+ logid_set_id(&osi->osi_cid.lci_logid, 0);
else if (rc < 0)
GOTO(out_cleanup, rc);
}
- if (unlikely(osi->osi_cid.lci_logid.lgl_oid == 0)) {
+ if (unlikely(logid_id(&osi->osi_cid.lci_logid) == 0)) {
rc = llog_open_create(env, ctxt, &lgh, NULL, NULL);
if (rc < 0)
GOTO(out_cleanup, rc);
osi->osi_cid.lci_logid = lgh->lgh_id;
}
+ LASSERT(lgh != NULL);
ctxt->loc_handle = lgh;
rc = llog_cat_init_and_process(env, lgh);