1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2001 Cluster File Systems, Inc. <info@clusterfs.com>
6 * This file is part of Lustre, http://www.lustre.org.
8 * Lustre is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * Lustre is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Lustre; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * Structures relating to the log commit thread.
24 #ifndef _LUSTRE_COMMIT_CONFD_H
25 #define _LUSTRE_COMMIT_CONFD_H
27 #include <linux/lustre_log.h>
29 struct llog_canceld_ctxt {
30 struct list_head llcd_list; /* free or pending struct list */
31 struct llog_ctxt *llcd_ctxt;
32 struct llog_commit_master *llcd_lcm;
33 int llcd_tries; /* number of tries to send */
35 struct llog_cookie llcd_cookies[0];
38 struct llog_commit_master {
39 struct list_head lcm_thread_busy; /* list of busy daemons */
40 struct list_head lcm_thread_idle; /* list of idle daemons */
41 spinlock_t lcm_thread_lock; /* protects thread_list */
42 atomic_t lcm_thread_numidle;/* number of idle threads */
43 atomic_t lcm_thread_total; /* total number of threads */
44 int lcm_thread_max; /* <= num_osts normally */
47 wait_queue_head_t lcm_waitq;
49 struct list_head lcm_llcd_pending; /* llog_canceld_ctxt to send */
50 struct list_head lcm_llcd_resend; /* try to resend this data */
51 struct list_head lcm_llcd_free; /* free llog_canceld_ctxt */
52 spinlock_t lcm_llcd_lock; /* protects llcd_free */
53 atomic_t lcm_llcd_numfree; /* items on llcd_free */
54 int lcm_llcd_minfree; /* min free on llcd_free */
55 int lcm_llcd_maxfree; /* max free on llcd_free */
58 #define LLOG_LCM_FL_EXIT 0x01
59 #define LLOG_LCM_FL_EXIT_FORCE 0x02
61 /* the thread data that collects local commits and makes rpc's */
62 struct llog_commit_daemon {
63 struct list_head lcd_lcm_list; /* list of daemon threads */
64 struct list_head lcd_llcd_list; /* list of pending RPCs */
65 struct llog_commit_master *lcd_lcm; /* pointer back to parent */
68 /* ptlrpc/recov_thread.c */
69 int llog_start_commit_thread(void);
70 int llog_cleanup_commit_master(int force);
71 struct llog_canceld_ctxt *llcd_grab(void);
72 void llcd_send(struct llog_canceld_ctxt *llcd);
74 #endif /* _LUSTRE_COMMIT_CONFD_H */