aboutsummaryrefslogtreecommitdiffstats
path: root/fs/char_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/char_dev.c')
-rw-r--r--fs/char_dev.c20
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 */
35struct 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
27static struct kobj_map *cdev_map; 46static struct kobj_map *cdev_map;
28 47
29static DEFINE_MUTEX(chrdevs_lock); 48static DEFINE_MUTEX(chrdevs_lock);
@@ -461,3 +480,4 @@ EXPORT_SYMBOL(cdev_del);
461EXPORT_SYMBOL(cdev_add); 480EXPORT_SYMBOL(cdev_add);
462EXPORT_SYMBOL(register_chrdev); 481EXPORT_SYMBOL(register_chrdev);
463EXPORT_SYMBOL(unregister_chrdev); 482EXPORT_SYMBOL(unregister_chrdev);
483EXPORT_SYMBOL(directly_mappable_cdev_bdi);