Re: [RFC PATCH 5/7] Btrfs: add btrfs_compare_trees function

2012-07-05 Thread Alex Lyakas
Alexander, + if (advance_left !left_end_reached) { + ret = tree_advance(left_root, left_path, left_level, + left_root_level, + advance_left != ADVANCE_ONLY_NEXT, +

Re: [RFC PATCH 5/7] Btrfs: add btrfs_compare_trees function

2012-07-05 Thread Alexander Block
On Thu, Jul 5, 2012 at 2:19 PM, Alex Lyakas alex.bolshoy.bt...@gmail.com wrote: Alexander, + if (advance_left !left_end_reached) { + ret = tree_advance(left_root, left_path, left_level, + left_root_level, +

Re: [RFC PATCH 5/7] Btrfs: add btrfs_compare_trees function

2012-07-05 Thread Alex Lyakas
On Thu, Jul 5, 2012 at 3:47 PM, Alexander Block abloc...@googlemail.com wrote: On Thu, Jul 5, 2012 at 2:19 PM, Alex Lyakas alex.bolshoy.bt...@gmail.com wrote: Alexander, + if (advance_left !left_end_reached) { + ret = tree_advance(left_root, left_path,

Re: [RFC PATCH 5/7] Btrfs: add btrfs_compare_trees function

2012-07-04 Thread Alex Lyakas
Hi Alex, + spin_lock(left_root-root_times_lock); + ctransid = btrfs_root_ctransid(left_root-root_item); + spin_unlock(left_root-root_times_lock); + if (ctransid != left_start_ctransid) +

Re: [RFC PATCH 5/7] Btrfs: add btrfs_compare_trees function

2012-07-04 Thread Alex Lyakas
Hi Alex, +static int tree_compare_item(struct btrfs_root *left_root, +struct btrfs_path *left_path, +struct btrfs_path *right_path, +char *tmp_buf) +{ + int cmp; + int len1, len2; +

Re: [RFC PATCH 5/7] Btrfs: add btrfs_compare_trees function

2012-07-04 Thread Alexander Block
On Wed, Jul 4, 2012 at 8:27 PM, Alex Lyakas alex.bolshoy.bt...@gmail.com wrote: Hi Alex, + spin_lock(left_root-root_times_lock); + ctransid = btrfs_root_ctransid(left_root-root_item); + spin_unlock(left_root-root_times_lock);

Re: [RFC PATCH 5/7] Btrfs: add btrfs_compare_trees function

2012-07-04 Thread Alexander Block
On Wed, Jul 4, 2012 at 9:13 PM, Alex Lyakas alex.bolshoy.bt...@gmail.com wrote: Hi Alex, +static int tree_compare_item(struct btrfs_root *left_root, +struct btrfs_path *left_path, +struct btrfs_path *right_path, +

Re: [RFC PATCH 5/7] Btrfs: add btrfs_compare_trees function

2012-07-04 Thread David Sterba
On Wed, Jul 04, 2012 at 10:18:34PM +0200, Alexander Block wrote: It might be worth to note in the comment, that tmp_buff should be large enough to hold the item from the left tree. Can it happen that the right tree has a different leafsize? This function is only to be used for for the