Whamcloud - gitweb
LU-15098 tests: sanity-sec 27a exec commands on right node
[fs/lustre-release.git] / lustre / ptlrpc / nodemap_internal.h
index f447eef..41c0bb0 100644 (file)
@@ -22,7 +22,7 @@
 /*
  * Copyright (C) 2013, Trustees of Indiana University
  *
- * Copyright (c) 2013, 2014, Intel Corporation.
+ * Copyright (c) 2013, 2017, Intel Corporation.
  *
  * Author: Joshua Walgenbach <jjw@iu.edu>
  */
 #define _NODEMAP_INTERNAL_H
 
 #include <lustre_nodemap.h>
-#include <interval_tree.h>
+#include <linux/rbtree.h>
 
 #define DEFAULT_NODEMAP "default"
 
-/* Turn on proc debug interface to allow OSS and
- * MDS nodes to configure nodemap independently of
- * MGS (since the nodemap distribution is not written
- * yet */
-#define NODEMAP_PROC_DEBUG 1
-
-/* Default nobody uid and gid values */
-
+/* Default nobody uid, gid and projid values */
 #define NODEMAP_NOBODY_UID 99
 #define NODEMAP_NOBODY_GID 99
+#define NODEMAP_NOBODY_PROJID 99
 
 struct lprocfs_static_vars;
 
@@ -64,7 +58,10 @@ struct lu_nid_range {
        /* list for nodemap */
        struct list_head         rn_list;
        /* nid interval tree */
-       struct interval_node     rn_node;
+       lnet_nid_t               rn_start,
+                                rn_end,
+                                rn_subtree_last;
+       struct rb_node           rn_rb;
 };
 
 struct lu_idmap {
@@ -94,6 +91,7 @@ enum nodemap_idx_type {
        NODEMAP_RANGE_IDX = 2,          /* nid range assigned to a nm cluster */
        NODEMAP_UIDMAP_IDX = 3,         /* uid map assigned to a nm cluster */
        NODEMAP_GIDMAP_IDX = 4,         /* gid map assigned to a nm cluster */
+       NODEMAP_PROJIDMAP_IDX = 5,      /* projid map assigned to nm cluster */
        NODEMAP_GLOBAL_IDX = 15,        /* stores nodemap activation status */
 };
 
@@ -141,8 +139,9 @@ int range_parse_nidstring(char *range_string, lnet_nid_t *start_nid,
                          lnet_nid_t *end_nid);
 void range_init_tree(void);
 struct lu_idmap *idmap_create(__u32 client_id, __u32 fs_id);
-void idmap_insert(enum nodemap_id_type id_type, struct lu_idmap *idmap,
-                struct lu_nodemap *nodemap);
+struct lu_idmap *idmap_insert(enum nodemap_id_type id_type,
+                             struct lu_idmap *idmap,
+                             struct lu_nodemap *nodemap);
 void idmap_delete(enum nodemap_id_type id_type,  struct lu_idmap *idmap,
                  struct lu_nodemap *nodemap);
 void idmap_delete_tree(struct lu_nodemap *nodemap);
@@ -156,6 +155,7 @@ void nm_member_delete_list(struct lu_nodemap *nodemap);
 struct lu_nodemap *nodemap_classify_nid(lnet_nid_t nid);
 void nm_member_reclassify_nodemap(struct lu_nodemap *nodemap);
 void nm_member_revoke_locks(struct lu_nodemap *nodemap);
+void nm_member_revoke_locks_always(struct lu_nodemap *nodemap);
 void nm_member_revoke_all(void);
 
 int nodemap_add_idmap_helper(struct lu_nodemap *nodemap,
@@ -170,6 +170,9 @@ struct rb_node *nm_rb_next_postorder(const struct rb_node *node);
 struct rb_node *nm_rb_first_postorder(const struct rb_root *root);
 void nodemap_getref(struct lu_nodemap *nodemap);
 void nodemap_putref(struct lu_nodemap *nodemap);
+int nm_hash_list_cb(struct cfs_hash *hs, struct cfs_hash_bd *bd,
+                   struct hlist_node *hnode,
+                   void *nodemap_list_head);
 
 #define nm_rbtree_postorder_for_each_entry_safe(pos, n,                        \
                                                root, field)            \