Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
848b83a5
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,发现更多精彩内容 >>
提交
848b83a5
编写于
7月 25, 2010
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
convert get_sb_mtd() users to ->mount()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
152a0836
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
49 deletion
+36
-49
drivers/mtd/mtdsuper.c
drivers/mtd/mtdsuper.c
+22
-32
fs/jffs2/super.c
fs/jffs2/super.c
+4
-5
fs/romfs/super.c
fs/romfs/super.c
+8
-9
include/linux/mtd/super.h
include/linux/mtd/super.h
+2
-3
未找到文件。
drivers/mtd/mtdsuper.c
浏览文件 @
848b83a5
...
...
@@ -54,11 +54,10 @@ static int get_sb_mtd_set(struct super_block *sb, void *_mtd)
/*
* get a superblock on an MTD-backed filesystem
*/
static
int
get_sb
_mtd_aux
(
struct
file_system_type
*
fs_type
,
int
flags
,
static
struct
dentry
*
mount
_mtd_aux
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
,
struct
mtd_info
*
mtd
,
int
(
*
fill_super
)(
struct
super_block
*
,
void
*
,
int
),
struct
vfsmount
*
mnt
)
int
(
*
fill_super
)(
struct
super_block
*
,
void
*
,
int
))
{
struct
super_block
*
sb
;
int
ret
;
...
...
@@ -79,57 +78,49 @@ static int get_sb_mtd_aux(struct file_system_type *fs_type, int flags,
ret
=
fill_super
(
sb
,
data
,
flags
&
MS_SILENT
?
1
:
0
);
if
(
ret
<
0
)
{
deactivate_locked_super
(
sb
);
return
ret
;
return
ERR_PTR
(
ret
)
;
}
/* go */
sb
->
s_flags
|=
MS_ACTIVE
;
simple_set_mnt
(
mnt
,
sb
);
return
0
;
return
dget
(
sb
->
s_root
);
/* new mountpoint for an already mounted superblock */
already_mounted:
DEBUG
(
1
,
"MTDSB: Device %d (
\"
%s
\"
) is already mounted
\n
"
,
mtd
->
index
,
mtd
->
name
);
simple_set_mnt
(
mnt
,
sb
);
ret
=
0
;
goto
out_put
;
put_mtd_device
(
mtd
);
return
dget
(
sb
->
s_root
);
out_error:
ret
=
PTR_ERR
(
sb
);
out_put:
put_mtd_device
(
mtd
);
return
ret
;
return
ERR_CAST
(
sb
)
;
}
/*
* get a superblock on an MTD-backed filesystem by MTD device number
*/
static
int
get_sb
_mtd_nr
(
struct
file_system_type
*
fs_type
,
int
flags
,
static
struct
dentry
*
mount
_mtd_nr
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
,
int
mtdnr
,
int
(
*
fill_super
)(
struct
super_block
*
,
void
*
,
int
),
struct
vfsmount
*
mnt
)
int
(
*
fill_super
)(
struct
super_block
*
,
void
*
,
int
))
{
struct
mtd_info
*
mtd
;
mtd
=
get_mtd_device
(
NULL
,
mtdnr
);
if
(
IS_ERR
(
mtd
))
{
DEBUG
(
0
,
"MTDSB: Device #%u doesn't appear to exist
\n
"
,
mtdnr
);
return
PTR_ERR
(
mtd
);
return
ERR_CAST
(
mtd
);
}
return
get_sb_mtd_aux
(
fs_type
,
flags
,
dev_name
,
data
,
mtd
,
fill_super
,
mnt
);
return
mount_mtd_aux
(
fs_type
,
flags
,
dev_name
,
data
,
mtd
,
fill_super
);
}
/*
* set up an MTD-based superblock
*/
int
get_sb
_mtd
(
struct
file_system_type
*
fs_type
,
int
flags
,
struct
dentry
*
mount
_mtd
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
,
int
(
*
fill_super
)(
struct
super_block
*
,
void
*
,
int
),
struct
vfsmount
*
mnt
)
int
(
*
fill_super
)(
struct
super_block
*
,
void
*
,
int
))
{
#ifdef CONFIG_BLOCK
struct
block_device
*
bdev
;
...
...
@@ -138,7 +129,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
int
mtdnr
;
if
(
!
dev_name
)
return
-
EINVAL
;
return
ERR_PTR
(
-
EINVAL
)
;
DEBUG
(
2
,
"MTDSB: dev_name
\"
%s
\"\n
"
,
dev_name
);
...
...
@@ -156,10 +147,10 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
mtd
=
get_mtd_device_nm
(
dev_name
+
4
);
if
(
!
IS_ERR
(
mtd
))
return
get_sb
_mtd_aux
(
return
mount
_mtd_aux
(
fs_type
,
flags
,
dev_name
,
data
,
mtd
,
fill_super
,
mnt
);
fill_super
);
printk
(
KERN_NOTICE
"MTD:"
" MTD device with name
\"
%s
\"
not found.
\n
"
,
...
...
@@ -174,9 +165,9 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
/* It was a valid number */
DEBUG
(
1
,
"MTDSB: mtd%%d, mtdnr %d
\n
"
,
mtdnr
);
return
get_sb
_mtd_nr
(
fs_type
,
flags
,
return
mount
_mtd_nr
(
fs_type
,
flags
,
dev_name
,
data
,
mtdnr
,
fill_super
,
mnt
);
mtdnr
,
fill_super
);
}
}
}
...
...
@@ -189,7 +180,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
if
(
IS_ERR
(
bdev
))
{
ret
=
PTR_ERR
(
bdev
);
DEBUG
(
1
,
"MTDSB: lookup_bdev() returned %d
\n
"
,
ret
);
return
ret
;
return
ERR_PTR
(
ret
)
;
}
DEBUG
(
1
,
"MTDSB: lookup_bdev() returned 0
\n
"
);
...
...
@@ -202,8 +193,7 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
if
(
major
!=
MTD_BLOCK_MAJOR
)
goto
not_an_MTD_device
;
return
get_sb_mtd_nr
(
fs_type
,
flags
,
dev_name
,
data
,
mtdnr
,
fill_super
,
mnt
);
return
mount_mtd_nr
(
fs_type
,
flags
,
dev_name
,
data
,
mtdnr
,
fill_super
);
not_an_MTD_device:
#endif
/* CONFIG_BLOCK */
...
...
@@ -212,10 +202,10 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
printk
(
KERN_NOTICE
"MTD: Attempt to mount non-MTD device
\"
%s
\"\n
"
,
dev_name
);
return
-
EINVAL
;
return
ERR_PTR
(
-
EINVAL
)
;
}
EXPORT_SYMBOL_GPL
(
get_sb
_mtd
);
EXPORT_SYMBOL_GPL
(
mount
_mtd
);
/*
* destroy an MTD-based superblock
...
...
fs/jffs2/super.c
浏览文件 @
848b83a5
...
...
@@ -179,12 +179,11 @@ static int jffs2_fill_super(struct super_block *sb, void *data, int silent)
return
ret
;
}
static
int
jffs2_get_sb
(
struct
file_system_type
*
fs_type
,
static
struct
dentry
*
jffs2_mount
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
,
struct
vfsmount
*
mnt
)
void
*
data
)
{
return
get_sb_mtd
(
fs_type
,
flags
,
dev_name
,
data
,
jffs2_fill_super
,
mnt
);
return
mount_mtd
(
fs_type
,
flags
,
dev_name
,
data
,
jffs2_fill_super
);
}
static
void
jffs2_put_super
(
struct
super_block
*
sb
)
...
...
@@ -229,7 +228,7 @@ static void jffs2_kill_sb(struct super_block *sb)
static
struct
file_system_type
jffs2_fs_type
=
{
.
owner
=
THIS_MODULE
,
.
name
=
"jffs2"
,
.
get_sb
=
jffs2_get_sb
,
.
mount
=
jffs2_mount
,
.
kill_sb
=
jffs2_kill_sb
,
};
...
...
fs/romfs/super.c
浏览文件 @
848b83a5
...
...
@@ -552,20 +552,19 @@ static int romfs_fill_super(struct super_block *sb, void *data, int silent)
/*
* get a superblock for mounting
*/
static
int
romfs_get_sb
(
struct
file_system_type
*
fs_type
,
static
struct
dentry
*
romfs_mount
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
,
struct
vfsmount
*
mnt
)
void
*
data
)
{
int
ret
=
-
EINVAL
;
struct
dentry
*
ret
=
ERR_PTR
(
-
EINVAL
)
;
#ifdef CONFIG_ROMFS_ON_MTD
ret
=
get_sb_mtd
(
fs_type
,
flags
,
dev_name
,
data
,
romfs_fill_super
,
mnt
);
ret
=
mount_mtd
(
fs_type
,
flags
,
dev_name
,
data
,
romfs_fill_super
);
#endif
#ifdef CONFIG_ROMFS_ON_BLOCK
if
(
ret
==
-
EINVAL
)
ret
=
get_sb
_bdev
(
fs_type
,
flags
,
dev_name
,
data
,
romfs_fill_super
,
mnt
);
if
(
ret
==
ERR_PTR
(
-
EINVAL
)
)
ret
=
mount
_bdev
(
fs_type
,
flags
,
dev_name
,
data
,
romfs_fill_super
);
#endif
return
ret
;
}
...
...
@@ -592,7 +591,7 @@ static void romfs_kill_sb(struct super_block *sb)
static
struct
file_system_type
romfs_fs_type
=
{
.
owner
=
THIS_MODULE
,
.
name
=
"romfs"
,
.
get_sb
=
romfs_get_sb
,
.
mount
=
romfs_mount
,
.
kill_sb
=
romfs_kill_sb
,
.
fs_flags
=
FS_REQUIRES_DEV
,
};
...
...
include/linux/mtd/super.h
浏览文件 @
848b83a5
...
...
@@ -18,10 +18,9 @@
#include <linux/fs.h>
#include <linux/mount.h>
extern
int
get_sb
_mtd
(
struct
file_system_type
*
fs_type
,
int
flags
,
extern
struct
dentry
*
mount
_mtd
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
,
int
(
*
fill_super
)(
struct
super_block
*
,
void
*
,
int
),
struct
vfsmount
*
mnt
);
int
(
*
fill_super
)(
struct
super_block
*
,
void
*
,
int
));
extern
void
kill_mtd_super
(
struct
super_block
*
sb
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录