Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
19ae4e81
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,发现更多精彩内容 >>
提交
19ae4e81
编写于
5月 20, 2012
作者:
J
Jan Schmidt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: fs_info variable for join_transaction
Signed-off-by:
N
Jan Schmidt
<
list.btrfs@jan-o-sch.net
>
上级
8445f61c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
18 deletion
+19
-18
fs/btrfs/transaction.c
fs/btrfs/transaction.c
+19
-18
未找到文件。
fs/btrfs/transaction.c
浏览文件 @
19ae4e81
...
...
@@ -55,48 +55,49 @@ static noinline void switch_commit_root(struct btrfs_root *root)
static
noinline
int
join_transaction
(
struct
btrfs_root
*
root
,
int
nofail
)
{
struct
btrfs_transaction
*
cur_trans
;
struct
btrfs_fs_info
*
fs_info
=
root
->
fs_info
;
spin_lock
(
&
root
->
fs_info
->
trans_lock
);
spin_lock
(
&
fs_info
->
trans_lock
);
loop:
/* The file system has been taken offline. No new transactions. */
if
(
root
->
fs_info
->
fs_state
&
BTRFS_SUPER_FLAG_ERROR
)
{
spin_unlock
(
&
root
->
fs_info
->
trans_lock
);
if
(
fs_info
->
fs_state
&
BTRFS_SUPER_FLAG_ERROR
)
{
spin_unlock
(
&
fs_info
->
trans_lock
);
return
-
EROFS
;
}
if
(
root
->
fs_info
->
trans_no_join
)
{
if
(
fs_info
->
trans_no_join
)
{
if
(
!
nofail
)
{
spin_unlock
(
&
root
->
fs_info
->
trans_lock
);
spin_unlock
(
&
fs_info
->
trans_lock
);
return
-
EBUSY
;
}
}
cur_trans
=
root
->
fs_info
->
running_transaction
;
cur_trans
=
fs_info
->
running_transaction
;
if
(
cur_trans
)
{
if
(
cur_trans
->
aborted
)
{
spin_unlock
(
&
root
->
fs_info
->
trans_lock
);
spin_unlock
(
&
fs_info
->
trans_lock
);
return
cur_trans
->
aborted
;
}
atomic_inc
(
&
cur_trans
->
use_count
);
atomic_inc
(
&
cur_trans
->
num_writers
);
cur_trans
->
num_joined
++
;
spin_unlock
(
&
root
->
fs_info
->
trans_lock
);
spin_unlock
(
&
fs_info
->
trans_lock
);
return
0
;
}
spin_unlock
(
&
root
->
fs_info
->
trans_lock
);
spin_unlock
(
&
fs_info
->
trans_lock
);
cur_trans
=
kmem_cache_alloc
(
btrfs_transaction_cachep
,
GFP_NOFS
);
if
(
!
cur_trans
)
return
-
ENOMEM
;
spin_lock
(
&
root
->
fs_info
->
trans_lock
);
if
(
root
->
fs_info
->
running_transaction
)
{
spin_lock
(
&
fs_info
->
trans_lock
);
if
(
fs_info
->
running_transaction
)
{
/*
* someone started a transaction after we unlocked. Make sure
* to redo the trans_no_join checks above
*/
kmem_cache_free
(
btrfs_transaction_cachep
,
cur_trans
);
cur_trans
=
root
->
fs_info
->
running_transaction
;
cur_trans
=
fs_info
->
running_transaction
;
goto
loop
;
}
...
...
@@ -127,14 +128,14 @@ static noinline int join_transaction(struct btrfs_root *root, int nofail)
INIT_LIST_HEAD
(
&
cur_trans
->
delayed_refs
.
seq_head
);
INIT_LIST_HEAD
(
&
cur_trans
->
pending_snapshots
);
list_add_tail
(
&
cur_trans
->
list
,
&
root
->
fs_info
->
trans_list
);
list_add_tail
(
&
cur_trans
->
list
,
&
fs_info
->
trans_list
);
extent_io_tree_init
(
&
cur_trans
->
dirty_pages
,
root
->
fs_info
->
btree_inode
->
i_mapping
);
root
->
fs_info
->
generation
++
;
cur_trans
->
transid
=
root
->
fs_info
->
generation
;
root
->
fs_info
->
running_transaction
=
cur_trans
;
fs_info
->
btree_inode
->
i_mapping
);
fs_info
->
generation
++
;
cur_trans
->
transid
=
fs_info
->
generation
;
fs_info
->
running_transaction
=
cur_trans
;
cur_trans
->
aborted
=
0
;
spin_unlock
(
&
root
->
fs_info
->
trans_lock
);
spin_unlock
(
&
fs_info
->
trans_lock
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录