dlm: improve rsb searches
By pre-allocating rsb structs before searching the hash table, they can be inserted immediately. This avoids always having to repeat the search when adding the struct to hash list. This also adds space to the rsb struct for a max resource name, so an rsb allocation can be used by any request. The constant size also allows us to finally use a slab for the rsb structs. Signed-off-by: David Teigland <teigland@redhat.com>
This commit is contained in:
@@ -293,7 +293,7 @@ struct dlm_rsb {
|
||||
int res_recover_locks_count;
|
||||
|
||||
char *res_lvbptr;
|
||||
char res_name[1];
|
||||
char res_name[DLM_RESNAME_MAXLEN+1];
|
||||
};
|
||||
|
||||
/* find_rsb() flags */
|
||||
@@ -477,6 +477,10 @@ struct dlm_ls {
|
||||
struct mutex ls_timeout_mutex;
|
||||
struct list_head ls_timeout;
|
||||
|
||||
spinlock_t ls_new_rsb_spin;
|
||||
int ls_new_rsb_count;
|
||||
struct list_head ls_new_rsb; /* new rsb structs */
|
||||
|
||||
struct list_head ls_nodes; /* current nodes in ls */
|
||||
struct list_head ls_nodes_gone; /* dead node list, recovery */
|
||||
int ls_num_nodes; /* number of nodes in ls */
|
||||
|
Reference in New Issue
Block a user