Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
7c4452b9
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
7c4452b9
编写于
4月 28, 2007
作者:
C
Chris Mason
提交者:
David Woodhouse
4月 28, 2007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: smarter transaction writeback
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
06a2f9fa
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
3 deletion
+37
-3
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+1
-0
fs/btrfs/super.c
fs/btrfs/super.c
+0
-1
fs/btrfs/transaction.c
fs/btrfs/transaction.c
+35
-2
fs/btrfs/transaction.h
fs/btrfs/transaction.h
+1
-0
未找到文件。
fs/btrfs/extent-tree.c
浏览文件 @
7c4452b9
...
...
@@ -762,6 +762,7 @@ struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
BUG_ON
(
ret
);
buf
=
btrfs_find_create_tree_block
(
root
,
ins
.
objectid
);
set_buffer_uptodate
(
buf
);
set_radix_bit
(
&
trans
->
transaction
->
dirty_pages
,
buf
->
b_page
->
index
);
return
buf
;
}
...
...
fs/btrfs/super.c
浏览文件 @
7c4452b9
...
...
@@ -980,7 +980,6 @@ static int btrfs_sync_fs(struct super_block *sb, int wait)
filemap_flush
(
root
->
fs_info
->
btree_inode
->
i_mapping
);
return
0
;
}
filemap_write_and_wait
(
root
->
fs_info
->
btree_inode
->
i_mapping
);
mutex_lock
(
&
root
->
fs_info
->
fs_mutex
);
trans
=
btrfs_start_transaction
(
root
,
1
);
ret
=
btrfs_commit_transaction
(
trans
,
root
);
...
...
fs/btrfs/transaction.c
浏览文件 @
7c4452b9
...
...
@@ -45,6 +45,7 @@ static int join_transaction(struct btrfs_root *root)
cur_trans
->
use_count
=
1
;
cur_trans
->
commit_done
=
0
;
list_add_tail
(
&
cur_trans
->
list
,
&
root
->
fs_info
->
trans_list
);
init_bit_radix
(
&
cur_trans
->
dirty_pages
);
}
cur_trans
->
num_writers
++
;
return
0
;
...
...
@@ -106,8 +107,40 @@ int btrfs_end_transaction(struct btrfs_trans_handle *trans,
int
btrfs_write_and_wait_transaction
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_root
*
root
)
{
filemap_write_and_wait
(
root
->
fs_info
->
btree_inode
->
i_mapping
);
return
0
;
unsigned
long
gang
[
16
];
int
ret
;
int
i
;
int
err
;
int
werr
=
0
;
struct
page
*
page
;
struct
radix_tree_root
*
dirty_pages
;
struct
inode
*
btree_inode
=
root
->
fs_info
->
btree_inode
;
if
(
!
trans
||
!
trans
->
transaction
)
{
return
filemap_write_and_wait
(
btree_inode
->
i_mapping
);
}
dirty_pages
=
&
trans
->
transaction
->
dirty_pages
;
while
(
1
)
{
ret
=
find_first_radix_bit
(
dirty_pages
,
gang
,
ARRAY_SIZE
(
gang
));
if
(
!
ret
)
break
;
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
/* FIXME EIO */
clear_radix_bit
(
dirty_pages
,
gang
[
i
]);
page
=
find_lock_page
(
btree_inode
->
i_mapping
,
gang
[
i
]);
if
(
!
page
)
continue
;
err
=
write_one_page
(
page
,
0
);
if
(
err
)
werr
=
err
;
page_cache_release
(
page
);
}
}
err
=
filemap_fdatawait
(
btree_inode
->
i_mapping
);
if
(
err
)
werr
=
err
;
return
werr
;
}
int
btrfs_commit_tree_roots
(
struct
btrfs_trans_handle
*
trans
,
...
...
fs/btrfs/transaction.h
浏览文件 @
7c4452b9
...
...
@@ -9,6 +9,7 @@ struct btrfs_transaction {
int
commit_done
;
int
magic
;
struct
list_head
list
;
struct
radix_tree_root
dirty_pages
;
wait_queue_head_t
writer_wait
;
wait_queue_head_t
commit_wait
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录