Beispiel #1
0
static int fld_insert_igif_fld(struct lu_server_fld *fld,
                               const struct lu_env *env)
{
        struct thandle *th;
        int rc;
        ENTRY;

        /* FLD_TXN_INDEX_INSERT_CREDITS */
        th = fld_trans_create(fld, env);
        if (IS_ERR(th))
                RETURN(PTR_ERR(th));
        rc = fld_declare_index_create(fld, env, &IGIF_FLD_RANGE, th);
        if (rc) {
                fld_trans_stop(fld, env, th);
                RETURN(rc);
        }
        rc = fld_trans_start(fld, env, th);
        if (rc) {
                fld_trans_stop(fld, env, th);
                RETURN(rc);
        }

        rc = fld_index_create(fld, env, &IGIF_FLD_RANGE, th);
        fld_trans_stop(fld, env, th);
        if (rc == -EEXIST)
                rc = 0;
        RETURN(rc);
}
Beispiel #2
0
static int fld_insert_entry(const struct lu_env *env,
			    struct lu_server_fld *fld,
			    const struct lu_seq_range *range)
{
	struct thandle *th;
	int rc;
	ENTRY;

	th = dt_trans_create(env, lu2dt_dev(fld->lsf_obj->do_lu.lo_dev));
	if (IS_ERR(th))
		RETURN(PTR_ERR(th));

	rc = fld_declare_index_create(env, fld, range, th);
	if (rc != 0) {
		if (rc == -EEXIST)
			rc = 0;
		GOTO(out, rc);
	}

	rc = dt_trans_start_local(env, lu2dt_dev(fld->lsf_obj->do_lu.lo_dev),
				  th);
	if (rc)
		GOTO(out, rc);

	rc = fld_index_create(env, fld, range, th);
	if (rc == -EEXIST)
		rc = 0;
out:
	dt_trans_stop(env, lu2dt_dev(fld->lsf_obj->do_lu.lo_dev), th);
	RETURN(rc);
}
Beispiel #3
0
int fld_declare_server_create(const struct lu_env *env,
			      struct lu_server_fld *fld,
			      const struct lu_seq_range *range,
			      struct thandle *th)
{
	int rc;

	rc = fld_declare_index_create(env, fld, range, th);
	RETURN(rc);
}