From 6e8d523315900cfdf44e311badb34cf5cfdfdaf9 Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 23 Apr 2002 07:36:15 +0000 Subject: [PATCH] Cleanup - avoid extraneous indirection in ost_brw_write_cb(). --- lustre/ost/ost_handler.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index ec2c30e..00971b0 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -329,8 +329,8 @@ static int ost_brw_read(struct ost_obd *obddev, struct ptlrpc_request *req) GOTO(out, 0); OBD_FREE(bulk, sizeof(*bulk)); - bulk = NULL; } + bulk = NULL; /* The unpackers move tmp1 and tmp2, so reset them before using */ tmp1 = lustre_msg_buf(req->rq_reqmsg, 1); @@ -387,11 +387,11 @@ static int ost_brw_write_cb(struct ptlrpc_bulk_desc *bulk, void *data) static int ost_brw_write(struct ost_obd *obddev, struct ptlrpc_request *req) { struct obd_conn conn; - struct niobuf *nb, *dst; + struct niobuf *nb, *res; struct obd_ioobj *ioo; struct ost_body *body; int cmd, rc, i, j, objcount, niocount, size[2] = {sizeof(*body)}; - void *tmp1, *tmp2, *end2, *res; + void *tmp1, *tmp2, *end2; ENTRY; body = lustre_msg_buf(req->rq_reqmsg, 0); @@ -431,7 +431,7 @@ static int ost_brw_write(struct ost_obd *obddev, struct ptlrpc_request *req) if (req->rq_status) GOTO(out, 0); - for (i = 0; i < niocount; i++) { + for (i = 0; i < niocount; i++, res++) { struct ptlrpc_bulk_desc *bulk; struct ptlrpc_service *srv = req->rq_obd->u.ost.ost_service; @@ -443,12 +443,11 @@ static int ost_brw_write(struct ost_obd *obddev, struct ptlrpc_request *req) bulk->b_xid = srv->srv_xid++; spin_unlock(&srv->srv_lock); - dst = &(((struct niobuf *)res)[i]); - dst->xid = HTON__u32(bulk->b_xid); + res->xid = HTON__u32(bulk->b_xid); - bulk->b_buf = (void *)(unsigned long)dst->addr; + bulk->b_buf = (void *)(unsigned long)res->addr; bulk->b_cb = ost_brw_write_cb; - bulk->b_page = dst->page; + bulk->b_page = res->page; memcpy(&(bulk->b_conn), &conn, sizeof(conn)); bulk->b_buflen = PAGE_SIZE; bulk->b_portal = OSC_BULK_PORTAL; -- 1.8.3.1