Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 25 Jan 2008 16:34:42 +0000 (08:34 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 25 Jan 2008 16:35:13 +0000 (08:35 -0800)
This can be broken down into these major areas:
 - Documentation updates (language translations and fixes, as
   well as kobject and kset documenatation updates.)
 - major kset/kobject/ktype rework and fixes.  This cleans up the
   kset and kobject and ktype relationship and architecture,
   making sense of things now, and good documenation and samples
   are provided for others to use.  Also the attributes for
   kobjects are much easier to handle now.  This cleaned up a LOT
   of code all through the kernel, making kobjects easier to use
   if you want to.
 - struct bus_type has been reworked to now handle the lifetime
   rules properly, as the kobject is properly dynamic.
 - struct driver has also been reworked, and now the lifetime
   issues are resolved.
 - the block subsystem has been converted to use struct device
   now, and not "raw" kobjects.  This patch has been in the -mm
   tree for over a year now, and finally all the issues are
   worked out with it.  Older distros now properly work with new
   kernels, and no userspace updates are needed at all.
 - nozomi driver is added.  This has also been in -mm for a long
   time, and many people have asked for it to go in.  It is now
   in good enough shape to do so.
 - lots of class_device conversions to use struct device instead.
   The tree is almost all cleaned up now, only SCSI and IB is the
   remaining code to fix up...

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (196 commits)
  Driver core: coding style fixes
  Kobject: fix coding style issues in kobject c files
  Kobject: fix coding style issues in kobject.h
  Driver core: fix coding style issues in device.h
  spi: use class iteration api
  scsi: use class iteration api
  rtc: use class iteration api
  power supply : use class iteration api
  ieee1394: use class iteration api
  Driver Core: add class iteration api
  Driver core: Cleanup get_device_parent() in device_add() and device_move()
  UIO: constify function pointer tables
  Driver Core: constify the name passed to platform_device_register_simple
  driver core: fix build with SYSFS=n
  sysfs: make SYSFS_DEPRECATED depend on SYSFS
  Driver core: use LIST_HEAD instead of call to INIT_LIST_HEAD in __init
  kobject: add sample code for how to use ksets/ktypes/kobjects
  kobject: add sample code for how to use kobjects in a simple manner.
  kobject: update the kobject/kset documentation
  kobject: remove old, outdated documentation.
  ...

drivers/isdn/capi/capidrv.c
mm/slab.c

index 48c1775ef5b3de68404f90649b3ea9ede2d30d8a..cb42b690b45ee221b3f77a3ab967ced3864ba619 100644 (file)
@@ -2332,13 +2332,14 @@ static int __init capidrv_init(void)
 
 static void __exit capidrv_exit(void)
 {
-       char rev[10];
+       char rev[32];
        char *p;
 
        if ((p = strchr(revision, ':')) != 0) {
-               strcpy(rev, p + 1);
-               p = strchr(rev, '$');
-               *p = 0;
+               strncpy(rev, p + 1, sizeof(rev));
+               rev[sizeof(rev)-1] = 0;
+               if ((p = strchr(rev, '$')) != 0)
+                       *p = 0;
        } else {
                strcpy(rev, " ??? ");
        }
index b03b2e46b8066cc077eaf75891e89c48b88c054e..ff31261fd24fa92702f773c5900693f72ff265fa 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -304,11 +304,11 @@ struct kmem_list3 {
 /*
  * Need this for bootstrapping a per node allocator.
  */
-#define NUM_INIT_LISTS (2 * MAX_NUMNODES + 1)
+#define NUM_INIT_LISTS (3 * MAX_NUMNODES)
 struct kmem_list3 __initdata initkmem_list3[NUM_INIT_LISTS];
 #define        CACHE_CACHE 0
-#define        SIZE_AC 1
-#define        SIZE_L3 (1 + MAX_NUMNODES)
+#define        SIZE_AC MAX_NUMNODES
+#define        SIZE_L3 (2 * MAX_NUMNODES)
 
 static int drain_freelist(struct kmem_cache *cache,
                        struct kmem_list3 *l3, int tofree);
@@ -1409,6 +1409,22 @@ static void init_list(struct kmem_cache *cachep, struct kmem_list3 *list,
        local_irq_enable();
 }
 
+/*
+ * For setting up all the kmem_list3s for cache whose buffer_size is same as
+ * size of kmem_list3.
+ */
+static void __init set_up_list3s(struct kmem_cache *cachep, int index)
+{
+       int node;
+
+       for_each_online_node(node) {
+               cachep->nodelists[node] = &initkmem_list3[index + node];
+               cachep->nodelists[node]->next_reap = jiffies +
+                   REAPTIMEOUT_LIST3 +
+                   ((unsigned long)cachep) % REAPTIMEOUT_LIST3;
+       }
+}
+
 /*
  * Initialisation.  Called after the page allocator have been initialised and
  * before smp_init().
@@ -1432,6 +1448,7 @@ void __init kmem_cache_init(void)
                if (i < MAX_NUMNODES)
                        cache_cache.nodelists[i] = NULL;
        }
+       set_up_list3s(&cache_cache, CACHE_CACHE);
 
        /*
         * Fragmentation resistance on low memory - only use bigger
@@ -1587,10 +1604,9 @@ void __init kmem_cache_init(void)
        {
                int nid;
 
-               /* Replace the static kmem_list3 structures for the boot cpu */
-               init_list(&cache_cache, &initkmem_list3[CACHE_CACHE], node);
-
                for_each_online_node(nid) {
+                       init_list(&cache_cache, &initkmem_list3[CACHE_CACHE], nid);
+
                        init_list(malloc_sizes[INDEX_AC].cs_cachep,
                                  &initkmem_list3[SIZE_AC + nid], nid);
 
@@ -1960,22 +1976,6 @@ static void slab_destroy(struct kmem_cache *cachep, struct slab *slabp)
        }
 }
 
-/*
- * For setting up all the kmem_list3s for cache whose buffer_size is same as
- * size of kmem_list3.
- */
-static void __init set_up_list3s(struct kmem_cache *cachep, int index)
-{
-       int node;
-
-       for_each_online_node(node) {
-               cachep->nodelists[node] = &initkmem_list3[index + node];
-               cachep->nodelists[node]->next_reap = jiffies +
-                   REAPTIMEOUT_LIST3 +
-                   ((unsigned long)cachep) % REAPTIMEOUT_LIST3;
-       }
-}
-
 static void __kmem_cache_destroy(struct kmem_cache *cachep)
 {
        int i;
@@ -2099,7 +2099,7 @@ static int __init_refok setup_cpu_cache(struct kmem_cache *cachep)
                        g_cpucache_up = PARTIAL_L3;
                } else {
                        int node;
-                       for_each_node_state(node, N_NORMAL_MEMORY) {
+                       for_each_online_node(node) {
                                cachep->nodelists[node] =
                                    kmalloc_node(sizeof(struct kmem_list3),
                                                GFP_KERNEL, node);