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
ee3a7e26
Commit
ee3a7e26
authored
Jun 08, 2003
by
Joe Thornber
Committed by
Greg Kroah-Hartman
Jun 08, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] dm: Lift dm_div_up()
Pull dm_div_up() out of dm-table.c into dm.h
parent
1d914277
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
drivers/md/dm-table.c
drivers/md/dm-table.c
+3
-11
drivers/md/dm.h
drivers/md/dm.h
+8
-0
No files found.
drivers/md/dm-table.c
View file @
ee3a7e26
...
...
@@ -55,14 +55,6 @@ struct dm_table {
wait_queue_head_t
eventq
;
};
/*
* Ceiling(n / size)
*/
static
inline
unsigned
long
div_up
(
unsigned
long
n
,
unsigned
long
size
)
{
return
dm_round_up
(
n
,
size
)
/
size
;
}
/*
* Similar to ceiling(log_size(n))
*/
...
...
@@ -71,7 +63,7 @@ static unsigned int int_log(unsigned long n, unsigned long base)
int
result
=
0
;
while
(
n
>
1
)
{
n
=
div_up
(
n
,
base
);
n
=
d
m_d
iv_up
(
n
,
base
);
result
++
;
}
...
...
@@ -664,7 +656,7 @@ static int setup_indexes(struct dm_table *t)
/* allocate the space for *all* the indexes */
for
(
i
=
t
->
depth
-
2
;
i
>=
0
;
i
--
)
{
t
->
counts
[
i
]
=
div_up
(
t
->
counts
[
i
+
1
],
CHILDREN_PER_NODE
);
t
->
counts
[
i
]
=
d
m_d
iv_up
(
t
->
counts
[
i
+
1
],
CHILDREN_PER_NODE
);
total
+=
t
->
counts
[
i
];
}
...
...
@@ -691,7 +683,7 @@ int dm_table_complete(struct dm_table *t)
unsigned
int
leaf_nodes
;
/* how many indexes will the btree have ? */
leaf_nodes
=
div_up
(
t
->
num_targets
,
KEYS_PER_NODE
);
leaf_nodes
=
d
m_d
iv_up
(
t
->
num_targets
,
KEYS_PER_NODE
);
t
->
depth
=
1
+
int_log
(
leaf_nodes
,
CHILDREN_PER_NODE
);
/* leaf layer has already been set up */
...
...
drivers/md/dm.h
View file @
ee3a7e26
...
...
@@ -134,6 +134,14 @@ static inline unsigned long dm_round_up(unsigned long n, unsigned long size)
return
n
+
(
r
?
(
size
-
r
)
:
0
);
}
/*
* Ceiling(n / size)
*/
static
inline
unsigned
long
dm_div_up
(
unsigned
long
n
,
unsigned
long
size
)
{
return
dm_round_up
(
n
,
size
)
/
size
;
}
/*
* The device-mapper can be driven through one of two interfaces;
* ioctl or filesystem, depending which patch you have applied.
...
...
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