Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
2309fb8e
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
2309fb8e
编写于
12月 10, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cramfs: get rid of ->put_super()
failure exits are simpler that way Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
842a859d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
16 deletion
+12
-16
fs/cramfs/inode.c
fs/cramfs/inode.c
+12
-16
未找到文件。
fs/cramfs/inode.c
浏览文件 @
2309fb8e
...
...
@@ -219,10 +219,11 @@ static void *cramfs_read(struct super_block *sb, unsigned int offset, unsigned i
return
read_buffers
[
buffer
]
+
offset
;
}
static
void
cramfs_
put_super
(
struct
super_block
*
sb
)
static
void
cramfs_
kill_sb
(
struct
super_block
*
sb
)
{
kfree
(
sb
->
s_fs_info
);
sb
->
s_fs_info
=
NULL
;
struct
cramfs_sb_info
*
sbi
=
sb
->
s_fs_info
;
kill_block_super
(
sb
);
kfree
(
sbi
);
}
static
int
cramfs_remount
(
struct
super_block
*
sb
,
int
*
flags
,
char
*
data
)
...
...
@@ -261,7 +262,7 @@ static int cramfs_fill_super(struct super_block *sb, void *data, int silent)
if
(
super
.
magic
==
CRAMFS_MAGIC_WEND
)
{
if
(
!
silent
)
printk
(
KERN_ERR
"cramfs: wrong endianness
\n
"
);
goto
out
;
return
-
EINVAL
;
}
/* check at 512 byte offset */
...
...
@@ -273,20 +274,20 @@ static int cramfs_fill_super(struct super_block *sb, void *data, int silent)
printk
(
KERN_ERR
"cramfs: wrong endianness
\n
"
);
else
if
(
!
silent
)
printk
(
KERN_ERR
"cramfs: wrong magic
\n
"
);
goto
out
;
return
-
EINVAL
;
}
}
/* get feature flags first */
if
(
super
.
flags
&
~
CRAMFS_SUPPORTED_FLAGS
)
{
printk
(
KERN_ERR
"cramfs: unsupported filesystem features
\n
"
);
goto
out
;
return
-
EINVAL
;
}
/* Check that the root inode is in a sane state */
if
(
!
S_ISDIR
(
super
.
root
.
mode
))
{
printk
(
KERN_ERR
"cramfs: root is not a directory
\n
"
);
goto
out
;
return
-
EINVAL
;
}
/* correct strange, hard-coded permissions of mkcramfs */
super
.
root
.
mode
|=
(
S_IRUSR
|
S_IXUSR
|
S_IRGRP
|
S_IXGRP
|
S_IROTH
|
S_IXOTH
);
...
...
@@ -310,22 +311,18 @@ static int cramfs_fill_super(struct super_block *sb, void *data, int silent)
(
root_offset
!=
512
+
sizeof
(
struct
cramfs_super
))))
{
printk
(
KERN_ERR
"cramfs: bad root offset %lu
\n
"
,
root_offset
);
goto
out
;
return
-
EINVAL
;
}
/* Set it all up.. */
sb
->
s_op
=
&
cramfs_ops
;
root
=
get_cramfs_inode
(
sb
,
&
super
.
root
,
0
);
if
(
IS_ERR
(
root
))
goto
out
;
return
PTR_ERR
(
root
)
;
sb
->
s_root
=
d_make_root
(
root
);
if
(
!
sb
->
s_root
)
goto
out
;
return
-
ENOMEM
;
return
0
;
out:
kfree
(
sbi
);
sb
->
s_fs_info
=
NULL
;
return
-
EINVAL
;
}
static
int
cramfs_statfs
(
struct
dentry
*
dentry
,
struct
kstatfs
*
buf
)
...
...
@@ -550,7 +547,6 @@ static const struct inode_operations cramfs_dir_inode_operations = {
};
static
const
struct
super_operations
cramfs_ops
=
{
.
put_super
=
cramfs_put_super
,
.
remount_fs
=
cramfs_remount
,
.
statfs
=
cramfs_statfs
,
};
...
...
@@ -565,7 +561,7 @@ static struct file_system_type cramfs_fs_type = {
.
owner
=
THIS_MODULE
,
.
name
=
"cramfs"
,
.
mount
=
cramfs_mount
,
.
kill_sb
=
kill_block_super
,
.
kill_sb
=
cramfs_kill_sb
,
.
fs_flags
=
FS_REQUIRES_DEV
,
};
MODULE_ALIAS_FS
(
"cramfs"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录