}
static struct lnet_libmd *
-lnet_md_build(struct lnet_md *umd, int unlink)
+lnet_md_build(const struct lnet_md *umd, int unlink)
{
int i;
unsigned int niov;
}
static int
-lnet_md_validate(struct lnet_md *umd)
+lnet_md_validate(const struct lnet_md *umd)
{
if (umd->start == NULL && umd->length != 0) {
CERROR("MD start pointer can not be NULL with length %u\n",
* a MD.
*/
int
-LNetMDAttach(struct lnet_me *me, struct lnet_md umd,
+LNetMDAttach(struct lnet_me *me, const struct lnet_md *umd,
enum lnet_unlink unlink, struct lnet_handle_md *handle)
{
LIST_HEAD(matches);
LASSERT(the_lnet.ln_refcount > 0);
- if (lnet_md_validate(&umd) != 0)
+ if (lnet_md_validate(umd) != 0)
return -EINVAL;
- if ((umd.options & (LNET_MD_OP_GET | LNET_MD_OP_PUT)) == 0) {
+ if ((umd->options & (LNET_MD_OP_GET | LNET_MD_OP_PUT)) == 0) {
CERROR("Invalid option: no MD_OP set\n");
return -EINVAL;
}
- md = lnet_md_build(&umd, unlink);
+ md = lnet_md_build(umd, unlink);
if (IS_ERR(md))
return PTR_ERR(md);
if (me->me_md)
rc = -EBUSY;
else
- rc = lnet_md_link(md, umd.handler, cpt);
+ rc = lnet_md_link(md, umd->handler, cpt);
if (rc != 0)
goto out_unlock;
* LNetInvalidateHandle() on it.
*/
int
-LNetMDBind(struct lnet_md umd, enum lnet_unlink unlink,
+LNetMDBind(const struct lnet_md *umd, enum lnet_unlink unlink,
struct lnet_handle_md *handle)
{
struct lnet_libmd *md;
LASSERT(the_lnet.ln_refcount > 0);
- if (lnet_md_validate(&umd) != 0)
+ if (lnet_md_validate(umd) != 0)
return -EINVAL;
- if ((umd.options & (LNET_MD_OP_GET | LNET_MD_OP_PUT)) != 0) {
+ if ((umd->options & (LNET_MD_OP_GET | LNET_MD_OP_PUT)) != 0) {
CERROR("Invalid option: GET|PUT illegal on active MDs\n");
return -EINVAL;
}
- md = lnet_md_build(&umd, unlink);
+ md = lnet_md_build(umd, unlink);
if (IS_ERR(md))
return PTR_ERR(md);
cpt = lnet_res_lock_current();
- rc = lnet_md_link(md, umd.handler, cpt);
+ rc = lnet_md_link(md, umd->handler, cpt);
if (rc != 0)
goto out_unlock;