summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2021-08-12 01:45:21 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-08-12 01:45:21 +0200
commited5090bde7497850a6ea654e8308496d518010e3 (patch)
tree3e1858682cf25dbb3ec38dd20464f84e88dce191
parent5ed12dc1583e4abd91410a53c4a49b7ab194a3f2 (diff)
ext2fs: Disable an expensive check
disk_cache_block_is_ref calls hurd_ihash_find which is very expensive, so better disable the checks from record_global_poke and record_indir_poke unless building a debugging version.
-rw-r--r--ext2fs/ext2fs.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h
index 2b49d2ea..ba0eaecd 100644
--- a/ext2fs/ext2fs.h
+++ b/ext2fs/ext2fs.h
@@ -505,7 +505,9 @@ record_global_poke (void *ptr)
block_t block = boffs_block (bptr_offs (ptr));
void *block_ptr = bptr (block);
ext2_debug ("(%p = %p)", ptr, block_ptr);
+#ifdef EXT2FS_DEBUG
assert_backtrace (disk_cache_block_is_ref (block));
+#endif
global_block_modified (block);
pokel_add (&global_pokel, block_ptr, block_size);
}
@@ -531,7 +533,9 @@ record_indir_poke (struct node *node, void *ptr)
block_t block = boffs_block (bptr_offs (ptr));
void *block_ptr = bptr (block);
ext2_debug ("(%llu, %p)", node->cache_id, ptr);
+#ifdef EXT2FS_DEBUG
assert_backtrace (disk_cache_block_is_ref (block));
+#endif
global_block_modified (block);
pokel_add (&diskfs_node_disknode (node)->indir_pokel, block_ptr, block_size);
}