Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
7ae9c09d
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
7ae9c09d
编写于
4月 18, 2008
作者:
C
Chris Mason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: Add support for labels in the super block
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
a443755f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
8 deletion
+11
-8
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+2
-0
fs/btrfs/volumes.c
fs/btrfs/volumes.c
+9
-8
未找到文件。
fs/btrfs/ctree.h
浏览文件 @
7ae9c09d
...
...
@@ -247,6 +247,7 @@ struct btrfs_header {
* room to translate 14 chunks with 3 stripes each.
*/
#define BTRFS_SYSTEM_CHUNK_ARRAY_SIZE 2048
#define BTRFS_LABEL_SIZE 256
/*
* the super block basically lists the main trees of the FS
...
...
@@ -276,6 +277,7 @@ struct btrfs_super_block {
u8
root_level
;
u8
chunk_root_level
;
struct
btrfs_dev_item
dev_item
;
char
label
[
BTRFS_LABEL_SIZE
];
u8
sys_chunk_array
[
BTRFS_SYSTEM_CHUNK_ARRAY_SIZE
];
}
__attribute__
((
__packed__
));
...
...
fs/btrfs/volumes.c
浏览文件 @
7ae9c09d
...
...
@@ -57,9 +57,7 @@ int btrfs_cleanup_fs_uuids(void)
devices_cur
=
fs_devices
->
devices
.
next
;
dev
=
list_entry
(
devices_cur
,
struct
btrfs_device
,
dev_list
);
printk
(
"uuid cleanup finds %s
\n
"
,
dev
->
name
);
if
(
dev
->
bdev
)
{
printk
(
"closing
\n
"
);
close_bdev_excl
(
dev
->
bdev
);
}
list_del
(
&
dev
->
dev_list
);
...
...
@@ -149,7 +147,6 @@ static int device_list_add(const char *path,
}
if
(
fs_devices
->
lowest_devid
>
devid
)
{
fs_devices
->
lowest_devid
=
devid
;
printk
(
"lowest devid now %Lu
\n
"
,
devid
);
}
*
fs_devices_ret
=
fs_devices
;
return
0
;
...
...
@@ -166,7 +163,6 @@ int btrfs_close_devices(struct btrfs_fs_devices *fs_devices)
device
=
list_entry
(
cur
,
struct
btrfs_device
,
dev_list
);
if
(
device
->
bdev
)
{
close_bdev_excl
(
device
->
bdev
);
printk
(
"close devices closes %s
\n
"
,
device
->
name
);
}
device
->
bdev
=
NULL
;
}
...
...
@@ -220,11 +216,9 @@ int btrfs_scan_one_device(const char *path, int flags, void *holder,
mutex_lock
(
&
uuid_mutex
);
printk
(
"scan one opens %s
\n
"
,
path
);
bdev
=
open_bdev_excl
(
path
,
flags
,
holder
);
if
(
IS_ERR
(
bdev
))
{
printk
(
"open failed
\n
"
);
ret
=
PTR_ERR
(
bdev
);
goto
error
;
}
...
...
@@ -240,13 +234,20 @@ int btrfs_scan_one_device(const char *path, int flags, void *holder,
disk_super
=
(
struct
btrfs_super_block
*
)
bh
->
b_data
;
if
(
strncmp
((
char
*
)(
&
disk_super
->
magic
),
BTRFS_MAGIC
,
sizeof
(
disk_super
->
magic
)))
{
printk
(
"no btrfs found on %s
\n
"
,
path
);
ret
=
-
EINVAL
;
goto
error_brelse
;
}
devid
=
le64_to_cpu
(
disk_super
->
dev_item
.
devid
);
transid
=
btrfs_super_generation
(
disk_super
);
printk
(
"found device %Lu transid %Lu on %s
\n
"
,
devid
,
transid
,
path
);
if
(
disk_super
->
label
[
0
])
printk
(
"device label %s "
,
disk_super
->
label
);
else
{
/* FIXME, make a readl uuid parser */
printk
(
"device fsid %llx-%llx "
,
*
(
unsigned
long
long
*
)
disk_super
->
fsid
,
*
(
unsigned
long
long
*
)(
disk_super
->
fsid
+
8
));
}
printk
(
"devid %Lu transid %Lu %s
\n
"
,
devid
,
transid
,
path
);
ret
=
device_list_add
(
path
,
disk_super
,
devid
,
fs_devices_ret
);
error_brelse:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录