Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
e145b35b
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e145b35b
编写于
9月 29, 2017
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ext4: take handling of EXT4_IOC_GROUP_ADD into a helper, get rid of set_fs()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
24219d21
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
43 addition
and
43 deletion
+43
-43
fs/ext4/ioctl.c
fs/ext4/ioctl.c
+43
-43
未找到文件。
fs/ext4/ioctl.c
浏览文件 @
e145b35b
...
@@ -583,6 +583,44 @@ static int ext4_ioc_getfsmap(struct super_block *sb,
...
@@ -583,6 +583,44 @@ static int ext4_ioc_getfsmap(struct super_block *sb,
return
0
;
return
0
;
}
}
static
long
ext4_ioctl_group_add
(
struct
file
*
file
,
struct
ext4_new_group_data
*
input
)
{
struct
super_block
*
sb
=
file_inode
(
file
)
->
i_sb
;
int
err
,
err2
=
0
;
err
=
ext4_resize_begin
(
sb
);
if
(
err
)
return
err
;
if
(
ext4_has_feature_bigalloc
(
sb
))
{
ext4_msg
(
sb
,
KERN_ERR
,
"Online resizing not supported with bigalloc"
);
err
=
-
EOPNOTSUPP
;
goto
group_add_out
;
}
err
=
mnt_want_write_file
(
file
);
if
(
err
)
goto
group_add_out
;
err
=
ext4_group_add
(
sb
,
input
);
if
(
EXT4_SB
(
sb
)
->
s_journal
)
{
jbd2_journal_lock_updates
(
EXT4_SB
(
sb
)
->
s_journal
);
err2
=
jbd2_journal_flush
(
EXT4_SB
(
sb
)
->
s_journal
);
jbd2_journal_unlock_updates
(
EXT4_SB
(
sb
)
->
s_journal
);
}
if
(
err
==
0
)
err
=
err2
;
mnt_drop_write_file
(
file
);
if
(
!
err
&&
ext4_has_group_desc_csum
(
sb
)
&&
test_opt
(
sb
,
INIT_INODE_TABLE
))
err
=
ext4_register_li_request
(
sb
,
input
->
group
);
group_add_out:
ext4_resize_end
(
sb
);
return
err
;
}
long
ext4_ioctl
(
struct
file
*
filp
,
unsigned
int
cmd
,
unsigned
long
arg
)
long
ext4_ioctl
(
struct
file
*
filp
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
{
struct
inode
*
inode
=
file_inode
(
filp
);
struct
inode
*
inode
=
file_inode
(
filp
);
...
@@ -767,44 +805,12 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
...
@@ -767,44 +805,12 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
case
EXT4_IOC_GROUP_ADD
:
{
case
EXT4_IOC_GROUP_ADD
:
{
struct
ext4_new_group_data
input
;
struct
ext4_new_group_data
input
;
int
err
,
err2
=
0
;
err
=
ext4_resize_begin
(
sb
);
if
(
err
)
return
err
;
if
(
copy_from_user
(
&
input
,
(
struct
ext4_new_group_input
__user
*
)
arg
,
if
(
copy_from_user
(
&
input
,
(
struct
ext4_new_group_input
__user
*
)
arg
,
sizeof
(
input
)))
{
sizeof
(
input
)))
err
=
-
EFAULT
;
return
-
EFAULT
;
goto
group_add_out
;
}
if
(
ext4_has_feature_bigalloc
(
sb
))
{
ext4_msg
(
sb
,
KERN_ERR
,
"Online resizing not supported with bigalloc"
);
err
=
-
EOPNOTSUPP
;
goto
group_add_out
;
}
err
=
mnt_want_write_file
(
filp
);
if
(
err
)
goto
group_add_out
;
err
=
ext4_group_add
(
sb
,
&
input
);
return
ext4_ioctl_group_add
(
filp
,
&
input
);
if
(
EXT4_SB
(
sb
)
->
s_journal
)
{
jbd2_journal_lock_updates
(
EXT4_SB
(
sb
)
->
s_journal
);
err2
=
jbd2_journal_flush
(
EXT4_SB
(
sb
)
->
s_journal
);
jbd2_journal_unlock_updates
(
EXT4_SB
(
sb
)
->
s_journal
);
}
if
(
err
==
0
)
err
=
err2
;
mnt_drop_write_file
(
filp
);
if
(
!
err
&&
ext4_has_group_desc_csum
(
sb
)
&&
test_opt
(
sb
,
INIT_INODE_TABLE
))
err
=
ext4_register_li_request
(
sb
,
input
.
group
);
group_add_out:
ext4_resize_end
(
sb
);
return
err
;
}
}
case
EXT4_IOC_MIGRATE
:
case
EXT4_IOC_MIGRATE
:
...
@@ -1075,8 +1081,7 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
...
@@ -1075,8 +1081,7 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break
;
break
;
case
EXT4_IOC32_GROUP_ADD
:
{
case
EXT4_IOC32_GROUP_ADD
:
{
struct
compat_ext4_new_group_input
__user
*
uinput
;
struct
compat_ext4_new_group_input
__user
*
uinput
;
struct
ext4_new_group_input
input
;
struct
ext4_new_group_data
input
;
mm_segment_t
old_fs
;
int
err
;
int
err
;
uinput
=
compat_ptr
(
arg
);
uinput
=
compat_ptr
(
arg
);
...
@@ -1089,12 +1094,7 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
...
@@ -1089,12 +1094,7 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
&
uinput
->
reserved_blocks
);
&
uinput
->
reserved_blocks
);
if
(
err
)
if
(
err
)
return
-
EFAULT
;
return
-
EFAULT
;
old_fs
=
get_fs
();
return
ext4_ioctl_group_add
(
file
,
&
input
);
set_fs
(
KERNEL_DS
);
err
=
ext4_ioctl
(
file
,
EXT4_IOC_GROUP_ADD
,
(
unsigned
long
)
&
input
);
set_fs
(
old_fs
);
return
err
;
}
}
case
EXT4_IOC_MOVE_EXT
:
case
EXT4_IOC_MOVE_EXT
:
case
EXT4_IOC_RESIZE_FS
:
case
EXT4_IOC_RESIZE_FS
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录