diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mlock.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/mm/mlock.c b/mm/mlock.c index cbe9e0581b75..28be15ead9c1 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -660,21 +660,14 @@ void *alloc_locked_buffer(size_t size) return buffer; } -void release_locked_buffer(void *buffer, size_t size) +void refund_locked_buffer_memory(struct mm_struct *mm, size_t size) { unsigned long pgsz = PAGE_ALIGN(size) >> PAGE_SHIFT; - down_write(¤t->mm->mmap_sem); - - current->mm->total_vm -= pgsz; - current->mm->locked_vm -= pgsz; - - up_write(¤t->mm->mmap_sem); -} + down_write(&mm->mmap_sem); -void free_locked_buffer(void *buffer, size_t size) -{ - release_locked_buffer(buffer, size); + mm->total_vm -= pgsz; + mm->locked_vm -= pgsz; - kfree(buffer); + up_write(&mm->mmap_sem); } |