hammer2 - Adjust LNK_SPAN/LNK_CONN
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 7 Aug 2012 19:38:33 +0000 (12:38 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 7 Aug 2012 19:38:33 +0000 (12:38 -0700)
* Adjust the SPAN and CONN structures, rename 'weight' to 'dist' (for
  distance).

sys/vfs/hammer2/hammer2_network.h
sys/vfs/hammer2/hammer2_vfsops.c

index 95305b8..fb7b370 100644 (file)
@@ -46,7 +46,7 @@
  * levels of interconnectedness, forming a graph.  The spanning tree protocol
  * running on each node transmits a LNK_SPAN transactional message to the
  * other end.  The protocol collects LNK_SPAN messages from all sources,
- * aggregates them using a shortest-weighted-path algorithm, and transmits
+ * aggregates them using a shortest-distance-path algorithm, and transmits
  * them over each link as well, creating a multplication within the topology.
  *
  * Any node in the graph may transmit a message to any other node by using
@@ -367,7 +367,7 @@ struct hammer2_lnk_conn {
        uint16_t        proto_version;  /* high level protocol support */
        uint32_t        status;         /* status flags */
        uint8_t         reserved02[8];
-       int32_t         weight;         /* span weight */
+       int32_t         dist;           /* span distance */
        uint32_t        reserved03[15];
        char            label[256];     /* PFS label (can be wildcard) */
 };
@@ -425,7 +425,7 @@ struct hammer2_lnk_span {
        uint16_t        proto_version;  /* high level protocol support */
        uint32_t        status;         /* status flags */
        uint8_t         reserved02[8];
-       int32_t         weight;         /* span weight */
+       int32_t         dist;           /* span distance */
        uint32_t        reserved03[15];
        char            label[256];     /* PFS label (can be wildcard) */
 };
index 7c6b3d4..e5a4e46 100644 (file)
@@ -1206,8 +1206,10 @@ hammer2_cluster_thread_wr(void *arg)
                                lockmgr(&pmp->msglk, LK_EXCLUSIVE);
                                continue;
                        }
-                       if (error)
+                       if (error) {
+                               lockmgr(&pmp->msglk, LK_EXCLUSIVE);
                                break;
+                       }
 
                        /*
                         * Dump the message to the pipe or socket.