Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
a7f9fb20
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
169
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看板
提交
a7f9fb20
编写于
7月 26, 2010
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
convert ceph
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
8bcbbf00
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
23 deletion
+27
-23
fs/ceph/super.c
fs/ceph/super.c
+27
-23
未找到文件。
fs/ceph/super.c
浏览文件 @
a7f9fb20
...
@@ -635,7 +635,7 @@ static struct dentry *open_root_dentry(struct ceph_fs_client *fsc,
...
@@ -635,7 +635,7 @@ static struct dentry *open_root_dentry(struct ceph_fs_client *fsc,
/*
/*
* mount: join the ceph cluster, and open root directory.
* mount: join the ceph cluster, and open root directory.
*/
*/
static
int
ceph_mount
(
struct
ceph_fs_client
*
fsc
,
struct
vfsmount
*
mnt
,
static
struct
dentry
*
ceph_real_mount
(
struct
ceph_fs_client
*
fsc
,
const
char
*
path
)
const
char
*
path
)
{
{
int
err
;
int
err
;
...
@@ -678,16 +678,14 @@ static int ceph_mount(struct ceph_fs_client *fsc, struct vfsmount *mnt,
...
@@ -678,16 +678,14 @@ static int ceph_mount(struct ceph_fs_client *fsc, struct vfsmount *mnt,
}
}
}
}
mnt
->
mnt_root
=
root
;
mnt
->
mnt_sb
=
fsc
->
sb
;
fsc
->
mount_state
=
CEPH_MOUNT_MOUNTED
;
fsc
->
mount_state
=
CEPH_MOUNT_MOUNTED
;
dout
(
"mount success
\n
"
);
dout
(
"mount success
\n
"
);
err
=
0
;
mutex_unlock
(
&
fsc
->
client
->
mount_mutex
);
return
root
;
out:
out:
mutex_unlock
(
&
fsc
->
client
->
mount_mutex
);
mutex_unlock
(
&
fsc
->
client
->
mount_mutex
);
return
err
;
return
ERR_PTR
(
err
)
;
fail:
fail:
if
(
first
)
{
if
(
first
)
{
...
@@ -777,41 +775,45 @@ static int ceph_register_bdi(struct super_block *sb,
...
@@ -777,41 +775,45 @@ static int ceph_register_bdi(struct super_block *sb,
return
err
;
return
err
;
}
}
static
int
ceph_get_sb
(
struct
file_system_type
*
fs_type
,
static
struct
dentry
*
ceph_mount
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
,
int
flags
,
const
char
*
dev_name
,
void
*
data
)
struct
vfsmount
*
mnt
)
{
{
struct
super_block
*
sb
;
struct
super_block
*
sb
;
struct
ceph_fs_client
*
fsc
;
struct
ceph_fs_client
*
fsc
;
struct
dentry
*
res
;
int
err
;
int
err
;
int
(
*
compare_super
)(
struct
super_block
*
,
void
*
)
=
ceph_compare_super
;
int
(
*
compare_super
)(
struct
super_block
*
,
void
*
)
=
ceph_compare_super
;
const
char
*
path
=
NULL
;
const
char
*
path
=
NULL
;
struct
ceph_mount_options
*
fsopt
=
NULL
;
struct
ceph_mount_options
*
fsopt
=
NULL
;
struct
ceph_options
*
opt
=
NULL
;
struct
ceph_options
*
opt
=
NULL
;
dout
(
"ceph_
get_sb
\n
"
);
dout
(
"ceph_
mount
\n
"
);
err
=
parse_mount_options
(
&
fsopt
,
&
opt
,
flags
,
data
,
dev_name
,
&
path
);
err
=
parse_mount_options
(
&
fsopt
,
&
opt
,
flags
,
data
,
dev_name
,
&
path
);
if
(
err
<
0
)
if
(
err
<
0
)
{
res
=
ERR_PTR
(
err
);
goto
out_final
;
goto
out_final
;
}
/* create client (which we may/may not use) */
/* create client (which we may/may not use) */
fsc
=
create_fs_client
(
fsopt
,
opt
);
fsc
=
create_fs_client
(
fsopt
,
opt
);
if
(
IS_ERR
(
fsc
))
{
if
(
IS_ERR
(
fsc
))
{
err
=
PTR_ERR
(
fsc
);
res
=
ERR_CAST
(
fsc
);
kfree
(
fsopt
);
kfree
(
fsopt
);
kfree
(
opt
);
kfree
(
opt
);
goto
out_final
;
goto
out_final
;
}
}
err
=
ceph_mdsc_init
(
fsc
);
err
=
ceph_mdsc_init
(
fsc
);
if
(
err
<
0
)
if
(
err
<
0
)
{
res
=
ERR_PTR
(
err
);
goto
out
;
goto
out
;
}
if
(
ceph_test_opt
(
fsc
->
client
,
NOSHARE
))
if
(
ceph_test_opt
(
fsc
->
client
,
NOSHARE
))
compare_super
=
NULL
;
compare_super
=
NULL
;
sb
=
sget
(
fs_type
,
compare_super
,
ceph_set_super
,
fsc
);
sb
=
sget
(
fs_type
,
compare_super
,
ceph_set_super
,
fsc
);
if
(
IS_ERR
(
sb
))
{
if
(
IS_ERR
(
sb
))
{
err
=
PTR_ERR
(
sb
);
res
=
ERR_CAST
(
sb
);
goto
out
;
goto
out
;
}
}
...
@@ -823,16 +825,18 @@ static int ceph_get_sb(struct file_system_type *fs_type,
...
@@ -823,16 +825,18 @@ static int ceph_get_sb(struct file_system_type *fs_type,
}
else
{
}
else
{
dout
(
"get_sb using new client %p
\n
"
,
fsc
);
dout
(
"get_sb using new client %p
\n
"
,
fsc
);
err
=
ceph_register_bdi
(
sb
,
fsc
);
err
=
ceph_register_bdi
(
sb
,
fsc
);
if
(
err
<
0
)
if
(
err
<
0
)
{
res
=
ERR_PTR
(
err
);
goto
out_splat
;
goto
out_splat
;
}
}
}
err
=
ceph_mount
(
fsc
,
mnt
,
path
);
res
=
ceph_real_mount
(
fsc
,
path
);
if
(
err
<
0
)
if
(
IS_ERR
(
res
)
)
goto
out_splat
;
goto
out_splat
;
dout
(
"root %p inode %p ino %llx.%llx
\n
"
,
mnt
->
mnt_root
,
dout
(
"root %p inode %p ino %llx.%llx
\n
"
,
res
,
mnt
->
mnt_root
->
d_inode
,
ceph_vinop
(
mnt
->
mnt_root
->
d_inode
));
res
->
d_inode
,
ceph_vinop
(
res
->
d_inode
));
return
0
;
return
res
;
out_splat:
out_splat:
ceph_mdsc_close_sessions
(
fsc
->
mdsc
);
ceph_mdsc_close_sessions
(
fsc
->
mdsc
);
...
@@ -843,8 +847,8 @@ static int ceph_get_sb(struct file_system_type *fs_type,
...
@@ -843,8 +847,8 @@ static int ceph_get_sb(struct file_system_type *fs_type,
ceph_mdsc_destroy
(
fsc
);
ceph_mdsc_destroy
(
fsc
);
destroy_fs_client
(
fsc
);
destroy_fs_client
(
fsc
);
out_final:
out_final:
dout
(
"ceph_
get_sb fail %d
\n
"
,
err
);
dout
(
"ceph_
mount fail %ld
\n
"
,
PTR_ERR
(
res
)
);
return
err
;
return
res
;
}
}
static
void
ceph_kill_sb
(
struct
super_block
*
s
)
static
void
ceph_kill_sb
(
struct
super_block
*
s
)
...
@@ -860,7 +864,7 @@ static void ceph_kill_sb(struct super_block *s)
...
@@ -860,7 +864,7 @@ static void ceph_kill_sb(struct super_block *s)
static
struct
file_system_type
ceph_fs_type
=
{
static
struct
file_system_type
ceph_fs_type
=
{
.
owner
=
THIS_MODULE
,
.
owner
=
THIS_MODULE
,
.
name
=
"ceph"
,
.
name
=
"ceph"
,
.
get_sb
=
ceph_get_sb
,
.
mount
=
ceph_mount
,
.
kill_sb
=
ceph_kill_sb
,
.
kill_sb
=
ceph_kill_sb
,
.
fs_flags
=
FS_RENAME_DOES_D_MOVE
,
.
fs_flags
=
FS_RENAME_DOES_D_MOVE
,
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录