1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef __XFS_TRANS_PRIV_H__
19#define __XFS_TRANS_PRIV_H__
20
21struct xfs_log_item;
22struct xfs_log_item_desc;
23struct xfs_mount;
24struct xfs_trans;
25struct xfs_ail;
26struct xfs_log_vec;
27
28void xfs_trans_add_item(struct xfs_trans *, struct xfs_log_item *);
29void xfs_trans_del_item(struct xfs_log_item *);
30void xfs_trans_free_items(struct xfs_trans *tp, xfs_lsn_t commit_lsn,
31 int flags);
32void xfs_trans_unreserve_and_mod_sb(struct xfs_trans *tp);
33
34void xfs_trans_committed_bulk(struct xfs_ail *ailp, struct xfs_log_vec *lv,
35 xfs_lsn_t commit_lsn, int aborted);
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55struct xfs_ail_cursor {
56 struct list_head list;
57 struct xfs_log_item *item;
58};
59
60
61
62
63
64
65struct xfs_ail {
66 struct xfs_mount *xa_mount;
67 struct task_struct *xa_task;
68 struct list_head xa_ail;
69 xfs_lsn_t xa_target;
70 struct list_head xa_cursors;
71 spinlock_t xa_lock;
72 xfs_lsn_t xa_last_pushed_lsn;
73};
74
75
76
77
78void xfs_trans_ail_update_bulk(struct xfs_ail *ailp,
79 struct xfs_ail_cursor *cur,
80 struct xfs_log_item **log_items, int nr_items,
81 xfs_lsn_t lsn) __releases(ailp->xa_lock);
82static inline void
83xfs_trans_ail_update(
84 struct xfs_ail *ailp,
85 struct xfs_log_item *lip,
86 xfs_lsn_t lsn) __releases(ailp->xa_lock)
87{
88 xfs_trans_ail_update_bulk(ailp, NULL, &lip, 1, lsn);
89}
90
91void xfs_trans_ail_delete_bulk(struct xfs_ail *ailp,
92 struct xfs_log_item **log_items, int nr_items)
93 __releases(ailp->xa_lock);
94static inline void
95xfs_trans_ail_delete(
96 struct xfs_ail *ailp,
97 xfs_log_item_t *lip) __releases(ailp->xa_lock)
98{
99 xfs_trans_ail_delete_bulk(ailp, &lip, 1);
100}
101
102void xfs_ail_push(struct xfs_ail *, xfs_lsn_t);
103void xfs_ail_push_all(struct xfs_ail *);
104xfs_lsn_t xfs_ail_min_lsn(struct xfs_ail *ailp);
105
106void xfs_trans_unlocked_item(struct xfs_ail *,
107 xfs_log_item_t *);
108
109struct xfs_log_item * xfs_trans_ail_cursor_first(struct xfs_ail *ailp,
110 struct xfs_ail_cursor *cur,
111 xfs_lsn_t lsn);
112struct xfs_log_item * xfs_trans_ail_cursor_last(struct xfs_ail *ailp,
113 struct xfs_ail_cursor *cur,
114 xfs_lsn_t lsn);
115struct xfs_log_item * xfs_trans_ail_cursor_next(struct xfs_ail *ailp,
116 struct xfs_ail_cursor *cur);
117void xfs_trans_ail_cursor_done(struct xfs_ail *ailp,
118 struct xfs_ail_cursor *cur);
119
120#if BITS_PER_LONG != 64
121static inline void
122xfs_trans_ail_copy_lsn(
123 struct xfs_ail *ailp,
124 xfs_lsn_t *dst,
125 xfs_lsn_t *src)
126{
127 ASSERT(sizeof(xfs_lsn_t) == 8);
128 spin_lock(&ailp->xa_lock);
129 *dst = *src;
130 spin_unlock(&ailp->xa_lock);
131}
132#else
133static inline void
134xfs_trans_ail_copy_lsn(
135 struct xfs_ail *ailp,
136 xfs_lsn_t *dst,
137 xfs_lsn_t *src)
138{
139 ASSERT(sizeof(xfs_lsn_t) == 8);
140 *dst = *src;
141}
142#endif
143#endif
144