From: Andreas Dilger Date: Sat, 25 Feb 2012 23:06:39 +0000 (-0700) Subject: LU-884 osc: remove unlikely() marker for checksums X-Git-Tag: 2.2.51~31 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=c1e490a9db157f3947f51750b6975e10ea515be3 LU-884 osc: remove unlikely() marker for checksums When the bulk RPC checksums were originally introduced they were disabled by default, and marked with an unlikely() annotation for the compiler to optimize branch prediction. Checksums are now enabled by default, so this compiler annotation is incorrect. Signed-off-by: Andreas Dilger Change-Id: Ib1d5c09da732224dfd331c1ce07a252a441ed549 Reviewed-on: http://review.whamcloud.com/2197 Reviewed-by: Jinshan Xiong Reviewed-by: Johann Lombardi Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 67f9673..6d87a0a 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1420,7 +1420,7 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,struct obdo *oa, /* size[REQ_REC_OFF] still sizeof (*body) */ if (opc == OST_WRITE) { - if (unlikely(cli->cl_checksum) && + if (cli->cl_checksum && !sptlrpc_flavor_has_bulk(&req->rq_flvr)) { /* store cl_cksum_type in a local variable since * it can be changed via lprocfs */ @@ -1451,7 +1451,7 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,struct obdo *oa, req_capsule_set_size(pill, &RMF_RCS, RCL_SERVER, sizeof(__u32) * niocount); } else { - if (unlikely(cli->cl_checksum) && + if (cli->cl_checksum && !sptlrpc_flavor_has_bulk(&req->rq_flvr)) { if ((body->oa.o_valid & OBD_MD_FLFLAGS) == 0) body->oa.o_flags = 0; diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 52b1366..16d7201 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -998,7 +998,7 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti) no_reply = rc != 0; skip_transfer: - if (unlikely(client_cksum != 0 && rc == 0)) { + if (client_cksum != 0 && rc == 0) { static int cksum_counter; repbody->oa.o_valid |= OBD_MD_FLCKSUM | OBD_MD_FLFLAGS; repbody->oa.o_flags &= ~OBD_FL_CKSUM_ALL; @@ -1039,7 +1039,7 @@ skip_transfer: */ repbody->oa.o_valid &= ~(OBD_MD_FLMTIME | OBD_MD_FLATIME); - if (unlikely(client_cksum != server_cksum && rc == 0 && !mmap)) { + if (unlikely(client_cksum != server_cksum && rc == 0 && !mmap)) { int new_cksum = ost_checksum_bulk(desc, OST_WRITE, cksum_type); char *msg; char *via;