1
2
3
4
5
6#ifndef __XFS_DEFER_H__
7#define __XFS_DEFER_H__
8
9struct xfs_defer_op_type;
10
11
12
13
14enum xfs_defer_ops_type {
15 XFS_DEFER_OPS_TYPE_BMAP,
16 XFS_DEFER_OPS_TYPE_REFCOUNT,
17 XFS_DEFER_OPS_TYPE_RMAP,
18 XFS_DEFER_OPS_TYPE_FREE,
19 XFS_DEFER_OPS_TYPE_AGFL_FREE,
20 XFS_DEFER_OPS_TYPE_MAX,
21};
22
23
24
25
26
27
28struct xfs_defer_pending {
29 struct list_head dfp_list;
30 struct list_head dfp_work;
31 void *dfp_intent;
32 void *dfp_done;
33 unsigned int dfp_count;
34 enum xfs_defer_ops_type dfp_type;
35};
36
37void xfs_defer_add(struct xfs_trans *tp, enum xfs_defer_ops_type type,
38 struct list_head *h);
39int xfs_defer_finish_noroll(struct xfs_trans **tp);
40int xfs_defer_finish(struct xfs_trans **tp);
41void xfs_defer_cancel(struct xfs_trans *);
42void xfs_defer_move(struct xfs_trans *dtp, struct xfs_trans *stp);
43
44
45struct xfs_defer_op_type {
46 void (*abort_intent)(void *);
47 void *(*create_done)(struct xfs_trans *, void *, unsigned int);
48 int (*finish_item)(struct xfs_trans *, struct list_head *, void *,
49 void **);
50 void (*finish_cleanup)(struct xfs_trans *, void *, int);
51 void (*cancel_item)(struct list_head *);
52 int (*diff_items)(void *, struct list_head *, struct list_head *);
53 void *(*create_intent)(struct xfs_trans *, uint);
54 void (*log_item)(struct xfs_trans *, void *, struct list_head *);
55 unsigned int max_items;
56};
57
58extern const struct xfs_defer_op_type xfs_bmap_update_defer_type;
59extern const struct xfs_defer_op_type xfs_refcount_update_defer_type;
60extern const struct xfs_defer_op_type xfs_rmap_update_defer_type;
61extern const struct xfs_defer_op_type xfs_extent_free_defer_type;
62extern const struct xfs_defer_op_type xfs_agfl_free_defer_type;
63
64#endif
65