btrfs: use common helpers for extent IO state insertion messages
authorDavid Sterba <dsterba@suse.com>
Tue, 18 Jun 2019 18:00:05 +0000 (20:00 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 2 Jul 2019 10:30:50 +0000 (12:30 +0200)
Print the error messages using the helpers that also print the
filesystem identification.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c

index 464e6b761a9c9fb078080ab0718e98bb501db936..932d2e0be8d7f3d4ae99e66fe1a5a1498494ca89 100644 (file)
@@ -522,9 +522,11 @@ static int insert_state(struct extent_io_tree *tree,
 {
        struct rb_node *node;
 
-       if (end < start)
-               WARN(1, KERN_ERR "BTRFS: end < start %llu %llu\n",
-                      end, start);
+       if (end < start) {
+               btrfs_err(tree->fs_info,
+                       "insert state: end < start %llu %llu", end, start);
+               WARN_ON(1);
+       }
        state->start = start;
        state->end = end;
 
@@ -534,7 +536,8 @@ static int insert_state(struct extent_io_tree *tree,
        if (node) {
                struct extent_state *found;
                found = rb_entry(node, struct extent_state, rb_node);
-               pr_err("BTRFS: found node %llu %llu on insert of %llu %llu\n",
+               btrfs_err(tree->fs_info,
+                      "found node %llu %llu on insert of %llu %llu",
                       found->start, found->end, start, end);
                return -EEXIST;
        }