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
7d1660d4
Commit
7d1660d4
authored
Mar 24, 2008
by
Chris Mason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: Bring back find_free_extent CPU usage optimizations
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
6324fbf3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+12
-8
No files found.
fs/btrfs/extent-tree.c
View file @
7d1660d4
...
@@ -182,9 +182,9 @@ static int noinline find_search_start(struct btrfs_root *root,
...
@@ -182,9 +182,9 @@ static int noinline find_search_start(struct btrfs_root *root,
int
ret
;
int
ret
;
struct
btrfs_block_group_cache
*
cache
=
*
cache_ret
;
struct
btrfs_block_group_cache
*
cache
=
*
cache_ret
;
struct
extent_io_tree
*
free_space_cache
;
struct
extent_io_tree
*
free_space_cache
;
struct
extent_state
*
state
;
u64
last
;
u64
last
;
u64
start
=
0
;
u64
start
=
0
;
u64
end
=
0
;
u64
cache_miss
=
0
;
u64
cache_miss
=
0
;
u64
total_fs_bytes
;
u64
total_fs_bytes
;
u64
search_start
=
*
start_ret
;
u64
search_start
=
*
start_ret
;
...
@@ -205,30 +205,34 @@ static int noinline find_search_start(struct btrfs_root *root,
...
@@ -205,30 +205,34 @@ static int noinline find_search_start(struct btrfs_root *root,
goto
new_group
;
goto
new_group
;
}
}
spin_lock_irq
(
&
free_space_cache
->
lock
);
state
=
find_first_extent_bit_state
(
free_space_cache
,
last
,
EXTENT_DIRTY
);
while
(
1
)
{
while
(
1
)
{
ret
=
find_first_extent_bit
(
&
root
->
fs_info
->
free_space_cache
,
if
(
!
state
)
{
last
,
&
start
,
&
end
,
EXTENT_DIRTY
);
if
(
ret
)
{
if
(
!
cache_miss
)
if
(
!
cache_miss
)
cache_miss
=
last
;
cache_miss
=
last
;
spin_unlock_irq
(
&
free_space_cache
->
lock
);
goto
new_group
;
goto
new_group
;
}
}
start
=
max
(
last
,
start
);
start
=
max
(
last
,
sta
te
->
sta
rt
);
last
=
end
+
1
;
last
=
state
->
end
+
1
;
if
(
last
-
start
<
num
)
{
if
(
last
-
start
<
num
)
{
if
(
last
==
cache
->
key
.
objectid
+
cache
->
key
.
offset
)
if
(
last
==
cache
->
key
.
objectid
+
cache
->
key
.
offset
)
cache_miss
=
start
;
cache_miss
=
start
;
do
{
state
=
extent_state_next
(
state
);
}
while
(
state
&&
!
(
state
->
state
&
EXTENT_DIRTY
));
continue
;
continue
;
}
}
spin_unlock_irq
(
&
free_space_cache
->
lock
);
if
(
start
+
num
>
cache
->
key
.
objectid
+
cache
->
key
.
offset
)
if
(
start
+
num
>
cache
->
key
.
objectid
+
cache
->
key
.
offset
)
goto
new_group
;
goto
new_group
;
if
(
start
+
num
>
total_fs_bytes
)
if
(
start
+
num
>
total_fs_bytes
)
goto
new_group
;
goto
new_group
;
*
start_ret
=
start
;
*
start_ret
=
start
;
return
0
;
return
0
;
}
}
out
:
out:
cache
=
btrfs_lookup_block_group
(
root
->
fs_info
,
search_start
);
cache
=
btrfs_lookup_block_group
(
root
->
fs_info
,
search_start
);
if
(
!
cache
)
{
if
(
!
cache
)
{
printk
(
"Unable to find block group for %Lu
\n
"
,
search_start
);
printk
(
"Unable to find block group for %Lu
\n
"
,
search_start
);
...
...
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