Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
421748ec
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
421748ec
编写于
16年前
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] assorted path_lookup() -> kern_path() conversions
more nameidata eviction Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
a63bb996
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
37 deletion
+34
-37
fs/block_dev.c
fs/block_dev.c
+7
-7
fs/configfs/symlink.c
fs/configfs/symlink.c
+8
-8
fs/ecryptfs/main.c
fs/ecryptfs/main.c
+9
-14
net/unix/af_unix.c
net/unix/af_unix.c
+10
-8
未找到文件。
fs/block_dev.c
浏览文件 @
421748ec
...
...
@@ -1268,33 +1268,33 @@ EXPORT_SYMBOL(ioctl_by_bdev);
* namespace if possible and return it. Return ERR_PTR(error)
* otherwise.
*/
struct
block_device
*
lookup_bdev
(
const
char
*
path
)
struct
block_device
*
lookup_bdev
(
const
char
*
path
name
)
{
struct
block_device
*
bdev
;
struct
inode
*
inode
;
struct
nameidata
nd
;
struct
path
path
;
int
error
;
if
(
!
path
||
!*
path
)
if
(
!
path
name
||
!*
pathname
)
return
ERR_PTR
(
-
EINVAL
);
error
=
path_lookup
(
path
,
LOOKUP_FOLLOW
,
&
nd
);
error
=
kern_path
(
pathname
,
LOOKUP_FOLLOW
,
&
path
);
if
(
error
)
return
ERR_PTR
(
error
);
inode
=
nd
.
path
.
dentry
->
d_inode
;
inode
=
path
.
dentry
->
d_inode
;
error
=
-
ENOTBLK
;
if
(
!
S_ISBLK
(
inode
->
i_mode
))
goto
fail
;
error
=
-
EACCES
;
if
(
nd
.
path
.
mnt
->
mnt_flags
&
MNT_NODEV
)
if
(
path
.
mnt
->
mnt_flags
&
MNT_NODEV
)
goto
fail
;
error
=
-
ENOMEM
;
bdev
=
bd_acquire
(
inode
);
if
(
!
bdev
)
goto
fail
;
out:
path_put
(
&
nd
.
path
);
path_put
(
&
path
);
return
bdev
;
fail:
bdev
=
ERR_PTR
(
error
);
...
...
This diff is collapsed.
Click to expand it.
fs/configfs/symlink.c
浏览文件 @
421748ec
...
...
@@ -108,18 +108,18 @@ static int create_link(struct config_item *parent_item,
}
static
int
get_target
(
const
char
*
symname
,
struct
nameidata
*
nd
,
static
int
get_target
(
const
char
*
symname
,
struct
path
*
path
,
struct
config_item
**
target
)
{
int
ret
;
ret
=
path_lookup
(
symname
,
LOOKUP_FOLLOW
|
LOOKUP_DIRECTORY
,
nd
);
ret
=
kern_path
(
symname
,
LOOKUP_FOLLOW
|
LOOKUP_DIRECTORY
,
path
);
if
(
!
ret
)
{
if
(
nd
->
path
.
dentry
->
d_sb
==
configfs_sb
)
{
*
target
=
configfs_get_config_item
(
nd
->
path
.
dentry
);
if
(
path
->
dentry
->
d_sb
==
configfs_sb
)
{
*
target
=
configfs_get_config_item
(
path
->
dentry
);
if
(
!*
target
)
{
ret
=
-
ENOENT
;
path_put
(
&
nd
->
path
);
path_put
(
path
);
}
}
else
ret
=
-
EPERM
;
...
...
@@ -132,7 +132,7 @@ static int get_target(const char *symname, struct nameidata *nd,
int
configfs_symlink
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
const
char
*
symname
)
{
int
ret
;
struct
nameidata
nd
;
struct
path
path
;
struct
configfs_dirent
*
sd
;
struct
config_item
*
parent_item
;
struct
config_item
*
target_item
;
...
...
@@ -159,7 +159,7 @@ int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symna
!
type
->
ct_item_ops
->
allow_link
)
goto
out_put
;
ret
=
get_target
(
symname
,
&
nd
,
&
target_item
);
ret
=
get_target
(
symname
,
&
path
,
&
target_item
);
if
(
ret
)
goto
out_put
;
...
...
@@ -174,7 +174,7 @@ int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symna
}
config_item_put
(
target_item
);
path_put
(
&
nd
.
path
);
path_put
(
&
path
);
out_put:
config_item_put
(
parent_item
);
...
...
This diff is collapsed.
Click to expand it.
fs/ecryptfs/main.c
浏览文件 @
421748ec
...
...
@@ -471,31 +471,26 @@ ecryptfs_fill_super(struct super_block *sb, void *raw_data, int silent)
*/
static
int
ecryptfs_read_super
(
struct
super_block
*
sb
,
const
char
*
dev_name
)
{
struct
path
path
;
int
rc
;
struct
nameidata
nd
;
struct
dentry
*
lower_root
;
struct
vfsmount
*
lower_mnt
;
memset
(
&
nd
,
0
,
sizeof
(
struct
nameidata
));
rc
=
path_lookup
(
dev_name
,
LOOKUP_FOLLOW
|
LOOKUP_DIRECTORY
,
&
nd
);
rc
=
kern_path
(
dev_name
,
LOOKUP_FOLLOW
|
LOOKUP_DIRECTORY
,
&
path
);
if
(
rc
)
{
ecryptfs_printk
(
KERN_WARNING
,
"path_lookup() failed
\n
"
);
goto
out
;
}
lower_root
=
nd
.
path
.
dentry
;
lower_mnt
=
nd
.
path
.
mnt
;
ecryptfs_set_superblock_lower
(
sb
,
lower_root
->
d_sb
);
sb
->
s_maxbytes
=
lower_root
->
d_sb
->
s_maxbytes
;
sb
->
s_blocksize
=
lower_root
->
d_sb
->
s_blocksize
;
ecryptfs_set_dentry_lower
(
sb
->
s_root
,
lower_root
);
ecryptfs_set_dentry_lower_mnt
(
sb
->
s_root
,
lower_mnt
);
rc
=
ecryptfs_interpose
(
lower_root
,
sb
->
s_root
,
sb
,
0
);
ecryptfs_set_superblock_lower
(
sb
,
path
.
dentry
->
d_sb
);
sb
->
s_maxbytes
=
path
.
dentry
->
d_sb
->
s_maxbytes
;
sb
->
s_blocksize
=
path
.
dentry
->
d_sb
->
s_blocksize
;
ecryptfs_set_dentry_lower
(
sb
->
s_root
,
path
.
dentry
);
ecryptfs_set_dentry_lower_mnt
(
sb
->
s_root
,
path
.
mnt
);
rc
=
ecryptfs_interpose
(
path
.
dentry
,
sb
->
s_root
,
sb
,
0
);
if
(
rc
)
goto
out_free
;
rc
=
0
;
goto
out
;
out_free:
path_put
(
&
nd
.
path
);
path_put
(
&
path
);
out:
return
rc
;
}
...
...
This diff is collapsed.
Click to expand it.
net/unix/af_unix.c
浏览文件 @
421748ec
...
...
@@ -711,28 +711,30 @@ static struct sock *unix_find_other(struct net *net,
int
type
,
unsigned
hash
,
int
*
error
)
{
struct
sock
*
u
;
struct
nameidata
nd
;
struct
path
path
;
int
err
=
0
;
if
(
sunname
->
sun_path
[
0
])
{
err
=
path_lookup
(
sunname
->
sun_path
,
LOOKUP_FOLLOW
,
&
nd
);
struct
inode
*
inode
;
err
=
kern_path
(
sunname
->
sun_path
,
LOOKUP_FOLLOW
,
&
path
);
if
(
err
)
goto
fail
;
err
=
vfs_permission
(
&
nd
,
MAY_WRITE
);
inode
=
path
.
dentry
->
d_inode
;
err
=
inode_permission
(
inode
,
MAY_WRITE
);
if
(
err
)
goto
put_fail
;
err
=
-
ECONNREFUSED
;
if
(
!
S_ISSOCK
(
nd
.
path
.
dentry
->
d_
inode
->
i_mode
))
if
(
!
S_ISSOCK
(
inode
->
i_mode
))
goto
put_fail
;
u
=
unix_find_socket_byinode
(
net
,
nd
.
path
.
dentry
->
d_
inode
);
u
=
unix_find_socket_byinode
(
net
,
inode
);
if
(
!
u
)
goto
put_fail
;
if
(
u
->
sk_type
==
type
)
touch_atime
(
nd
.
path
.
mnt
,
nd
.
path
.
dentry
);
touch_atime
(
path
.
mnt
,
path
.
dentry
);
path_put
(
&
nd
.
path
);
path_put
(
&
path
);
err
=-
EPROTOTYPE
;
if
(
u
->
sk_type
!=
type
)
{
...
...
@@ -753,7 +755,7 @@ static struct sock *unix_find_other(struct net *net,
return
u
;
put_fail:
path_put
(
&
nd
.
path
);
path_put
(
&
path
);
fail:
*
error
=
err
;
return
NULL
;
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部