Re: [PATCH 1/4] Btrfs: use radix tree for checksum

2012-07-07 Thread Liu Bo
On 07/06/2012 11:37 PM, Chris Mason wrote: > On Wed, Jun 13, 2012 at 07:50:52PM -0600, Liu Bo wrote: >> On 06/14/2012 12:07 AM, Zach Brown wrote: >> int set_state_private(struct extent_io_tree *tree, u64 start, u64 private) { >>> [...] +ret = radix_tree_insert(&tree->cs

Re: [PATCH 1/4] Btrfs: use radix tree for checksum

2012-07-06 Thread Chris Mason
On Wed, Jun 13, 2012 at 07:50:52PM -0600, Liu Bo wrote: > On 06/14/2012 12:07 AM, Zach Brown wrote: > > > > >> int set_state_private(struct extent_io_tree *tree, u64 start, u64 > >> private) > >> { > > [...] > >> +ret = radix_tree_insert(&tree->csum, (unsigned long)start, > >> +

Re: [PATCH 1/4] Btrfs: use radix tree for checksum

2012-06-14 Thread Zach Brown
+BUG_ON(ret); I wonder if we can patch BUG_ON() to break the build if its only argument is "ret". why? Well, I'm mostly joking :). That would be a very silly change to make. But only mostly joking. btrfs does have a real fragility problem from all these incomplete error handling pa

Re: [PATCH 1/4] Btrfs: use radix tree for checksum

2012-06-14 Thread David Sterba
On Wed, Jun 13, 2012 at 06:19:08PM +0800, Liu Bo wrote: > We used to issue a checksum to an extent state of 4K range for read endio, > but now we want to use larger range for performance optimization, so instead > we > create a radix tree for checksum, where an item stands for checksum of 4K > da

Re: [PATCH 1/4] Btrfs: use radix tree for checksum

2012-06-13 Thread Liu Bo
On 06/14/2012 12:07 AM, Zach Brown wrote: > >> int set_state_private(struct extent_io_tree *tree, u64 start, u64 >> private) >> { > [...] >> +ret = radix_tree_insert(&tree->csum, (unsigned long)start, >> + (void *)((unsigned long)private<< 1)); > > Will this fail for 6

Re: [PATCH 1/4] Btrfs: use radix tree for checksum

2012-06-13 Thread Zach Brown
int set_state_private(struct extent_io_tree *tree, u64 start, u64 private) { [...] + ret = radix_tree_insert(&tree->csum, (unsigned long)start, + (void *)((unsigned long)private<< 1)); Will this fail for 64bit files on 32bit hosts? + BUG_ON(ret

[PATCH 1/4] Btrfs: use radix tree for checksum

2012-06-13 Thread Liu Bo
We used to issue a checksum to an extent state of 4K range for read endio, but now we want to use larger range for performance optimization, so instead we create a radix tree for checksum, where an item stands for checksum of 4K data. Signed-off-by: Liu Bo --- fs/btrfs/extent_io.c | 84 +++