Skip to content

Make ocfs2_extent_tree a first-class object

TaoMa ocfs2-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10ocfs2: Prefix the extent tree operations structure.+0 -00 replies
2/10ocfs2: Prefix the ocfs2_extent_tree structure.+0 -00 replies
3/10ocfs2: Make ocfs2_extent_tree get/put instead of alloc.+0 -01 reply
4/10ocfs2: Make 'private' into 'object' on ocfs2_extent_tree.+0 -00 replies
5/10ocfs2: Provide the get_root_el() method to ocfs2_extent_tree_operations.+0 -01 reply
6/10ocfs2: Use struct ocfs2_extent_tree in ocfs2_num_free_extents().+0 -01 reply
6/10ocfs2: Use struct ocfs2_extent_tree in ocfs2_num_free_extents().+0 -00 replies
7/10ocfs2: Determine an extent tree's max_leaf_clusters in an et_op.+0 -01 reply
8/10ocfs2: Create specific get_extent_tree functions.+0 -00 replies
9/10ocfs2: Add an insertion check to ocfs2_extent_tree_operations.+0 -01 reply
10/10ocfs2: Make ocfs2_extent_tree the first-class representation of a tree.+0 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Ocfs2-devel] [PATCH 0/10] Make ocfs2_extent_tree a first-class object
Quoted 17 lines · Joel Becker

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.

Quoted 3 lines

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

wow, you did such a quick job. ;)
I just put my modification(which is generated from your review) in my local branch and wait for a final send, but you have already sent them out. Awesome!
Then I will just need to review them.;)

Regards,
Tao