btrfs: switch args for comp_*_refs
authorJosef Bacik <josef@toxicpanda.com>
Thu, 19 Oct 2017 18:15:58 +0000 (14:15 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 1 Nov 2017 19:45:35 +0000 (20:45 +0100)
Make it more consistent, we want the inserted ref to be compared against
what's already in there.  This will make the order go from lowest seq ->
highest seq, which will make us more likely to make forward progress if
there's a seqlock currently held.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-ref.c

index a2973340a94f8752b1448ee3feb289fe2f1f03d3..bc940bb374cfb8d9e06ba0bd5529bdde94dba2cf 100644 (file)
@@ -40,8 +40,8 @@ struct kmem_cache *btrfs_delayed_extent_op_cachep;
 /*
  * compare two delayed tree backrefs with same bytenr and type
  */
-static int comp_tree_refs(struct btrfs_delayed_tree_ref *ref2,
-                         struct btrfs_delayed_tree_ref *ref1)
+static int comp_tree_refs(struct btrfs_delayed_tree_ref *ref1,
+                         struct btrfs_delayed_tree_ref *ref2)
 {
        if (ref1->node.type == BTRFS_TREE_BLOCK_REF_KEY) {
                if (ref1->root < ref2->root)
@@ -60,8 +60,8 @@ static int comp_tree_refs(struct btrfs_delayed_tree_ref *ref2,
 /*
  * compare two delayed data backrefs with same bytenr and type
  */
-static int comp_data_refs(struct btrfs_delayed_data_ref *ref2,
-                         struct btrfs_delayed_data_ref *ref1)
+static int comp_data_refs(struct btrfs_delayed_data_ref *ref1,
+                         struct btrfs_delayed_data_ref *ref2)
 {
        if (ref1->node.type == BTRFS_EXTENT_DATA_REF_KEY) {
                if (ref1->root < ref2->root)