Whamcloud - gitweb
port llog fixes from b1_6 into HEAD
[fs/lustre-release.git] / lustre / include / lustre_commit_confd.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *   This file is part of Lustre, http://www.lustre.org
5  *
6  * Structures relating to the log commit thread.
7  */
8
9 #ifndef _LUSTRE_COMMIT_CONFD_H
10 #define _LUSTRE_COMMIT_CONFD_H
11
12 #include <lustre_log.h>
13
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;
18         int                        llcd_size;
19         int                        llcd_cookiebytes;
20         struct llog_cookie         llcd_cookies[0];
21 };
22
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 */
30
31         int                     lcm_flags;
32         cfs_waitq_t             lcm_waitq;
33
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 */
41 };
42
43 #define LLOG_LCM_FL_EXIT        0x01
44 #define LLOG_LCM_FL_EXIT_FORCE  0x02
45
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 };
52
53 /* ptlrpc/recov_thread.c */
54 int llog_start_commit_thread(struct llog_commit_master *);
55
56 int llog_init_commit_master(struct llog_commit_master *);
57 int llog_cleanup_commit_master(struct llog_commit_master *lcm, int force);
58 #endif /* _LUSTRE_COMMIT_CONFD_H */