Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
0f70abe2
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看板
提交
0f70abe2
编写于
2月 28, 2007
作者:
C
Chris Mason
提交者:
David Woodhouse
2月 28, 2007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: more return code checking
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
aa5d6bed
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
11 deletion
+21
-11
fs/btrfs/ctree.c
fs/btrfs/ctree.c
+12
-5
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+9
-6
未找到文件。
fs/btrfs/ctree.c
浏览文件 @
0f70abe2
...
...
@@ -1087,7 +1087,9 @@ static int del_ptr(struct ctree_root *root, struct ctree_path *path, int level)
break
;
}
level
++
;
free_extent
(
root
,
blocknr
,
1
);
wret
=
free_extent
(
root
,
blocknr
,
1
);
if
(
wret
)
ret
=
wret
;
if
(
!
path
->
nodes
[
level
])
BUG
();
}
...
...
@@ -1136,7 +1138,9 @@ int del_item(struct ctree_root *root, struct ctree_path *path)
wret
=
del_ptr
(
root
,
path
,
1
);
if
(
wret
)
ret
=
wret
;
free_extent
(
root
,
leaf_buf
->
blocknr
,
1
);
wret
=
free_extent
(
root
,
leaf_buf
->
blocknr
,
1
);
if
(
wret
)
ret
=
wret
;
}
}
else
{
int
used
=
leaf_space_used
(
leaf
,
0
,
leaf
->
header
.
nritems
);
...
...
@@ -1173,7 +1177,9 @@ int del_item(struct ctree_root *root, struct ctree_path *path)
if
(
wret
)
ret
=
wret
;
tree_block_release
(
root
,
leaf_buf
);
free_extent
(
root
,
blocknr
,
1
);
wret
=
free_extent
(
root
,
blocknr
,
1
);
if
(
wret
)
ret
=
wret
;
}
else
{
tree_block_release
(
root
,
leaf_buf
);
}
...
...
@@ -1184,7 +1190,8 @@ int del_item(struct ctree_root *root, struct ctree_path *path)
/*
* walk up the tree as far as required to find the next leaf.
* returns 0 if it found something or -1 if there are no greater leaves.
* returns 0 if it found something or 1 if there are no greater leaves.
* returns < 0 on io errors.
*/
int
next_leaf
(
struct
ctree_root
*
root
,
struct
ctree_path
*
path
)
{
...
...
@@ -1196,7 +1203,7 @@ int next_leaf(struct ctree_root *root, struct ctree_path *path)
while
(
level
<
MAX_LEVEL
)
{
if
(
!
path
->
nodes
[
level
])
return
-
1
;
return
1
;
slot
=
path
->
slots
[
level
]
+
1
;
c
=
path
->
nodes
[
level
];
if
(
slot
>=
c
->
node
.
header
.
nritems
)
{
...
...
fs/btrfs/extent-tree.c
浏览文件 @
0f70abe2
...
...
@@ -105,8 +105,8 @@ int free_extent(struct ctree_root *root, u64 blocknr, u64 num_blocks)
* ins->offset == number of blocks
* Any available blocks before search_start are skipped.
*/
int
find_free_extent
(
struct
ctree_root
*
orig_root
,
u64
num_blocks
,
u64
search_start
,
u64
search_end
,
struct
key
*
ins
)
static
int
find_free_extent
(
struct
ctree_root
*
orig_root
,
u64
num_blocks
,
u64
search_start
,
u64
search_end
,
struct
key
*
ins
)
{
struct
ctree_path
path
;
struct
key
*
key
;
...
...
@@ -125,10 +125,8 @@ int find_free_extent(struct ctree_root *orig_root, u64 num_blocks,
ins
->
flags
=
0
;
start_found
=
0
;
ret
=
search_slot
(
root
,
ins
,
&
path
,
0
);
if
(
ret
<
0
)
{
release_path
(
root
,
&
path
);
return
ret
;
}
if
(
ret
<
0
)
goto
error
;
while
(
1
)
{
l
=
&
path
.
nodes
[
0
]
->
leaf
;
...
...
@@ -137,6 +135,8 @@ int find_free_extent(struct ctree_root *orig_root, u64 num_blocks,
ret
=
next_leaf
(
root
,
&
path
);
if
(
ret
==
0
)
continue
;
if
(
ret
<
0
)
goto
error
;
if
(
!
start_found
)
{
ins
->
objectid
=
search_start
;
ins
->
offset
=
num_blocks
;
...
...
@@ -187,6 +187,9 @@ int find_free_extent(struct ctree_root *orig_root, u64 num_blocks,
if
(
ins
->
offset
!=
1
)
BUG
();
return
0
;
error:
release_path
(
root
,
&
path
);
return
ret
;
}
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录