Commit d054b36f authored by Jeremy Kerr's avatar Jeremy Kerr Committed by Arnd Bergmann

[CELL] spufs: Make signal-notification files readonly for NOSCHED contexts

Reading from the signal{1,2} files requires a spu_acquire_saved, so
make these files write-only for contexts created with
SPU_CREATE_NOSCHED.
Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
Signed-off-by: default avatarArnd Bergmann <arnd.bergmann@de.ibm.com>
parent 49776d30
...@@ -934,6 +934,13 @@ static const struct file_operations spufs_signal1_fops = { ...@@ -934,6 +934,13 @@ static const struct file_operations spufs_signal1_fops = {
.mmap = spufs_signal1_mmap, .mmap = spufs_signal1_mmap,
}; };
static const struct file_operations spufs_signal1_nosched_fops = {
.open = spufs_signal1_open,
.release = spufs_signal1_release,
.write = spufs_signal1_write,
.mmap = spufs_signal1_mmap,
};
static int spufs_signal2_open(struct inode *inode, struct file *file) static int spufs_signal2_open(struct inode *inode, struct file *file)
{ {
struct spufs_inode_info *i = SPUFS_I(inode); struct spufs_inode_info *i = SPUFS_I(inode);
...@@ -1062,6 +1069,13 @@ static const struct file_operations spufs_signal2_fops = { ...@@ -1062,6 +1069,13 @@ static const struct file_operations spufs_signal2_fops = {
.mmap = spufs_signal2_mmap, .mmap = spufs_signal2_mmap,
}; };
static const struct file_operations spufs_signal2_nosched_fops = {
.open = spufs_signal2_open,
.release = spufs_signal2_release,
.write = spufs_signal2_write,
.mmap = spufs_signal2_mmap,
};
static void spufs_signal1_type_set(void *data, u64 val) static void spufs_signal1_type_set(void *data, u64 val)
{ {
struct spu_context *ctx = data; struct spu_context *ctx = data;
...@@ -2184,8 +2198,8 @@ struct tree_descr spufs_dir_nosched_contents[] = { ...@@ -2184,8 +2198,8 @@ struct tree_descr spufs_dir_nosched_contents[] = {
{ "mbox_stat", &spufs_mbox_stat_fops, 0444, }, { "mbox_stat", &spufs_mbox_stat_fops, 0444, },
{ "ibox_stat", &spufs_ibox_stat_fops, 0444, }, { "ibox_stat", &spufs_ibox_stat_fops, 0444, },
{ "wbox_stat", &spufs_wbox_stat_fops, 0444, }, { "wbox_stat", &spufs_wbox_stat_fops, 0444, },
{ "signal1", &spufs_signal1_fops, 0666, }, { "signal1", &spufs_signal1_nosched_fops, 0222, },
{ "signal2", &spufs_signal2_fops, 0666, }, { "signal2", &spufs_signal2_nosched_fops, 0222, },
{ "signal1_type", &spufs_signal1_type, 0666, }, { "signal1_type", &spufs_signal1_type, 0666, },
{ "signal2_type", &spufs_signal2_type, 0666, }, { "signal2_type", &spufs_signal2_type, 0666, },
{ "mss", &spufs_mss_fops, 0666, }, { "mss", &spufs_mss_fops, 0666, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment