[Ocfs2-tools-devel] [patch 11/11] Some minor modification in other files.

Mark Fasheh mark.fasheh at oracle.com
Fri Aug 17 15:29:57 PDT 2007


On Thu, Aug 16, 2007 at 01:56:29AM +0800, tao.ma wrote:
> ===================================================================
> --- test.ocfs2-tools.orig/fswreck/extent.c	2007-08-16 00:27:44.000000000 -0400
> +++ test.ocfs2-tools/fswreck/extent.c	2007-08-16 00:36:28.000000000 -0400
> @@ -84,7 +84,7 @@ static void custom_extend_allocation(ocf
>  {
>  	errcode_t ret;
>  	uint32_t n_clusters;
> -	uint32_t i;
> +	uint32_t i, offset = 0;
>  	uint64_t blkno;
>  	uint64_t tmpblk;
>  
> @@ -103,7 +103,8 @@ static void custom_extend_allocation(ocf
>  		 * we insert each cluster in reverse. */
>  		for(i = n_clusters; i; --i) {
>  			tmpblk = blkno + ocfs2_clusters_to_blocks(fs, i - 1);
> -		 	ret = ocfs2_insert_extent(fs, ino, tmpblk, 1);
> +		 	ret = ocfs2_insert_extent(fs, ino, offset++,
> +						  tmpblk, 1);

Hmm... I'm not 100% sure what this function is supposed to do, but it
_looks_ like it's trying to grow allocation based on the rightmost allocated
cluster. Shouldn't 'offset' above start at the rightmost rec cpos + clusters
then? Starting at '0' means you'll just try to allocate over existing
records...
	--Mark

--
Mark Fasheh
Senior Software Developer, Oracle
mark.fasheh at oracle.com



More information about the Ocfs2-tools-devel mailing list