aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2010-09-21 05:49:01 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-09-22 03:48:47 -0400
commit371d217ee1ff8b418b8f73fb2a34990f951ec2d4 (patch)
tree74d5e95a0aa85b8a8b94621b247a78eb527ce609
parent976e48f8a5b02fc33f3e5cad87fb3fcea041a49c (diff)
char: Mark /dev/zero and /dev/kmem as not capable of writeback
These devices don't do any writeback but their device inodes still can get dirty so mark bdi appropriately so that bdi code does the right thing and files inodes to lists of bdi carrying the device inodes. Cc: stable@kernel.org Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
-rw-r--r--drivers/char/mem.c3
-rw-r--r--fs/char_dev.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index a398ecdbd758..1f528fad3516 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -788,10 +788,11 @@ static const struct file_operations zero_fops = {
788/* 788/*
789 * capabilities for /dev/zero 789 * capabilities for /dev/zero
790 * - permits private mappings, "copies" are taken of the source of zeros 790 * - permits private mappings, "copies" are taken of the source of zeros
791 * - no writeback happens
791 */ 792 */
792static struct backing_dev_info zero_bdi = { 793static struct backing_dev_info zero_bdi = {
793 .name = "char/mem", 794 .name = "char/mem",
794 .capabilities = BDI_CAP_MAP_COPY, 795 .capabilities = BDI_CAP_MAP_COPY | BDI_CAP_NO_ACCT_AND_WRITEBACK,
795}; 796};
796 797
797static const struct file_operations full_fops = { 798static const struct file_operations full_fops = {
diff --git a/fs/char_dev.c b/fs/char_dev.c
index f80a4f25123c..143d393881cb 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -40,7 +40,9 @@ struct backing_dev_info directly_mappable_cdev_bdi = {
40#endif 40#endif
41 /* permit direct mmap, for read, write or exec */ 41 /* permit direct mmap, for read, write or exec */
42 BDI_CAP_MAP_DIRECT | 42 BDI_CAP_MAP_DIRECT |
43 BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP), 43 BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP |
44 /* no writeback happens */
45 BDI_CAP_NO_ACCT_AND_WRITEBACK),
44}; 46};
45 47
46static struct kobj_map *cdev_map; 48static struct kobj_map *cdev_map;