Linux 5.8-rc4
[linux/fpc-iii.git] / fs / ocfs2 / dlm / dlmdomain.h
blob7c21664d23d08ca12680762f54e3f35f7a2098e5
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:
5 * dlmdomain.h
7 * Copyright (C) 2004 Oracle. All rights reserved.
8 */
10 #ifndef DLMDOMAIN_H
11 #define DLMDOMAIN_H
13 extern spinlock_t dlm_domain_lock;
14 extern struct list_head dlm_domains;
16 static inline int dlm_joined(struct dlm_ctxt *dlm)
18 int ret = 0;
20 spin_lock(&dlm_domain_lock);
21 if (dlm->dlm_state == DLM_CTXT_JOINED)
22 ret = 1;
23 spin_unlock(&dlm_domain_lock);
25 return ret;
28 static inline int dlm_shutting_down(struct dlm_ctxt *dlm)
30 int ret = 0;
32 spin_lock(&dlm_domain_lock);
33 if (dlm->dlm_state == DLM_CTXT_IN_SHUTDOWN)
34 ret = 1;
35 spin_unlock(&dlm_domain_lock);
37 return ret;
40 void dlm_fire_domain_eviction_callbacks(struct dlm_ctxt *dlm,
41 int node_num);
43 #endif