This one needs to be split in two - the second one adding the readme file...
+static ssize_t... and the first one adding perm to struct dfs_node.
+inj_readme_read(struct file *filp, char __user *ubuf,
+ size_t cnt, loff_t *ppos)
+{
+ return simple_read_from_buffer(ubuf, cnt, ppos,
+ readme_msg, strlen(readme_msg));
+}
+
+static const struct file_operations readme_fops = {
+ .read = inj_readme_read,
+};
+
static struct dfs_node {
char *name;
struct dentry *d;
const struct file_operations *fops;
+ umode_t perm;
} dfs_fls[] = {
- { .name = "status", .fops = &status_fops },
- { .name = "misc", .fops = &misc_fops },
- { .name = "addr", .fops = &addr_fops },
- { .name = "bank", .fops = &bank_fops },
- { .name = "flags", .fops = &flags_fops },
- { .name = "cpu", .fops = &extcpu_fops },
+ { .name = "status", .fops = &status_fops, S_IRUSR | S_IWUSR },
+ { .name = "misc", .fops = &misc_fops, S_IRUSR | S_IWUSR },
+ { .name = "addr", .fops = &addr_fops, S_IRUSR | S_IWUSR },
+ { .name = "bank", .fops = &bank_fops, S_IRUSR | S_IWUSR },
+ { .name = "flags", .fops = &flags_fops, S_IRUSR | S_IWUSR },
+ { .name = "cpu", .fops = &extcpu_fops, S_IRUSR | S_IWUSR },
+ { .name = "README", .fops = &readme_fops, S_IRUSR | S_IRGRP |
+ S_IROTH },