diff options
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/xenfs/super.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/xen/xenfs/super.c b/drivers/xen/xenfs/super.c index 515741a8e6b8..6559e0c752ce 100644 --- a/drivers/xen/xenfs/super.c +++ b/drivers/xen/xenfs/super.c | |||
@@ -20,10 +20,27 @@ | |||
20 | MODULE_DESCRIPTION("Xen filesystem"); | 20 | MODULE_DESCRIPTION("Xen filesystem"); |
21 | MODULE_LICENSE("GPL"); | 21 | MODULE_LICENSE("GPL"); |
22 | 22 | ||
23 | static ssize_t capabilities_read(struct file *file, char __user *buf, | ||
24 | size_t size, loff_t *off) | ||
25 | { | ||
26 | char *tmp = ""; | ||
27 | |||
28 | if (xen_initial_domain()) | ||
29 | tmp = "control_d\n"; | ||
30 | |||
31 | return simple_read_from_buffer(buf, size, off, tmp, strlen(tmp)); | ||
32 | } | ||
33 | |||
34 | static const struct file_operations capabilities_file_ops = { | ||
35 | .read = capabilities_read, | ||
36 | }; | ||
37 | |||
23 | static int xenfs_fill_super(struct super_block *sb, void *data, int silent) | 38 | static int xenfs_fill_super(struct super_block *sb, void *data, int silent) |
24 | { | 39 | { |
25 | static struct tree_descr xenfs_files[] = { | 40 | static struct tree_descr xenfs_files[] = { |
26 | [2] = {"xenbus", &xenbus_file_ops, S_IRUSR|S_IWUSR}, | 41 | [1] = {}, |
42 | { "xenbus", &xenbus_file_ops, S_IRUSR|S_IWUSR }, | ||
43 | { "capabilities", &capabilities_file_ops, S_IRUGO }, | ||
27 | {""}, | 44 | {""}, |
28 | }; | 45 | }; |
29 | 46 | ||