diff options
Diffstat (limited to 'vm/vm_object.h')
-rw-r--r-- | vm/vm_object.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/vm/vm_object.h b/vm/vm_object.h index c992570..4e4c949 100644 --- a/vm/vm_object.h +++ b/vm/vm_object.h @@ -71,8 +71,8 @@ struct vm_object { * if internal) */ - short ref_count; /* Number of references */ - short resident_page_count; + int ref_count; /* Number of references */ + int resident_page_count; /* number of resident pages */ struct vm_object *copy; /* Object that should receive @@ -370,4 +370,23 @@ MACRO_END #define vm_object_lock_taken(object) simple_lock_taken(&(object)->Lock) #endif /* VM_OBJECT_DEBUG */ +/* + * Page cache accounting. + * + * The number of cached objects and pages can be read + * without holding any lock. + */ + +extern int vm_object_cached_count; + +extern int vm_object_cached_pages; +decl_simple_lock_data(extern,vm_object_cached_pages_lock_data) + +#define vm_object_cached_pages_update(page_count) \ + MACRO_BEGIN \ + simple_lock(&vm_object_cached_pages_lock_data); \ + vm_object_cached_pages += (page_count); \ + simple_unlock(&vm_object_cached_pages_lock_data); \ + MACRO_END + #endif /* _VM_VM_OBJECT_H_ */ |