diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/backing-dev.c | 4 | ||||
-rw-r--r-- | mm/filemap_xip.c | 2 | ||||
-rw-r--r-- | mm/slab.c | 1 | ||||
-rw-r--r-- | mm/slob.c | 1 | ||||
-rw-r--r-- | mm/slub.c | 6 |
5 files changed, 10 insertions, 4 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index b0ceb29..e8644b1 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -7,7 +7,7 @@ int bdi_init(struct backing_dev_info *bdi) { - int i, j; + int i; int err; for (i = 0; i < NR_BDI_STAT_ITEMS; i++) { @@ -21,7 +21,7 @@ int bdi_init(struct backing_dev_info *bdi) if (err) { err: - for (j = 0; j < i; j++) + while (i--) percpu_counter_destroy(&bdi->bdi_stat[i]); } diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c index 32132f3..e233fff 100644 --- a/mm/filemap_xip.c +++ b/mm/filemap_xip.c @@ -314,7 +314,7 @@ __xip_file_write(struct file *filp, const char __user *buf, fault_in_pages_readable(buf, bytes); kaddr = kmap_atomic(page, KM_USER0); copied = bytes - - __copy_from_user_inatomic_nocache(kaddr, buf, bytes); + __copy_from_user_inatomic_nocache(kaddr + offset, buf, bytes); kunmap_atomic(kaddr, KM_USER0); flush_dcache_page(page); @@ -4475,3 +4475,4 @@ size_t ksize(const void *objp) return obj_size(virt_to_cache(objp)); } +EXPORT_SYMBOL(ksize); @@ -495,6 +495,7 @@ size_t ksize(const void *block) else return sp->page.private; } +EXPORT_SYMBOL(ksize); struct kmem_cache { unsigned int size, align; @@ -2558,8 +2558,12 @@ size_t ksize(const void *object) if (unlikely(object == ZERO_SIZE_PTR)) return 0; - page = get_object_page(object); + page = virt_to_head_page(object); BUG_ON(!page); + + if (unlikely(!PageSlab(page))) + return PAGE_SIZE << compound_order(page); + s = page->slab; BUG_ON(!s); |