]> git.ipfire.org Git - people/ms/linux.git/blobdiff - fs/ocfs2/heartbeat.c
Merge branch 'for-6.0/dax' into libnvdimm-fixes
[people/ms/linux.git] / fs / ocfs2 / heartbeat.c
index 9099d8fc7599997699433a2c786b8a52b3bb54c0..22da768e65b7ced822eb206736fd793809502640 100644 (file)
@@ -2,12 +2,13 @@
 /*
  * heartbeat.c
  *
- * Register ourselves with the heartbaet service, keep our node maps
+ * Register ourselves with the heartbeat service, keep our node maps
  * up to date, and fire off recovery when needed.
  *
  * Copyright (C) 2002, 2004 Oracle.  All rights reserved.
  */
 
+#include <linux/bitmap.h>
 #include <linux/fs.h>
 #include <linux/types.h>
 #include <linux/highmem.h>
 
 #include "buffer_head_io.h"
 
-static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map,
-                                           int bit);
-static inline void __ocfs2_node_map_clear_bit(struct ocfs2_node_map *map,
-                                             int bit);
-
 /* special case -1 for now
  * TODO: should *really* make sure the calling func never passes -1!!  */
 static void ocfs2_node_map_init(struct ocfs2_node_map *map)
 {
        map->num_nodes = OCFS2_NODE_MAP_MAX_NODES;
-       memset(map->map, 0, BITS_TO_LONGS(OCFS2_NODE_MAP_MAX_NODES) *
-              sizeof(unsigned long));
+       bitmap_zero(map->map, OCFS2_NODE_MAP_MAX_NODES);
 }
 
 void ocfs2_init_node_maps(struct ocfs2_super *osb)
@@ -65,12 +60,6 @@ void ocfs2_do_node_down(int node_num, void *data)
        ocfs2_recovery_thread(osb, node_num);
 }
 
-static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map,
-                                           int bit)
-{
-       set_bit(bit, map->map);
-}
-
 void ocfs2_node_map_set_bit(struct ocfs2_super *osb,
                            struct ocfs2_node_map *map,
                            int bit)
@@ -79,16 +68,10 @@ void ocfs2_node_map_set_bit(struct ocfs2_super *osb,
                return;
        BUG_ON(bit >= map->num_nodes);
        spin_lock(&osb->node_map_lock);
-       __ocfs2_node_map_set_bit(map, bit);
+       set_bit(bit, map->map);
        spin_unlock(&osb->node_map_lock);
 }
 
-static inline void __ocfs2_node_map_clear_bit(struct ocfs2_node_map *map,
-                                             int bit)
-{
-       clear_bit(bit, map->map);
-}
-
 void ocfs2_node_map_clear_bit(struct ocfs2_super *osb,
                              struct ocfs2_node_map *map,
                              int bit)
@@ -97,7 +80,7 @@ void ocfs2_node_map_clear_bit(struct ocfs2_super *osb,
                return;
        BUG_ON(bit >= map->num_nodes);
        spin_lock(&osb->node_map_lock);
-       __ocfs2_node_map_clear_bit(map, bit);
+       clear_bit(bit, map->map);
        spin_unlock(&osb->node_map_lock);
 }