Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
2d864651
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
2d864651
编写于
9月 08, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
introduce kern_path_mountpoint()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
197df04c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
11 deletion
+25
-11
fs/namei.c
fs/namei.c
+24
-11
include/linux/namei.h
include/linux/namei.h
+1
-0
未找到文件。
fs/namei.c
浏览文件 @
2d864651
...
...
@@ -2360,6 +2360,20 @@ path_mountpoint(int dfd, const char *name, struct path *path, unsigned int flags
return
err
;
}
static
int
filename_mountpoint
(
int
dfd
,
struct
filename
*
s
,
struct
path
*
path
,
unsigned
int
flags
)
{
int
error
=
path_mountpoint
(
dfd
,
s
->
name
,
path
,
flags
|
LOOKUP_RCU
);
if
(
unlikely
(
error
==
-
ECHILD
))
error
=
path_mountpoint
(
dfd
,
s
->
name
,
path
,
flags
);
if
(
unlikely
(
error
==
-
ESTALE
))
error
=
path_mountpoint
(
dfd
,
s
->
name
,
path
,
flags
|
LOOKUP_REVAL
);
if
(
likely
(
!
error
))
audit_inode
(
s
,
path
->
dentry
,
0
);
return
error
;
}
/**
* user_path_mountpoint_at - lookup a path from userland in order to umount it
* @dfd: directory file descriptor
...
...
@@ -2380,23 +2394,22 @@ user_path_mountpoint_at(int dfd, const char __user *name, unsigned int flags,
{
struct
filename
*
s
=
getname
(
name
);
int
error
;
if
(
IS_ERR
(
s
))
return
PTR_ERR
(
s
);
error
=
path_mountpoint
(
dfd
,
s
->
name
,
path
,
flags
|
LOOKUP_RCU
);
if
(
unlikely
(
error
==
-
ECHILD
))
error
=
path_mountpoint
(
dfd
,
s
->
name
,
path
,
flags
);
if
(
unlikely
(
error
==
-
ESTALE
))
error
=
path_mountpoint
(
dfd
,
s
->
name
,
path
,
flags
|
LOOKUP_REVAL
);
if
(
likely
(
!
error
))
audit_inode
(
s
,
path
->
dentry
,
0
);
error
=
filename_mountpoint
(
dfd
,
s
,
path
,
flags
);
putname
(
s
);
return
error
;
}
int
kern_path_mountpoint
(
int
dfd
,
const
char
*
name
,
struct
path
*
path
,
unsigned
int
flags
)
{
struct
filename
s
=
{.
name
=
name
};
return
filename_mountpoint
(
dfd
,
&
s
,
path
,
flags
);
}
EXPORT_SYMBOL
(
kern_path_mountpoint
);
/*
* It's inline, so penalty for filesystems that don't use sticky bit is
* minimal.
...
...
include/linux/namei.h
浏览文件 @
2d864651
...
...
@@ -70,6 +70,7 @@ extern struct dentry *kern_path_create(int, const char *, struct path *, unsigne
extern
struct
dentry
*
user_path_create
(
int
,
const
char
__user
*
,
struct
path
*
,
unsigned
int
);
extern
void
done_path_create
(
struct
path
*
,
struct
dentry
*
);
extern
struct
dentry
*
kern_path_locked
(
const
char
*
,
struct
path
*
);
extern
int
kern_path_mountpoint
(
int
,
const
char
*
,
struct
path
*
,
unsigned
int
);
extern
struct
dentry
*
lookup_one_len
(
const
char
*
,
struct
dentry
*
,
int
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录