From 83290b574c610937167bbc811a323c7cc604a397 Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 21 Jun 2002 06:35:54 +0000 Subject: [PATCH] Merge from posix_stable --- lustre/osc/osc_request.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 82a28eb..93229b3 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -628,7 +628,7 @@ static int osc_brw_write(struct obd_conn *conn, obd_count num_oa, return rc; } -static int osc_brw(int rw, struct obd_conn *conn, obd_count num_oa, +static int osc_brw(int cmd, struct obd_conn *conn, obd_count num_oa, struct obdo **oa, obd_count *oa_bufs, struct page **buf, obd_size *count, obd_off *offset, obd_flag *flags, void *callback) @@ -636,12 +636,12 @@ static int osc_brw(int rw, struct obd_conn *conn, obd_count num_oa, if (num_oa != 1) LBUG(); - if (rw == OBD_BRW_READ) - return osc_brw_read(conn, num_oa, oa, oa_bufs, buf, count, - offset, flags, (bulk_callback_t)callback); - else + if (cmd & OBD_BRW_WRITE) return osc_brw_write(conn, num_oa, oa, oa_bufs, buf, count, offset, flags, (bulk_callback_t)callback); + else + return osc_brw_read(conn, num_oa, oa, oa_bufs, buf, count, + offset, flags, (bulk_callback_t)callback); } static int osc_enqueue(struct obd_conn *oconn, @@ -804,25 +804,20 @@ static int osc_cleanup(struct obd_device * obddev) } #if 0 -static int osc_statfs(struct obd_conn *conn, struct statfs *statfs); +static int osc_statfs(struct obd_conn *conn, struct statfs *sfs); { struct ptlrpc_request *request; struct ptlrpc_client *cl; struct ptlrpc_connection *connection; - struct ost_body *body; - int rc, size = sizeof(*body); + struct obd_statfs *osfs; + int rc, size = sizeof(*osfs); ENTRY; osc_con2cl(conn, &cl, &connection); - request = ptlrpc_prep_req(cl, connection, OST_STATFS, 1, &size, NULL); + request = ptlrpc_prep_req(cl, connection, OST_STATFS, 0, NULL, NULL); if (!request) RETURN(-ENOMEM); - body = lustre_msg_buf(request->rq_reqmsg, 0); - memcpy(&body->oa, oa, sizeof(*oa)); - body->oa.o_valid = ~0; - body->connid = conn->oc_id; - request->rq_replen = lustre_msg_size(1, &size); rc = ptlrpc_queue_wait(request); @@ -830,8 +825,8 @@ static int osc_statfs(struct obd_conn *conn, struct statfs *statfs); if (rc) GOTO(out, rc); - body = lustre_msg_buf(request->rq_repmsg, 0); - memcpy(oa, &body->oa, sizeof(*oa)); + osfs = lustre_msg_buf(request->rq_repmsg, 0); + obd_statfs_unpack(sfs, osfs); EXIT; out: -- 1.8.3.1