コード例 #1
0
ファイル: llog_obd.c プロジェクト: 7799/linux
int __llog_ctxt_put(const struct lu_env *env, struct llog_ctxt *ctxt)
{
	struct obd_llog_group *olg = ctxt->loc_olg;
	struct obd_device *obd;
	int rc = 0;

	spin_lock(&olg->olg_lock);
	if (!atomic_dec_and_test(&ctxt->loc_refcount)) {
		spin_unlock(&olg->olg_lock);
		return rc;
	}
	olg->olg_ctxts[ctxt->loc_idx] = NULL;
	spin_unlock(&olg->olg_lock);

	obd = ctxt->loc_obd;
	spin_lock(&obd->obd_dev_lock);
	/* sync with llog ctxt user thread */
	spin_unlock(&obd->obd_dev_lock);

	/* obd->obd_starting is needed for the case of cleanup
	 * in error case while obd is starting up. */
	LASSERTF(obd->obd_starting == 1 ||
		 obd->obd_stopping == 1 || obd->obd_set_up == 0,
		 "wrong obd state: %d/%d/%d\n", !!obd->obd_starting,
		 !!obd->obd_stopping, !!obd->obd_set_up);

	/* cleanup the llog ctxt here */
	if (CTXTP(ctxt, cleanup))
		rc = CTXTP(ctxt, cleanup)(env, ctxt);

	llog_ctxt_destroy(ctxt);
	wake_up(&olg->olg_waitq);
	return rc;
}
コード例 #2
0
ファイル: llog_obd.c プロジェクト: 7799/linux
int llog_sync(struct llog_ctxt *ctxt, struct obd_export *exp, int flags)
{
	int rc = 0;

	if (!ctxt)
		return 0;

	if (CTXTP(ctxt, sync))
		rc = CTXTP(ctxt, sync)(ctxt, exp, flags);

	return rc;
}
コード例 #3
0
ファイル: llog_obd.c プロジェクト: EMSL-MSC/lustre-release
int llog_sync(struct llog_ctxt *ctxt, struct obd_export *exp, int flags)
{
        int rc = 0;
        ENTRY;

        if (!ctxt)
                RETURN(0);

        if (CTXTP(ctxt, sync))
		rc = CTXTP(ctxt, sync)(ctxt, exp, flags);

        RETURN(rc);
}
コード例 #4
0
ファイル: llog_obd.c プロジェクト: Cool-Joe/imx23-audio
int llog_obd_add(const struct lu_env *env, struct llog_ctxt *ctxt,
		 struct llog_rec_hdr *rec, struct lov_stripe_md *lsm,
		 struct llog_cookie *logcookies, int numcookies)
{
	int raised, rc;
	ENTRY;

	if (!ctxt) {
		CERROR("No ctxt\n");
		RETURN(-ENODEV);
	}

	if (ctxt->loc_flags & LLOG_CTXT_FLAG_UNINITIALIZED)
		RETURN(-ENXIO);

	CTXT_CHECK_OP(ctxt, obd_add, -EOPNOTSUPP);
	raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
	if (!raised)
		cfs_cap_raise(CFS_CAP_SYS_RESOURCE);
	rc = CTXTP(ctxt, obd_add)(env, ctxt, rec, lsm, logcookies,
				  numcookies);
	if (!raised)
		cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
	RETURN(rc);
}
コード例 #5
0
ファイル: llog_obd.c プロジェクト: 7799/linux
int llog_cancel(const struct lu_env *env, struct llog_ctxt *ctxt,
		struct lov_stripe_md *lsm, int count,
		struct llog_cookie *cookies, int flags)
{
	int rc;

	if (!ctxt) {
		CERROR("No ctxt\n");
		return -ENODEV;
	}

	CTXT_CHECK_OP(ctxt, cancel, -EOPNOTSUPP);
	rc = CTXTP(ctxt, cancel)(env, ctxt, lsm, count, cookies, flags);
	return rc;
}
コード例 #6
0
ファイル: llog_obd.c プロジェクト: EMSL-MSC/lustre-release
int llog_cancel(const struct lu_env *env, struct llog_ctxt *ctxt,
		struct llog_cookie *cookies, int flags)
{
        int rc;
        ENTRY;

        if (!ctxt) {
                CERROR("No ctxt\n");
                RETURN(-ENODEV);
        }

        CTXT_CHECK_OP(ctxt, cancel, -EOPNOTSUPP);
	rc = CTXTP(ctxt, cancel)(env, ctxt, cookies, flags);
        RETURN(rc);
}