Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.20 /mm/slab.c

Filename:/mm/slab.c
Lines Added:10
Lines Deleted:3
Also changed in: (Previous) 2.4.20-rc4  2.4.20-rc3  2.4.20-rc2  2.4.20-rc1  2.4.20-pre11  2.4.20-pre10 
(Following) 2.4.21-pre2  2.4.21-pre3  2.4.21-pre4  2.4.21-pre5  2.4.21-pre6  2.4.21-pre7 

Location
[  2.4.20
  [  mm
     o  slab.c

Patch

diff -urN linux-2.4.19/mm/slab.c linux-2.4.20/mm/slab.c
--- linux-2.4.19/mm/slab.c   Fri Aug  2 17:39:46 2002
+++ linux-2.4.20/mm/slab.c   Thu Nov 28 15:53:15 2002
@@ -123,7 +123,7 @@
  * Bufctl's are used for linking objs within a slab
  * linked offsets.
  *
- * This implementaion relies on "struct page" for locating the cache &
+ * This implementation relies on "struct page" for locating the cache &
  * slab an object belongs to.
  * This allows the bufctl structure to be small (one int), but limits
  * the number of objects a slab (not a cache) can contain when off-slab
@@ -970,8 +970,6 @@
    if (!cachep || in_interrupt() || !is_chained_kmem_cache(cachep))
       BUG();
 
-   drain_cpu_caches(cachep);
-  
    spin_lock_irq(&cachep->spinlock);
    ret = __kmem_cache_shrink_locked(cachep);
    spin_unlock_irq(&cachep->spinlock);
@@ -1608,6 +1606,15 @@
    local_irq_restore(flags);
 }
 
+unsigned int kmem_cache_size(kmem_cache_t *cachep)
+{
+#if DEBUG
+   if (cachep->flags & SLAB_RED_ZONE)
+      return (cachep->objsize - 2*BYTES_PER_WORD);
+#endif
+   return cachep->objsize;
+}
+
 kmem_cache_t * kmem_find_general_cachep (size_t size, int gfpflags)
 {
    cache_sizes_t *csizep = cache_sizes;


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.