On Wed, Jan 03, 2007 at 10:07:01AM -0800, Mingming Cao wrote: > Alex Tomas wrote: > >I think that stuff that converts uninitialized blocks > >to initialized ones should be a separate codepath and > >shouldn't be done in the insert path. and an insert > >(basic tree manipulation) should BUG_ON() one tries > >to add extent with a block which is already covered > >by the tree. > > > >IMHO, get_blocks() should look like: > > > > path = find_path() > > if (found extent covers request block(s)) { > > if (extent is uninitialized) { > > convert(); > > } > > } > > > >where > > function convert() > > { > > /* adopt existing extent so that it > > * doesn't cover requested blocks */ > > > > /* insert head or tail of existing > > * extent, if necessary */ > > > > /* insert new extent of initialized blocks */ > > } > > > >thanks, Alex > > I was thing about the same thing. The current ext4_ext_get_blocks() > function becomes very bulky. The code to convert uninitialized blocks to > initialized ones is pretty selfcontained, and worth the effort to put it > into a seperate function. Ok. I will move this code to a new function. -- Regards, Amit Arora - To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html