Пример #1
0
int llog_declare_add(const struct lu_env *env, struct llog_handle *lgh,
		     struct llog_rec_hdr *rec, struct thandle *th)
{
	int raised, rc;

	ENTRY;

	if (lgh->lgh_logops->lop_declare_add == NULL)
		RETURN(-EOPNOTSUPP);

	raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
	if (!raised)
		cfs_cap_raise(CFS_CAP_SYS_RESOURCE);
	rc = lgh->lgh_logops->lop_declare_add(env, lgh, rec, th);
	if (!raised)
		cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
	RETURN(rc);
}
Пример #2
0
Файл: llog.c Проект: 7799/linux
int llog_create(const struct lu_env *env, struct llog_handle *handle,
		struct thandle *th)
{
	struct llog_operations	*lop;
	int			 raised, rc;

	rc = llog_handle2ops(handle, &lop);
	if (rc)
		return rc;
	if (lop->lop_create == NULL)
		return -EOPNOTSUPP;

	raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
	if (!raised)
		cfs_cap_raise(CFS_CAP_SYS_RESOURCE);
	rc = lop->lop_create(env, handle, th);
	if (!raised)
		cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
	return rc;
}
Пример #3
0
int llog_declare_create(const struct lu_env *env,
			struct llog_handle *loghandle, struct thandle *th)
{
	struct llog_operations	*lop;
	int			 raised, rc;

	ENTRY;

	rc = llog_handle2ops(loghandle, &lop);
	if (rc)
		RETURN(rc);
	if (lop->lop_declare_create == NULL)
		RETURN(-EOPNOTSUPP);

	raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
	if (!raised)
		cfs_cap_raise(CFS_CAP_SYS_RESOURCE);
	rc = lop->lop_declare_create(env, loghandle, th);
	if (!raised)
		cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
	RETURN(rc);
}
Пример #4
0
Файл: llog.c Проект: 7799/linux
int llog_declare_write_rec(const struct lu_env *env,
			   struct llog_handle *handle,
			   struct llog_rec_hdr *rec, int idx,
			   struct thandle *th)
{
	struct llog_operations	*lop;
	int			 raised, rc;

	rc = llog_handle2ops(handle, &lop);
	if (rc)
		return rc;
	LASSERT(lop);
	if (lop->lop_declare_write_rec == NULL)
		return -EOPNOTSUPP;

	raised = cfs_cap_raised(CFS_CAP_SYS_RESOURCE);
	if (!raised)
		cfs_cap_raise(CFS_CAP_SYS_RESOURCE);
	rc = lop->lop_declare_write_rec(env, handle, rec, idx, th);
	if (!raised)
		cfs_cap_lower(CFS_CAP_SYS_RESOURCE);
	return rc;
}
Пример #5
0
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;

	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;
}