1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * This file is part of Lustre, http://www.lustre.org
6 * Structures relating to the log commit thread.
9 #ifndef _LUSTRE_COMMIT_CONFD_H
10 #define _LUSTRE_COMMIT_CONFD_H
12 #include <lustre_log.h>
14 struct llog_canceld_ctxt {
15 struct list_head llcd_list; /* free or pending struct list */
16 struct llog_ctxt *llcd_ctxt;
17 struct llog_commit_master *llcd_lcm;
20 struct llog_cookie llcd_cookies[0];
23 struct llog_commit_master {
24 struct list_head lcm_thread_busy; /* list of busy daemons */
25 struct list_head lcm_thread_idle; /* list of idle daemons */
26 spinlock_t lcm_thread_lock; /* protects thread_list */
27 atomic_t lcm_thread_numidle;/* number of idle threads */
28 atomic_t lcm_thread_total; /* total number of threads */
29 int lcm_thread_max; /* <= num_osts normally */
32 cfs_waitq_t lcm_waitq;
34 struct list_head lcm_llcd_pending; /* llog_canceld_ctxt to send */
35 struct list_head lcm_llcd_resend; /* try to resend this data */
36 struct list_head lcm_llcd_free; /* free llog_canceld_ctxt */
37 spinlock_t lcm_llcd_lock; /* protects llcd_free */
38 atomic_t lcm_llcd_numfree; /* items on llcd_free */
39 int lcm_llcd_minfree; /* min free on llcd_free */
40 int lcm_llcd_maxfree; /* max free on llcd_free */
43 #define LLOG_LCM_FL_EXIT 0x01
44 #define LLOG_LCM_FL_EXIT_FORCE 0x02
46 /* the thread data that collects local commits and makes rpc's */
47 struct llog_commit_daemon {
48 struct list_head lcd_lcm_list; /* list of daemon threads */
49 struct list_head lcd_llcd_list; /* list of pending RPCs */
50 struct llog_commit_master *lcd_lcm; /* pointer back to parent */
51 int lcd_index; /* the index of the llog daemon */
54 /* ptlrpc/recov_thread.c */
55 int llog_start_commit_thread(struct llog_commit_master *);
57 int llog_init_commit_master(struct llog_commit_master *);
58 int llog_cleanup_commit_master(struct llog_commit_master *lcm, int force);
59 #endif /* _LUSTRE_COMMIT_CONFD_H */