diff options
Diffstat (limited to 'fs/xfs/xfs_trans_priv.h')
-rw-r--r-- | fs/xfs/xfs_trans_priv.h | 55 |
1 files changed, 44 insertions, 11 deletions
diff --git a/fs/xfs/xfs_trans_priv.h b/fs/xfs/xfs_trans_priv.h index 98317fdc33b5..f114d388570a 100644 --- a/fs/xfs/xfs_trans_priv.h +++ b/fs/xfs/xfs_trans_priv.h | |||
@@ -44,20 +44,33 @@ xfs_log_busy_slot_t *xfs_trans_add_busy(xfs_trans_t *tp, | |||
44 | xfs_extlen_t idx); | 44 | xfs_extlen_t idx); |
45 | 45 | ||
46 | /* | 46 | /* |
47 | * From xfs_trans_ail.c | 47 | * AIL traversal cursor. |
48 | * | ||
49 | * Rather than using a generation number for detecting changes in the ail, use | ||
50 | * a cursor that is protected by the ail lock. The aild cursor exists in the | ||
51 | * struct xfs_ail, but other traversals can declare it on the stack and link it | ||
52 | * to the ail list. | ||
53 | * | ||
54 | * When an object is deleted from or moved int the AIL, the cursor list is | ||
55 | * searched to see if the object is a designated cursor item. If it is, it is | ||
56 | * deleted from the cursor so that the next time the cursor is used traversal | ||
57 | * will return to the start. | ||
58 | * | ||
59 | * This means a traversal colliding with a removal will cause a restart of the | ||
60 | * list scan, rather than any insertion or deletion anywhere in the list. The | ||
61 | * low bit of the item pointer is set if the cursor has been invalidated so | ||
62 | * that we can tell the difference between invalidation and reaching the end | ||
63 | * of the list to trigger traversal restarts. | ||
48 | */ | 64 | */ |
49 | void xfs_trans_update_ail(struct xfs_mount *mp, | 65 | struct xfs_ail_cursor { |
50 | struct xfs_log_item *lip, xfs_lsn_t lsn) | 66 | struct xfs_ail_cursor *next; |
51 | __releases(mp->m_ail_lock); | 67 | struct xfs_log_item *item; |
52 | void xfs_trans_delete_ail(struct xfs_mount *mp, | 68 | }; |
53 | struct xfs_log_item *lip) | ||
54 | __releases(mp->m_ail_lock); | ||
55 | struct xfs_log_item *xfs_trans_first_ail(struct xfs_mount *, int *); | ||
56 | struct xfs_log_item *xfs_trans_next_ail(struct xfs_mount *, | ||
57 | struct xfs_log_item *, int *, int *); | ||
58 | 69 | ||
59 | /* | 70 | /* |
60 | * AIL push thread support | 71 | * Private AIL structures. |
72 | * | ||
73 | * Eventually we need to drive the locking in here as well. | ||
61 | */ | 74 | */ |
62 | struct xfs_ail { | 75 | struct xfs_ail { |
63 | struct xfs_mount *xa_mount; | 76 | struct xfs_mount *xa_mount; |
@@ -65,8 +78,28 @@ struct xfs_ail { | |||
65 | uint xa_gen; | 78 | uint xa_gen; |
66 | struct task_struct *xa_task; | 79 | struct task_struct *xa_task; |
67 | xfs_lsn_t xa_target; | 80 | xfs_lsn_t xa_target; |
81 | struct xfs_ail_cursor xa_cursors; | ||
68 | }; | 82 | }; |
69 | 83 | ||
84 | /* | ||
85 | * From xfs_trans_ail.c | ||
86 | */ | ||
87 | void xfs_trans_update_ail(struct xfs_mount *mp, | ||
88 | struct xfs_log_item *lip, xfs_lsn_t lsn) | ||
89 | __releases(mp->m_ail_lock); | ||
90 | void xfs_trans_delete_ail(struct xfs_mount *mp, | ||
91 | struct xfs_log_item *lip) | ||
92 | __releases(mp->m_ail_lock); | ||
93 | struct xfs_log_item *xfs_trans_first_ail(struct xfs_mount *mp, | ||
94 | struct xfs_ail_cursor *cur); | ||
95 | struct xfs_log_item *xfs_trans_next_ail(struct xfs_mount *mp, | ||
96 | struct xfs_ail_cursor *cur); | ||
97 | |||
98 | void xfs_trans_ail_cursor_init(struct xfs_ail *ailp, | ||
99 | struct xfs_ail_cursor *cur); | ||
100 | void xfs_trans_ail_cursor_done(struct xfs_ail *ailp, | ||
101 | struct xfs_ail_cursor *cur); | ||
102 | |||
70 | long xfsaild_push(struct xfs_ail *, xfs_lsn_t *); | 103 | long xfsaild_push(struct xfs_ail *, xfs_lsn_t *); |
71 | void xfsaild_wakeup(struct xfs_ail *, xfs_lsn_t); | 104 | void xfsaild_wakeup(struct xfs_ail *, xfs_lsn_t); |
72 | int xfsaild_start(struct xfs_ail *); | 105 | int xfsaild_start(struct xfs_ail *); |