Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
f68cad0f
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看板
提交
f68cad0f
编写于
4月 24, 2007
作者:
C
Chris Mason
提交者:
David Woodhouse
4月 24, 2007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: fixup dirty_inode related deadlocks
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
c62a1920
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
56 addition
and
53 deletion
+56
-53
fs/btrfs/super.c
fs/btrfs/super.c
+56
-53
未找到文件。
fs/btrfs/super.c
浏览文件 @
f68cad0f
...
@@ -120,6 +120,58 @@ static void btrfs_read_locked_inode(struct inode *inode)
...
@@ -120,6 +120,58 @@ static void btrfs_read_locked_inode(struct inode *inode)
make_bad_inode
(
inode
);
make_bad_inode
(
inode
);
}
}
static
void
fill_inode_item
(
struct
btrfs_inode_item
*
item
,
struct
inode
*
inode
)
{
btrfs_set_inode_uid
(
item
,
inode
->
i_uid
);
btrfs_set_inode_gid
(
item
,
inode
->
i_gid
);
btrfs_set_inode_size
(
item
,
inode
->
i_size
);
btrfs_set_inode_mode
(
item
,
inode
->
i_mode
);
btrfs_set_inode_nlink
(
item
,
inode
->
i_nlink
);
btrfs_set_timespec_sec
(
&
item
->
atime
,
inode
->
i_atime
.
tv_sec
);
btrfs_set_timespec_nsec
(
&
item
->
atime
,
inode
->
i_atime
.
tv_nsec
);
btrfs_set_timespec_sec
(
&
item
->
mtime
,
inode
->
i_mtime
.
tv_sec
);
btrfs_set_timespec_nsec
(
&
item
->
mtime
,
inode
->
i_mtime
.
tv_nsec
);
btrfs_set_timespec_sec
(
&
item
->
ctime
,
inode
->
i_ctime
.
tv_sec
);
btrfs_set_timespec_nsec
(
&
item
->
ctime
,
inode
->
i_ctime
.
tv_nsec
);
btrfs_set_inode_nblocks
(
item
,
inode
->
i_blocks
);
btrfs_set_inode_generation
(
item
,
inode
->
i_generation
);
}
static
int
btrfs_update_inode
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_root
*
root
,
struct
inode
*
inode
)
{
struct
btrfs_inode_item
*
inode_item
;
struct
btrfs_path
*
path
;
int
ret
;
path
=
btrfs_alloc_path
();
BUG_ON
(
!
path
);
btrfs_init_path
(
path
);
ret
=
btrfs_lookup_inode
(
trans
,
root
,
path
,
&
BTRFS_I
(
inode
)
->
location
,
1
);
if
(
ret
)
{
if
(
ret
>
0
)
ret
=
-
ENOENT
;
goto
failed
;
}
inode_item
=
btrfs_item_ptr
(
btrfs_buffer_leaf
(
path
->
nodes
[
0
]),
path
->
slots
[
0
],
struct
btrfs_inode_item
);
fill_inode_item
(
inode_item
,
inode
);
btrfs_mark_buffer_dirty
(
path
->
nodes
[
0
]);
ret
=
0
;
failed:
btrfs_release_path
(
root
,
path
);
btrfs_free_path
(
path
);
return
ret
;
}
static
int
btrfs_unlink_trans
(
struct
btrfs_trans_handle
*
trans
,
static
int
btrfs_unlink_trans
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_root
*
root
,
struct
btrfs_root
*
root
,
struct
inode
*
dir
,
struct
inode
*
dir
,
...
@@ -166,10 +218,11 @@ static int btrfs_unlink_trans(struct btrfs_trans_handle *trans,
...
@@ -166,10 +218,11 @@ static int btrfs_unlink_trans(struct btrfs_trans_handle *trans,
dentry
->
d_inode
->
i_ctime
=
dir
->
i_ctime
;
dentry
->
d_inode
->
i_ctime
=
dir
->
i_ctime
;
err:
err:
btrfs_free_path
(
path
);
btrfs_free_path
(
path
);
if
(
ret
==
0
)
{
if
(
!
ret
)
{
inode_dec_link_count
(
dentry
->
d_inode
);
dir
->
i_size
-=
name_len
*
2
;
dir
->
i_size
-=
name_len
*
2
;
mark_inode_dirty
(
dir
);
btrfs_update_inode
(
trans
,
root
,
dir
);
drop_nlink
(
dentry
->
d_inode
);
btrfs_update_inode
(
trans
,
root
,
dentry
->
d_inode
);
}
}
return
ret
;
return
ret
;
}
}
...
@@ -668,56 +721,6 @@ static int btrfs_fill_super(struct super_block * sb, void * data, int silent)
...
@@ -668,56 +721,6 @@ static int btrfs_fill_super(struct super_block * sb, void * data, int silent)
return
0
;
return
0
;
}
}
static
void
fill_inode_item
(
struct
btrfs_inode_item
*
item
,
struct
inode
*
inode
)
{
btrfs_set_inode_uid
(
item
,
inode
->
i_uid
);
btrfs_set_inode_gid
(
item
,
inode
->
i_gid
);
btrfs_set_inode_size
(
item
,
inode
->
i_size
);
btrfs_set_inode_mode
(
item
,
inode
->
i_mode
);
btrfs_set_inode_nlink
(
item
,
inode
->
i_nlink
);
btrfs_set_timespec_sec
(
&
item
->
atime
,
inode
->
i_atime
.
tv_sec
);
btrfs_set_timespec_nsec
(
&
item
->
atime
,
inode
->
i_atime
.
tv_nsec
);
btrfs_set_timespec_sec
(
&
item
->
mtime
,
inode
->
i_mtime
.
tv_sec
);
btrfs_set_timespec_nsec
(
&
item
->
mtime
,
inode
->
i_mtime
.
tv_nsec
);
btrfs_set_timespec_sec
(
&
item
->
ctime
,
inode
->
i_ctime
.
tv_sec
);
btrfs_set_timespec_nsec
(
&
item
->
ctime
,
inode
->
i_ctime
.
tv_nsec
);
btrfs_set_inode_nblocks
(
item
,
inode
->
i_blocks
);
btrfs_set_inode_generation
(
item
,
inode
->
i_generation
);
}
static
int
btrfs_update_inode
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_root
*
root
,
struct
inode
*
inode
)
{
struct
btrfs_inode_item
*
inode_item
;
struct
btrfs_path
*
path
;
int
ret
;
path
=
btrfs_alloc_path
();
BUG_ON
(
!
path
);
btrfs_init_path
(
path
);
ret
=
btrfs_lookup_inode
(
trans
,
root
,
path
,
&
BTRFS_I
(
inode
)
->
location
,
1
);
if
(
ret
)
{
if
(
ret
>
0
)
ret
=
-
ENOENT
;
goto
failed
;
}
inode_item
=
btrfs_item_ptr
(
btrfs_buffer_leaf
(
path
->
nodes
[
0
]),
path
->
slots
[
0
],
struct
btrfs_inode_item
);
fill_inode_item
(
inode_item
,
inode
);
btrfs_mark_buffer_dirty
(
path
->
nodes
[
0
]);
ret
=
0
;
failed:
btrfs_release_path
(
root
,
path
);
btrfs_free_path
(
path
);
return
ret
;
}
static
int
btrfs_write_inode
(
struct
inode
*
inode
,
int
wait
)
static
int
btrfs_write_inode
(
struct
inode
*
inode
,
int
wait
)
{
{
struct
btrfs_root
*
root
=
BTRFS_I
(
inode
)
->
root
;
struct
btrfs_root
*
root
=
BTRFS_I
(
inode
)
->
root
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录