X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fptlrpc%2Fnodemap_internal.h;h=5d75fd7123b8af95c51cbdd0d6ffc697d4c74ee8;hp=991564f093628c45b0a52419cfdf3c04c184afd3;hb=be7efb4ce06996444c08914305a73833a7123eeb;hpb=928714dddabb2dbc4fc93101f23eaa671099dbea diff --git a/lustre/ptlrpc/nodemap_internal.h b/lustre/ptlrpc/nodemap_internal.h index 991564f..5d75fd7 100644 --- a/lustre/ptlrpc/nodemap_internal.h +++ b/lustre/ptlrpc/nodemap_internal.h @@ -35,6 +35,12 @@ #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 */ #define NODEMAP_NOBODY_UID 99 @@ -72,34 +78,6 @@ struct lu_idmap { struct rb_node id_fs_to_client; }; -struct nodemap_range_tree { - struct interval_node *nmrt_range_interval_root; - unsigned int nmrt_range_highest_id; -}; - -struct nodemap_config { - /* Highest numerical lu_nodemap.nm_id defined */ - unsigned int nmc_nodemap_highest_id; - - /* Simple flag to determine if nodemaps are active */ - bool nmc_nodemap_is_active; - - /* Pointer to default nodemap as it is needed more often */ - struct lu_nodemap *nmc_default_nodemap; - - /** - * Lock required to access the range tree. - */ - struct rw_semaphore nmc_range_tree_lock; - struct nodemap_range_tree nmc_range_tree; - - /** - * Hash keyed on nodemap name containing all - * nodemaps - */ - struct cfs_hash *nmc_nodemap_hash; -}; - /* first 4 bits of the nodemap_id is the index type */ struct nodemap_key { __u32 nk_nodemap_id; @@ -132,8 +110,6 @@ static inline __u32 nm_idx_set_type(unsigned int id, enum nodemap_idx_type t) return (id & NM_TYPE_MASK) | (t << NM_TYPE_SHIFT); } -struct nodemap_config *nodemap_config_alloc(void); -void nodemap_config_dealloc(struct nodemap_config *config); void nodemap_config_set_active(struct nodemap_config *config); struct lu_nodemap *nodemap_create(const char *name, struct nodemap_config *config, @@ -180,6 +156,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, @@ -192,7 +169,11 @@ int nodemap_add_range_helper(struct nodemap_config *config, 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) \