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
323da79c
Commit
323da79c
authored
May 09, 2008
by
Chris Mason
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: Chunk relocation fine tuning, and add a few printks to show progress
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
bbaf549e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+17
-3
fs/btrfs/volumes.c
fs/btrfs/volumes.c
+2
-0
No files found.
fs/btrfs/extent-tree.c
View file @
323da79c
...
@@ -2493,7 +2493,7 @@ static int find_root_for_ref(struct btrfs_root *root,
...
@@ -2493,7 +2493,7 @@ static int find_root_for_ref(struct btrfs_root *root,
btrfs_file_extent_disk_bytenr
(
leaf
,
btrfs_file_extent_disk_bytenr
(
leaf
,
file_extent
);
file_extent
);
}
}
}
else
if
(
ret
==
0
)
{
}
else
if
(
!
file_key
)
{
if
(
path
->
nodes
[
level
])
if
(
path
->
nodes
[
level
])
found_bytenr
=
path
->
nodes
[
level
]
->
start
;
found_bytenr
=
path
->
nodes
[
level
]
->
start
;
}
}
...
@@ -2797,14 +2797,25 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 shrink_start)
...
@@ -2797,14 +2797,25 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 shrink_start)
root
=
root
->
fs_info
->
extent_root
;
root
=
root
->
fs_info
->
extent_root
;
path
->
reada
=
2
;
path
->
reada
=
2
;
printk
(
"btrfs relocating block group %llu flags %llu
\n
"
,
(
unsigned
long
long
)
shrink_start
,
(
unsigned
long
long
)
shrink_block_group
->
flags
);
again:
again:
if
(
btrfs_block_group_used
(
&
shrink_block_group
->
item
)
>
0
)
{
if
(
btrfs_block_group_used
(
&
shrink_block_group
->
item
)
>
0
)
{
u64
calc
;
trans
=
btrfs_start_transaction
(
root
,
1
);
trans
=
btrfs_start_transaction
(
root
,
1
);
new_alloc_flags
=
update_block_group_flags
(
root
,
new_alloc_flags
=
update_block_group_flags
(
root
,
shrink_block_group
->
flags
);
shrink_block_group
->
flags
);
if
(
new_alloc_flags
!=
shrink_block_group
->
flags
)
{
calc
=
btrfs_block_group_used
(
&
shrink_block_group
->
item
);
}
else
{
calc
=
shrink_block_group
->
key
.
offset
;
}
do_chunk_alloc
(
trans
,
root
->
fs_info
->
extent_root
,
do_chunk_alloc
(
trans
,
root
->
fs_info
->
extent_root
,
btrfs_block_group_used
(
&
shrink_block_group
->
item
)
+
calc
+
2
*
1024
*
1024
,
new_alloc_flags
);
2
*
1024
*
1024
,
new_alloc_flags
);
btrfs_end_transaction
(
trans
,
root
);
btrfs_end_transaction
(
trans
,
root
);
}
}
shrink_block_group
->
ro
=
1
;
shrink_block_group
->
ro
=
1
;
...
@@ -2888,6 +2899,9 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 shrink_start)
...
@@ -2888,6 +2899,9 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 shrink_start)
btrfs_release_path
(
root
,
path
);
btrfs_release_path
(
root
,
path
);
if
(
total_found
>
0
)
{
if
(
total_found
>
0
)
{
printk
(
"btrfs relocate found %llu last extent was %llu
\n
"
,
(
unsigned
long
long
)
total_found
,
(
unsigned
long
long
)
found_key
.
objectid
);
trans
=
btrfs_start_transaction
(
tree_root
,
1
);
trans
=
btrfs_start_transaction
(
tree_root
,
1
);
btrfs_commit_transaction
(
trans
,
tree_root
);
btrfs_commit_transaction
(
trans
,
tree_root
);
...
...
fs/btrfs/volumes.c
View file @
323da79c
...
@@ -1011,6 +1011,8 @@ int btrfs_relocate_chunk(struct btrfs_root *root,
...
@@ -1011,6 +1011,8 @@ int btrfs_relocate_chunk(struct btrfs_root *root,
int
ret
;
int
ret
;
int
i
;
int
i
;
printk
(
"btrfs relocating chunk %llu
\n
"
,
(
unsigned
long
long
)
chunk_offset
);
root
=
root
->
fs_info
->
chunk_root
;
root
=
root
->
fs_info
->
chunk_root
;
extent_root
=
root
->
fs_info
->
extent_root
;
extent_root
=
root
->
fs_info
->
extent_root
;
em_tree
=
&
root
->
fs_info
->
mapping_tree
.
map_tree
;
em_tree
=
&
root
->
fs_info
->
mapping_tree
.
map_tree
;
...
...
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