summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2010-09-21 11:49:01 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-21 12:45:41 -0700
commit44498d9d63480b416a23e67a57c51481c861f8a3 (patch)
treee244ad44c7890a54924f36d50107317fcb525f0c
parent060049e494a4f234002941aa2403d849ca8c883c (diff)
downloadkernel-common-44498d9d63480b416a23e67a57c51481c861f8a3.tar.gz
kernel-common-44498d9d63480b416a23e67a57c51481c861f8a3.tar.bz2
kernel-common-44498d9d63480b416a23e67a57c51481c861f8a3.zip
char: Mark /dev/zero and /dev/kmem as not capable of writeback
commit 371d217ee1ff8b418b8f73fb2a34990f951ec2d4 upstream. 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. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <jaxboe@fusionio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-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 48788db4e280..bc46ea8e3591 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -784,10 +784,11 @@ static const struct file_operations zero_fops = {
/*
* capabilities for /dev/zero
* - permits private mappings, "copies" are taken of the source of zeros
+ * - no writeback happens
*/
static struct backing_dev_info zero_bdi = {
.name = "char/mem",
- .capabilities = BDI_CAP_MAP_COPY,
+ .capabilities = BDI_CAP_MAP_COPY | BDI_CAP_NO_ACCT_AND_WRITEBACK,
};
static const struct file_operations full_fops = {
diff --git a/fs/char_dev.c b/fs/char_dev.c
index d6db933df2b2..be7613ebb661 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -39,7 +39,9 @@ struct backing_dev_info directly_mappable_cdev_bdi = {
#endif
/* permit direct mmap, for read, write or exec */
BDI_CAP_MAP_DIRECT |
- BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP),
+ BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP |
+ /* no writeback happens */
+ BDI_CAP_NO_ACCT_AND_WRITEBACK),
};
static struct kobj_map *cdev_map;