Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
f7d57218
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看板
提交
f7d57218
编写于
11月 10, 2011
作者:
C
Chris Mason
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'mount-fixes' of
git://github.com/idryomov/btrfs-unstable
into integration
上级
2115133f
04d21a24
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
43 addition
and
46 deletion
+43
-46
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+18
-24
fs/btrfs/super.c
fs/btrfs/super.c
+25
-22
未找到文件。
fs/btrfs/disk-io.c
浏览文件 @
f7d57218
...
...
@@ -1890,31 +1890,32 @@ struct btrfs_root *open_ctree(struct super_block *sb,
u64
features
;
struct
btrfs_key
location
;
struct
buffer_head
*
bh
;
struct
btrfs_root
*
extent_root
=
kzalloc
(
sizeof
(
struct
btrfs_root
),
GFP_NOFS
);
struct
btrfs_root
*
csum_root
=
kzalloc
(
sizeof
(
struct
btrfs_root
),
GFP_NOFS
);
struct
btrfs_super_block
*
disk_super
;
struct
btrfs_root
*
tree_root
=
btrfs_sb
(
sb
);
struct
btrfs_fs_info
*
fs_info
=
NULL
;
struct
btrfs_root
*
chunk_root
=
kzalloc
(
sizeof
(
struct
btrfs_root
),
GFP_NOFS
)
;
struct
btrfs_root
*
dev_root
=
kzalloc
(
sizeof
(
struct
btrfs_root
),
GFP_NOFS
)
;
struct
btrfs_fs_info
*
fs_info
=
tree_root
->
fs_info
;
struct
btrfs_root
*
extent_root
;
struct
btrfs_root
*
csum_root
;
struct
btrfs_root
*
chunk_root
;
struct
btrfs_root
*
dev_root
;
struct
btrfs_root
*
log_tree_root
;
int
ret
;
int
err
=
-
EINVAL
;
int
num_backups_tried
=
0
;
int
backup_index
=
0
;
struct
btrfs_super_block
*
disk_super
;
extent_root
=
fs_info
->
extent_root
=
kzalloc
(
sizeof
(
struct
btrfs_root
),
GFP_NOFS
);
csum_root
=
fs_info
->
csum_root
=
kzalloc
(
sizeof
(
struct
btrfs_root
),
GFP_NOFS
);
chunk_root
=
fs_info
->
chunk_root
=
kzalloc
(
sizeof
(
struct
btrfs_root
),
GFP_NOFS
);
dev_root
=
fs_info
->
dev_root
=
kzalloc
(
sizeof
(
struct
btrfs_root
),
GFP_NOFS
);
if
(
!
extent_root
||
!
tree_root
||
!
tree_root
->
fs_info
||
!
chunk_root
||
!
dev_root
||
!
csum_root
)
{
if
(
!
extent_root
||
!
csum_root
||
!
chunk_root
||
!
dev_root
)
{
err
=
-
ENOMEM
;
goto
fail
;
}
fs_info
=
tree_root
->
fs_info
;
ret
=
init_srcu_struct
(
&
fs_info
->
subvol_srcu
);
if
(
ret
)
{
...
...
@@ -1954,12 +1955,6 @@ struct btrfs_root *open_ctree(struct super_block *sb,
mutex_init
(
&
fs_info
->
reloc_mutex
);
init_completion
(
&
fs_info
->
kobj_unregister
);
fs_info
->
tree_root
=
tree_root
;
fs_info
->
extent_root
=
extent_root
;
fs_info
->
csum_root
=
csum_root
;
fs_info
->
chunk_root
=
chunk_root
;
fs_info
->
dev_root
=
dev_root
;
fs_info
->
fs_devices
=
fs_devices
;
INIT_LIST_HEAD
(
&
fs_info
->
dirty_cowonly_roots
);
INIT_LIST_HEAD
(
&
fs_info
->
space_info
);
btrfs_mapping_init
(
&
fs_info
->
mapping_tree
);
...
...
@@ -2465,21 +2460,20 @@ struct btrfs_root *open_ctree(struct super_block *sb,
btrfs_stop_workers
(
&
fs_info
->
caching_workers
);
fail_alloc:
fail_iput:
btrfs_mapping_tree_free
(
&
fs_info
->
mapping_tree
);
invalidate_inode_pages2
(
fs_info
->
btree_inode
->
i_mapping
);
iput
(
fs_info
->
btree_inode
);
btrfs_close_devices
(
fs_info
->
fs_devices
);
btrfs_mapping_tree_free
(
&
fs_info
->
mapping_tree
);
fail_bdi:
bdi_destroy
(
&
fs_info
->
bdi
);
fail_srcu:
cleanup_srcu_struct
(
&
fs_info
->
subvol_srcu
);
fail:
btrfs_close_devices
(
fs_info
->
fs_devices
);
free_fs_info
(
fs_info
);
return
ERR_PTR
(
err
);
recovery_tree_root:
if
(
!
btrfs_test_opt
(
tree_root
,
RECOVERY
))
goto
fail_tree_roots
;
...
...
fs/btrfs/super.c
浏览文件 @
f7d57218
...
...
@@ -448,6 +448,7 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags,
token
=
match_token
(
p
,
tokens
,
args
);
switch
(
token
)
{
case
Opt_subvol
:
kfree
(
*
subvol_name
);
*
subvol_name
=
match_strdup
(
&
args
[
0
]);
break
;
case
Opt_subvolid
:
...
...
@@ -890,7 +891,6 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
struct
super_block
*
s
;
struct
dentry
*
root
;
struct
btrfs_fs_devices
*
fs_devices
=
NULL
;
struct
btrfs_root
*
tree_root
=
NULL
;
struct
btrfs_fs_info
*
fs_info
=
NULL
;
fmode_t
mode
=
FMODE_READ
;
char
*
subvol_name
=
NULL
;
...
...
@@ -904,8 +904,10 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
error
=
btrfs_parse_early_options
(
data
,
mode
,
fs_type
,
&
subvol_name
,
&
subvol_objectid
,
&
subvol_rootid
,
&
fs_devices
);
if
(
error
)
if
(
error
)
{
kfree
(
subvol_name
);
return
ERR_PTR
(
error
);
}
if
(
subvol_name
)
{
root
=
mount_subvol
(
subvol_name
,
flags
,
device_name
,
data
);
...
...
@@ -917,15 +919,6 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
if
(
error
)
return
ERR_PTR
(
error
);
error
=
btrfs_open_devices
(
fs_devices
,
mode
,
fs_type
);
if
(
error
)
return
ERR_PTR
(
error
);
if
(
!
(
flags
&
MS_RDONLY
)
&&
fs_devices
->
rw_devices
==
0
)
{
error
=
-
EACCES
;
goto
error_close_devices
;
}
/*
* Setup a dummy root and fs_info for test/set super. This is because
* we don't actually fill this stuff out until open_ctree, but we need
...
...
@@ -933,28 +926,36 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
* then open_ctree will properly initialize everything later.
*/
fs_info
=
kzalloc
(
sizeof
(
struct
btrfs_fs_info
),
GFP_NOFS
);
if
(
!
fs_info
)
{
error
=
-
ENOMEM
;
goto
error_close_devices
;
}
tree_root
=
kzalloc
(
sizeof
(
struct
btrfs_root
),
GFP_NOFS
);
if
(
!
tree_root
)
{
if
(
!
fs_info
)
return
ERR_PTR
(
-
ENOMEM
);
fs_info
->
tree_root
=
kzalloc
(
sizeof
(
struct
btrfs_root
),
GFP_NOFS
);
if
(
!
fs_info
->
tree_root
)
{
error
=
-
ENOMEM
;
goto
error_
close_devices
;
goto
error_
fs_info
;
}
fs_info
->
tree_root
=
tree_root
;
fs_info
->
tree_root
->
fs_info
=
fs_info
;
fs_info
->
fs_devices
=
fs_devices
;
tree_root
->
fs_info
=
fs_info
;
fs_info
->
super_copy
=
kzalloc
(
BTRFS_SUPER_INFO_SIZE
,
GFP_NOFS
);
fs_info
->
super_for_commit
=
kzalloc
(
BTRFS_SUPER_INFO_SIZE
,
GFP_NOFS
);
if
(
!
fs_info
->
super_copy
||
!
fs_info
->
super_for_commit
)
{
error
=
-
ENOMEM
;
goto
error_fs_info
;
}
error
=
btrfs_open_devices
(
fs_devices
,
mode
,
fs_type
);
if
(
error
)
goto
error_fs_info
;
if
(
!
(
flags
&
MS_RDONLY
)
&&
fs_devices
->
rw_devices
==
0
)
{
error
=
-
EACCES
;
goto
error_close_devices
;
}
bdev
=
fs_devices
->
latest_bdev
;
s
=
sget
(
fs_type
,
btrfs_test_super
,
btrfs_set_super
,
tree_root
);
s
=
sget
(
fs_type
,
btrfs_test_super
,
btrfs_set_super
,
fs_info
->
tree_root
);
if
(
IS_ERR
(
s
))
{
error
=
PTR_ERR
(
s
);
goto
error_close_devices
;
...
...
@@ -963,7 +964,8 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
if
(
s
->
s_root
)
{
if
((
flags
^
s
->
s_flags
)
&
MS_RDONLY
)
{
deactivate_locked_super
(
s
);
return
ERR_PTR
(
-
EBUSY
);
error
=
-
EBUSY
;
goto
error_close_devices
;
}
btrfs_close_devices
(
fs_devices
);
...
...
@@ -994,6 +996,7 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
error_close_devices:
btrfs_close_devices
(
fs_devices
);
error_fs_info:
free_fs_info
(
fs_info
);
return
ERR_PTR
(
error
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录