Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
b339158a
Commit
b339158a
authored
Jan 25, 2005
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MM]: PTRS_PER_{PUD,PMD} are not necessarily compile time constants.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
2e5cbd2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
36 deletions
+38
-36
mm/memory.c
mm/memory.c
+38
-36
No files found.
mm/memory.c
View file @
b339158a
...
@@ -2089,7 +2089,6 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma,
...
@@ -2089,7 +2089,6 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma,
}
}
#ifndef __ARCH_HAS_4LEVEL_HACK
#ifndef __ARCH_HAS_4LEVEL_HACK
#if (PTRS_PER_PUD > 1)
/*
/*
* Allocate page upper directory.
* Allocate page upper directory.
*
*
...
@@ -2101,29 +2100,30 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma,
...
@@ -2101,29 +2100,30 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma,
*/
*/
pud_t
fastcall
*
__pud_alloc
(
struct
mm_struct
*
mm
,
pgd_t
*
pgd
,
unsigned
long
address
)
pud_t
fastcall
*
__pud_alloc
(
struct
mm_struct
*
mm
,
pgd_t
*
pgd
,
unsigned
long
address
)
{
{
pud_t
*
new
;
if
(
PTRS_PER_PUD
>
1
)
{
pud_t
*
new
;
spin_unlock
(
&
mm
->
page_table_lock
);
spin_unlock
(
&
mm
->
page_table_lock
);
new
=
pud_alloc_one
(
mm
,
address
);
new
=
pud_alloc_one
(
mm
,
address
);
spin_lock
(
&
mm
->
page_table_lock
);
spin_lock
(
&
mm
->
page_table_lock
);
if
(
!
new
)
if
(
!
new
)
return
NULL
;
return
NULL
;
/*
/*
* Because we dropped the lock, we should re-check the
* Because we dropped the lock, we should re-check the
* entry, as somebody else could have populated it..
* entry, as somebody else could have populated it..
*/
*/
if
(
pgd_present
(
*
pgd
))
{
if
(
pgd_present
(
*
pgd
))
{
pud_free
(
new
);
pud_free
(
new
);
goto
out
;
goto
out
;
}
pgd_populate
(
mm
,
pgd
,
new
);
out:
return
pud_offset
(
pgd
,
address
);
}
}
pgd_populate
(
mm
,
pgd
,
new
);
return
NULL
;
out:
return
pud_offset
(
pgd
,
address
);
}
}
#endif
#if (PTRS_PER_PMD > 1)
/*
/*
* Allocate page middle directory.
* Allocate page middle directory.
*
*
...
@@ -2135,27 +2135,29 @@ pud_t fastcall *__pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long addr
...
@@ -2135,27 +2135,29 @@ pud_t fastcall *__pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long addr
*/
*/
pmd_t
fastcall
*
__pmd_alloc
(
struct
mm_struct
*
mm
,
pud_t
*
pud
,
unsigned
long
address
)
pmd_t
fastcall
*
__pmd_alloc
(
struct
mm_struct
*
mm
,
pud_t
*
pud
,
unsigned
long
address
)
{
{
pmd_t
*
new
;
if
(
PTRS_PER_PMD
>
1
)
{
pmd_t
*
new
;
spin_unlock
(
&
mm
->
page_table_lock
);
spin_unlock
(
&
mm
->
page_table_lock
);
new
=
pmd_alloc_one
(
mm
,
address
);
new
=
pmd_alloc_one
(
mm
,
address
);
spin_lock
(
&
mm
->
page_table_lock
);
spin_lock
(
&
mm
->
page_table_lock
);
if
(
!
new
)
if
(
!
new
)
return
NULL
;
return
NULL
;
/*
/*
* Because we dropped the lock, we should re-check the
* Because we dropped the lock, we should re-check the
* entry, as somebody else could have populated it..
* entry, as somebody else could have populated it..
*/
*/
if
(
pud_present
(
*
pud
))
{
if
(
pud_present
(
*
pud
))
{
pmd_free
(
new
);
pmd_free
(
new
);
goto
out
;
goto
out
;
}
pud_populate
(
mm
,
pud
,
new
);
out:
return
pmd_offset
(
pud
,
address
);
}
}
pud_populate
(
mm
,
pud
,
new
);
return
NULL
;
out:
return
pmd_offset
(
pud
,
address
);
}
}
#endif
#else
#else
pmd_t
fastcall
*
__pmd_alloc
(
struct
mm_struct
*
mm
,
pud_t
*
pud
,
unsigned
long
address
)
pmd_t
fastcall
*
__pmd_alloc
(
struct
mm_struct
*
mm
,
pud_t
*
pud
,
unsigned
long
address
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment