diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-12-12 11:46:22 -0500 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-12-12 11:47:16 -0500 |
commit | 02b100fb83f9b0f8719deef6c4ed973b4d9ce00c (patch) | |
tree | 7851231aa2e3edf3865cb806d654bc07e3ab94aa /fs/xfs/libxfs/xfs_defer.h | |
parent | bc9f2b7c8a732d896753709cc9d495780ba7e9f9 (diff) |
xfs: streamline defer op type handling
There's no need to bundle a pointer to the defer op type into the defer
op control structure. Instead, store the defer op type enum, which
enables us to shorten some of the lines.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_defer.h')
-rw-r--r-- | fs/xfs/libxfs/xfs_defer.h | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/fs/xfs/libxfs/xfs_defer.h b/fs/xfs/libxfs/xfs_defer.h index 0a4b88e3df74..7c28d7608ac6 100644 --- a/fs/xfs/libxfs/xfs_defer.h +++ b/fs/xfs/libxfs/xfs_defer.h | |||
@@ -9,20 +9,6 @@ | |||
9 | struct xfs_defer_op_type; | 9 | struct xfs_defer_op_type; |
10 | 10 | ||
11 | /* | 11 | /* |
12 | * Save a log intent item and a list of extents, so that we can replay | ||
13 | * whatever action had to happen to the extent list and file the log done | ||
14 | * item. | ||
15 | */ | ||
16 | struct xfs_defer_pending { | ||
17 | const struct xfs_defer_op_type *dfp_type; /* function pointers */ | ||
18 | struct list_head dfp_list; /* pending items */ | ||
19 | void *dfp_intent; /* log intent item */ | ||
20 | void *dfp_done; /* log done item */ | ||
21 | struct list_head dfp_work; /* work items */ | ||
22 | unsigned int dfp_count; /* # extent items */ | ||
23 | }; | ||
24 | |||
25 | /* | ||
26 | * Header for deferred operation list. | 12 | * Header for deferred operation list. |
27 | */ | 13 | */ |
28 | enum xfs_defer_ops_type { | 14 | enum xfs_defer_ops_type { |
@@ -34,6 +20,20 @@ enum xfs_defer_ops_type { | |||
34 | XFS_DEFER_OPS_TYPE_MAX, | 20 | XFS_DEFER_OPS_TYPE_MAX, |
35 | }; | 21 | }; |
36 | 22 | ||
23 | /* | ||
24 | * Save a log intent item and a list of extents, so that we can replay | ||
25 | * whatever action had to happen to the extent list and file the log done | ||
26 | * item. | ||
27 | */ | ||
28 | struct xfs_defer_pending { | ||
29 | struct list_head dfp_list; /* pending items */ | ||
30 | struct list_head dfp_work; /* work items */ | ||
31 | void *dfp_intent; /* log intent item */ | ||
32 | void *dfp_done; /* log done item */ | ||
33 | unsigned int dfp_count; /* # extent items */ | ||
34 | enum xfs_defer_ops_type dfp_type; | ||
35 | }; | ||
36 | |||
37 | void xfs_defer_add(struct xfs_trans *tp, enum xfs_defer_ops_type type, | 37 | void xfs_defer_add(struct xfs_trans *tp, enum xfs_defer_ops_type type, |
38 | struct list_head *h); | 38 | struct list_head *h); |
39 | int xfs_defer_finish_noroll(struct xfs_trans **tp); | 39 | int xfs_defer_finish_noroll(struct xfs_trans **tp); |
@@ -43,8 +43,6 @@ void xfs_defer_move(struct xfs_trans *dtp, struct xfs_trans *stp); | |||
43 | 43 | ||
44 | /* Description of a deferred type. */ | 44 | /* Description of a deferred type. */ |
45 | struct xfs_defer_op_type { | 45 | struct xfs_defer_op_type { |
46 | enum xfs_defer_ops_type type; | ||
47 | unsigned int max_items; | ||
48 | void (*abort_intent)(void *); | 46 | void (*abort_intent)(void *); |
49 | void *(*create_done)(struct xfs_trans *, void *, unsigned int); | 47 | void *(*create_done)(struct xfs_trans *, void *, unsigned int); |
50 | int (*finish_item)(struct xfs_trans *, struct list_head *, void *, | 48 | int (*finish_item)(struct xfs_trans *, struct list_head *, void *, |
@@ -54,6 +52,7 @@ struct xfs_defer_op_type { | |||
54 | int (*diff_items)(void *, struct list_head *, struct list_head *); | 52 | int (*diff_items)(void *, struct list_head *, struct list_head *); |
55 | void *(*create_intent)(struct xfs_trans *, uint); | 53 | void *(*create_intent)(struct xfs_trans *, uint); |
56 | void (*log_item)(struct xfs_trans *, void *, struct list_head *); | 54 | void (*log_item)(struct xfs_trans *, void *, struct list_head *); |
55 | unsigned int max_items; | ||
57 | }; | 56 | }; |
58 | 57 | ||
59 | extern const struct xfs_defer_op_type xfs_bmap_update_defer_type; | 58 | extern const struct xfs_defer_op_type xfs_bmap_update_defer_type; |