[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 11/98: mach-defpager: turn dealloc_direct into a normal function
From: |
Samuel Thibault |
Subject: |
[hurd] 11/98: mach-defpager: turn dealloc_direct into a normal function |
Date: |
Tue, 14 Jan 2014 01:59:58 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit b31164eeecf3f798f75a71577ae365daf8211946
Author: Justus Winter <address@hidden>
Date: Wed Nov 6 17:05:41 2013 +0100
mach-defpager: turn dealloc_direct into a normal function
* mach-defpager/default_pager.c (dealloc_direct): Move function
definition outside of pager_truncate.
---
mach-defpager/default_pager.c | 45 ++++++++++++++++++++++---------------------
1 file changed, 23 insertions(+), 22 deletions(-)
diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c
index b445590..9dad4c2 100644
--- a/mach-defpager/default_pager.c
+++ b/mach-defpager/default_pager.c
@@ -1061,6 +1061,29 @@ pager_extend(pager, new_size)
pthread_mutex_unlock(&pager->lock);
}
+/* This deallocates the pages necessary to truncate a direct map
+ previously of size NEW_SIZE to the smaller size OLD_SIZE. */
+static void
+dealloc_direct (dp_map_t mapptr,
+ vm_size_t old_size, vm_size_t new_size)
+{
+ vm_size_t i;
+
+ if (!mapptr)
+ return;
+
+ for (i = new_size; i < old_size; ++i)
+ {
+ const union dp_map entry = mapptr[i];
+ if (!no_block(entry))
+ {
+ pager_dealloc_page(entry.block.p_index, entry.block.p_offset,
+ TRUE);
+ invalidate_block(mapptr[i]);
+ }
+ }
+}
+
/* Truncate a memory object. First, any pages between the new size
and the (larger) old size are deallocated. Then, the size of
the pagemap may be reduced, an indirect map may be turned into
@@ -1075,28 +1098,6 @@ pager_truncate(dpager_t pager, vm_size_t new_size)
/* in pages */
int i;
vm_size_t old_size;
- /* This deallocates the pages necessary to truncate a direct map
- previously of size NEW_SIZE to the smaller size OLD_SIZE. */
- inline void dealloc_direct (dp_map_t mapptr,
- vm_size_t old_size, vm_size_t new_size)
- {
- vm_size_t i;
-
- if (!mapptr)
- return;
-
- for (i = new_size; i < old_size; ++i)
- {
- const union dp_map entry = mapptr[i];
- if (!no_block(entry))
- {
- pager_dealloc_page(entry.block.p_index, entry.block.p_offset,
- TRUE);
- invalidate_block(mapptr[i]);
- }
- }
- }
-
pthread_mutex_lock(&pager->lock); /* XXX lock_write */
if (!pager->map)
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 60/98: trans: fix the creation of files in fakeroot, (continued)
- [hurd] 60/98: trans: fix the creation of files in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 69/98: trans: return nodes locked when creating fake nodes in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 20/98: ext2fs: fix error handling, Samuel Thibault, 2014/01/13
- [hurd] 21/98: libshouldbeinlibc: fix dead assignment, Samuel Thibault, 2014/01/13
- [hurd] 93/98: trans/mtab: make the translator multithreaded, Samuel Thibault, 2014/01/13
- [hurd] 05/98: proc: remove declaration of nested functions from proc.h, Samuel Thibault, 2014/01/13
- [hurd] 15/98: mach-defpager: include errno.h, Samuel Thibault, 2014/01/13
- [hurd] 91/98: trans/mtab: remove the loop detection logic, Samuel Thibault, 2014/01/13
- [hurd] 97/98: libnetfs: register passive translator startups, Samuel Thibault, 2014/01/13
- [hurd] 19/98: libdiskfs: fix error handling, Samuel Thibault, 2014/01/13
- [hurd] 11/98: mach-defpager: turn dealloc_direct into a normal function,
Samuel Thibault <=
- [hurd] 23/98: mach-defpager: do not remove -Wall from CFLAGS, Samuel Thibault, 2014/01/13
- [hurd] 94/98: trans/mtab: do not include non-filesystem translators by default, Samuel Thibault, 2014/01/13
- [hurd] 96/98: libdiskfs: register passive translator startups, Samuel Thibault, 2014/01/13
- [hurd] 92/98: trans/mtab: properly lock mtab objects, Samuel Thibault, 2014/01/13
- [hurd] 03/98: libports: fix the thread counts in case the thread creation fails, Samuel Thibault, 2014/01/13
- [hurd] 76/98: utils/settrans: fix the teardown of chrooted environments, Samuel Thibault, 2014/01/13
- [hurd] 16/98: libshouldbeinlibc: fix reference counting in port_name_xlator_create, Samuel Thibault, 2014/01/13
- [hurd] 95/98: libfshelp: fix the api of fshelp_set_active_translator, Samuel Thibault, 2014/01/13
- [hurd] 98/98: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2014/01/13
- [hurd] 17/98: utils: implement portinfo --search, Samuel Thibault, 2014/01/13