diff options
| author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-29 17:03:14 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-29 17:03:14 -0500 |
| commit | c9cfcddfd65735437a4cb8563d6b66a6da8a5ed6 (patch) | |
| tree | 618cdf37baafe8b283bcc9923d9dde89d6428fb5 /fs/exec.c | |
| parent | 4168f7a31801bba6acc18662978d24ec850bbbd0 (diff) | |
VM: add common helper function to create the page tables
This logic was duplicated four times, for no good reason.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/exec.c')
| -rw-r--r-- | fs/exec.c | 12 |
1 files changed, 1 insertions, 11 deletions
| @@ -306,9 +306,6 @@ void install_arg_page(struct vm_area_struct *vma, | |||
| 306 | struct page *page, unsigned long address) | 306 | struct page *page, unsigned long address) |
| 307 | { | 307 | { |
| 308 | struct mm_struct *mm = vma->vm_mm; | 308 | struct mm_struct *mm = vma->vm_mm; |
| 309 | pgd_t * pgd; | ||
| 310 | pud_t * pud; | ||
| 311 | pmd_t * pmd; | ||
| 312 | pte_t * pte; | 309 | pte_t * pte; |
| 313 | spinlock_t *ptl; | 310 | spinlock_t *ptl; |
| 314 | 311 | ||
| @@ -316,14 +313,7 @@ void install_arg_page(struct vm_area_struct *vma, | |||
| 316 | goto out; | 313 | goto out; |
| 317 | 314 | ||
| 318 | flush_dcache_page(page); | 315 | flush_dcache_page(page); |
| 319 | pgd = pgd_offset(mm, address); | 316 | pte = get_locked_pte(mm, address, &ptl); |
| 320 | pud = pud_alloc(mm, pgd, address); | ||
| 321 | if (!pud) | ||
| 322 | goto out; | ||
| 323 | pmd = pmd_alloc(mm, pud, address); | ||
| 324 | if (!pmd) | ||
| 325 | goto out; | ||
| 326 | pte = pte_alloc_map_lock(mm, pmd, address, &ptl); | ||
| 327 | if (!pte) | 317 | if (!pte) |
| 328 | goto out; | 318 | goto out; |
| 329 | if (!pte_none(*pte)) { | 319 | if (!pte_none(*pte)) { |
