Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
1ba10681
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看板
提交
1ba10681
编写于
6月 26, 2011
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch do_spufs_create() to user_path_create(), fix double-unlock
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
dae6ad8f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
32 deletion
+21
-32
arch/powerpc/platforms/cell/spufs/inode.c
arch/powerpc/platforms/cell/spufs/inode.c
+11
-18
arch/powerpc/platforms/cell/spufs/spufs.h
arch/powerpc/platforms/cell/spufs/spufs.h
+1
-1
arch/powerpc/platforms/cell/spufs/syscalls.c
arch/powerpc/platforms/cell/spufs/syscalls.c
+9
-13
未找到文件。
arch/powerpc/platforms/cell/spufs/inode.c
浏览文件 @
1ba10681
...
@@ -611,15 +611,14 @@ static int spufs_create_gang(struct inode *inode,
...
@@ -611,15 +611,14 @@ static int spufs_create_gang(struct inode *inode,
static
struct
file_system_type
spufs_type
;
static
struct
file_system_type
spufs_type
;
long
spufs_create
(
struct
nameidata
*
nd
,
unsigned
int
flags
,
mode_t
mode
,
long
spufs_create
(
struct
path
*
path
,
struct
dentry
*
dentry
,
struct
file
*
filp
)
unsigned
int
flags
,
mode_t
mode
,
struct
file
*
filp
)
{
{
struct
dentry
*
dentry
;
int
ret
;
int
ret
;
ret
=
-
EINVAL
;
ret
=
-
EINVAL
;
/* check if we are on spufs */
/* check if we are on spufs */
if
(
nd
->
path
.
dentry
->
d_sb
->
s_type
!=
&
spufs_type
)
if
(
path
->
dentry
->
d_sb
->
s_type
!=
&
spufs_type
)
goto
out
;
goto
out
;
/* don't accept undefined flags */
/* don't accept undefined flags */
...
@@ -627,33 +626,27 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
...
@@ -627,33 +626,27 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
goto
out
;
goto
out
;
/* only threads can be underneath a gang */
/* only threads can be underneath a gang */
if
(
nd
->
path
.
dentry
!=
nd
->
path
.
dentry
->
d_sb
->
s_root
)
{
if
(
path
->
dentry
!=
path
->
dentry
->
d_sb
->
s_root
)
{
if
((
flags
&
SPU_CREATE_GANG
)
||
if
((
flags
&
SPU_CREATE_GANG
)
||
!
SPUFS_I
(
nd
->
path
.
dentry
->
d_inode
)
->
i_gang
)
!
SPUFS_I
(
path
->
dentry
->
d_inode
)
->
i_gang
)
goto
out
;
goto
out
;
}
}
dentry
=
lookup_create
(
nd
,
1
);
ret
=
PTR_ERR
(
dentry
);
if
(
IS_ERR
(
dentry
))
goto
out_dir
;
mode
&=
~
current_umask
();
mode
&=
~
current_umask
();
if
(
flags
&
SPU_CREATE_GANG
)
if
(
flags
&
SPU_CREATE_GANG
)
ret
=
spufs_create_gang
(
nd
->
path
.
dentry
->
d_inode
,
ret
=
spufs_create_gang
(
path
->
dentry
->
d_inode
,
dentry
,
nd
->
path
.
mnt
,
mode
);
dentry
,
path
->
mnt
,
mode
);
else
else
ret
=
spufs_create_context
(
nd
->
path
.
dentry
->
d_inode
,
ret
=
spufs_create_context
(
path
->
dentry
->
d_inode
,
dentry
,
nd
->
path
.
mnt
,
flags
,
mode
,
dentry
,
path
->
mnt
,
flags
,
mode
,
filp
);
filp
);
if
(
ret
>=
0
)
if
(
ret
>=
0
)
fsnotify_mkdir
(
nd
->
path
.
dentry
->
d_inode
,
dentry
);
fsnotify_mkdir
(
path
->
dentry
->
d_inode
,
dentry
);
return
ret
;
return
ret
;
out_dir:
mutex_unlock
(
&
nd
->
path
.
dentry
->
d_inode
->
i_mutex
);
out:
out:
mutex_unlock
(
&
path
->
dentry
->
d_inode
->
i_mutex
);
return
ret
;
return
ret
;
}
}
...
...
arch/powerpc/platforms/cell/spufs/spufs.h
浏览文件 @
1ba10681
...
@@ -248,7 +248,7 @@ extern const struct spufs_tree_descr spufs_dir_debug_contents[];
...
@@ -248,7 +248,7 @@ extern const struct spufs_tree_descr spufs_dir_debug_contents[];
/* system call implementation */
/* system call implementation */
extern
struct
spufs_calls
spufs_calls
;
extern
struct
spufs_calls
spufs_calls
;
long
spufs_run_spu
(
struct
spu_context
*
ctx
,
u32
*
npc
,
u32
*
status
);
long
spufs_run_spu
(
struct
spu_context
*
ctx
,
u32
*
npc
,
u32
*
status
);
long
spufs_create
(
struct
nameidata
*
nd
,
unsigned
int
flags
,
long
spufs_create
(
struct
path
*
nd
,
struct
dentry
*
dentry
,
unsigned
int
flags
,
mode_t
mode
,
struct
file
*
filp
);
mode_t
mode
,
struct
file
*
filp
);
/* ELF coredump callbacks for writing SPU ELF notes */
/* ELF coredump callbacks for writing SPU ELF notes */
extern
int
spufs_coredump_extra_notes_size
(
void
);
extern
int
spufs_coredump_extra_notes_size
(
void
);
...
...
arch/powerpc/platforms/cell/spufs/syscalls.c
浏览文件 @
1ba10681
...
@@ -62,21 +62,17 @@ static long do_spu_run(struct file *filp,
...
@@ -62,21 +62,17 @@ static long do_spu_run(struct file *filp,
static
long
do_spu_create
(
const
char
__user
*
pathname
,
unsigned
int
flags
,
static
long
do_spu_create
(
const
char
__user
*
pathname
,
unsigned
int
flags
,
mode_t
mode
,
struct
file
*
neighbor
)
mode_t
mode
,
struct
file
*
neighbor
)
{
{
char
*
tmp
;
struct
path
path
;
struct
dentry
*
dentry
;
int
ret
;
int
ret
;
tmp
=
getname
(
pathname
);
dentry
=
user_path_create
(
AT_FDCWD
,
pathname
,
&
path
,
1
);
ret
=
PTR_ERR
(
tmp
);
ret
=
PTR_ERR
(
dentry
);
if
(
!
IS_ERR
(
tmp
))
{
if
(
!
IS_ERR
(
dentry
))
{
struct
nameidata
nd
;
ret
=
spufs_create
(
&
path
,
dentry
,
flags
,
mode
,
neighbor
);
mutex_unlock
(
&
path
.
dentry
->
d_inode
->
i_mutex
);
ret
=
kern_path_parent
(
tmp
,
&
nd
);
dput
(
dentry
);
if
(
!
ret
)
{
path_put
(
&
path
);
nd
.
flags
|=
LOOKUP_OPEN
|
LOOKUP_CREATE
;
ret
=
spufs_create
(
&
nd
,
flags
,
mode
,
neighbor
);
path_put
(
&
nd
.
path
);
}
putname
(
tmp
);
}
}
return
ret
;
return
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录