dlmdomain.h 814 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /* -*- mode: c; c-basic-offset: 8; -*-
  3. * vim: noexpandtab sw=8 ts=8 sts=0:
  4. *
  5. * dlmdomain.h
  6. *
  7. * Copyright (C) 2004 Oracle. All rights reserved.
  8. */
  9. #ifndef DLMDOMAIN_H
  10. #define DLMDOMAIN_H
  11. extern spinlock_t dlm_domain_lock;
  12. extern struct list_head dlm_domains;
  13. static inline int dlm_joined(struct dlm_ctxt *dlm)
  14. {
  15. int ret = 0;
  16. spin_lock(&dlm_domain_lock);
  17. if (dlm->dlm_state == DLM_CTXT_JOINED)
  18. ret = 1;
  19. spin_unlock(&dlm_domain_lock);
  20. return ret;
  21. }
  22. static inline int dlm_shutting_down(struct dlm_ctxt *dlm)
  23. {
  24. int ret = 0;
  25. spin_lock(&dlm_domain_lock);
  26. if (dlm->dlm_state == DLM_CTXT_IN_SHUTDOWN)
  27. ret = 1;
  28. spin_unlock(&dlm_domain_lock);
  29. return ret;
  30. }
  31. void dlm_fire_domain_eviction_callbacks(struct dlm_ctxt *dlm,
  32. int node_num);
  33. #endif