Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
cf786e79
Commit
cf786e79
authored
Oct 15, 2007
by
Chris Mason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: Defrag: only walk into nodes with the defrag bit set
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
304fced6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
fs/btrfs/ctree.c
fs/btrfs/ctree.c
+0
-1
fs/btrfs/tree-defrag.c
fs/btrfs/tree-defrag.c
+4
-4
No files found.
fs/btrfs/ctree.c
View file @
cf786e79
...
@@ -280,7 +280,6 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,
...
@@ -280,7 +280,6 @@ int btrfs_realloc_node(struct btrfs_trans_handle *trans,
*
last_ret
=
search_start
;
*
last_ret
=
search_start
;
if
(
parent_level
==
1
)
if
(
parent_level
==
1
)
btrfs_clear_buffer_defrag
(
tmp
);
btrfs_clear_buffer_defrag
(
tmp
);
btrfs_set_buffer_defrag_done
(
tmp
);
free_extent_buffer
(
tmp
);
free_extent_buffer
(
tmp
);
}
}
return
err
;
return
err
;
...
...
fs/btrfs/tree-defrag.c
View file @
cf786e79
...
@@ -87,8 +87,8 @@ static int defrag_walk_down(struct btrfs_trans_handle *trans,
...
@@ -87,8 +87,8 @@ static int defrag_walk_down(struct btrfs_trans_handle *trans,
if
(
cache_only
)
{
if
(
cache_only
)
{
next
=
btrfs_find_tree_block
(
root
,
bytenr
,
next
=
btrfs_find_tree_block
(
root
,
bytenr
,
btrfs_level_size
(
root
,
*
level
-
1
));
btrfs_level_size
(
root
,
*
level
-
1
));
/* FIXME, test for defrag */
if
(
!
next
||
!
btrfs_buffer_uptodate
(
next
)
||
if
(
!
next
||
!
btrfs_buffer_uptodate
(
next
))
{
!
btrfs_buffer_defrag
(
next
))
{
free_extent_buffer
(
next
);
free_extent_buffer
(
next
);
path
->
slots
[
*
level
]
++
;
path
->
slots
[
*
level
]
++
;
continue
;
continue
;
...
@@ -147,7 +147,8 @@ static int defrag_walk_up(struct btrfs_trans_handle *trans,
...
@@ -147,7 +147,8 @@ static int defrag_walk_up(struct btrfs_trans_handle *trans,
root
->
defrag_level
=
i
;
root
->
defrag_level
=
i
;
return
0
;
return
0
;
}
else
{
}
else
{
if
(
*
level
>
1
&&
path
->
nodes
[
*
level
]
!=
root
->
node
)
{
if
(
*
level
>
1
&&
path
->
nodes
[
*
level
]
!=
root
->
node
&&
btrfs_buffer_defrag
(
path
->
nodes
[
*
level
]))
{
struct
extent_buffer
*
next
;
struct
extent_buffer
*
next
;
u64
last
;
u64
last
;
int
ret
;
int
ret
;
...
@@ -168,7 +169,6 @@ static int defrag_walk_up(struct btrfs_trans_handle *trans,
...
@@ -168,7 +169,6 @@ static int defrag_walk_up(struct btrfs_trans_handle *trans,
}
}
btrfs_clear_buffer_defrag
(
path
->
nodes
[
*
level
]);
btrfs_clear_buffer_defrag
(
path
->
nodes
[
*
level
]);
btrfs_clear_buffer_defrag_done
(
path
->
nodes
[
*
level
]);
free_extent_buffer
(
path
->
nodes
[
*
level
]);
free_extent_buffer
(
path
->
nodes
[
*
level
]);
path
->
nodes
[
*
level
]
=
NULL
;
path
->
nodes
[
*
level
]
=
NULL
;
*
level
=
i
+
1
;
*
level
=
i
+
1
;
...
...
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