aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/rd.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2007-10-17 02:25:46 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:42:45 -0400
commite0bf68ddec4f4f90e5871404be4f1854c17f3120 (patch)
tree36203a3558cbe26d698bed18be69b3822fb5eef2 /drivers/block/rd.c
parentdc62a30e274d003a4d08fb888f1520add4b21373 (diff)
mm: bdi init hooks
provide BDI constructor/destructor hooks [akpm@linux-foundation.org: compile fix] Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/rd.c')
-rw-r--r--drivers/block/rd.c20
1 files changed, 19 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