]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Avoid duplicate _count variables in page_struct
authorChristoph Lameter <cl@linux.com>
Thu, 14 Jul 2011 17:48:14 +0000 (12:48 -0500)
committerPekka Enberg <penberg@kernel.org>
Mon, 18 Jul 2011 12:17:01 +0000 (15:17 +0300)
Restructure the union / struct cascade in struct page so that
we only have one definition of _count.

Tested-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
include/linux/mm_types.h

index 3d76a433d52f24547c2b4afd500fcd6883c4f0f4..774b8952deb46cff7ab12a76936f1cad25ebae4d 100644 (file)
@@ -49,30 +49,31 @@ struct page {
                                         * see PAGE_MAPPING_ANON below.
                                         */
        /* Second double word */
-       union {
-               struct {
+       struct {
+               union {
                        pgoff_t index;          /* Our offset within mapping. */
-                       atomic_t _mapcount;     /* Count of ptes mapped in mms,
+                       void *freelist;         /* slub first free object */
+               };
+
+               union {
+                       /* Used for cmpxchg_double in slub */
+                       unsigned long counters;
+
+                       struct {
+
+                               union {
+                                       atomic_t _mapcount;     /* Count of ptes mapped in mms,
                                                         * to show when page is mapped
                                                         * & limit reverse map searches.
                                                         */
-                       atomic_t _count;                /* Usage count, see below. */
-               };
 
-               struct {                        /* SLUB cmpxchg_double area */
-                       void *freelist;
-                       union {
-                               unsigned long counters;
-                               struct {
-                                       unsigned inuse:16;
-                                       unsigned objects:15;
-                                       unsigned frozen:1;
-                                       /*
-                                        * Kernel may make use of this field even when slub
-                                        * uses the rest of the double word!
-                                        */
-                                       atomic_t _count;
+                                       struct {
+                                               unsigned inuse:16;
+                                               unsigned objects:15;
+                                               unsigned frozen:1;
+                                       };
                                };
+                               atomic_t _count;                /* Usage count, see below. */
                        };
                };
        };