Code Monkey home page Code Monkey logo

Comments (21)

johnbent avatar johnbent commented on July 27, 2024

Thanks @rupasree-roy for reporting this. You provided two links. One to the original code and one to the modified code (uploaded as a tarball). Is the pasted compilation error coming from the original code or from the modified code in the tarball? Also, for those of us who can't see inside Seagate, does the tarball contain everything that is at the original link?

from cortx-motr.

rupasree-roy avatar rupasree-roy commented on July 27, 2024

The compiling errors are from the original code. There were many other compiling errors which were mainly around change in naming convention and change in function definitions. I changed the original code to take care of those compiling errors and thus the modified code.

And yes, the tarball contains everything that is at the original link. Just that its the updated version to make it work with the opensource code. I made changes to the following files from the original link : ~/clovis-app/Makefile, ~/clovis-app/src/main.c, ~/m0-instance/Makefile, ~/m0-instance/src/main.c

from cortx-motr.

johnbent avatar johnbent commented on July 27, 2024

Thanks Rupasree for the info. Where are you maintaining this code and working on this? I think it would make sense for you to put this code into a fork of either cortx-motr or m0-client-apps. That way, others of us can pull your fork and help look at these issues. Would that be possible for you to do please?

from cortx-motr.

andriytk avatar andriytk commented on July 27, 2024

I've found the code for container functions in an old branch of Motr. Here are the functions:

void m0_container_init(struct m0_container *cont,
		       struct m0_realm     *parent,
		       const struct m0_uint128    *id,
		       struct m0_client           *instance,
		       struct m0_pool             *pool)
{
        M0_ENTRY();

        M0_PRE(cont != NULL);
        M0_PRE(instance != NULL);
        M0_PRE(parent != NULL);
        M0_PRE(pool != NULL);
        M0_PRE(id != NULL);

        m0_realm_init(&cont->cont_realm, parent, id,
		      M0_ST_CONTAINER, instance);
        m0_idx_init(&cont->cont_idx, parent, id);
        cont->cont_pool = pool;

        M0_LEAVE();
}
M0_EXPORTED(m0_container_init);

void m0_container_fini(struct m0_container *cont)
{
        M0_ENTRY();

        M0_PRE(cont != NULL);

        m0_idx_fini(&cont->cont_idx);
        m0_realm_fini(&cont->cont_realm);

        M0_LEAVE();
}
M0_EXPORTED(m0_container_fini);

int m0_container_op(struct m0_container *cont,
		    enum m0_idx_opcode   opcode,
		    struct m0_bufvec    *keys,
		    struct m0_bufvec    *vals,
		    int32_t             *rcs,
		    uint32_t             flags,
		    struct m0_op       **op)
{
        M0_PRE(cont != NULL);
        M0_ENTRY();

        return M0_RC(m0_idx_op(&cont->cont_idx, opcode, keys,
                                      vals, rcs, flags, op));
}


int m0_container_bulk(struct m0_container *cont,
		      struct m0_uint128          *bop,
		      struct m0_param            *datum,
		      struct m0_op       **ops)
{
        M0_ENTRY();

        return M0_RC(m0_idx_bulk(&cont->cont_idx, bop, datum, ops));
}


M0_INTERNAL int m0_container_create(struct m0_container *cont,
				    struct m0_op       **op)
{
        M0_ENTRY();

	M0_PRE(op != NULL);
        M0_PRE(cont != NULL);

        return M0_RC(m0_entity_create(&cont->cont_idx.in_entity, op));
}

Looks like they are mostly the wrappers over existing API, that's probably why they never made into the main branch. At least you can see the idea behind them.

from cortx-motr.

andriytk avatar andriytk commented on July 27, 2024

Another one:

int m0_idx_bulk(struct m0_idx *idx,
                       struct m0_uint128    *bop,
                       struct m0_param      *datum,
                       struct m0_op **ops)
{
	int                         rc;
	struct m0_bufvec           *fids;
	struct m0_bufvec           *data;
	int                        *rcs;

	M0_ENTRY();

	M0_PRE(idx != NULL);
	M0_PRE(bop != NULL);
	M0_PRE(datum != NULL);
	M0_PRE(ops != NULL);

	M0_ALLOC_PTR(rcs);
	M0_ALLOC_PTR(fids);
	M0_ALLOC_PTR(data);
	if (!rcs || !fids || !data) {
		return -ENOMEM;
	}
	rc = m0_bufvec_empty_alloc(fids, 1);
	if (rc) {
		return M0_ERR(rc);
	}
	rc = m0_bufvec_empty_alloc(data, 1);
	if (rc) {
		return M0_ERR(rc);
	}

	fids->ov_buf[0] = (void*) bop;
	fids->ov_vec.v_count[0] = sizeof(void*);

	data->ov_buf[0] = (void*) datum;
	data->ov_vec.v_count[0] = sizeof(void*);

	return M0_RC(m0_idx_op(idx, M0_IC_BULK, fids,
		                      data, rcs, 0, ops));
}

from cortx-motr.

andriytk avatar andriytk commented on July 27, 2024

Instead of m0_default_layout_id() use M0_DEFAULT_LAYOUT_ID macro.

Don't worry about m0_realm_init(), just drop it and see how the realm is used in another examples. (For example, at https://github.com/Seagate/cortx-motr/blob/main/bindings/go/mio/mio.go.)

from cortx-motr.

andriytk avatar andriytk commented on July 27, 2024

As for the m0_conf_fs_get(), here I updated it to the latest API (m0_confc_root_open()) - m0-instance.tar.gz.

Hope you could continue from here?

from cortx-motr.

rupasree-roy avatar rupasree-roy commented on July 27, 2024

@johnbent I was maintaining the code in one of the lab machines in FRC. And sure I can fork cortx-motr and put the code there.

from cortx-motr.

rupasree-roy avatar rupasree-roy commented on July 27, 2024

@andriytk Thank you for sharing those info. Made changes according to what you suggested.

As far as the wrappers like 'm0_container_op' is concerned, how are we going to take care of that?

from cortx-motr.

johnbent avatar johnbent commented on July 27, 2024

@andriytk might say differently but I'd suggest to just add the wrappers yourself in your FDMI plugin.

from cortx-motr.

andriytk avatar andriytk commented on July 27, 2024

I'd suggest to make direct calls and get rid of the wrappers.

from cortx-motr.

stale avatar stale commented on July 27, 2024

This issue/pull request has been marked as needs attention as it has been left pending without new activity for 4 days. Tagging @huanghua78 @mukundkanekar for appropriate assignment. Sorry for the delay & Thank you for contributing to CORTX. We will get back to you as soon as possible.

from cortx-motr.

rupasree-roy avatar rupasree-roy commented on July 27, 2024

Adding
@paulq11 @Lsmithy @Z2020Z

from cortx-motr.

stale avatar stale commented on July 27, 2024

This issue/pull request has been marked as needs attention as it has been left pending without new activity for 4 days. Tagging @huanghua78 @mukundkanekar for appropriate assignment. Sorry for the delay & Thank you for contributing to CORTX. We will get back to you as soon as possible.

from cortx-motr.

huanghua78 avatar huanghua78 commented on July 27, 2024

Please note, this fdmi-demo is somewhat copied from "dix/utils/m0dixinit.c".
Please refer to "dix/utils/m0dixinit.c " and change the fdmi-demo accordingly.

from cortx-motr.

stale avatar stale commented on July 27, 2024

This issue/pull request has been marked as needs attention as it has been left pending without new activity for 4 days. Tagging @huanghua78 @mukundkanekar for appropriate assignment. Sorry for the delay & Thank you for contributing to CORTX. We will get back to you as soon as possible.

from cortx-motr.

nkommuri avatar nkommuri commented on July 27, 2024

@huanghua78 please have a look at this once and suggest what needs to be done. Thanks.

from cortx-motr.

huanghua78 avatar huanghua78 commented on July 27, 2024

This issue is outdated.
Please refer to files in fdmi/plugins/* for more details about how to write an FDMI application and how to compile it.

from cortx-motr.

cortx-admin avatar cortx-admin commented on July 27, 2024

Nagakishore Kommuri commented in Jira Server:

Github Issue closed.

from cortx-motr.

cortx-admin avatar cortx-admin commented on July 27, 2024

Nagakishore Kommuri commented in Jira Server:

.

from cortx-motr.

cortx-admin avatar cortx-admin commented on July 27, 2024

Nagakishore Kommuri commented in Jira Server:

.

from cortx-motr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.