Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
5443be45
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5443be45
编写于
8月 15, 2008
作者:
C
Chris Mason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: Give all the worker threads descriptive names
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
777e6bd7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
10 deletion
+24
-10
fs/btrfs/async-thread.c
fs/btrfs/async-thread.c
+5
-2
fs/btrfs/async-thread.h
fs/btrfs/async-thread.h
+4
-1
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+15
-7
未找到文件。
fs/btrfs/async-thread.c
浏览文件 @
5443be45
...
...
@@ -153,7 +153,7 @@ int btrfs_stop_workers(struct btrfs_workers *workers)
/*
* simple init on struct btrfs_workers
*/
void
btrfs_init_workers
(
struct
btrfs_workers
*
workers
,
int
max
)
void
btrfs_init_workers
(
struct
btrfs_workers
*
workers
,
char
*
name
,
int
max
)
{
workers
->
num_workers
=
0
;
INIT_LIST_HEAD
(
&
workers
->
worker_list
);
...
...
@@ -161,6 +161,7 @@ void btrfs_init_workers(struct btrfs_workers *workers, int max)
spin_lock_init
(
&
workers
->
lock
);
workers
->
max_workers
=
max
;
workers
->
idle_thresh
=
32
;
workers
->
name
=
name
;
}
/*
...
...
@@ -184,7 +185,9 @@ int btrfs_start_workers(struct btrfs_workers *workers, int num_workers)
INIT_LIST_HEAD
(
&
worker
->
worker_list
);
spin_lock_init
(
&
worker
->
lock
);
atomic_set
(
&
worker
->
num_pending
,
0
);
worker
->
task
=
kthread_run
(
worker_loop
,
worker
,
"btrfs"
);
worker
->
task
=
kthread_run
(
worker_loop
,
worker
,
"btrfs-%s-%d"
,
workers
->
name
,
workers
->
num_workers
+
i
);
worker
->
workers
=
workers
;
if
(
IS_ERR
(
worker
->
task
))
{
kfree
(
worker
);
...
...
fs/btrfs/async-thread.h
浏览文件 @
5443be45
...
...
@@ -69,11 +69,14 @@ struct btrfs_workers {
/* lock for finding the next worker thread to queue on */
spinlock_t
lock
;
/* extra name for this worker */
char
*
name
;
};
int
btrfs_queue_worker
(
struct
btrfs_workers
*
workers
,
struct
btrfs_work
*
work
);
int
btrfs_start_workers
(
struct
btrfs_workers
*
workers
,
int
num_workers
);
int
btrfs_stop_workers
(
struct
btrfs_workers
*
workers
);
void
btrfs_init_workers
(
struct
btrfs_workers
*
workers
,
int
max
);
void
btrfs_init_workers
(
struct
btrfs_workers
*
workers
,
char
*
name
,
int
max
);
int
btrfs_requeue_work
(
struct
btrfs_work
*
work
);
#endif
fs/btrfs/disk-io.c
浏览文件 @
5443be45
...
...
@@ -492,11 +492,11 @@ static int __btree_submit_bio_hook(struct inode *inode, int rw, struct bio *bio,
/*
* when we're called for a write, we're already in the async
* submission context. Just jump in
g
o btrfs_map_bio
* submission context. Just jump in
t
o btrfs_map_bio
*/
if
(
rw
&
(
1
<<
BIO_RW
))
{
return
btrfs_map_bio
(
BTRFS_I
(
inode
)
->
root
,
rw
,
bio
,
mirror_num
,
0
);
mirror_num
,
1
);
}
/*
...
...
@@ -528,6 +528,12 @@ static int btree_writepage(struct page *page, struct writeback_control *wbc)
{
struct
extent_io_tree
*
tree
;
tree
=
&
BTRFS_I
(
page
->
mapping
->
host
)
->
io_tree
;
if
(
current
->
flags
&
PF_MEMALLOC
)
{
redirty_page_for_writepage
(
wbc
,
page
);
unlock_page
(
page
);
return
0
;
}
return
extent_write_full_page
(
tree
,
page
,
btree_get_extent
,
wbc
);
}
...
...
@@ -1363,8 +1369,9 @@ struct btrfs_root *open_ctree(struct super_block *sb,
* queue work function gets called at interrupt time, and so it
* cannot dynamically grow.
*/
btrfs_init_workers
(
&
fs_info
->
workers
,
fs_info
->
thread_pool_size
);
btrfs_init_workers
(
&
fs_info
->
submit_workers
,
btrfs_init_workers
(
&
fs_info
->
workers
,
"worker"
,
fs_info
->
thread_pool_size
);
btrfs_init_workers
(
&
fs_info
->
submit_workers
,
"submit"
,
min_t
(
u64
,
fs_devices
->
num_devices
,
fs_info
->
thread_pool_size
));
...
...
@@ -1374,9 +1381,10 @@ struct btrfs_root *open_ctree(struct super_block *sb,
*/
fs_info
->
submit_workers
.
idle_thresh
=
64
;
btrfs_init_workers
(
&
fs_info
->
fixup_workers
,
1
);
btrfs_init_workers
(
&
fs_info
->
endio_workers
,
fs_info
->
thread_pool_size
);
btrfs_init_workers
(
&
fs_info
->
endio_write_workers
,
btrfs_init_workers
(
&
fs_info
->
fixup_workers
,
"fixup"
,
1
);
btrfs_init_workers
(
&
fs_info
->
endio_workers
,
"endio"
,
fs_info
->
thread_pool_size
);
btrfs_init_workers
(
&
fs_info
->
endio_write_workers
,
"endio-write"
,
fs_info
->
thread_pool_size
);
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录