Whamcloud - gitweb
ptlrpc: mark branches in hot path as unlikely()
authornikita <nikita>
Thu, 12 Oct 2006 20:18:02 +0000 (20:18 +0000)
committernikita <nikita>
Thu, 12 Oct 2006 20:18:02 +0000 (20:18 +0000)
lustre/ptlrpc/pack_generic.c

index a83cc98..9bd9388 100644 (file)
@@ -421,14 +421,14 @@ void *lustre_msg_buf_v1(void *msg, int n, int min_size)
         LASSERT(n >= 0);
 
         bufcount = m->lm_bufcount;
-        if (n >= bufcount) {
+        if (unlikely(n >= bufcount)) {
                 CDEBUG(D_INFO, "msg %p buffer[%d] not present (count %d)\n",
                        m, n, bufcount);
                 return NULL;
         }
 
         buflen = m->lm_buflens[n];
-        if (buflen < min_size) {
+        if (unlikely(buflen < min_size)) {
                 CERROR("msg %p buffer[%d] size %d too small (required %d)\n",
                        m, n, buflen, min_size);
                 LBUG();