Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
323da79c
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
323da79c
编写于
5月 09, 2008
作者:
C
Chris Mason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: Chunk relocation fine tuning, and add a few printks to show progress
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
bbaf549e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
3 deletion
+19
-3
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+17
-3
fs/btrfs/volumes.c
fs/btrfs/volumes.c
+2
-0
未找到文件。
fs/btrfs/extent-tree.c
浏览文件 @
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
浏览文件 @
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
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录