(*hdr)->type = OST_TYPE_REQ;
- req->buflen1 = NTOH__u32(buflen1);
+ req->buflen1 = HTON__u32(buflen1);
if (buf1) {
LOGL(buf1, buflen1, ptr);
}
- req->buflen2 = NTOH__u32(buflen2);
+ req->buflen2 = HTON__u32(buflen2);
if (buf2) {
LOGL(buf2, buflen2, ptr);
}
ptr = *buf + sizeof(**hdr) + sizeof(*rep);
- rep->buflen1 = NTOH__u32(buflen1);
+ rep->buflen1 = HTON__u32(buflen1);
if (buf1) {
LOGL(buf1, buflen1, ptr);
- }
+ } else {
+ ptr += size_round(buflen1);
+ }
- rep->buflen2 = NTOH__u32(buflen2);
+ rep->buflen2 = HTON__u32(buflen2);
if (buf2) {
LOGL(buf2, buflen2, ptr);
}
{
struct obd_ioobj *ioo = *tmp;
char *c = *tmp;
-
- ioo->ioo_id = NTOH__u64(oa->o_id);
- ioo->ioo_gr = NTOH__u64(oa->o_gr);
- ioo->ioo_type = NTOH__u64(oa->o_mode);
- ioo->ioo_bufcnt = NTOH__u32(bufcnt);
+
+ ioo->ioo_id = HTON__u64(oa->o_id);
+ ioo->ioo_gr = HTON__u64(oa->o_gr);
+ ioo->ioo_type = HTON__u64(oa->o_mode);
+ ioo->ioo_bufcnt = HTON__u32(bufcnt);
*tmp = c + sizeof(*ioo);
}
char *c = *tmp;
struct obd_ioobj *ioo = *tmp;
*ioop = *tmp;
-
+
ioo->ioo_id = NTOH__u64(ioo->ioo_id);
ioo->ioo_gr = NTOH__u64(ioo->ioo_gr);
ioo->ioo_type = NTOH__u64(ioo->ioo_type);
struct niobuf *ioo = *tmp;
char *c = *tmp;
- ioo->addr = NTOH__u64((__u64)(unsigned long)addr);
- ioo->offset = NTOH__u64(offset);
- ioo->len = NTOH__u32(len);
- ioo->flags = NTOH__u32(flags);
- ioo->xid = NTOH__u32(xid);
+ if ((offset >> 32) != 0)
+ BUG();
+
+ ioo->addr = HTON__u64((__u64)(unsigned long)addr);
+ ioo->offset = HTON__u64(offset);
+ ioo->len = HTON__u32(len);
+ ioo->flags = HTON__u32(flags);
+ ioo->xid = HTON__u32(xid);
*tmp = c + sizeof(*ioo);
}
nb->len = NTOH__u32(nb->len);
nb->flags = NTOH__u32(nb->flags);
+ if ((nb->offset >> 32) != 0)
+ BUG();
+
*tmp = c + sizeof(*nb);
}
fail:
SetPageChecked(page);
SetPageError(page);
+ BUG();
}
static struct page * ext2_get_page(struct inode *dir, unsigned long n)
/* mount the file system (secretly) */
-static int mds_setup(struct obd_device *obddev, obd_count len,
- void *buf)
+static int mds_setup(struct obd_device *obddev, obd_count len, void *buf)
{
struct obd_ioctl_data* data = buf;
struct mds_obd *mds = &obddev->u.mds;
mnt = do_kern_mount(data->ioc_inlbuf2, 0, data->ioc_inlbuf1, NULL);
err = PTR_ERR(mnt);
- if (IS_ERR(mnt)) {
+ if (IS_ERR(mnt)) {
+ CERROR("do_kern_mount failed: %d\n", err);
EXIT;
return err;
}
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
- * Copryright (C) 2001 Cluster File Systems, Inc.
+ * Copryright (C) 2001, 2002 Cluster File Systems, Inc.
*
* This code is issued under the GNU General Public License.
* See the file COPYING in this distribution
if (req->rq_flags != PTL_RPC_REPLY) {
CERROR("Unknown reason for wakeup\n");
+ BUG();
EXIT;
return -EINTR;
}
}
service->srv_me_active = NEXT_INDEX(service->srv_me_active,
- service->srv_ring_length);
+ service->srv_ring_length);
if (service->srv_me_h[service->srv_me_active] == 0)
CERROR("All %d ring ME's are unlinked!\n",
return 0;
}
-
static int bulk_source_callback(ptl_event_t *ev, void *data)
{
struct ptlrpc_bulk_desc *bulk = ev->mem_desc.user_ptr;
rc = PtlMDBind(peer->peer_ni, request->rq_req_md, &md_h);
if (rc != 0) {
- BUG();
CERROR("PtlMDBind failed: %d\n", rc);
+ BUG();
return rc;
}
rc = PtlPut(md_h, ack, remote_id, portal, 0, request->rq_xid, 0, 0);
if (rc != PTL_OK) {
- BUG();
CERROR("PtlPut(%d, %d, %d) failed: %d\n", remote_id.nid,
portal, request->rq_xid, rc);
/* FIXME: tear down md */
+ BUG();
}
return rc;
rc = PtlMDBind(bulk->b_peer.peer_ni, bulk->b_md, &md_h);
if (rc != 0) {
- BUG();
CERROR("PtlMDBind failed: %d\n", rc);
+ BUG();
return rc;
}
rc = PtlPut(md_h, PTL_ACK_REQ, remote_id, portal, 0, bulk->b_xid, 0, 0);
if (rc != PTL_OK) {
- BUG();
CERROR("PtlPut(%d, %d, %d) failed: %d\n", remote_id.nid,
portal, bulk->b_xid, rc);
- /* FIXME: tear down md */
+ PtlMDUnlink(md_h);
+ BUG();
}
return rc;
return 0;
cleanup2:
- EXIT;
PtlMEUnlink(bulk->b_me_h);
cleanup1:
PtlMDUnlink(bulk->b_md_h);
- EXIT;
return rc;
}
CDEBUG(D_INFO, "Attach MD in ring, rc %d\n", rc);
if (rc != PTL_OK) {
/* XXX cleanup */
- BUG();
CERROR("PtlMDAttach failed: %d\n", rc);
+ BUG();
return rc;
}
static int ptlrpc_check_event(struct ptlrpc_service *svc)
{
-
if (sigismember(&(current->pending.signal), SIGKILL) ||
sigismember(&(current->pending.signal), SIGINT)) {
svc->srv_flags |= SVC_KILLED;
return 1;
}
+ if (svc->srv_flags & SVC_EVENT)
+ BUG();
+
if ( svc->srv_eq_h ) {
int rc;
rc = PtlEQGet(svc->srv_eq_h, &svc->srv_ev);
EXIT;
return 1;
}
-
+
EXIT;
return 0;
}
/* And now, loop forever on requests */
while (1) {
-
wait_event(svc->srv_waitq, ptlrpc_check_event(svc));
if (svc->srv_flags & SVC_SIGNAL) {
* mds_handle instead. */
memset(&request, 0, sizeof(request));
request.rq_obd = obddev;
- request.rq_reqbuf = svc->srv_ev.mem_desc.start + svc->srv_ev.offset;
+ request.rq_reqbuf = (svc->srv_ev.mem_desc.start +
+ svc->srv_ev.offset);
request.rq_reqlen = svc->srv_ev.mem_desc.length;
request.rq_xid = svc->srv_ev.match_bits;
CDEBUG(D_NET, "got req %d\n", request.rq_xid);
request.rq_peer.peer_ni = svc->srv_self.peer_ni;
rc = svc->srv_handler(obddev, svc, &request);
ptl_received_rpc(svc);
+ svc->srv_flags &= ~SVC_EVENT;
continue;
}
return rc;
}
+ CDEBUG(D_NET, "Starting service listening on portal %d\n",
+ service->srv_req_portal);
+
/* Attach the leading ME on which we build the ring */
rc = PtlMEAttach(peer.peer_ni, service->srv_req_portal,
service->srv_id, 0, ~0, PTL_RETAIN,
return 0;
}
-
new_fs ${MDSFS} /tmp/mds 10000
MDS=$LOOPDEV
-mknod /dev/obd c 10 241
echo 0xffffffff > /proc/sys/portals/debug
$R/usr/src/obd/utils/obdctl <<EOF