[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 02/06: ext2fs: Fix adding blocks to free blocks cache
From: |
Samuel Thibault |
Subject: |
[hurd] 02/06: ext2fs: Fix adding blocks to free blocks cache |
Date: |
Wed, 16 Mar 2016 01:36:35 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit b50c419c9b8f59b459d488d7bf11654d56f35511
Author: Samuel Thibault <address@hidden>
Date: Tue Mar 15 00:27:20 2016 +0100
ext2fs: Fix adding blocks to free blocks cache
* ext2fs/pager.c (disk_cache_info_free_push): Add prototype.
(disk_pager_notify_evict): When dropping DC_INCORE flag, if the
block becomes free (no reference and no DC_DONT_REUSE flags), call
disk_cache_info_free_push.
(disk_cache_block_deref): Only call disk_cache_info_free_push if the flags
of the block do not contain DC_DONT_REUSE flags.
---
ext2fs/pager.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/ext2fs/pager.c b/ext2fs/pager.c
index 458b822..d395472 100644
--- a/ext2fs/pager.c
+++ b/ext2fs/pager.c
@@ -79,6 +79,9 @@ do { pthread_spin_lock (&ext2s_pager_stats.lock);
\
#else /* !STATS */
#define STAT_INC(field) /* nop */0
#endif /* STATS */
+
+static void
+disk_cache_info_free_push (struct disk_cache_info *p);
#define FREE_PAGE_BUFS 24
@@ -538,6 +541,9 @@ disk_pager_notify_evict (vm_offset_t page)
pthread_mutex_lock (&disk_cache_lock);
disk_cache_info[index].flags &= ~DC_INCORE;
+ if (disk_cache_info[index].ref_count == 0 &&
+ !(disk_cache_info[index].flags & DC_DONT_REUSE))
+ disk_cache_info_free_push (&disk_cache_info[index]);
pthread_mutex_unlock (&disk_cache_lock);
}
@@ -1196,7 +1202,8 @@ disk_cache_block_deref (void *ptr)
assert (! (disk_cache_info[index].flags & DC_UNTOUCHED));
assert (disk_cache_info[index].ref_count >= 1);
disk_cache_info[index].ref_count--;
- if (disk_cache_info[index].ref_count == 0)
+ if (disk_cache_info[index].ref_count == 0 &&
+ !(disk_cache_info[index].flags & DC_DONT_REUSE))
disk_cache_info_free_push (&disk_cache_info[index]);
pthread_mutex_unlock (&disk_cache_lock);
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (77b1fce -> a2cfb67), Samuel Thibault, 2016/03/15
- [hurd] 04/06: Show firmlink mounts to mount points, Samuel Thibault, 2016/03/15
- [hurd] 03/06: Add get_source support to firmlink, Samuel Thibault, 2016/03/15
- [hurd] 02/06: ext2fs: Fix adding blocks to free blocks cache,
Samuel Thibault <=
- [hurd] 06/06: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd into upstream, Samuel Thibault, 2016/03/15
- [hurd] 01/06: Add missing RPC definitions, Samuel Thibault, 2016/03/15
- [hurd] 05/06: Add getting swap information from swapon and procfs, Samuel Thibault, 2016/03/15