diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-05-22 08:08:00 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-22 08:08:00 -0700 |
| commit | c8ba206502dbf94b5ba984150d936a860cc8f339 (patch) | |
| tree | 23aad74edb4a7cc7e2ebe35e512f5dee6b133dac /fs/exec.c | |
| parent | ee7baa35264d9cb6bbf01491f3757c3312fb2376 (diff) | |
[PATCH] rmap 27 memset 0 vma
From: Hugh Dickins <hugh@veritas.com>
We're NULLifying more and more fields when initializing a vma
(mpol_set_vma_default does that too, if configured to do anything). Now use
memset to avoid specifying fields, and save a little code too.
(Yes, I realize anon_vma will want to set vm_pgoff non-0, but I think that
will be better handled at the core, since anon vm_pgoff is negotiable up until
an anon_vma is actually assigned.)
Diffstat (limited to 'fs/exec.c')
| -rw-r--r-- | fs/exec.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/exec.c b/fs/exec.c index 69e1e47a7fd6..1cbb19157a43 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -404,6 +404,8 @@ int setup_arg_pages(struct linux_binprm *bprm, int executable_stack) return -ENOMEM; } + memset(mpnt, 0, sizeof(*mpnt)); + down_write(&mm->mmap_sem); { mpnt->vm_mm = mm; @@ -425,11 +427,6 @@ int setup_arg_pages(struct linux_binprm *bprm, int executable_stack) else mpnt->vm_flags = VM_STACK_FLAGS; mpnt->vm_page_prot = protection_map[mpnt->vm_flags & 0x7]; - mpnt->vm_ops = NULL; - mpnt->vm_pgoff = 0; - mpnt->vm_file = NULL; - mpol_set_vma_default(mpnt); - mpnt->vm_private_data = (void *) 0; insert_vm_struct(mm, mpnt); mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; } |
