diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/char_dev.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/char_dev.c b/fs/char_dev.c index 3483d3cf8087..0009346d827f 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c | |||
@@ -19,11 +19,30 @@ | |||
19 | #include <linux/kobj_map.h> | 19 | #include <linux/kobj_map.h> |
20 | #include <linux/cdev.h> | 20 | #include <linux/cdev.h> |
21 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
22 | #include <linux/backing-dev.h> | ||
22 | 23 | ||
23 | #ifdef CONFIG_KMOD | 24 | #ifdef CONFIG_KMOD |
24 | #include <linux/kmod.h> | 25 | #include <linux/kmod.h> |
25 | #endif | 26 | #endif |
26 | 27 | ||
28 | /* | ||
29 | * capabilities for /dev/mem, /dev/kmem and similar directly mappable character | ||
30 | * devices | ||
31 | * - permits shared-mmap for read, write and/or exec | ||
32 | * - does not permit private mmap in NOMMU mode (can't do COW) | ||
33 | * - no readahead or I/O queue unplugging required | ||
34 | */ | ||
35 | struct backing_dev_info directly_mappable_cdev_bdi = { | ||
36 | .capabilities = ( | ||
37 | #ifdef CONFIG_MMU | ||
38 | /* permit private copies of the data to be taken */ | ||
39 | BDI_CAP_MAP_COPY | | ||
40 | #endif | ||
41 | /* permit direct mmap, for read, write or exec */ | ||
42 | BDI_CAP_MAP_DIRECT | | ||
43 | BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP), | ||
44 | }; | ||
45 | |||
27 | static struct kobj_map *cdev_map; | 46 | static struct kobj_map *cdev_map; |
28 | 47 | ||
29 | static DEFINE_MUTEX(chrdevs_lock); | 48 | static DEFINE_MUTEX(chrdevs_lock); |
@@ -461,3 +480,4 @@ EXPORT_SYMBOL(cdev_del); | |||
461 | EXPORT_SYMBOL(cdev_add); | 480 | EXPORT_SYMBOL(cdev_add); |
462 | EXPORT_SYMBOL(register_chrdev); | 481 | EXPORT_SYMBOL(register_chrdev); |
463 | EXPORT_SYMBOL(unregister_chrdev); | 482 | EXPORT_SYMBOL(unregister_chrdev); |
483 | EXPORT_SYMBOL(directly_mappable_cdev_bdi); | ||