Whamcloud - gitweb
A mostly-fix for "mknod /mnt/lustre/foofo p". It doesn't fail outright
[fs/lustre-release.git] / lustre / mdc / mdc_request.c
index dea2dce..be73b40 100644 (file)
 
 extern int mds_queue_req(struct ptlrpc_request *);
 
+int mdc_con2cl(struct lustre_handle *conn, struct ptlrpc_client **cl,
+               struct ptlrpc_connection **connection,
+               struct lustre_handle **rconn)
+{
+        struct obd_export *export;
+        struct mdc_obd *mdc;
+
+        export = class_conn2export(conn);
+        if (!export)
+                return -ENOTCONN;
+
+        mdc = &export->exp_obd->u.mdc;
+
+        *cl = mdc->mdc_client;
+        *connection = mdc->mdc_conn;
+        *rconn = &export->exp_rconnh;
+
+        return 0;
+}
+
+static int mdc_con2dlmcl(struct lustre_handle *conn, struct ptlrpc_client **cl,
+                         struct ptlrpc_connection **connection,
+                         struct lustre_handle **rconn)
+{
+        struct obd_export *export;
+        struct mdc_obd *mdc;
+
+        export = class_conn2export(conn);
+        if (!export)
+                return -ENOTCONN;
+
+        mdc = &export->exp_obd->u.mdc;
+
+        *cl = mdc->mdc_ldlm_client;
+        *connection = mdc->mdc_conn;
+        *rconn = &export->exp_rconnh;
+
+        return 0;
+}
+
 
 int mdc_getstatus(struct lustre_handle *conn, struct ll_fid *rootfid,
                   __u64 *last_committed, __u64 *last_rcvd,
@@ -40,12 +80,15 @@ int mdc_getstatus(struct lustre_handle *conn, struct ll_fid *rootfid,
 {
         struct ptlrpc_request *req;
         struct mds_body *body;
-        struct mdc_obd *mdc = mdc_conn2mdc(conn);
+        struct ptlrpc_client *cl;
+        struct ptlrpc_connection *connection;
+        struct lustre_handle *rconn;
         int rc, size = sizeof(*body);
         ENTRY;
 
-        req = ptlrpc_prep_req2(mdc->mdc_client, mdc->mdc_conn, &mdc->mdc_connh,
-                              MDS_GETSTATUS, 1, &size, NULL);
+        mdc_con2cl(conn, &cl, &connection, &rconn);
+        req = ptlrpc_prep_req2(cl, connection, rconn,
+                               MDS_GETSTATUS, 1, &size, NULL);
         if (!req)
                 GOTO(out, rc = -ENOMEM);
 
@@ -79,18 +122,68 @@ int mdc_getstatus(struct lustre_handle *conn, struct ll_fid *rootfid,
         return rc;
 }
 
+int mdc_getlovinfo(struct obd_device *obd, struct lustre_handle *mdc_connh,
+                   uuid_t **uuids, struct ptlrpc_request **request)
+{
+        struct ptlrpc_request *req;
+        struct mds_status_req *streq;
+        struct lov_obd *lov = &obd->u.lov;
+        struct mdc_obd *mdc = &lov->mdcobd->u.mdc;
+        struct ptlrpc_client *cl;
+        struct ptlrpc_connection *connection;
+        struct lustre_handle *rconn;
+        struct lov_desc *desc = &lov->desc;
+        int rc, size[2] = {sizeof(*streq)};
+        ENTRY;
+
+        mdc_con2cl(mdc_connh, &cl, &connection, &rconn);
+        req = ptlrpc_prep_req2(cl, connection, rconn,
+                               MDS_LOVINFO, 1, size, NULL);
+        if (!req)
+                GOTO(out, rc = -ENOMEM);
+
+        *request = req;
+        streq = lustre_msg_buf(req->rq_reqmsg, 0);
+        streq->flags = HTON__u32(MDS_STATUS_LOV);
+        streq->repbuf = HTON__u32(8000);
+
+        /* prepare for reply */
+        req->rq_level = LUSTRE_CONN_CON;
+        size[0] = sizeof(*desc);
+        size[1] = 8000;
+        req->rq_replen = lustre_msg_size(2, size);
+
+        rc = ptlrpc_queue_wait(req);
+        rc = ptlrpc_check_status(req, rc);
+
+        if (!rc) {
+                memcpy(desc, lustre_msg_buf(req->rq_repmsg, 0), sizeof(*desc));
+                *uuids = lustre_msg_buf(req->rq_repmsg, 1);
+                lov_unpackdesc(desc);
+        }
+        mdc->mdc_max_mdsize = sizeof(*desc) +
+                desc->ld_tgt_count * sizeof(uuid_t);
+
+        EXIT;
+ out:
+        return rc;
+}
+
 
 int mdc_getattr(struct lustre_handle *conn,
                 obd_id ino, int type, unsigned long valid, size_t ea_size,
                 struct ptlrpc_request **request)
 {
-        struct mdc_obd *mdc = mdc_conn2mdc(conn);
+        struct ptlrpc_client *cl;
+        struct ptlrpc_connection *connection;
+        struct lustre_handle *rconn;
         struct ptlrpc_request *req;
         struct mds_body *body;
         int rc, size[2] = {sizeof(*body), 0}, bufcount = 1;
         ENTRY;
 
-        req = ptlrpc_prep_req2(mdc->mdc_client, mdc->mdc_conn, &mdc->mdc_connh,
+        mdc_con2cl(conn, &cl, &connection, &rconn);
+        req = ptlrpc_prep_req2(cl, connection, rconn,
                                MDS_GETATTR, 1, size, NULL);
         if (!req)
                 GOTO(out, rc = -ENOMEM);
@@ -100,8 +193,9 @@ int mdc_getattr(struct lustre_handle *conn,
         body->valid = valid;
 
         if (S_ISREG(type)) {
+                struct mdc_obd *mdc = &class_conn2obd(conn)->u.mdc;
                 bufcount = 2;
-                size[1] = sizeof(struct obdo);
+                size[1] = mdc->mdc_max_mdsize;
         } else if (valid & OBD_MD_LINKNAME) {
                 bufcount = 2;
                 size[1] = ea_size;
@@ -150,7 +244,7 @@ static int mdc_lock_callback(struct lustre_handle *lockh,
                 invalidate_inode_pages(inode);
         }
 
-        rc = ldlm_cli_cancel(lockh, NULL);
+        rc = ldlm_cli_cancel(lockh);
         if (rc < 0) {
                 CERROR("ldlm_cli_cancel: %d\n", rc);
                 LBUG();
@@ -165,42 +259,43 @@ int mdc_enqueue(struct lustre_handle *conn, int lock_type,
 {
         struct ptlrpc_request *req;
         struct obd_device *obddev = class_conn2obd(conn);
-        struct mdc_obd *mdc = mdc_conn2mdc(conn);
+        struct ptlrpc_client *cl;
+        struct ptlrpc_connection *connection;
+        struct lustre_handle *rconn;
         __u64 res_id[RES_NAME_SIZE] = {dir->i_ino};
         int size[5] = {sizeof(struct ldlm_request), sizeof(struct ldlm_intent)};
         int rc, flags;
+        int repsize[3] = {sizeof(struct ldlm_reply), 
+                          sizeof(struct mds_body),
+                          obddev->u.mdc.mdc_max_mdsize};
         struct ldlm_reply *dlm_rep;
         struct ldlm_intent *lit;
         ENTRY;
 
-#warning FIXME: Andreas, the sgid directory stuff also goes here, but check again on mds
-
         LDLM_DEBUG_NOLOCK("mdsintent %d dir %ld", it->it_op, dir->i_ino);
 
         switch (it->it_op) { 
         case IT_MKDIR:
                 it->it_mode = (it->it_mode | S_IFDIR) & ~current->fs->umask; 
                 break;
-        case IT_SETATTR:
-                it->it_op = IT_GETATTR;
-                break;
         case (IT_CREAT|IT_OPEN):
         case IT_CREAT:
+                it->it_mode |= S_IFREG; /* no break */
         case IT_MKNOD:
-                it->it_mode = (it->it_mode | S_IFREG) & ~current->fs->umask; 
+                it->it_mode &= ~current->fs->umask;
                 break;
         case IT_SYMLINK:
                 it->it_mode = (it->it_mode | S_IFLNK) & ~current->fs->umask; 
                 break;
         }
 
+        mdc_con2dlmcl(conn, &cl, &connection, &rconn);
         if (it->it_op & (IT_MKDIR | IT_CREAT | IT_SYMLINK | IT_MKNOD)) {
                 size[2] = sizeof(struct mds_rec_create);
                 size[3] = de->d_name.len + 1;
                 size[4] = tgtlen + 1;
-                req = ptlrpc_prep_req2(mdc->mdc_ldlm_client, mdc->mdc_conn,
-                                       &mdc->mdc_connh, LDLM_ENQUEUE, 5, size,
-                                       NULL);
+                req = ptlrpc_prep_req2(cl, connection, rconn,
+                                       LDLM_ENQUEUE, 5, size, NULL);
                 if (!req)
                         RETURN(-ENOMEM);
 
@@ -212,20 +307,15 @@ int mdc_enqueue(struct lustre_handle *conn, int lock_type,
                 mds_create_pack(req, 2, dir, it->it_mode, id, current->fsuid,
                                 current->fsgid, CURRENT_TIME, de->d_name.name,
                                 de->d_name.len, tgt, tgtlen);
-
-                size[0] = sizeof(struct ldlm_reply);
-                size[1] = sizeof(struct mds_body);
-                size[2] = sizeof(struct obdo);
-                req->rq_replen = lustre_msg_size(3, size);
+                req->rq_replen = lustre_msg_size(3, repsize);
         } else if (it->it_op == IT_RENAME2) {
                 struct dentry *old_de = it->it_data;
 
                 size[2] = sizeof(struct mds_rec_rename);
                 size[3] = old_de->d_name.len + 1;
                 size[4] = de->d_name.len + 1;
-                req = ptlrpc_prep_req2(mdc->mdc_ldlm_client, mdc->mdc_conn,
-                                       &mdc->mdc_connh, LDLM_ENQUEUE, 5, size,
-                                       NULL);
+                req = ptlrpc_prep_req2(cl, connection, rconn,
+                                       LDLM_ENQUEUE, 5, size, NULL);
                 if (!req)
                         RETURN(-ENOMEM);
 
@@ -237,14 +327,12 @@ int mdc_enqueue(struct lustre_handle *conn, int lock_type,
                 mds_rename_pack(req, 2, old_de->d_parent->d_inode, dir,
                                 old_de->d_name.name, old_de->d_name.len,
                                 de->d_name.name, de->d_name.len);
-
-                size[0] = sizeof(struct ldlm_reply);
-                req->rq_replen = lustre_msg_size(1, size);
-        } else if (it->it_op == IT_UNLINK) {
+                req->rq_replen = lustre_msg_size(1, repsize);
+        } else if (it->it_op == IT_UNLINK || it->it_op == IT_RMDIR) {
                 size[2] = sizeof(struct mds_rec_unlink);
                 size[3] = de->d_name.len + 1;
-                req = ptlrpc_prep_req2(mdc->mdc_ldlm_client, mdc->mdc_conn,
-                                &mdc->mdc_connh, LDLM_ENQUEUE, 4, size, NULL);
+                req = ptlrpc_prep_req2(cl, connection, rconn,
+                                       LDLM_ENQUEUE, 4, size, NULL);
                 if (!req)
                         RETURN(-ENOMEM);
 
@@ -255,35 +343,16 @@ int mdc_enqueue(struct lustre_handle *conn, int lock_type,
                 /* pack the intended request */
                 mds_unlink_pack(req, 2, dir, NULL, de->d_name.name, 
                                 de->d_name.len);
-                size[0] = sizeof(struct ldlm_reply);
-                size[1] = sizeof(struct obdo);
-                req->rq_replen = lustre_msg_size(2, size);
-        } else if (it->it_op == IT_RMDIR) {
-                size[2] = sizeof(struct mds_rec_unlink);
-                size[3] = de->d_name.len + 1;
-                req = ptlrpc_prep_req2(mdc->mdc_ldlm_client, mdc->mdc_conn,
-                                       &mdc->mdc_connh, LDLM_ENQUEUE, 4, size,
-                                       NULL);
-                if (!req)
-                        RETURN(-ENOMEM);
-
-                /* pack the intent */
-                lit = lustre_msg_buf(req->rq_reqmsg, 1);
-                lit->opc = NTOH__u64((__u64)it->it_op);
 
-                /* pack the intended request */
-                mds_unlink_pack(req, 2, dir, NULL, de->d_name.name, 
-                                de->d_name.len);
-                size[0] = sizeof(struct ldlm_reply);
-                req->rq_replen = lustre_msg_size(1, size);
+                req->rq_replen = lustre_msg_size(3, repsize);
         } else if (it->it_op == IT_GETATTR || it->it_op == IT_RENAME ||
-                   it->it_op == IT_OPEN) {
+                   it->it_op == IT_OPEN || it->it_op == IT_SETATTR ||
+                   it->it_op == IT_LOOKUP) {
                 size[2] = sizeof(struct mds_body);
                 size[3] = de->d_name.len + 1;
 
-                req = ptlrpc_prep_req2(mdc->mdc_ldlm_client, mdc->mdc_conn,
-                                       &mdc->mdc_connh, LDLM_ENQUEUE, 4, size,
-                                       NULL);
+                req = ptlrpc_prep_req2(cl, connection, rconn,
+                                       LDLM_ENQUEUE, 4, size, NULL);
                 if (!req)
                         RETURN(-ENOMEM);
 
@@ -295,45 +364,21 @@ int mdc_enqueue(struct lustre_handle *conn, int lock_type,
                 mds_getattr_pack(req, 2, dir, de->d_name.name, de->d_name.len);
 
                 /* get ready for the reply */
-                size[0] = sizeof(struct ldlm_reply);
-                size[1] = sizeof(struct mds_body);
-                size[2] = sizeof(struct obdo);
-                req->rq_replen = lustre_msg_size(3, size);
-        } else if (it->it_op == IT_SETATTR) {
-                size[2] = sizeof(struct mds_rec_setattr);
-                size[3] = de->d_name.len + 1;
-                req = ptlrpc_prep_req2(mdc->mdc_ldlm_client, mdc->mdc_conn,
-                                       &mdc->mdc_connh, LDLM_ENQUEUE, 5, size,
-                                       NULL);
-                if (!req)
-                        RETURN(-ENOMEM);
-
-                lit = lustre_msg_buf(req->rq_reqmsg, 1);
-                lit->opc = NTOH__u64((__u64)it->it_op);
-                
-                if (!it->it_iattr) 
-                        LBUG();
-
-                mds_setattr_pack(req, 2, dir, it->it_iattr, 
-                                de->d_name.name, de->d_name.len);
-                size[0] = sizeof(struct ldlm_reply);
-                size[1] = sizeof(struct mds_body);
-                req->rq_replen = lustre_msg_size(2, size);
+                req->rq_replen = lustre_msg_size(3, repsize);
         } else if (it->it_op == IT_READDIR) {
-                req = ptlrpc_prep_req2(mdc->mdc_ldlm_client, mdc->mdc_conn,
-                                &mdc->mdc_connh, LDLM_ENQUEUE, 1, size, NULL);
+                req = ptlrpc_prep_req2(cl, connection, rconn,
+                                       LDLM_ENQUEUE, 1, size, NULL);
                 if (!req)
                         RETURN(-ENOMEM);
 
                 /* get ready for the reply */
-                size[0] = sizeof(struct ldlm_reply);
-                req->rq_replen = lustre_msg_size(1, size);
+                req->rq_replen = lustre_msg_size(1, repsize);
         } else {
                 LBUG();
                 RETURN(-1);
         }
 #warning FIXME: the data here needs to be different if a lock was granted for a different inode
-        rc = ldlm_cli_enqueue(mdc->mdc_ldlm_client, mdc->mdc_conn, NULL, req,
+        rc = ldlm_cli_enqueue(cl, connection, rconn, req,
                               obddev->obd_namespace, NULL, res_id, lock_type,
                               NULL, 0, lock_mode, &flags,
                               (void *)mdc_lock_callback, data, datalen, lockh);
@@ -355,21 +400,24 @@ int mdc_enqueue(struct lustre_handle *conn, int lock_type,
 }
 
 int mdc_open(struct lustre_handle *conn, obd_id ino, int type, int flags,
-             struct obdo *obdo,
-             __u64 cookie, __u64 *fh, struct ptlrpc_request **request)
+             struct lov_stripe_md *smd, __u64 cookie, __u64 *fh,
+             struct ptlrpc_request **request)
 {
-        struct mdc_obd *mdc = mdc_conn2mdc(conn);
+        struct ptlrpc_client *cl;
+        struct ptlrpc_connection *connection;
+        struct lustre_handle *rconn;
         struct mds_body *body;
         int rc, size[2] = {sizeof(*body)}, bufcount = 1;
         struct ptlrpc_request *req;
         ENTRY;
 
-        if (obdo != NULL) {
+        if (smd != NULL) {
                 bufcount = 2;
-                size[1] = sizeof(*obdo);
+                size[1] = smd->lmd_size;
         }
 
-        req = ptlrpc_prep_req2(mdc->mdc_client, mdc->mdc_conn, &mdc->mdc_connh,
+        mdc_con2cl(conn, &cl, &connection, &rconn);
+        req = ptlrpc_prep_req2(cl, connection, rconn,
                                MDS_OPEN, bufcount, size, NULL);
         if (!req)
                 GOTO(out, rc = -ENOMEM);
@@ -381,14 +429,13 @@ int mdc_open(struct lustre_handle *conn, obd_id ino, int type, int flags,
         body->flags = HTON__u32(flags);
         body->extra = cookie;
 
-        if (obdo != NULL)
-                memcpy(lustre_msg_buf(req->rq_reqmsg, 1), obdo, sizeof(*obdo));
+        if (smd != NULL)
+                memcpy(lustre_msg_buf(req->rq_reqmsg, 1), smd, smd->lmd_size);
 
         req->rq_replen = lustre_msg_size(1, size);
 
         rc = ptlrpc_queue_wait(req);
         rc = ptlrpc_check_status(req, rc);
-
         if (!rc) {
                 body = lustre_msg_buf(req->rq_repmsg, 0);
                 mds_unpack_body(body);
@@ -404,12 +451,15 @@ int mdc_open(struct lustre_handle *conn, obd_id ino, int type, int flags,
 int mdc_close(struct lustre_handle *conn, 
               obd_id ino, int type, __u64 fh, struct ptlrpc_request **request)
 {
-        struct mdc_obd *mdc = mdc_conn2mdc(conn);
+        struct ptlrpc_client *cl;
+        struct ptlrpc_connection *connection;
+        struct lustre_handle *rconn;
         struct mds_body *body;
         int rc, size = sizeof(*body);
         struct ptlrpc_request *req;
 
-        req = ptlrpc_prep_req2(mdc->mdc_client, mdc->mdc_conn, &mdc->mdc_connh,
+        mdc_con2cl(conn, &cl, &connection, &rconn);
+        req = ptlrpc_prep_req2(cl, connection, rconn,
                                MDS_CLOSE, 1, &size, NULL);
         if (!req)
                 GOTO(out, rc = -ENOMEM);
@@ -432,7 +482,9 @@ int mdc_close(struct lustre_handle *conn,
 int mdc_readpage(struct lustre_handle *conn, obd_id ino, int type, __u64 offset,
                  char *addr, struct ptlrpc_request **request)
 {
-        struct mdc_obd *mdc = mdc_conn2mdc(conn);
+        struct ptlrpc_client *cl;
+        struct ptlrpc_connection *connection;
+        struct lustre_handle *rconn;
         struct ptlrpc_request *req = NULL;
         struct ptlrpc_bulk_desc *desc = NULL;
         struct ptlrpc_bulk_page *bulk = NULL;
@@ -442,11 +494,12 @@ int mdc_readpage(struct lustre_handle *conn, obd_id ino, int type, __u64 offset,
 
         CDEBUG(D_INODE, "inode: %ld\n", (long)ino);
 
-        desc = ptlrpc_prep_bulk(mdc->mdc_conn);
+        mdc_con2cl(conn, &cl, &connection, &rconn);
+        desc = ptlrpc_prep_bulk(connection);
         if (desc == NULL)
                 GOTO(out, rc = -ENOMEM);
 
-        req = ptlrpc_prep_req2(mdc->mdc_client, mdc->mdc_conn, &mdc->mdc_connh,
+        req = ptlrpc_prep_req2(cl, connection, rconn,
                                MDS_READPAGE, 1, &size, NULL);
         if (!req)
                 GOTO(out2, rc = -ENOMEM);
@@ -490,13 +543,16 @@ int mdc_readpage(struct lustre_handle *conn, obd_id ino, int type, __u64 offset,
 int mdc_statfs(struct lustre_handle *conn, struct statfs *sfs,
                struct ptlrpc_request **request)
 {
-        struct mdc_obd *mdc = mdc_conn2mdc(conn);
+        struct ptlrpc_client *cl;
+        struct ptlrpc_connection *connection;
+        struct lustre_handle *rconn;
         struct obd_statfs *osfs;
         struct ptlrpc_request *req;
         int rc, size = sizeof(*osfs);
         ENTRY;
 
-        req = ptlrpc_prep_req2(mdc->mdc_client, mdc->mdc_conn, &mdc->mdc_connh,
+        mdc_con2cl(conn, &cl, &connection, &rconn);
+        req = ptlrpc_prep_req2(cl, connection, rconn,
                                MDS_STATFS, 0, NULL, NULL);
         if (!req)
                 GOTO(out, rc = -ENOMEM);
@@ -524,8 +580,9 @@ static int mdc_ioctl(long cmd, struct lustre_handle *conn, int len, void *karg,
 #if 0
         /* FIXME XXX : This should use the new ioc_data to pass args in */
         int err = 0;
-        struct ptlrpc_client cl;
-        struct ptlrpc_connection *conn;
+        struct ptlrpc_client *cl;
+        struct ptlrpc_connection *connection;
+        struct lustre_handle *rconn;
         struct ptlrpc_request *request;
 
         ENTRY;
@@ -540,12 +597,8 @@ static int mdc_ioctl(long cmd, struct lustre_handle *conn, int len, void *karg,
 
         ptlrpc_init_client(NULL, NULL, 
                            MDS_REQUEST_PORTAL, MDC_REPLY_PORTAL, &cl);
-        connection = ptlrpc_uuid_to_connection("mds");
-        if (!connection) {
-                CERROR("cannot create client\n");
-                RETURN(-EINVAL);
-        }
 
+        mdc_con2cl(conn, &cl, &connection, &rconn);
         switch (cmd) {
         case IOC_REQUEST_GETATTR: {
                 CERROR("-- getting attr for ino %lu\n", arg);
@@ -692,6 +745,7 @@ static int mdc_setup(struct obd_device *obddev, obd_count len, void *buf)
                            mdc->mdc_ldlm_client);
         mdc->mdc_client->cli_name = "mdc";
         mdc->mdc_ldlm_client->cli_name = "ldlm";
+        mdc->mdc_max_mdsize = sizeof(struct lov_stripe_md);
         /* XXX get recovery hooked in here again */
         //ptlrpc_init_client(ptlrpc_connmgr, ll_recover,...
 
@@ -749,14 +803,17 @@ static int mdc_connect(struct lustre_handle *conn, struct obd_device *obd)
 
         request->rq_level = LUSTRE_CONN_NEW;
         request->rq_replen = lustre_msg_size(0, NULL);
+        /* Sending our local connection info breaks for local connections
+        request->rq_reqmsg->addr = conn->addr;
+        request->rq_reqmsg->cookie = conn->cookie;
+         */
 
         rc = ptlrpc_queue_wait(request);
         rc = ptlrpc_check_status(request, rc);
         if (rc)
                 GOTO(out, rc);
 
-        mdc->mdc_connh.addr = request->rq_repmsg->addr;
-        mdc->mdc_connh.cookie = request->rq_repmsg->cookie;
+        class_rconn2export(conn, (struct lustre_handle *)request->rq_repmsg);
 
         EXIT;
  out:
@@ -771,15 +828,18 @@ static int mdc_connect(struct lustre_handle *conn, struct obd_device *obd)
 
 static int mdc_disconnect(struct lustre_handle *conn)
 {
-        struct mdc_obd *mdc = mdc_conn2mdc(conn);
+        struct ptlrpc_client *cl;
+        struct ptlrpc_connection *connection;
+        struct lustre_handle *rconn;
         struct obd_device *obd = class_conn2obd(conn);
         struct ptlrpc_request *request;
         int rc;
         ENTRY;
 
         ldlm_namespace_free(obd->obd_namespace);
-        request = ptlrpc_prep_req2(mdc->mdc_client, mdc->mdc_conn, 
-                                   &mdc->mdc_connh, MDS_DISCONNECT, 0, NULL, NULL);
+        mdc_con2cl(conn, &cl, &connection, &rconn);
+        request = ptlrpc_prep_req2(cl, connection, rconn,
+                                   MDS_DISCONNECT, 0, NULL, NULL);
         if (!request)
                 RETURN(-ENOMEM);
 
@@ -819,6 +879,7 @@ MODULE_DESCRIPTION("Lustre Metadata Client v1.0");
 MODULE_LICENSE("GPL");
 
 EXPORT_SYMBOL(mdc_getstatus);
+EXPORT_SYMBOL(mdc_getlovinfo);
 EXPORT_SYMBOL(mdc_enqueue);
 EXPORT_SYMBOL(mdc_getattr);
 EXPORT_SYMBOL(mdc_statfs);