* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2012, Intel Corporation.
+ * Copyright (c) 2012, 2013, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
LASSERT(ctxt);
LASSERT(ctxt->loc_exp);
- if (cathandle->lgh_obj != NULL) {
- dt = ctxt->loc_exp->exp_obd->obd_lvfs_ctxt.dt;
- LASSERT(dt);
+ LASSERT(cathandle->lgh_obj != NULL);
+ dt = lu2dt_dev(cathandle->lgh_obj->do_lu.lo_dev);
- th = dt_trans_create(env, dt);
- if (IS_ERR(th))
- RETURN(PTR_ERR(th));
+ th = dt_trans_create(env, dt);
+ if (IS_ERR(th))
+ RETURN(PTR_ERR(th));
- rc = llog_cat_declare_add_rec(env, cathandle, rec, th);
- if (rc)
- GOTO(out_trans, rc);
+ rc = llog_cat_declare_add_rec(env, cathandle, rec, th);
+ if (rc)
+ GOTO(out_trans, rc);
- rc = dt_trans_start_local(env, dt, th);
- if (rc)
- GOTO(out_trans, rc);
- rc = llog_cat_add_rec(env, cathandle, rec, reccookie, buf, th);
+ rc = dt_trans_start_local(env, dt, th);
+ if (rc)
+ GOTO(out_trans, rc);
+ rc = llog_cat_add_rec(env, cathandle, rec, reccookie, buf, th);
out_trans:
- dt_trans_stop(env, dt, th);
- } else { /* lvfs compat code */
- LASSERT(cathandle->lgh_file != NULL);
- rc = llog_cat_declare_add_rec(env, cathandle, rec, th);
- if (rc == 0)
- rc = llog_cat_add_rec(env, cathandle, rec, reccookie,
- buf, th);
- }
+ dt_trans_stop(env, dt, th);
RETURN(rc);
}
EXPORT_SYMBOL(llog_cat_add);
RETURN(rc);
}
- if (rec->lrh_index < d->lpd_startcat)
- /* Skip processing of the logs until startcat */
- RETURN(0);
-
- if (d->lpd_startidx > 0) {
+ if (rec->lrh_index < d->lpd_startcat) {
+ /* Skip processing of the logs until startcat */
+ rc = 0;
+ } else if (d->lpd_startidx > 0) {
struct llog_process_cat_data cd;
cd.lpcd_first_idx = d->lpd_startidx;
rc = llog_process_or_fork(env, llh, d->lpd_cb, d->lpd_data,
NULL, false);
}
+
llog_handle_put(llh);
RETURN(rc);