summaryrefslogtreecommitdiff
path: root/debian/patches/ext2fs-optimize-bcache0002-ext2fs-disable-block-cache-debugging-by-default.patch
blob: 27048fa937e502498556485bd069d601841d4648 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From 990ee5080a171f0848e72ec0f9ef6e5f62740aa7 Mon Sep 17 00:00:00 2001
From: Justus Winter <4winter@informatik.uni-hamburg.de>
Date: Thu, 12 Nov 2015 23:33:35 +0100
Subject: [PATCH hurd 2/3] ext2fs: disable block cache debugging by default

* ext2fs/ext2fs.h: Disable block cache debugging by default.
* ext2fs/pager.c: Likewise.
---
 ext2fs/ext2fs.h | 4 ++--
 ext2fs/pager.c  | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h
index 42717c5..0b6b79e 100644
--- a/ext2fs/ext2fs.h
+++ b/ext2fs/ext2fs.h
@@ -244,7 +244,7 @@ extern int disk_cache_blocks;
 
 #define DC_NO_BLOCK	((block_t) -1L)
 
-#ifndef NDEBUG
+#ifdef DEBUG_DISK_CACHE
 #define DISK_CACHE_LAST_READ_XOR	0xDEADBEEF
 #endif
 
@@ -254,7 +254,7 @@ struct disk_cache_info
   block_t block;
   uint16_t flags;
   uint16_t ref_count;
-#ifndef NDEBUG
+#ifdef DEBUG_DISK_CACHE
   block_t last_read, last_read_xor;
 #endif
 };
diff --git a/ext2fs/pager.c b/ext2fs/pager.c
index 2528856..f28bcab 100644
--- a/ext2fs/pager.c
+++ b/ext2fs/pager.c
@@ -433,7 +433,7 @@ disk_pager_read_page (vm_offset_t page, void **buf, int *writelock)
     + offset % block_size;
   disk_cache_info[index].flags |= DC_INCORE;
   disk_cache_info[index].flags &=~ DC_UNTOUCHED;
-#ifndef NDEBUG
+#ifdef DEBUG_DISK_CACHE
   disk_cache_info[index].last_read = disk_cache_info[index].block;
   disk_cache_info[index].last_read_xor
     = disk_cache_info[index].block ^ DISK_CACHE_LAST_READ_XOR;
@@ -469,7 +469,7 @@ disk_pager_write_page (vm_offset_t page, void *buf)
   assert (disk_cache_info[index].block != DC_NO_BLOCK);
   offset = ((store_offset_t) disk_cache_info[index].block << log2_block_size)
     + offset % block_size;
-#ifndef NDEBUG			/* Not strictly needed.  */
+#ifdef DEBUG_DISK_CACHE			/* Not strictly needed.  */
   assert ((disk_cache_info[index].last_read ^ DISK_CACHE_LAST_READ_XOR)
 	  == disk_cache_info[index].last_read_xor);
   assert (disk_cache_info[index].last_read
@@ -873,7 +873,7 @@ disk_cache_init (void)
       disk_cache_info[i].block = DC_NO_BLOCK;
       disk_cache_info[i].flags = 0;
       disk_cache_info[i].ref_count = 0;
-#ifndef NDEBUG
+#ifdef DEBUG_DISK_CACHE
       disk_cache_info[i].last_read = DC_NO_BLOCK;
       disk_cache_info[i].last_read_xor
 	= DC_NO_BLOCK ^ DISK_CACHE_LAST_READ_XOR;
-- 
2.1.4