Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
3f225c07
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
3f225c07
编写于
11月 10, 2009
作者:
T
Takashi Iwai
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'topic/ctl-pid-lock' into topic/core-change
上级
b7fe750f
25d27ede
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
8 deletion
+8
-8
include/sound/control.h
include/sound/control.h
+3
-2
sound/core/control.c
sound/core/control.c
+3
-4
sound/core/pcm.c
sound/core/pcm.c
+1
-1
sound/core/rawmidi.c
sound/core/rawmidi.c
+1
-1
未找到文件。
include/sound/control.h
浏览文件 @
3f225c07
...
...
@@ -56,7 +56,6 @@ struct snd_kcontrol_new {
struct
snd_kcontrol_volatile
{
struct
snd_ctl_file
*
owner
;
/* locked */
pid_t
owner_pid
;
unsigned
int
access
;
/* access rights */
};
...
...
@@ -87,10 +86,12 @@ struct snd_kctl_event {
#define snd_kctl_event(n) list_entry(n, struct snd_kctl_event, list)
struct
pid
;
struct
snd_ctl_file
{
struct
list_head
list
;
/* list of all control files */
struct
snd_card
*
card
;
pid_t
pid
;
struct
pid
*
pid
;
int
prefer_pcm_subdevice
;
int
prefer_rawmidi_subdevice
;
wait_queue_head_t
change_sleep
;
...
...
sound/core/control.c
浏览文件 @
3f225c07
...
...
@@ -75,7 +75,7 @@ static int snd_ctl_open(struct inode *inode, struct file *file)
ctl
->
card
=
card
;
ctl
->
prefer_pcm_subdevice
=
-
1
;
ctl
->
prefer_rawmidi_subdevice
=
-
1
;
ctl
->
pid
=
current
->
pid
;
ctl
->
pid
=
get_pid
(
task_pid
(
current
))
;
file
->
private_data
=
ctl
;
write_lock_irqsave
(
&
card
->
ctl_files_rwlock
,
flags
);
list_add_tail
(
&
ctl
->
list
,
&
card
->
ctl_files
);
...
...
@@ -125,6 +125,7 @@ static int snd_ctl_release(struct inode *inode, struct file *file)
control
->
vd
[
idx
].
owner
=
NULL
;
up_write
(
&
card
->
controls_rwsem
);
snd_ctl_empty_read_queue
(
ctl
);
put_pid
(
ctl
->
pid
);
kfree
(
ctl
);
module_put
(
card
->
module
);
snd_card_file_remove
(
card
,
file
);
...
...
@@ -672,7 +673,7 @@ static int snd_ctl_elem_info(struct snd_ctl_file *ctl,
info
->
access
|=
SNDRV_CTL_ELEM_ACCESS_LOCK
;
if
(
vd
->
owner
==
ctl
)
info
->
access
|=
SNDRV_CTL_ELEM_ACCESS_OWNER
;
info
->
owner
=
vd
->
owner_pid
;
info
->
owner
=
pid_vnr
(
vd
->
owner
->
pid
)
;
}
else
{
info
->
owner
=
-
1
;
}
...
...
@@ -827,7 +828,6 @@ static int snd_ctl_elem_lock(struct snd_ctl_file *file,
result
=
-
EBUSY
;
else
{
vd
->
owner
=
file
;
vd
->
owner_pid
=
current
->
pid
;
result
=
0
;
}
}
...
...
@@ -858,7 +858,6 @@ static int snd_ctl_elem_unlock(struct snd_ctl_file *file,
result
=
-
EPERM
;
else
{
vd
->
owner
=
NULL
;
vd
->
owner_pid
=
0
;
result
=
0
;
}
}
...
...
sound/core/pcm.c
浏览文件 @
3f225c07
...
...
@@ -809,7 +809,7 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
card
=
pcm
->
card
;
read_lock
(
&
card
->
ctl_files_rwlock
);
list_for_each_entry
(
kctl
,
&
card
->
ctl_files
,
list
)
{
if
(
kctl
->
pid
==
current
->
pid
)
{
if
(
kctl
->
pid
==
task_pid
(
current
)
)
{
prefer_subdevice
=
kctl
->
prefer_pcm_subdevice
;
if
(
prefer_subdevice
!=
-
1
)
break
;
...
...
sound/core/rawmidi.c
浏览文件 @
3f225c07
...
...
@@ -413,7 +413,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file)
subdevice
=
-
1
;
read_lock
(
&
card
->
ctl_files_rwlock
);
list_for_each_entry
(
kctl
,
&
card
->
ctl_files
,
list
)
{
if
(
kctl
->
pid
==
current
->
pid
)
{
if
(
kctl
->
pid
==
task_pid
(
current
)
)
{
subdevice
=
kctl
->
prefer_rawmidi_subdevice
;
if
(
subdevice
!=
-
1
)
break
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录