summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-04-11 22:57:51 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-11 22:57:51 -0700
commit2b38960cbf6a500bb8d2d8afd7e0cd546c72efe6 (patch)
tree58c211f7e904062581baa300694b3927448bd065 /include
parent376fd482d39e4f51685cd9d33b099e9cfc3b21e3 (diff)
[PATCH] JBD: ordered-data commit cleanup
For data=ordered, kjournald at commit time has to write out and wait upon a long list of buffers. It does this in a rather awkward way with a single list. it causes complexity and long lock hold times, and makes the addition of rescheduling points quite hard So what we do instead (based on Chris Mason's suggestion) is to add a new buffer list (t_locked_list) to the journal. It contains buffers which have been placed under I/O. So as we walk the t_sync_datalist list we move buffers over to t_locked_list as they are written out. When t_sync_datalist is empty we may then walk t_locked_list waiting for the I/O to complete. As a side-effect this means that we can remove the nasty synchronous wait in journal_dirty_data which is there to avoid the kjournald livelock which would otherwise occur when someone is continuously dirtying a buffer.
Diffstat (limited to 'include')
-rw-r--r--include/linux/jbd.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index eb154bafe1e4..241387b13764 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -487,6 +487,12 @@ struct transaction_s
struct journal_head *t_reserved_list;
/*
+ * Doubly-linked circular list of all buffers under writeout during
+ * commit [j_list_lock]
+ */
+ struct journal_head *t_locked_list;
+
+ /*
* Doubly-linked circular list of all metadata buffers owned by this
* transaction [j_list_lock]
*/
@@ -1079,7 +1085,8 @@ static inline int jbd_space_needed(journal_t *journal)
#define BJ_Shadow 5 /* Buffer contents being shadowed to the log */
#define BJ_LogCtl 6 /* Buffer contains log descriptors */
#define BJ_Reserved 7 /* Buffer is reserved for access by journal */
-#define BJ_Types 8
+#define BJ_Locked 8 /* Locked for I/O during commit */
+#define BJ_Types 9
extern int jbd_blocks_per_page(struct inode *inode);