Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
d0dbc624
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d0dbc624
编写于
4月 10, 2007
作者:
C
Chris Mason
提交者:
David Woodhouse
4月 10, 2007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: drop owner and parentid
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
1b05da2e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
6 addition
and
47 deletion
+6
-47
fs/btrfs/ctree.c
fs/btrfs/ctree.c
+0
-8
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+1
-24
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+2
-6
fs/btrfs/file-item.c
fs/btrfs/file-item.c
+1
-1
fs/btrfs/print-tree.c
fs/btrfs/print-tree.c
+2
-2
fs/btrfs/transaction.c
fs/btrfs/transaction.c
+0
-6
未找到文件。
fs/btrfs/ctree.c
浏览文件 @
d0dbc624
...
...
@@ -688,8 +688,6 @@ static int insert_new_root(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_level
(
&
c
->
header
,
level
);
btrfs_set_header_blocknr
(
&
c
->
header
,
t
->
b_blocknr
);
btrfs_set_header_generation
(
&
c
->
header
,
trans
->
transid
);
btrfs_set_header_parentid
(
&
c
->
header
,
btrfs_header_parentid
(
btrfs_buffer_header
(
root
->
node
)));
lower
=
btrfs_buffer_node
(
path
->
nodes
[
level
-
1
]);
memcpy
(
c
->
header
.
fsid
,
root
->
fs_info
->
disk_super
->
fsid
,
sizeof
(
c
->
header
.
fsid
));
...
...
@@ -784,8 +782,6 @@ static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_level
(
&
split
->
header
,
btrfs_header_level
(
&
c
->
header
));
btrfs_set_header_blocknr
(
&
split
->
header
,
split_buffer
->
b_blocknr
);
btrfs_set_header_generation
(
&
split
->
header
,
trans
->
transid
);
btrfs_set_header_parentid
(
&
split
->
header
,
btrfs_header_parentid
(
btrfs_buffer_header
(
root
->
node
)));
memcpy
(
split
->
header
.
fsid
,
root
->
fs_info
->
disk_super
->
fsid
,
sizeof
(
split
->
header
.
fsid
));
mid
=
(
c_nritems
+
1
)
/
2
;
...
...
@@ -1145,8 +1141,6 @@ static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_blocknr
(
&
right
->
header
,
right_buffer
->
b_blocknr
);
btrfs_set_header_generation
(
&
right
->
header
,
trans
->
transid
);
btrfs_set_header_level
(
&
right
->
header
,
0
);
btrfs_set_header_parentid
(
&
right
->
header
,
btrfs_header_parentid
(
btrfs_buffer_header
(
root
->
node
)));
memcpy
(
right
->
header
.
fsid
,
root
->
fs_info
->
disk_super
->
fsid
,
sizeof
(
right
->
header
.
fsid
));
if
(
mid
<=
slot
)
{
...
...
@@ -1237,8 +1231,6 @@ static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_blocknr
(
&
right
->
header
,
right_buffer
->
b_blocknr
);
btrfs_set_header_generation
(
&
right
->
header
,
trans
->
transid
);
btrfs_set_header_level
(
&
right
->
header
,
0
);
btrfs_set_header_parentid
(
&
right
->
header
,
btrfs_header_parentid
(
btrfs_buffer_header
(
root
->
node
)));
memcpy
(
right
->
header
.
fsid
,
root
->
fs_info
->
disk_super
->
fsid
,
sizeof
(
right
->
header
.
fsid
));
btrfs_cpu_key_to_disk
(
&
disk_key
,
ins_key
);
...
...
fs/btrfs/ctree.h
浏览文件 @
d0dbc624
...
...
@@ -60,7 +60,6 @@ struct btrfs_header {
u8
fsid
[
16
];
/* FS specific uuid */
__le64
blocknr
;
/* which block this node is supposed to live in */
__le64
generation
;
__le64
parentid
;
/* objectid of the tree root */
__le16
nritems
;
__le16
flags
;
u8
level
;
...
...
@@ -147,7 +146,6 @@ struct btrfs_path {
*/
struct
btrfs_extent_item
{
__le32
refs
;
__le64
owner
;
}
__attribute__
((
__packed__
));
struct
btrfs_inode_timespec
{
...
...
@@ -443,16 +441,6 @@ static inline void btrfs_set_timespec_nsec(struct btrfs_inode_timespec *ts,
ts
->
nsec
=
cpu_to_le32
(
val
);
}
static
inline
u64
btrfs_extent_owner
(
struct
btrfs_extent_item
*
ei
)
{
return
le64_to_cpu
(
ei
->
owner
);
}
static
inline
void
btrfs_set_extent_owner
(
struct
btrfs_extent_item
*
ei
,
u64
val
)
{
ei
->
owner
=
cpu_to_le64
(
val
);
}
static
inline
u32
btrfs_extent_refs
(
struct
btrfs_extent_item
*
ei
)
{
return
le32_to_cpu
(
ei
->
refs
);
...
...
@@ -652,17 +640,6 @@ static inline void btrfs_set_header_generation(struct btrfs_header *h,
h
->
generation
=
cpu_to_le64
(
val
);
}
static
inline
u64
btrfs_header_parentid
(
struct
btrfs_header
*
h
)
{
return
le64_to_cpu
(
h
->
parentid
);
}
static
inline
void
btrfs_set_header_parentid
(
struct
btrfs_header
*
h
,
u64
parentid
)
{
h
->
parentid
=
cpu_to_le64
(
parentid
);
}
static
inline
u16
btrfs_header_nritems
(
struct
btrfs_header
*
h
)
{
return
le16_to_cpu
(
h
->
nritems
);
...
...
@@ -919,7 +896,7 @@ struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
struct
btrfs_root
*
root
);
int
btrfs_alloc_extent
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_root
*
root
,
u64
num_blocks
,
u64
search_start
,
u64
search_end
,
u64
owner
,
struct
btrfs_key
*
ins
);
search_end
,
struct
btrfs_key
*
ins
);
int
btrfs_inc_ref
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_root
*
root
,
struct
buffer_head
*
buf
);
int
btrfs_free_extent
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_root
...
...
fs/btrfs/extent-tree.c
浏览文件 @
d0dbc624
...
...
@@ -157,8 +157,6 @@ static int finish_current_insert(struct btrfs_trans_handle *trans, struct
struct
btrfs_fs_info
*
info
=
extent_root
->
fs_info
;
btrfs_set_extent_refs
(
&
extent_item
,
1
);
btrfs_set_extent_owner
(
&
extent_item
,
btrfs_header_parentid
(
btrfs_buffer_header
(
extent_root
->
node
)));
ins
.
offset
=
1
;
ins
.
flags
=
0
;
btrfs_set_key_type
(
&
ins
,
BTRFS_EXTENT_ITEM_KEY
);
...
...
@@ -457,7 +455,7 @@ static int find_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
*/
int
btrfs_alloc_extent
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_root
*
root
,
u64
num_blocks
,
u64
search_start
,
u64
search_end
,
u64
owner
,
struct
btrfs_key
*
ins
)
search_end
,
struct
btrfs_key
*
ins
)
{
int
ret
;
int
pending_ret
;
...
...
@@ -467,7 +465,6 @@ int btrfs_alloc_extent(struct btrfs_trans_handle *trans, struct btrfs_root
struct
btrfs_extent_item
extent_item
;
btrfs_set_extent_refs
(
&
extent_item
,
1
);
btrfs_set_extent_owner
(
&
extent_item
,
owner
);
if
(
root
==
extent_root
)
{
BUG_ON
(
extent_root
->
fs_info
->
current_insert
.
offset
==
0
);
...
...
@@ -510,8 +507,7 @@ struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
int
ret
;
struct
buffer_head
*
buf
;
ret
=
btrfs_alloc_extent
(
trans
,
root
,
1
,
0
,
(
unsigned
long
)
-
1
,
btrfs_header_parentid
(
btrfs_buffer_header
(
root
->
node
)),
&
ins
);
ret
=
btrfs_alloc_extent
(
trans
,
root
,
1
,
0
,
(
unsigned
long
)
-
1
,
&
ins
);
if
(
ret
)
{
BUG
();
return
NULL
;
...
...
fs/btrfs/file-item.c
浏览文件 @
d0dbc624
...
...
@@ -19,7 +19,7 @@ int btrfs_alloc_file_extent(struct btrfs_trans_handle *trans,
BUG_ON
(
!
path
);
btrfs_init_path
(
path
);
ret
=
btrfs_alloc_extent
(
trans
,
root
,
num_blocks
,
hint_block
,
(
u64
)
-
1
,
objectid
,
&
ins
);
(
u64
)
-
1
,
&
ins
);
BUG_ON
(
ret
);
file_key
.
objectid
=
objectid
;
file_key
.
offset
=
offset
;
...
...
fs/btrfs/print-tree.c
浏览文件 @
d0dbc624
...
...
@@ -50,8 +50,8 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
break
;
case
BTRFS_EXTENT_ITEM_KEY
:
ei
=
btrfs_item_ptr
(
l
,
i
,
struct
btrfs_extent_item
);
printk
(
"
\t\t
extent data refs %u
owner %Lu
\n
"
,
btrfs_extent_refs
(
ei
)
,
btrfs_extent_owner
(
ei
)
);
printk
(
"
\t\t
extent data refs %u
\n
"
,
btrfs_extent_refs
(
ei
));
break
;
case
BTRFS_STRING_ITEM_KEY
:
printk
(
"
\t\t
item data %.*s
\n
"
,
btrfs_item_size
(
item
),
...
...
fs/btrfs/transaction.c
浏览文件 @
d0dbc624
...
...
@@ -163,7 +163,6 @@ int add_dirty_roots(struct btrfs_trans_handle *trans,
int
i
;
int
ret
;
int
err
;
printk
(
"add dirty
\n
"
);
while
(
1
)
{
ret
=
radix_tree_gang_lookup_tag
(
radix
,
(
void
**
)
gang
,
0
,
ARRAY_SIZE
(
gang
),
...
...
@@ -188,7 +187,6 @@ printk("add dirty\n");
dirty
->
commit_root
=
root
->
commit_root
;
root
->
commit_root
=
NULL
;
dirty
->
root
=
root
;
printk
(
"adding dirty root %Lu gen %Lu blocknr %Lu
\n
"
,
root
->
root_key
.
objectid
,
root
->
root_key
.
offset
,
dirty
->
commit_root
->
b_blocknr
);
root
->
root_key
.
offset
=
root
->
fs_info
->
generation
;
btrfs_set_root_blocknr
(
&
root
->
root_item
,
root
->
node
->
b_blocknr
);
...
...
@@ -199,7 +197,6 @@ printk("adding dirty root %Lu gen %Lu blocknr %Lu\n", root->root_key.objectid, r
list_add
(
&
dirty
->
list
,
list
);
}
}
printk
(
"add dirty done
\n
"
);
return
0
;
}
...
...
@@ -213,12 +210,10 @@ int drop_dirty_roots(struct btrfs_root *tree_root, struct list_head *list)
dirty
=
list_entry
(
list
->
next
,
struct
dirty_root
,
list
);
list_del_init
(
&
dirty
->
list
);
trans
=
btrfs_start_transaction
(
tree_root
,
1
);
printk
(
"drop snapshot root %p, commit_root blocknr %Lu generation %Lu
\n
"
,
dirty
->
root
,
dirty
->
commit_root
->
b_blocknr
,
dirty
->
snap_key
.
offset
);
ret
=
btrfs_drop_snapshot
(
trans
,
dirty
->
root
,
dirty
->
commit_root
);
BUG_ON
(
ret
);
printk
(
"del root objectid %Lu, offset %Lu
\n
"
,
dirty
->
snap_key
.
objectid
,
dirty
->
snap_key
.
offset
);
ret
=
btrfs_del_root
(
trans
,
tree_root
,
&
dirty
->
snap_key
);
BUG_ON
(
ret
);
ret
=
btrfs_end_transaction
(
trans
,
tree_root
);
...
...
@@ -240,7 +235,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
mutex_lock
(
&
root
->
fs_info
->
trans_mutex
);
if
(
trans
->
transaction
->
in_commit
)
{
printk
(
"already in commit!, waiting
\n
"
);
cur_trans
=
trans
->
transaction
;
trans
->
transaction
->
use_count
++
;
btrfs_end_transaction
(
trans
,
root
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录