diff options
author | dyson <dyson@FreeBSD.org> | 1997-08-18 02:06:35 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1997-08-18 02:06:35 +0000 |
commit | cc823b6e73bb5ca0ce0985be66c29c51c6db4610 (patch) | |
tree | b0ab1e166385449ac1be20b025e2a4c29bbc281e /sys/vm/vm_map.c | |
parent | 228bbc181cefc1f36d72c2b52dec55b3665a14cd (diff) | |
download | FreeBSD-src-cc823b6e73bb5ca0ce0985be66c29c51c6db4610.zip FreeBSD-src-cc823b6e73bb5ca0ce0985be66c29c51c6db4610.tar.gz |
Fix kern_lock so that it will work. Additionally, clean-up some of the
VM systems usage of the kernel lock (lockmgr) code. This is a first
pass implementation, and is expected to evolve as needed. The API
for the lock manager code has not changed, but the underlying implementation
has changed significantly. This change should not materially affect
our current SMP or UP code without non-standard parameters being used.
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r-- | sys/vm/vm_map.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 4019599..640c2aa 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_map.c,v 1.84 1997/08/05 23:03:23 dyson Exp $ + * $Id: vm_map.c,v 1.85 1997/08/06 04:58:03 dyson Exp $ */ /* @@ -1378,7 +1378,7 @@ vm_map_user_pageable(map, start, end, new_pageable) /* First we need to allow map modifications */ vm_map_set_recursive(map); - lockmgr(&map->lock, LK_DOWNGRADE,(void *)0, curproc); + vm_map_lock_downgrade(map); rv = vm_fault_user_wire(map, entry->start, entry->end); if (rv) { @@ -1394,7 +1394,7 @@ vm_map_user_pageable(map, start, end, new_pageable) } vm_map_clear_recursive(map); - lockmgr(&map->lock, LK_UPGRADE, (void *)0, curproc); + vm_map_lock_upgrade(map); goto rescan; } @@ -1594,7 +1594,7 @@ vm_map_pageable(map, start, end, new_pageable) vm_map_unlock(map); /* trust me ... */ } else { vm_map_set_recursive(map); - lockmgr(&map->lock, LK_DOWNGRADE, (void*)0, curproc); + vm_map_lock_downgrade(map); } rv = 0; @@ -2374,9 +2374,7 @@ RetryLookup:; * object. */ - if (lockmgr(&share_map->lock, LK_EXCLUPGRADE, - (void *)0, curproc)) { - + if (vm_map_lock_upgrade(share_map)) { if (share_map != map) vm_map_unlock_read(map); @@ -2388,9 +2386,7 @@ RetryLookup:; OFF_TO_IDX(entry->end - entry->start)); entry->eflags &= ~MAP_ENTRY_NEEDS_COPY; - - lockmgr(&share_map->lock, LK_DOWNGRADE, - (void *)0, curproc); + vm_map_lock_downgrade(share_map); } else { /* * We're attempting to read a copy-on-write page -- @@ -2405,8 +2401,7 @@ RetryLookup:; */ if (entry->object.vm_object == NULL) { - if (lockmgr(&share_map->lock, LK_EXCLUPGRADE, - (void *)0, curproc)) { + if (vm_map_lock_upgrade(share_map)) { if (share_map != map) vm_map_unlock_read(map); goto RetryLookup; @@ -2414,7 +2409,7 @@ RetryLookup:; entry->object.vm_object = vm_object_allocate(OBJT_DEFAULT, OFF_TO_IDX(entry->end - entry->start)); entry->offset = 0; - lockmgr(&share_map->lock, LK_DOWNGRADE, (void *)0, curproc); + vm_map_lock_downgrade(share_map); } if (entry->object.vm_object != NULL) |