- this makes separate opcodes out of OST_BRW: OST_WRITE and OST_READ
- documentation updates, still in progress for 0.5.1
__u64 cookie; /* security token */
__u32 magic;
__u32 version;
__u64 cookie; /* security token */
__u32 magic;
__u32 version;
__u64 last_rcvd;
__u64 last_committed;
__u64 transno;
__u64 last_rcvd;
__u64 last_committed;
__u64 transno;
__u32 status;
__u32 type;
__u32 bufcount;
__u32 status;
__u32 type;
__u32 bufcount;
#define OST_REPLY 0 /* reply ? */
#define OST_GETATTR 1
#define OST_SETATTR 2
#define OST_REPLY 0 /* reply ? */
#define OST_GETATTR 1
#define OST_SETATTR 2
-#define OST_BRW 3
-#define OST_CREATE 4
-#define OST_DESTROY 5
-#define OST_GET_INFO 6
-#define OST_CONNECT 7
-#define OST_DISCONNECT 8
-#define OST_PUNCH 9
-#define OST_OPEN 10
-#define OST_CLOSE 11
-#define OST_STATFS 12
+#define OST_READ 3
+#define OST_WRITE 4
+#define OST_CREATE 5
+#define OST_DESTROY 6
+#define OST_GET_INFO 7
+#define OST_CONNECT 8
+#define OST_DISCONNECT 9
+#define OST_PUNCH 10
+#define OST_OPEN 11
+#define OST_CLOSE 12
+#define OST_STATFS 13
#define OST_REQ_HAS_OA1 0x1
struct ost_body {
#define OST_REQ_HAS_OA1 0x1
struct ost_body {
- __u32 connid;
- __u32 data;
osc_con2cl(conn, &cl, &connection, &rconn);
request = ptlrpc_prep_req2(cl, connection, rconn,
osc_con2cl(conn, &cl, &connection, &rconn);
request = ptlrpc_prep_req2(cl, connection, rconn,
- OST_BRW, 3, size, NULL);
+ OST_READ, 3, size, NULL);
if (!request)
RETURN(-ENOMEM);
body = lustre_msg_buf(request->rq_reqmsg, 0);
if (!request)
RETURN(-ENOMEM);
body = lustre_msg_buf(request->rq_reqmsg, 0);
- body->data = OBD_BRW_READ;
desc = ptlrpc_prep_bulk(connection);
if (!desc)
desc = ptlrpc_prep_bulk(connection);
if (!desc)
osc_con2cl(conn, &cl, &connection, &rconn);
request = ptlrpc_prep_req2(cl, connection, rconn,
osc_con2cl(conn, &cl, &connection, &rconn);
request = ptlrpc_prep_req2(cl, connection, rconn,
- OST_BRW, 3, size, NULL);
+ OST_WRITE, 3, size, NULL);
if (!request)
RETURN(-ENOMEM);
body = lustre_msg_buf(request->rq_reqmsg, 0);
if (!request)
RETURN(-ENOMEM);
body = lustre_msg_buf(request->rq_reqmsg, 0);
- body->data = OBD_BRW_WRITE;
desc = ptlrpc_prep_bulk(connection);
if (!desc)
desc = ptlrpc_prep_bulk(connection);
if (!desc)
end2 = (char *)tmp2 + req->rq_reqmsg->buflens[2];
objcount = req->rq_reqmsg->buflens[1] / sizeof(*ioo);
niocount = req->rq_reqmsg->buflens[2] / sizeof(*remote_nb);
end2 = (char *)tmp2 + req->rq_reqmsg->buflens[2];
objcount = req->rq_reqmsg->buflens[1] / sizeof(*ioo);
niocount = req->rq_reqmsg->buflens[2] / sizeof(*remote_nb);
for (i = 0; i < objcount; i++) {
ost_unpack_ioo(&tmp1, &ioo);
for (i = 0; i < objcount; i++) {
ost_unpack_ioo(&tmp1, &ioo);
end2 = (char *)tmp2 + req->rq_reqmsg->buflens[2];
objcount = req->rq_reqmsg->buflens[1] / sizeof(*ioo);
niocount = req->rq_reqmsg->buflens[2] / sizeof(*remote_nb);
end2 = (char *)tmp2 + req->rq_reqmsg->buflens[2];
objcount = req->rq_reqmsg->buflens[1] / sizeof(*ioo);
niocount = req->rq_reqmsg->buflens[2] / sizeof(*remote_nb);
for (i = 0; i < objcount; i++) {
ost_unpack_ioo((void *)&tmp1, &ioo);
for (i = 0; i < objcount; i++) {
ost_unpack_ioo((void *)&tmp1, &ioo);
-static int ost_brw(struct ptlrpc_request *req)
-{
- struct ost_body *body = lustre_msg_buf(req->rq_reqmsg, 0);
-
- if (body->data & OBD_BRW_WRITE)
- return ost_brw_write(req);
- else
- return ost_brw_read(req);
-}
-
-
static int ost_handle(struct ptlrpc_request *req)
{
int rc;
static int ost_handle(struct ptlrpc_request *req)
{
int rc;
OBD_FAIL_RETURN(OBD_FAIL_OST_CLOSE_NET, 0);
rc = ost_close(req);
break;
OBD_FAIL_RETURN(OBD_FAIL_OST_CLOSE_NET, 0);
rc = ost_close(req);
break;
- case OST_BRW:
- CDEBUG(D_INODE, "brw\n");
+ case OST_WRITE:
+ CDEBUG(D_INODE, "write\n");
+ OBD_FAIL_RETURN(OBD_FAIL_OST_BRW_NET, 0);
+ rc = ost_brw_write(req);
+ /* ost_brw sends its own replies */
+ RETURN(rc);
+ case OST_READ:
+ CDEBUG(D_INODE, "read\n");
OBD_FAIL_RETURN(OBD_FAIL_OST_BRW_NET, 0);
OBD_FAIL_RETURN(OBD_FAIL_OST_BRW_NET, 0);
+ rc = ost_brw_read(req);
/* ost_brw sends its own replies */
RETURN(rc);
case OST_PUNCH:
/* ost_brw sends its own replies */
RETURN(rc);
case OST_PUNCH: