summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-11-22 18:30:37 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-11-22 18:30:37 +0100
commit8ab38e51c634f5d78daa9c721d707915b671810c (patch)
treea5e7c7c78f7a79755e2ba1ee5629ce5aa731c948 /debian
parentddf92baac22da93a4fc9ee0f941201fa757a80c1 (diff)
add patch series
Diffstat (limited to 'debian')
-rw-r--r--debian/patches/ext2fs-optimize-bcache0001-ext2fs-improve-the-block-cache.patch53
-rw-r--r--debian/patches/ext2fs-optimize-bcache0002-ext2fs-disable-block-cache-debugging-by-default.patch68
-rw-r--r--debian/patches/series2
3 files changed, 123 insertions, 0 deletions
diff --git a/debian/patches/ext2fs-optimize-bcache0001-ext2fs-improve-the-block-cache.patch b/debian/patches/ext2fs-optimize-bcache0001-ext2fs-improve-the-block-cache.patch
new file mode 100644
index 00000000..c2a351a5
--- /dev/null
+++ b/debian/patches/ext2fs-optimize-bcache0001-ext2fs-improve-the-block-cache.patch
@@ -0,0 +1,53 @@
+From e2c56080e44eea2912dcfcd296977c942f5ffeff Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Thu, 12 Nov 2015 23:22:13 +0100
+Subject: [PATCH hurd 1/2] ext2fs: improve the block cache
+
+* ext2fs/pager.c (disk_cache_block_ref): Improve the cache by using
+the new lookup and insertion functions that return and use a location
+pointer.
+---
+ ext2fs/pager.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/ext2fs/pager.c b/ext2fs/pager.c
+index 9df7e0b..2528856 100644
+--- a/ext2fs/pager.c
++++ b/ext2fs/pager.c
+@@ -960,6 +960,7 @@ disk_cache_block_ref (block_t block)
+ {
+ int index;
+ void *bptr;
++ hurd_ihash_locp_t slot;
+
+ assert (block < store->size >> log2_block_size);
+
+@@ -968,7 +969,7 @@ disk_cache_block_ref (block_t block)
+ retry_ref:
+ pthread_mutex_lock (&disk_cache_lock);
+
+- bptr = hurd_ihash_find (disk_cache_bptr, block);
++ bptr = hurd_ihash_locp_find (disk_cache_bptr, block, &slot);
+ if (bptr)
+ /* Already mapped. */
+ {
+@@ -1091,12 +1092,13 @@ retry_ref:
+ #endif
+
+ /* Re-associate. */
++
++ /* New association. */
++ if (hurd_ihash_locp_add (disk_cache_bptr, slot, block, bptr))
++ ext2_panic ("Couldn't hurd_ihash_locp_add new disk block");
+ if (disk_cache_info[index].block != DC_NO_BLOCK)
+ /* Remove old association. */
+ hurd_ihash_remove (disk_cache_bptr, disk_cache_info[index].block);
+- /* New association. */
+- if (hurd_ihash_add (disk_cache_bptr, block, bptr))
+- ext2_panic ("Couldn't hurd_ihash_add new disk block");
+ assert (! (disk_cache_info[index].flags & DC_DONT_REUSE & ~DC_UNTOUCHED));
+ disk_cache_info[index].block = block;
+ assert (! disk_cache_info[index].ref_count);
+--
+2.1.4
+
diff --git a/debian/patches/ext2fs-optimize-bcache0002-ext2fs-disable-block-cache-debugging-by-default.patch b/debian/patches/ext2fs-optimize-bcache0002-ext2fs-disable-block-cache-debugging-by-default.patch
new file mode 100644
index 00000000..e69d825c
--- /dev/null
+++ b/debian/patches/ext2fs-optimize-bcache0002-ext2fs-disable-block-cache-debugging-by-default.patch
@@ -0,0 +1,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/2] 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
+
diff --git a/debian/patches/series b/debian/patches/series
index 17a5c8ee..5e5387fc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -56,3 +56,5 @@ introspection0009-pflocal-annotate-objects-managed-by-libports.patch
ihash-as-cache0001-libihash-fix-ill-devised-locp-lookup-interface.patch
ihash-as-cache0002-libihash-fix-fast-insertion-corner-case.patch
ihash-as-cache0003-libihash-generalize-the-interface-to-support-non-int.patch
+ext2fs-optimize-bcache0001-ext2fs-improve-the-block-cache.patch
+ext2fs-optimize-bcache0002-ext2fs-disable-block-cache-debugging-by-default.patch