[Ocfs2-devel] [PATCH 07/10] ocfs2: Determine an extent tree's max_leaf_clusters in an et_op.

Joel Becker Joel.Becker at oracle.com
Wed Aug 20 23:23:30 PDT 2008


On Thu, Aug 21, 2008 at 12:13:15PM +0800, TaoMa wrote:
> Joel Becker wrote:
>> Provide an optional extent_tree_operation to specify the
>> max_leaf_clusters of an ocfs2_extent_tree.  If not provided, the value
>> is 0 (unlimited).
>>

<snip>

>> @@ -265,11 +275,13 @@ static void ocfs2_get_extent_tree(struct ocfs2_extent_tree *et,
>>  		et->et_ops = &ocfs2_xattr_et_ops;
>>  	} else if (et_type == OCFS2_XATTR_TREE_EXTENT) {
>>  		et->et_ops = &ocfs2_xattr_tree_et_ops;
>> -		et->et_max_leaf_clusters = ocfs2_clusters_for_bytes(inode->i_sb,
>> -						OCFS2_MAX_XATTR_TREE_LEAF_SIZE);
>>  	}
>>   	et->et_ops->eo_fill_root_el(et);
>> +	if (!et->et_ops->eo_fill_max_leaf_clusters)
>> +		et->et_max_leaf_clusters = 0;
>> +	else
>> +		et->et_ops->eo_fill_max_leaf_clusters(inode, et);
>>  }
>>   
> Like what you have done in patch 1/10, maybe we can add a small wrapper  
> named ocfs2_et_fill_max_leaf_clusters for this?

	I did it that way at first, but then I decided to make the
eo_fill_*() functions not have an accessor, because they are internal to
get_extent_tree().  They can only be called from there.
	I'm open to changing it.  It jwas just a thought.

Joel

-- 

Life's Little Instruction Book #396

	"Never give anyone a fruitcake."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-devel mailing list