Whamcloud - gitweb
LU-6163 kernel: use do_div64() for 64 bit divides
[fs/lustre-release.git] / lnet / klnds / o2iblnd / o2iblnd.c
index 4d25dd4..d13ace0 100644 (file)
@@ -675,6 +675,7 @@ kiblnd_get_completion_vector(kib_conn_t *conn, int cpt)
        int             vectors;
        int             off;
        int             i;
+       lnet_nid_t      ibp_nid;
 
        vectors = conn->ibc_cmid->device->num_comp_vectors;
        if (vectors <= 1)
@@ -683,7 +684,8 @@ kiblnd_get_completion_vector(kib_conn_t *conn, int cpt)
        mask = cfs_cpt_cpumask(lnet_cpt_table(), cpt);
 
        /* hash NID to CPU id in this partition... */
-       off = conn->ibc_peer->ibp_nid % cpumask_weight(mask);
+       ibp_nid = conn->ibc_peer->ibp_nid;
+       off = do_div(ibp_nid, cpumask_weight(mask));
        for_each_cpu(i, mask) {
                if (off-- == 0)
                        return i % vectors;