[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 30/75: ext2fs: improve the block cache
From: |
Samuel Thibault |
Subject: |
[hurd] 30/75: ext2fs: improve the block cache |
Date: |
Thu, 14 Jan 2016 01:04:08 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch dde
in repository hurd.
commit 1b6d78a1a79afe79a71841d914a4e49d6eb9100c
Author: Justus Winter <address@hidden>
Date: Thu Nov 12 23:22:13 2015 +0100
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);
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 12/75: Merge branch 'dde' of ssh://git.savannah.gnu.org/srv/git/hurd/incubator into dde, (continued)
- [hurd] 12/75: Merge branch 'dde' of ssh://git.savannah.gnu.org/srv/git/hurd/incubator into dde, Samuel Thibault, 2016/01/13
- [hurd] 02/75: libtrivfs: remove deprecated static class vectors, Samuel Thibault, 2016/01/13
- [hurd] 05/75: random: improve error handling, Samuel Thibault, 2016/01/13
- [hurd] 01/75: pfinet: fix sanity check at translator startup time, Samuel Thibault, 2016/01/13
- [hurd] 22/75: Fix undefined reference, Samuel Thibault, 2016/01/13
- [hurd] 24/75: Use -L instead of -Wl,-rpath-link, Samuel Thibault, 2016/01/13
- [hurd] 26/75: libihash: fix fast insertion corner case, Samuel Thibault, 2016/01/13
- [hurd] 25/75: libihash: fix ill-devised locp lookup interface, Samuel Thibault, 2016/01/13
- [hurd] 21/75: Drop spurious debugging or outdated changes, Samuel Thibault, 2016/01/13
- [hurd] 14/75: Add devnode translator, Samuel Thibault, 2016/01/13
- [hurd] 30/75: ext2fs: improve the block cache,
Samuel Thibault <=
- [hurd] 28/75: libihash: fix item insertion, Samuel Thibault, 2016/01/13
- [hurd] 66/75: Make private variables static, Samuel Thibault, 2016/01/13
- [hurd] 32/75: ext2fs: keep list of reusable disk cache entries, Samuel Thibault, 2016/01/13
- [hurd] 33/75: libdiskfs: use ihash for the node cache, Samuel Thibault, 2016/01/13
- [hurd] 31/75: ext2fs: disable block cache debugging by default, Samuel Thibault, 2016/01/13
- [hurd] 27/75: libihash: generalize the interface to support non-integer keys, Samuel Thibault, 2016/01/13
- [hurd] 68/75: Fix build with perl >= 5.22, Samuel Thibault, 2016/01/13
- [hurd] 29/75: libihash: provide a general purpose hash algorithm, Samuel Thibault, 2016/01/13
- [hurd] 65/75: pflocal: Do not abort on too small getopt parameter, Samuel Thibault, 2016/01/13
- [hurd] 71/75: Merge branch 'dde-upstream' into dde, Samuel Thibault, 2016/01/13