// SPDX-License-Identifier: GPL-2.0-only /****************************************************************************** ******************************************************************************* ** ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. ** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. ** ** ******************************************************************************* ******************************************************************************/ #include "dlm_internal.h" #include "lockspace.h" #include "member.h" #include "lowcomms.h" #include "rcom.h" #include "config.h" #include "memory.h" #include "recover.h" #include "util.h" #include "lock.h" #include "dir.h" /* * We use the upper 16 bits of the hash value to select the directory node. * Low bits are used for distribution of rsb's among hash buckets on each node. * * To give the exact range wanted (0 to num_nodes-1), we apply a modulus of * num_nodes to the hash value. This value in the desired range is used as an * offset into the sorted list of nodeid's to give the particular nodeid. */ int dlm_hash2nodeid(struct dlm_ls *ls, uint32_t hash) { … } int dlm_dir_nodeid(struct dlm_rsb *r) { … } void dlm_recover_dir_nodeid(struct dlm_ls *ls, const struct list_head *root_list) { … } int dlm_recover_directory(struct dlm_ls *ls, uint64_t seq) { … } static struct dlm_rsb *find_rsb_root(struct dlm_ls *ls, const char *name, int len) { … } struct dlm_dir_dump { … }; static void drop_dir_ctx(struct dlm_ls *ls, int nodeid) { … } static struct dlm_dir_dump *lookup_dir_dump(struct dlm_ls *ls, int nodeid) { … } static struct dlm_dir_dump *init_dir_dump(struct dlm_ls *ls, int nodeid) { … } /* Find the rsb where we left off (or start again), then send rsb names for rsb's we're master of and whose directory node matches the requesting node. inbuf is the rsb name last sent, inlen is the name's length */ void dlm_copy_master_names(struct dlm_ls *ls, const char *inbuf, int inlen, char *outbuf, int outlen, int nodeid) { … }