Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
cee36a03
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cee36a03
编写于
1月 15, 2008
作者:
C
Chris Mason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rework btrfs_drop_inode to avoid scheduling
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
61295eb8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
44 addition
and
10 deletion
+44
-10
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+1
-0
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+1
-0
fs/btrfs/inode.c
fs/btrfs/inode.c
+3
-10
fs/btrfs/ordered-data.c
fs/btrfs/ordered-data.c
+36
-0
fs/btrfs/ordered-data.h
fs/btrfs/ordered-data.h
+1
-0
fs/btrfs/transaction.c
fs/btrfs/transaction.c
+2
-0
未找到文件。
fs/btrfs/ctree.h
浏览文件 @
cee36a03
...
...
@@ -349,6 +349,7 @@ struct btrfs_fs_info {
u64
total_pinned
;
spinlock_t
delalloc_lock
;
spinlock_t
new_trans_lock
;
u64
delalloc_bytes
;
};
/*
...
...
fs/btrfs/disk-io.c
浏览文件 @
cee36a03
...
...
@@ -639,6 +639,7 @@ struct btrfs_root *open_ctree(struct super_block *sb)
INIT_LIST_HEAD
(
&
fs_info
->
hashers
);
spin_lock_init
(
&
fs_info
->
hash_lock
);
spin_lock_init
(
&
fs_info
->
delalloc_lock
);
spin_lock_init
(
&
fs_info
->
new_trans_lock
);
memset
(
&
fs_info
->
super_kobj
,
0
,
sizeof
(
fs_info
->
super_kobj
));
init_completion
(
&
fs_info
->
kobj_unregister
);
...
...
fs/btrfs/inode.c
浏览文件 @
cee36a03
...
...
@@ -993,20 +993,13 @@ static int btrfs_setattr(struct dentry *dentry, struct iattr *attr)
void
btrfs_drop_inode
(
struct
inode
*
inode
)
{
struct
btrfs_trans_handle
*
trans
;
struct
btrfs_root
*
root
=
BTRFS_I
(
inode
)
->
root
;
if
(
!
BTRFS_I
(
inode
)
->
ordered_trans
)
{
if
(
!
BTRFS_I
(
inode
)
->
ordered_trans
||
inode
->
i_nlink
)
{
generic_drop_inode
(
inode
);
return
;
}
/* nasty, but it prevents a deadlock with data=ordered by preventing
* a commit until after this inode is done
*/
trans
=
btrfs_start_transaction
(
root
,
1
);
/* FIXME, make sure this delete actually ends up in the transaction */
btrfs_del_ordered_inode
(
inode
);
generic_drop_inode
(
inode
);
/* note, the inode is now untouchable */
btrfs_end_transaction
(
trans
,
root
);
}
void
btrfs_delete_inode
(
struct
inode
*
inode
)
...
...
fs/btrfs/ordered-data.c
浏览文件 @
cee36a03
...
...
@@ -219,3 +219,39 @@ int btrfs_find_del_first_ordered_inode(struct btrfs_ordered_inode_tree *tree,
kfree
(
entry
);
return
1
;
}
static
int
__btrfs_del_ordered_inode
(
struct
btrfs_ordered_inode_tree
*
tree
,
u64
root_objectid
,
u64
objectid
)
{
struct
tree_entry
*
entry
;
struct
rb_node
*
node
;
struct
rb_node
*
prev
;
write_lock
(
&
tree
->
lock
);
node
=
__tree_search
(
&
tree
->
tree
,
root_objectid
,
objectid
,
&
prev
);
if
(
!
node
)
{
write_unlock
(
&
tree
->
lock
);
return
0
;
}
rb_erase
(
node
,
&
tree
->
tree
);
write_unlock
(
&
tree
->
lock
);
entry
=
rb_entry
(
node
,
struct
tree_entry
,
rb_node
);
kfree
(
entry
);
return
1
;
}
int
btrfs_del_ordered_inode
(
struct
inode
*
inode
)
{
struct
btrfs_root
*
root
=
BTRFS_I
(
inode
)
->
root
;
u64
root_objectid
=
root
->
root_key
.
objectid
;
spin_lock
(
&
root
->
fs_info
->
new_trans_lock
);
if
(
root
->
fs_info
->
running_transaction
)
{
struct
btrfs_ordered_inode_tree
*
tree
;
tree
=
&
root
->
fs_info
->
running_transaction
->
ordered_inode_tree
;
__btrfs_del_ordered_inode
(
tree
,
root_objectid
,
inode
->
i_ino
);
}
spin_unlock
(
&
root
->
fs_info
->
new_trans_lock
);
return
0
;
}
fs/btrfs/ordered-data.h
浏览文件 @
cee36a03
...
...
@@ -36,4 +36,5 @@ int btrfs_find_del_first_ordered_inode(struct btrfs_ordered_inode_tree *tree,
u64
*
root_objectid
,
u64
*
objectid
);
int
btrfs_find_first_ordered_inode
(
struct
btrfs_ordered_inode_tree
*
tree
,
u64
*
root_objectid
,
u64
*
objectid
);
int
btrfs_del_ordered_inode
(
struct
inode
*
inode
);
#endif
fs/btrfs/transaction.c
浏览文件 @
cee36a03
...
...
@@ -699,7 +699,9 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
BUG_ON
(
ret
);
cur_trans
=
root
->
fs_info
->
running_transaction
;
spin_lock
(
&
root
->
fs_info
->
new_trans_lock
);
root
->
fs_info
->
running_transaction
=
NULL
;
spin_unlock
(
&
root
->
fs_info
->
new_trans_lock
);
btrfs_set_super_generation
(
&
root
->
fs_info
->
super_copy
,
cur_trans
->
transid
);
btrfs_set_super_root
(
&
root
->
fs_info
->
super_copy
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录