]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ocfs2/stackglue.c
ocfs2: Abstract out node number queries.
[linux-2.6-omap-h63xx.git] / fs / ocfs2 / stackglue.c
index f6f309a083443d90ca924991a9e65649de44eebf..814686356cc6cee37e909d85b66a71ad0ed2cc3d 100644 (file)
@@ -25,6 +25,8 @@
 #include <linux/fs.h>
 
 #include "cluster/masklog.h"
+#include "cluster/nodemanager.h"
+
 #include "stackglue.h"
 
 static struct ocfs2_locking_protocol *lproto;
@@ -371,6 +373,21 @@ int ocfs2_cluster_disconnect(struct ocfs2_cluster_connection *conn)
        return 0;
 }
 
+int ocfs2_cluster_this_node(unsigned int *node)
+{
+       int node_num;
+
+       node_num = o2nm_this_node();
+       if (node_num == O2NM_INVALID_NODE_NUM)
+               return -ENOENT;
+
+       if (node_num >= O2NM_MAX_NODES)
+               return -EOVERFLOW;
+
+       *node = node_num;
+       return 0;
+}
+
 void o2cb_get_stack(struct ocfs2_locking_protocol *proto)
 {
        BUG_ON(proto == NULL);