Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
3a5f1d45
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3a5f1d45
编写于
9月 11, 2008
作者:
C
Chris Mason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: Optimize btree walking while logging inodes
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
49eb7e46
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
20 addition
and
7 deletion
+20
-7
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+1
-1
fs/btrfs/tree-log.c
fs/btrfs/tree-log.c
+19
-6
未找到文件。
fs/btrfs/disk-io.c
浏览文件 @
3a5f1d45
...
...
@@ -1497,7 +1497,7 @@ struct btrfs_root *open_ctree(struct super_block *sb,
* low idle thresh
*/
fs_info
->
endio_workers
.
idle_thresh
=
4
;
fs_info
->
endio_write_workers
.
idle_thresh
=
4
;
fs_info
->
endio_write_workers
.
idle_thresh
=
6
4
;
btrfs_start_workers
(
&
fs_info
->
workers
,
1
);
btrfs_start_workers
(
&
fs_info
->
submit_workers
,
1
);
...
...
fs/btrfs/tree-log.c
浏览文件 @
3a5f1d45
...
...
@@ -1982,7 +1982,6 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
DEFINE_WAIT
(
wait
);
prepare_to_wait
(
&
log
->
fs_info
->
tree_log_wait
,
&
wait
,
TASK_UNINTERRUPTIBLE
);
batch
=
log
->
fs_info
->
tree_log_batch
;
mutex_unlock
(
&
log
->
fs_info
->
tree_log_mutex
);
if
(
atomic_read
(
&
log
->
fs_info
->
tree_log_writers
))
schedule
();
...
...
@@ -2024,8 +2023,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
}
/*
* free all the extents used by the tree log. This should be called
/* * free all the extents used by the tree log. This should be called
* at commit time of the full transaction
*/
int
btrfs_free_log
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_root
*
root
)
...
...
@@ -2107,6 +2105,9 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
int
ret
;
int
bytes_del
=
0
;
if
(
BTRFS_I
(
dir
)
->
logged_trans
<
trans
->
transid
)
return
0
;
ret
=
join_running_log_trans
(
root
);
if
(
ret
)
return
0
;
...
...
@@ -2178,6 +2179,9 @@ int btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans,
u64
index
;
int
ret
;
if
(
BTRFS_I
(
inode
)
->
logged_trans
<
trans
->
transid
)
return
0
;
ret
=
join_running_log_trans
(
root
);
if
(
ret
)
return
0
;
...
...
@@ -2484,6 +2488,7 @@ static int __btrfs_log_inode(struct btrfs_trans_handle *trans,
struct
btrfs_inode_item
*
inode_item
;
u32
size
;
int
ret
;
int
nritems
;
log
=
root
->
log_root
;
...
...
@@ -2541,12 +2546,11 @@ static int __btrfs_log_inode(struct btrfs_trans_handle *trans,
path
,
0
,
trans
->
transid
);
if
(
ret
!=
0
)
break
;
again:
if
(
min_key
.
objectid
!=
inode
->
i_ino
)
break
;
if
(
min_key
.
type
>
max_key
.
type
)
break
;
src
=
path
->
nodes
[
0
];
size
=
btrfs_item_size_nr
(
src
,
path
->
slots
[
0
]);
ret
=
btrfs_insert_empty_item
(
trans
,
log
,
dst_path
,
&
min_key
,
...
...
@@ -2606,9 +2610,17 @@ static int __btrfs_log_inode(struct btrfs_trans_handle *trans,
}
btrfs_mark_buffer_dirty
(
dst_path
->
nodes
[
0
]);
btrfs_release_path
(
root
,
path
);
btrfs_release_path
(
log
,
dst_path
);
nritems
=
btrfs_header_nritems
(
path
->
nodes
[
0
]);
path
->
slots
[
0
]
++
;
if
(
path
->
slots
[
0
]
<
nritems
)
{
btrfs_item_key_to_cpu
(
path
->
nodes
[
0
],
&
min_key
,
path
->
slots
[
0
]);
goto
again
;
}
btrfs_release_path
(
root
,
path
);
if
(
min_key
.
offset
<
(
u64
)
-
1
)
min_key
.
offset
++
;
else
if
(
min_key
.
type
<
(
u8
)
-
1
)
...
...
@@ -2626,6 +2638,7 @@ static int __btrfs_log_inode(struct btrfs_trans_handle *trans,
ret
=
log_directory_changes
(
trans
,
root
,
inode
,
path
,
dst_path
);
BUG_ON
(
ret
);
}
BTRFS_I
(
inode
)
->
logged_trans
=
trans
->
transid
;
mutex_unlock
(
&
BTRFS_I
(
inode
)
->
log_mutex
);
btrfs_free_path
(
path
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录