Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
95bc5f25
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看板
提交
95bc5f25
编写于
11月 25, 2011
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vfs: spread struct mount - do_add_mount and graft_tree
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
6776db3d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
11 deletion
+11
-11
fs/namespace.c
fs/namespace.c
+11
-11
未找到文件。
fs/namespace.c
浏览文件 @
95bc5f25
...
@@ -1666,19 +1666,19 @@ static void unlock_mount(struct path *path)
...
@@ -1666,19 +1666,19 @@ static void unlock_mount(struct path *path)
mutex_unlock
(
&
path
->
dentry
->
d_inode
->
i_mutex
);
mutex_unlock
(
&
path
->
dentry
->
d_inode
->
i_mutex
);
}
}
static
int
graft_tree
(
struct
vfs
mount
*
mnt
,
struct
path
*
path
)
static
int
graft_tree
(
struct
mount
*
mnt
,
struct
path
*
path
)
{
{
if
(
mnt
->
mnt_sb
->
s_flags
&
MS_NOUSER
)
if
(
mnt
->
mnt
.
mnt
_sb
->
s_flags
&
MS_NOUSER
)
return
-
EINVAL
;
return
-
EINVAL
;
if
(
S_ISDIR
(
path
->
dentry
->
d_inode
->
i_mode
)
!=
if
(
S_ISDIR
(
path
->
dentry
->
d_inode
->
i_mode
)
!=
S_ISDIR
(
mnt
->
mnt_root
->
d_inode
->
i_mode
))
S_ISDIR
(
mnt
->
mnt
.
mnt
_root
->
d_inode
->
i_mode
))
return
-
ENOTDIR
;
return
-
ENOTDIR
;
if
(
d_unlinked
(
path
->
dentry
))
if
(
d_unlinked
(
path
->
dentry
))
return
-
ENOENT
;
return
-
ENOENT
;
return
attach_recursive_mnt
(
real_mount
(
mnt
)
,
path
,
NULL
);
return
attach_recursive_mnt
(
mnt
,
path
,
NULL
);
}
}
/*
/*
...
@@ -1776,7 +1776,7 @@ static int do_loopback(struct path *path, char *old_name,
...
@@ -1776,7 +1776,7 @@ static int do_loopback(struct path *path, char *old_name,
if
(
!
mnt
)
if
(
!
mnt
)
goto
out2
;
goto
out2
;
err
=
graft_tree
(
&
mnt
->
mnt
,
path
);
err
=
graft_tree
(
mnt
,
path
);
if
(
err
)
{
if
(
err
)
{
br_write_lock
(
vfsmount_lock
);
br_write_lock
(
vfsmount_lock
);
umount_tree
(
mnt
,
0
,
&
umount_list
);
umount_tree
(
mnt
,
0
,
&
umount_list
);
...
@@ -1972,7 +1972,7 @@ do_kern_mount(const char *fstype, int flags, const char *name, void *data)
...
@@ -1972,7 +1972,7 @@ do_kern_mount(const char *fstype, int flags, const char *name, void *data)
/*
/*
* add a mount into a namespace's mount tree
* add a mount into a namespace's mount tree
*/
*/
static
int
do_add_mount
(
struct
vfs
mount
*
newmnt
,
struct
path
*
path
,
int
mnt_flags
)
static
int
do_add_mount
(
struct
mount
*
newmnt
,
struct
path
*
path
,
int
mnt_flags
)
{
{
int
err
;
int
err
;
...
@@ -1988,15 +1988,15 @@ static int do_add_mount(struct vfsmount *newmnt, struct path *path, int mnt_flag
...
@@ -1988,15 +1988,15 @@ static int do_add_mount(struct vfsmount *newmnt, struct path *path, int mnt_flag
/* Refuse the same filesystem on the same mount point */
/* Refuse the same filesystem on the same mount point */
err
=
-
EBUSY
;
err
=
-
EBUSY
;
if
(
path
->
mnt
->
mnt_sb
==
newmnt
->
mnt_sb
&&
if
(
path
->
mnt
->
mnt_sb
==
newmnt
->
mnt
.
mnt
_sb
&&
path
->
mnt
->
mnt_root
==
path
->
dentry
)
path
->
mnt
->
mnt_root
==
path
->
dentry
)
goto
unlock
;
goto
unlock
;
err
=
-
EINVAL
;
err
=
-
EINVAL
;
if
(
S_ISLNK
(
newmnt
->
mnt_root
->
d_inode
->
i_mode
))
if
(
S_ISLNK
(
newmnt
->
mnt
.
mnt
_root
->
d_inode
->
i_mode
))
goto
unlock
;
goto
unlock
;
newmnt
->
mnt_flags
=
mnt_flags
;
newmnt
->
mnt
.
mnt
_flags
=
mnt_flags
;
err
=
graft_tree
(
newmnt
,
path
);
err
=
graft_tree
(
newmnt
,
path
);
unlock:
unlock:
...
@@ -2025,7 +2025,7 @@ static int do_new_mount(struct path *path, char *type, int flags,
...
@@ -2025,7 +2025,7 @@ static int do_new_mount(struct path *path, char *type, int flags,
if
(
IS_ERR
(
mnt
))
if
(
IS_ERR
(
mnt
))
return
PTR_ERR
(
mnt
);
return
PTR_ERR
(
mnt
);
err
=
do_add_mount
(
mnt
,
path
,
mnt_flags
);
err
=
do_add_mount
(
real_mount
(
mnt
)
,
path
,
mnt_flags
);
if
(
err
)
if
(
err
)
mntput
(
mnt
);
mntput
(
mnt
);
return
err
;
return
err
;
...
@@ -2046,7 +2046,7 @@ int finish_automount(struct vfsmount *m, struct path *path)
...
@@ -2046,7 +2046,7 @@ int finish_automount(struct vfsmount *m, struct path *path)
goto
fail
;
goto
fail
;
}
}
err
=
do_add_mount
(
m
,
path
,
path
->
mnt
->
mnt_flags
|
MNT_SHRINKABLE
);
err
=
do_add_mount
(
m
nt
,
path
,
path
->
mnt
->
mnt_flags
|
MNT_SHRINKABLE
);
if
(
!
err
)
if
(
!
err
)
return
0
;
return
0
;
fail:
fail:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录