Re: [PATCH] Consolidate init_mm definition

From: Andrew Morton
Date: Tue Apr 07 2009 - 17:23:47 EST


On Fri, 27 Mar 2009 02:51:16 +0300
Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:

> --- /dev/null
> +++ b/mm/init-mm.c
> @@ -0,0 +1,13 @@
> +#include <linux/mm_types.h>
> +#include <asm/pgtable.h>
> +
> +struct mm_struct init_mm = {
> + .mm_rb = RB_ROOT,
> + .pgd = swapper_pg_dir,
> + .mm_users = ATOMIC_INIT(2),
> + .mm_count = ATOMIC_INIT(1),
> + .mmap_sem = __RWSEM_INITIALIZER(init_mm.mmap_sem),
> + .page_table_lock = __SPIN_LOCK_UNLOCKED(init_mm.page_table_lock),
> + .mmlist = LIST_HEAD_INIT(init_mm.mmlist),
> + .cpu_vm_mask = CPU_MASK_ALL,
> +};

I'd be more conmfortable if this file were to explicitly include the
headers which it needs.

As it stands, variations in configs (especially different
architectures) have a decent chance of breaking things.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/