[PATCH] Btrfs: Simplify the logic in alloc_extent_buffer() for existing extent buffer case

2013-10-07 Thread Chandra Seetharaman
alloc_extent_buffer() uses radix_tree_lookup() when radix_tree_insert() fails with EEXIST. That part of the code is very similar to the code in find_extent_buffer(). This patch replaces radix_tree_lookup() and surrounding code in alloc_extent_buffer() with find_extent_buffer(). Note that radix_tre

Re: [PATCH] Btrfs: Simplify the logic in alloc_extent_buffer() for existing extent buffer case

2013-10-04 Thread Zach Brown
> > > +struct extent_buffer *find_extent_buffer(struct extent_io_tree *tree, > > > + u64 start, unsigned long len) > > > > len isn't used. > > Thought about removing the unused argument. But didn't know all the > history behind why it was there in the first place.

Re: [PATCH] Btrfs: Simplify the logic in alloc_extent_buffer() for existing extent buffer case

2013-10-04 Thread Chandra Seetharaman
On Fri, 2013-10-04 at 14:38 -0700, Zach Brown wrote: Thanks for the review Zach. > On Fri, Oct 04, 2013 at 02:55:29PM -0500, Chandra Seetharaman wrote: > > alloc_extent_buffer() uses radix_tree_lookup() when radix_tree_insert() > > fails > > with EEXIST. That part of the code is very similar to

Re: [PATCH] Btrfs: Simplify the logic in alloc_extent_buffer() for existing extent buffer case

2013-10-04 Thread Zach Brown
On Fri, Oct 04, 2013 at 02:55:29PM -0500, Chandra Seetharaman wrote: > alloc_extent_buffer() uses radix_tree_lookup() when radix_tree_insert() fails > with EEXIST. That part of the code is very similar to the code in > find_extent_buffer(). This patch replaces radix_tree_lookup() and surrounding >

[PATCH] Btrfs: Simplify the logic in alloc_extent_buffer() for existing extent buffer case

2013-10-04 Thread Chandra Seetharaman
alloc_extent_buffer() uses radix_tree_lookup() when radix_tree_insert() fails with EEXIST. That part of the code is very similar to the code in find_extent_buffer(). This patch replaces radix_tree_lookup() and surrounding code in alloc_extent_buffer() with find_extent_buffer(). While at it, this p