Skip to contentSkip to conversation

Btrfs: add missing extent state caching calls

PATCH New Filipe David Borba Manana 1 participant 1 message Nov 26, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: add missing extent state caching calls

When we didn't find a matching extent state, we inserted a new one but didn't cache it in the **cached_state parameter, which makes a subsequent call do a tree lookup to get it.

---
 fs/btrfs/extent_io.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/btrfs/extent_io.c +3 -1
index cb9ce69..b8e7e41 100644
@@ -817,6 +817,7 @@ again:
 		if (err)
 			extent_io_tree_panic(tree, err);
 
+		cache_state(prealloc, cached_state);
 		prealloc = NULL;
 		goto out;
 	}
@@ -1040,9 +1041,10 @@ again:
 			goto out;
 		}
 		err = insert_state(tree, prealloc, start, end, &bits);
-		prealloc = NULL;
 		if (err)
 			extent_io_tree_panic(tree, err);
+		cache_state(prealloc, cached_state);
+		prealloc = NULL;
 		goto out;
 	}
 	state = rb_entry(node, struct extent_state, rb_node);
Signature · 1 line
1.7.9.5