18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* -*- mode: c; c-basic-offset: 8; -*- 38c2ecf20Sopenharmony_ci * vim: noexpandtab sw=8 ts=8 sts=0: 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * dlmdomain.h 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * Copyright (C) 2004 Oracle. All rights reserved. 88c2ecf20Sopenharmony_ci */ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#ifndef DLMDOMAIN_H 118c2ecf20Sopenharmony_ci#define DLMDOMAIN_H 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ciextern spinlock_t dlm_domain_lock; 148c2ecf20Sopenharmony_ciextern struct list_head dlm_domains; 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_cistatic inline int dlm_joined(struct dlm_ctxt *dlm) 178c2ecf20Sopenharmony_ci{ 188c2ecf20Sopenharmony_ci int ret = 0; 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci spin_lock(&dlm_domain_lock); 218c2ecf20Sopenharmony_ci if (dlm->dlm_state == DLM_CTXT_JOINED) 228c2ecf20Sopenharmony_ci ret = 1; 238c2ecf20Sopenharmony_ci spin_unlock(&dlm_domain_lock); 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci return ret; 268c2ecf20Sopenharmony_ci} 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_cistatic inline int dlm_shutting_down(struct dlm_ctxt *dlm) 298c2ecf20Sopenharmony_ci{ 308c2ecf20Sopenharmony_ci int ret = 0; 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci spin_lock(&dlm_domain_lock); 338c2ecf20Sopenharmony_ci if (dlm->dlm_state == DLM_CTXT_IN_SHUTDOWN) 348c2ecf20Sopenharmony_ci ret = 1; 358c2ecf20Sopenharmony_ci spin_unlock(&dlm_domain_lock); 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci return ret; 388c2ecf20Sopenharmony_ci} 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_civoid dlm_fire_domain_eviction_callbacks(struct dlm_ctxt *dlm, 418c2ecf20Sopenharmony_ci int node_num); 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci#endif 44