aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/rd.c20
-rw-r--r--drivers/char/mem.c5
2 files changed, 24 insertions, 1 deletions
diff --git a/drivers/block/rd.c b/drivers/block/rd.c
index 701ea77f62e9..80e1585b741e 100644
--- a/drivers/block/rd.c
+++ b/drivers/block/rd.c
@@ -411,6 +411,9 @@ static void __exit rd_cleanup(void)
411 blk_cleanup_queue(rd_queue[i]); 411 blk_cleanup_queue(rd_queue[i]);
412 } 412 }
413 unregister_blkdev(RAMDISK_MAJOR, "ramdisk"); 413 unregister_blkdev(RAMDISK_MAJOR, "ramdisk");
414
415 bdi_destroy(&rd_file_backing_dev_info);
416 bdi_destroy(&rd_backing_dev_info);
414} 417}
415 418
416/* 419/*
@@ -419,7 +422,19 @@ static void __exit rd_cleanup(void)
419static int __init rd_init(void) 422static int __init rd_init(void)
420{ 423{
421 int i; 424 int i;
422 int err = -ENOMEM; 425 int err;
426
427 err = bdi_init(&rd_backing_dev_info);
428 if (err)
429 goto out2;
430
431 err = bdi_init(&rd_file_backing_dev_info);
432 if (err) {
433 bdi_destroy(&rd_backing_dev_info);
434 goto out2;
435 }
436
437 err = -ENOMEM;
423 438
424 if (rd_blocksize > PAGE_SIZE || rd_blocksize < 512 || 439 if (rd_blocksize > PAGE_SIZE || rd_blocksize < 512 ||
425 (rd_blocksize & (rd_blocksize-1))) { 440 (rd_blocksize & (rd_blocksize-1))) {
@@ -473,6 +488,9 @@ out:
473 put_disk(rd_disks[i]); 488 put_disk(rd_disks[i]);
474 blk_cleanup_queue(rd_queue[i]); 489 blk_cleanup_queue(rd_queue[i]);
475 } 490 }
491 bdi_destroy(&rd_backing_dev_info);
492 bdi_destroy(&rd_file_backing_dev_info);
493out2:
476 return err; 494 return err;
477} 495}
478 496
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 64551ab6be03..0e937f64a789 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -893,6 +893,11 @@ static struct class *mem_class;
893static int __init chr_dev_init(void) 893static int __init chr_dev_init(void)
894{ 894{
895 int i; 895 int i;
896 int err;
897
898 err = bdi_init(&zero_bdi);
899 if (err)
900 return err;
896 901
897 if (register_chrdev(MEM_MAJOR,"mem",&memory_fops)) 902 if (register_chrdev(MEM_MAJOR,"mem",&memory_fops))
898 printk("unable to get major %d for memory devs\n", MEM_MAJOR); 903 printk("unable to get major %d for memory devs\n", MEM_MAJOR);