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
a443da37
Commit
a443da37
authored
May 22, 2003
by
David S. Miller
Committed by
David S. Miller
May 22, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV4]: Use get_order instead of reimplementation.
parent
b913de8c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
13 deletions
+2
-13
net/ipv4/fib_hash.c
net/ipv4/fib_hash.c
+2
-13
No files found.
net/ipv4/fib_hash.c
View file @
a443da37
...
...
@@ -151,17 +151,6 @@ static rwlock_t fib_hash_lock = RW_LOCK_UNLOCKED;
#define FZ_MAX_DIVISOR ((PAGE_SIZE<<MAX_ORDER) / sizeof(struct fib_node *))
static
unsigned
long
size_to_order
(
unsigned
long
size
)
{
unsigned
long
order
;
for
(
order
=
0
;
order
<
MAX_ORDER
;
order
++
)
{
if
((
PAGE_SIZE
<<
order
)
>=
size
)
break
;
}
return
order
;
}
static
struct
fib_node
**
fz_hash_alloc
(
int
divisor
)
{
unsigned
long
size
=
divisor
*
sizeof
(
struct
fib_node
*
);
...
...
@@ -170,7 +159,7 @@ static struct fib_node **fz_hash_alloc(int divisor)
return
kmalloc
(
size
,
GFP_KERNEL
);
}
else
{
return
(
struct
fib_node
**
)
__get_free_pages
(
GFP_KERNEL
,
size_to
_order
(
size
));
__get_free_pages
(
GFP_KERNEL
,
get
_order
(
size
));
}
}
...
...
@@ -201,7 +190,7 @@ static void fz_hash_free(struct fib_node **hash, int divisor)
kfree
(
hash
);
else
free_pages
((
unsigned
long
)
hash
,
size_to
_order
(
divisor
*
sizeof
(
struct
fib_node
*
)));
get
_order
(
divisor
*
sizeof
(
struct
fib_node
*
)));
}
static
void
fn_rehash_zone
(
struct
fn_zone
*
fz
)
...
...
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