diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-06-23 04:11:15 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-07-26 14:16:34 -0400 |
commit | e98c414f9a3134fe7efc56ef8f1d394b54bfd40e (patch) | |
tree | b3d4696cfb4875af39041f9ddcd642bd1cd90a29 /fs/xfs/xfs_trans_priv.h | |
parent | 3400777ff03a3cd4fdbc6cb15676fc7e7ceefc00 (diff) |
xfs: simplify log item descriptor tracking
Currently we track log item descriptor belonging to a transaction using a
complex opencoded chunk allocator. This code has been there since day one
and seems to work around the lack of an efficient slab allocator.
This patch replaces it with dynamically allocated log item descriptors
from a dedicated slab pool, linked to the transaction by a linked list.
This allows to greatly simplify the log item descriptor tracking to the
point where it's just a couple hundred lines in xfs_trans.c instead of
a separate file. The external API has also been simplified while we're
at it - the xfs_trans_add_item and xfs_trans_del_item functions to add/
delete items from a transaction have been simplified to the bare minium,
and the xfs_trans_find_item function is replaced with a direct dereference
of the li_desc field. All debug code walking the list of log items in
a transaction is down to a simple list_for_each_entry.
Note that we could easily use a singly linked list here instead of the
double linked list from list.h as the fastpath only does deletion from
sequential traversal. But given that we don't have one available as
a library function yet I use the list.h functions for simplicity.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_trans_priv.h')
-rw-r--r-- | fs/xfs/xfs_trans_priv.h | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/fs/xfs/xfs_trans_priv.h b/fs/xfs/xfs_trans_priv.h index c6e4f2c8de6e..e2d93d8ead7b 100644 --- a/fs/xfs/xfs_trans_priv.h +++ b/fs/xfs/xfs_trans_priv.h | |||
@@ -23,22 +23,8 @@ struct xfs_log_item_desc; | |||
23 | struct xfs_mount; | 23 | struct xfs_mount; |
24 | struct xfs_trans; | 24 | struct xfs_trans; |
25 | 25 | ||
26 | /* | 26 | void xfs_trans_add_item(struct xfs_trans *, struct xfs_log_item *); |
27 | * From xfs_trans_item.c | 27 | void xfs_trans_del_item(struct xfs_log_item *); |
28 | */ | ||
29 | struct xfs_log_item_desc *xfs_trans_add_item(struct xfs_trans *, | ||
30 | struct xfs_log_item *); | ||
31 | void xfs_trans_free_item(struct xfs_trans *, | ||
32 | struct xfs_log_item_desc *); | ||
33 | struct xfs_log_item_desc *xfs_trans_find_item(struct xfs_trans *, | ||
34 | struct xfs_log_item *); | ||
35 | struct xfs_log_item_desc *xfs_trans_first_item(struct xfs_trans *); | ||
36 | struct xfs_log_item_desc *xfs_trans_next_item(struct xfs_trans *, | ||
37 | struct xfs_log_item_desc *); | ||
38 | |||
39 | void xfs_trans_unlock_items(struct xfs_trans *tp, xfs_lsn_t commit_lsn); | ||
40 | void xfs_trans_free_items(struct xfs_trans *tp, xfs_lsn_t commit_lsn, | ||
41 | int flags); | ||
42 | 28 | ||
43 | void xfs_trans_item_committed(struct xfs_log_item *lip, | 29 | void xfs_trans_item_committed(struct xfs_log_item *lip, |
44 | xfs_lsn_t commit_lsn, int aborted); | 30 | xfs_lsn_t commit_lsn, int aborted); |