Whamcloud - gitweb
Branch HEAD
authorbwzhou <bwzhou>
Tue, 18 Mar 2008 07:30:54 +0000 (07:30 +0000)
committerbwzhou <bwzhou>
Tue, 18 Mar 2008 07:30:54 +0000 (07:30 +0000)
b=13285
r=johann, nathan

cid-290.diff - fixes some oti_init to return earlier if NULL value

lustre/include/obd.h

index 953192c..2f4f771 100644 (file)
@@ -748,17 +748,18 @@ static inline void oti_init(struct obd_trans_info *oti,
 {
         if (oti == NULL)
                 return;
-        memset(oti, 0, sizeof *oti);
+        memset(oti, 0, sizeof(*oti));
 
         if (req == NULL)
                 return;
 
         oti->oti_xid = req->rq_xid;
 
-        if (req->rq_repmsg && req->rq_reqmsg != 0)
+        if (req->rq_repmsg != NULL)
                 oti->oti_transno = lustre_msg_get_transno(req->rq_repmsg);
         oti->oti_thread_id = req->rq_svc_thread ? req->rq_svc_thread->t_id : -1;
-        oti->oti_conn_cnt = lustre_msg_get_conn_cnt(req->rq_reqmsg);
+        if (req->rq_reqmsg != NULL)
+                oti->oti_conn_cnt = lustre_msg_get_conn_cnt(req->rq_reqmsg);
 }
 
 static inline void oti_alloc_cookies(struct obd_trans_info *oti,int num_cookies)