summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-07-25 02:21:33 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-08-20 18:59:44 +0200
commite113297de8d349b3ccc2e7bf8b169fe5c5493580 (patch)
tree6b56f333f3e75ab0f2344da43305a3af0a10ca06
parentf8f95cd634a444789871fb851912b6768f733943 (diff)
vm/object: use a general lock to protect the object cache
* vm/vm_object.c: Use a general lock to protect the object cache.
-rw-r--r--vm/vm_object.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/vm/vm_object.c b/vm/vm_object.c
index 36dbd8b..4b31482 100644
--- a/vm/vm_object.c
+++ b/vm/vm_object.c
@@ -178,14 +178,16 @@ queue_head_t vm_object_cached_list;
int vm_object_cached_count;
int vm_object_cached_max = 4000; /* may be patched*/
-decl_simple_lock_data(,vm_object_cached_lock_data)
+struct lock vm_object_cache_lock_data;
+#define vm_object_cache_lock_init() \
+ lock_init(&vm_object_cache_lock_data, FALSE)
#define vm_object_cache_lock() \
- simple_lock(&vm_object_cached_lock_data)
+ lock_write(&vm_object_cache_lock_data)
#define vm_object_cache_lock_try() \
- simple_lock_try(&vm_object_cached_lock_data)
+ lock_try_write(&vm_object_cache_lock_data)
#define vm_object_cache_unlock() \
- simple_unlock(&vm_object_cached_lock_data)
+ lock_write_done(&vm_object_cache_lock_data)
/*
* Number of physical pages referenced by cached objects.
@@ -266,7 +268,7 @@ void vm_object_bootstrap(void)
sizeof(struct vm_object), 0, NULL, NULL, NULL, 0);
queue_init(&vm_object_cached_list);
- simple_lock_init(&vm_object_cached_lock_data);
+ vm_object_cache_lock_init();
/*
* Fill in a template object, for quick initialization