[Ocfs2-devel] [PATCH] Refactor ocfs2_insert_extent for not-merging. Revised

Mark Fasheh mfasheh at suse.com
Thu Aug 14 20:09:35 PDT 2008


On Fri, Aug 15, 2008 at 12:22:24AM +0800, Tao Ma wrote:
> Hi Mark,
> 	Your explanation is clear enough. So here is the revised one. Thanks.

Great, thanks Tao.


> @@ -4134,6 +4139,20 @@ static void ocfs2_figure_contig_type(struct inode *inode,
>  		}
>  	}
>  	insert->ins_contig = contig_type;
> +
> +	if (insert->ins_contig != CONTIG_NONE) {
> +		struct ocfs2_extent_rec *rec =
> +				&el->l_recs[insert->ins_contig_index];
> +		unsigned int len = le16_to_cpu(rec->e_leaf_clusters) +
> +				   le16_to_cpu(insert_rec->e_leaf_clusters);
> +
> +		/*
> +		 * Caller might want us to limit the size of extents, don't
> +		 * calculate contiguousness if we might exceed that limit.
> + 		 */
> +		if (et->max_leaf_clusters && len > et->max_leaf_clusters)
> +		        insert->ins_contig = CONTIG_NONE;
> +	}

I would have just compared len and max_leaf_clusters at the top of the
function, but either way works for me. The rest of the patch looks great.


Do we have to do anything similar for when you remove clusters from the ea
index tree?
	--Mark

--
Mark Fasheh



More information about the Ocfs2-devel mailing list