[Ocfs2-devel] [PATCH 0/10] Make ocfs2_extent_tree a first-class object

Joel Becker joel.becker at oracle.com
Wed Aug 20 19:48:15 PDT 2008


The new xattr code introduced a great abstraction, ocfs2_extent_tree.
However, it's hidden in alloc.c.  Tao said he wanted to keep it there,
but I think it works great as a first-class object.

Callers into alloc.c can just fill in an ocfs2_extent_tree with the
appropriate ocfs2_get_*_extent_tree() function, then pass it to all
alloc.c functions.  Those functions no longer need individual root_bh,
root_el, et_type, or void*private arguments.  People filling in dinode
extent trees don't even need to pass NULL for that private.

The series first adds structure prefixes to ocfs2_extent_tree and
ocfs2_extent_tree_operations.  Next, it turns 'private' into 'object',
calculating object as bh->b_data if it was NULL.  Third, we calculate
the other fields (root_el, max_leaf_extents) in operations rather than
if blocks.  Finally, we remove the et_type, the if block, and start
using extent trees as first class objects.

Check out the last patch, which is really the payoff, to see what I'm
going for.

Joel





More information about the Ocfs2-devel mailing list