Whamcloud - gitweb
LU-884 osc: remove unlikely() marker for checksums
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 25 Feb 2012 23:06:39 +0000 (16:06 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 29 Mar 2012 04:11:15 +0000 (00:11 -0400)
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 <adilger@whamcloud.com>
Change-Id: Ib1d5c09da732224dfd331c1ce07a252a441ed549
Reviewed-on: http://review.whamcloud.com/2197
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osc/osc_request.c
lustre/ost/ost_handler.c

index 67f9673..6d87a0a 100644 (file)
@@ -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;
index 52b1366..16d7201 100644 (file)
@@ -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;