Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
9aca1d51
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
9aca1d51
编写于
3月 13, 2007
作者:
C
Chris Mason
提交者:
David Woodhouse
3月 13, 2007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: make some funcs static
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
234b63a0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
44 addition
and
19 deletion
+44
-19
fs/btrfs/ctree.c
fs/btrfs/ctree.c
+8
-8
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+36
-11
未找到文件。
fs/btrfs/ctree.c
浏览文件 @
9aca1d51
...
...
@@ -34,7 +34,7 @@ void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p)
memset
(
p
,
0
,
sizeof
(
*
p
));
}
int
btrfs_cow_block
(
struct
btrfs_root
*
root
,
static
int
btrfs_cow_block
(
struct
btrfs_root
*
root
,
struct
btrfs_buffer
*
buf
,
struct
btrfs_buffer
*
parent
,
int
parent_slot
,
...
...
@@ -96,7 +96,7 @@ int btrfs_leaf_free_space(struct btrfs_leaf *leaf)
/*
* compare two keys in a memcmp fashion
*/
int
comp_keys
(
struct
btrfs_disk_key
*
disk
,
struct
btrfs_key
*
k2
)
static
int
comp_keys
(
struct
btrfs_disk_key
*
disk
,
struct
btrfs_key
*
k2
)
{
struct
btrfs_key
k1
;
...
...
@@ -117,7 +117,7 @@ int comp_keys(struct btrfs_disk_key *disk, struct btrfs_key *k2)
return
0
;
}
int
check_node
(
struct
btrfs_path
*
path
,
int
level
)
static
int
check_node
(
struct
btrfs_path
*
path
,
int
level
)
{
int
i
;
struct
btrfs_node
*
parent
=
NULL
;
...
...
@@ -146,7 +146,7 @@ int check_node(struct btrfs_path *path, int level)
return
0
;
}
int
check_leaf
(
struct
btrfs_path
*
path
,
int
level
)
static
int
check_leaf
(
struct
btrfs_path
*
path
,
int
level
)
{
int
i
;
struct
btrfs_leaf
*
leaf
=
&
path
->
nodes
[
level
]
->
leaf
;
...
...
@@ -186,7 +186,7 @@ int check_leaf(struct btrfs_path *path, int level)
return
0
;
}
int
check_block
(
struct
btrfs_path
*
path
,
int
level
)
static
int
check_block
(
struct
btrfs_path
*
path
,
int
level
)
{
if
(
level
==
0
)
return
check_leaf
(
path
,
level
);
...
...
@@ -202,7 +202,7 @@ int check_block(struct btrfs_path *path, int level)
*
* slot may point to max if the key is bigger than all of the keys
*/
int
generic_bin_search
(
char
*
p
,
int
item_size
,
struct
btrfs_key
*
key
,
static
int
generic_bin_search
(
char
*
p
,
int
item_size
,
struct
btrfs_key
*
key
,
int
max
,
int
*
slot
)
{
int
low
=
0
;
...
...
@@ -233,7 +233,7 @@ int generic_bin_search(char *p, int item_size, struct btrfs_key *key,
* simple bin_search frontend that does the right thing for
* leaves vs nodes
*/
int
bin_search
(
struct
btrfs_node
*
c
,
struct
btrfs_key
*
key
,
int
*
slot
)
static
int
bin_search
(
struct
btrfs_node
*
c
,
struct
btrfs_key
*
key
,
int
*
slot
)
{
if
(
btrfs_is_leaf
(
c
))
{
struct
btrfs_leaf
*
l
=
(
struct
btrfs_leaf
*
)
c
;
...
...
@@ -250,7 +250,7 @@ int bin_search(struct btrfs_node *c, struct btrfs_key *key, int *slot)
return
-
1
;
}
struct
btrfs_buffer
*
read_node_slot
(
struct
btrfs_root
*
root
,
st
atic
st
ruct
btrfs_buffer
*
read_node_slot
(
struct
btrfs_root
*
root
,
struct
btrfs_buffer
*
parent_buf
,
int
slot
)
{
...
...
fs/btrfs/extent-tree.c
浏览文件 @
9aca1d51
...
...
@@ -365,8 +365,9 @@ static int find_free_extent(struct btrfs_root *orig_root, u64 num_blocks,
*
* returns 0 if everything worked, non-zero otherwise.
*/
int
alloc_extent
(
struct
btrfs_root
*
root
,
u64
num_blocks
,
u64
search_start
,
u64
search_end
,
u64
owner
,
struct
btrfs_key
*
ins
)
static
int
alloc_extent
(
struct
btrfs_root
*
root
,
u64
num_blocks
,
u64
search_start
,
u64
search_end
,
u64
owner
,
struct
btrfs_key
*
ins
)
{
int
ret
;
int
pending_ret
;
...
...
@@ -425,7 +426,12 @@ struct btrfs_buffer *btrfs_alloc_free_block(struct btrfs_root *root)
return
buf
;
}
int
walk_down_tree
(
struct
btrfs_root
*
root
,
struct
btrfs_path
*
path
,
int
*
level
)
/*
* helper function for drop_snapshot, this walks down the tree dropping ref
* counts as it goes.
*/
static
int
walk_down_tree
(
struct
btrfs_root
*
root
,
struct
btrfs_path
*
path
,
int
*
level
)
{
struct
btrfs_buffer
*
next
;
struct
btrfs_buffer
*
cur
;
...
...
@@ -437,6 +443,9 @@ int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path, int *level)
BUG_ON
(
ret
);
if
(
refs
>
1
)
goto
out
;
/*
* walk down to the last node level and free all the leaves
*/
while
(
*
level
>
0
)
{
cur
=
path
->
nodes
[
*
level
];
if
(
path
->
slots
[
*
level
]
>=
...
...
@@ -467,7 +476,13 @@ int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path, int *level)
return
0
;
}
int
walk_up_tree
(
struct
btrfs_root
*
root
,
struct
btrfs_path
*
path
,
int
*
level
)
/*
* helper for dropping snapshots. This walks back up the tree in the path
* to find the first node higher up where we haven't yet gone through
* all the slots
*/
static
int
walk_up_tree
(
struct
btrfs_root
*
root
,
struct
btrfs_path
*
path
,
int
*
level
)
{
int
i
;
int
slot
;
...
...
@@ -491,9 +506,15 @@ int walk_up_tree(struct btrfs_root *root, struct btrfs_path *path, int *level)
return
1
;
}
/*
* drop the reference count on the tree rooted at 'snap'. This traverses
* the tree freeing any blocks that have a ref count of zero after being
* decremented.
*/
int
btrfs_drop_snapshot
(
struct
btrfs_root
*
root
,
struct
btrfs_buffer
*
snap
)
{
int
ret
;
int
ret
=
0
;;
int
wret
;
int
level
;
struct
btrfs_path
path
;
int
i
;
...
...
@@ -506,18 +527,22 @@ int btrfs_drop_snapshot(struct btrfs_root *root, struct btrfs_buffer *snap)
path
.
nodes
[
level
]
=
snap
;
path
.
slots
[
level
]
=
0
;
while
(
1
)
{
ret
=
walk_down_tree
(
root
,
&
path
,
&
level
);
if
(
ret
>
0
)
w
ret
=
walk_down_tree
(
root
,
&
path
,
&
level
);
if
(
w
ret
>
0
)
break
;
ret
=
walk_up_tree
(
root
,
&
path
,
&
level
);
if
(
ret
>
0
)
if
(
wret
<
0
)
ret
=
wret
;
wret
=
walk_up_tree
(
root
,
&
path
,
&
level
);
if
(
wret
>
0
)
break
;
if
(
wret
<
0
)
ret
=
wret
;
}
for
(
i
=
0
;
i
<=
orig_level
;
i
++
)
{
if
(
path
.
nodes
[
i
])
{
btrfs_block_release
(
root
,
path
.
nodes
[
i
]);
}
}
return
0
;
return
ret
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录